test -d $(distdir)/mcs || mkdir $(distdir)/mcs
d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
rm -rf `find $(top_distdir)/external -path '*\.git'`
+ rm -f `find $(top_distdir)/external -path '*\.exe'`
+ rm -f `find $(top_distdir)/external -path '*\.dll'`
cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/
cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/
# Disable this for now because it is very slow and causes wrench to timeout:
Mono is a software platform designed to allow developers to easily create cross platform applications.
Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime.
-[![Build Status](http://monojenkins.cloudapp.net/job/Mono/badge/icon)](http://monojenkins.cloudapp.net/job/Mono/)
+[![Build Status](http://jenkins.mono-project.com/job/test-mono-mainline/badge/icon/)](http://jenkins.mono-project.com/job/test-mono-mainline/)
1. [Installation](#compilation-and-installation)
2. [Using Mono](#using-mono)
* `dis/` - CIL executable Disassembler
- * `cli/` - Common code for the JIT and the interpreter.
-
* `io-layer/` - The I/O layer and system abstraction for
emulating the .NET IO model.
* `cil/` - Common Intermediate Representation, XML
definition of the CIL bytecodes.
- * `interp/` - Interpreter for CLI executables (obsolete).
-
* `arch/` - Architecture specific portions.
* `man/` - Manual pages for the various Mono commands and programs.
popd
else
cat mono/mini/Makefile.am.in > mono/mini/Makefile.am
- cat mono/metadata/Makefile.am.in > mono/metadata/Makefile.am
fi
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
-AC_INIT(mono, [3.6.1],
+AC_INIT(mono, [3.10.1],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
with_sigaltstack=no
use_sigposix=yes
;;
+ *-*-kfreebsd*-gnu)
+ host_win32=no
+ CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -DTHREAD_LOCAL_ALLOC -pthread"
+ libmono_cflags="-D_REENTRANT -DTHREAD_LOCAL_ALLOC -pthread"
+ libmono_ldflags="-lpthread -pthread"
+ libdl="-ldl"
+ libgc_threads=pthreads
+ need_link_unlink=yes
+ with_sigaltstack=no
+ use_sigposix=yes
+ ;;
*-*-*freebsd*)
host_win32=no
if test "x$PTHREAD_CFLAGS" = "x"; then
AC_SUBST(extra_runtime_ldflags)
AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
+AM_CONDITIONAL(PLATFORM_GNU, echo x$target_os | grep -q -- -gnu)
AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
ACCESS_UNALIGNED="yes"
JIT_SUPPORTED=no
-INTERP_SUPPORTED=no
LIBC="libc.so.6"
INTL="libc.so.6"
SQLITE="libsqlite.so.0"
X11="libX11.so"
GDKX11="libgdk-x11-2.0.so.0"
GTKX11="libgtk-x11-2.0.so.0"
-XINERAMA="libXinerama.so"
+XINERAMA="libXinerama.so.1"
sizeof_register="SIZEOF_VOID_P"
jit_wanted=true
-interp_wanted=false
sgen_supported=false
boehm_supported=true
case "$host" in
sgen_supported=true
AOT_SUPPORTED="yes"
;;
- openbsd*|freebsd*)
+ openbsd*|freebsd*|kfreebsd-gnu*)
sgen_supported=true
;;
esac
sgen_supported=true
AOT_SUPPORTED="yes"
;;
- openbsd*|freebsd*)
+ openbsd*|freebsd*|kfreebsd-gnu*)
sgen_supported=true
;;
mingw*)
;;
esac
;;
+ i686*-linux-*)
+ TARGET=X86;
+ arch_target=x86;
+ AC_DEFINE(TARGET_X86, 1, [...])
+ AC_DEFINE(TARGET_ANDROID, 1, [...])
+ JIT_SUPPORTED=yes
+ CPPFLAGS="$CPPFLAGS"
+ jit_wanted=true
+ sgen_supported=true
+ # Can't use tls, since it depends on the runtime detection of tls offsets
+ # in mono-compiler.h
+ with_tls=pthread
+ target_mach=no
+ ;;
aarch64-*)
TARGET=ARM64
JIT_SUPPORTED=yes
USEJIT=true
jit_status="Building and using the JIT"
else
- if $interp_wanted; then
- jit_status="Building the JIT, defaulting to the interpreter"
- else
- AC_ERROR(No JIT or interpreter support available or selected.)
- fi
+ AC_ERROR(No JIT support available or selected.)
fi
else
- if test x$interp_wanted = xtrue; then
- jit_status="interpreter"
- else
- AC_ERROR(No JIT or interpreter support available or selected.)
- fi
+ AC_ERROR(No JIT support available or selected.)
fi
AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
LIBC="libc.so.12"
INTL="libintl.so.0"
;;
+ *-*-kfreebsd*-gnu)
+ LIBC="libc.so.0.1"
+ INTL="libc.so.0.1"
+ X11="libX11.so.6"
+ ;;
*-*-*freebsd*)
LIBC="libc.so"
INTL="libintl.so"
done
if test "x$X11" = "xlibX11.so"; then
- AC_MSG_WARN([Could not find X development libs. Do you have the -devel package installed? Assuming libX11.so.6...]);
+ AC_MSG_WARN([Could not find libX11.so. Do you have X.org or XFree86 installed? Assuming libX11.so.6...]);
X11=libX11.so.6
fi
- AC_MSG_CHECKING(for the soname of libXinerama.so)
- for i in $x_libraries $dlsearch_path; do
- for r in 1 2 3; do
- if test -f $i/libXinerama.so.$r; then
- XINERAMA=libXinerama.so.$r
- AC_MSG_RESULT($XINERAMA)
- fi
- done
- done
- if test "x$XINERAMA" = "xlibXinerama.so"; then
- AC_MSG_WARN([Could not find Xinerama development libs. Support for multiple monitors might not work...]);
- fi
;;
esac
AM_CONDITIONAL(CROSS_COMPILE, test "x$host" != "x$target")
AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
-AM_CONDITIONAL(INTERP_SUPPORTED, test x$interp_wanted = xtrue)
AM_CONDITIONAL(INCLUDED_LIBGC, test x$libgc = xincluded)
AC_SUBST(LIBC)
mono_build_root=`pwd`
AC_SUBST(mono_build_root)
-if test x$USEJIT = xtrue; then
- mono_runtime=mono/mini/mono
-else
- mono_runtime=mono/interpreter/mint
-fi
+mono_runtime=mono/mini/mono
AC_SUBST(mono_runtime)
mono_cfg_root=$mono_build_root/runtime
mono/arch/arm64/Makefile
mono/arch/ia64/Makefile
mono/arch/mips/Makefile
-mono/interpreter/Makefile
mono/tests/Makefile
mono/tests/tests-config
mono/tests/assemblyresolve/Makefile
endif
if JIT_SUPPORTED
-if INTERP_SUPPORTED
-pkgconfig_DATA= mono.pc mono-2.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
- system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
-else
pkgconfig_DATA= mono.pc mono-2.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
system.web.extensions.design_1.0.pc system.web.mvc.pc system.web.mvc2.pc system.web.mvc3.pc aspnetwebstack.pc reactive.pc xbuild12.pc $(SGENPCFILE)
-endif
else
pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc monodoc.pc mono-lineeditor.pc
endif
<dllmap dll="i:odbc32.dll" target="libiodbc.dylib" os="osx"/>
<dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
<dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
- <dllmap dll="MonoPosixHelper" target="@prefix@/lib/libMonoPosixHelper@libsuffix@" os="!windows" />
+ <dllmap dll="MonoPosixHelper" target="@prefix@/@reloc_libdir@/libMonoPosixHelper@libsuffix@" os="!windows" />
<dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
<dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
<dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
#define g_utf8_get_char_validated monoeg_utf8_get_char_validated
#define g_utf8_prev_char monoeg_utf8_prev_char
#define g_utf8_to_ucs4 monoeg_utf8_to_ucs4
+
+
+#define g_log_default_handler monoeg_log_default_handler
+#define g_log_set_default_handler monoeg_log_set_default_handler
+#define g_set_print_handler monoeg_set_print_handler
+#define g_set_printerr_handler monoeg_set_printerr_handler
#define g_message(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
#define g_debug(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
#endif /* ndef HAVE_C99_SUPPORT */
-#define g_log_set_handler(a,b,c,d)
-#define G_GNUC_INTERNAL
+typedef void (*GLogFunc) (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data);
+typedef void (*GPrintFunc) (const gchar *string);
+void g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data);
+GLogFunc g_log_set_default_handler (GLogFunc log_func, gpointer user_data);
+GPrintFunc g_set_print_handler (GPrintFunc func);
+GPrintFunc g_set_printerr_handler (GPrintFunc func);
/*
* Conversions
*/
/* The current fatal levels, error is always fatal */
static GLogLevelFlags fatal = G_LOG_LEVEL_ERROR;
+static GLogFunc default_log_func;
+static gpointer default_log_func_user_data;
+static GPrintFunc stdout_handler, stderr_handler;
-#if PLATFORM_ANDROID
-#include <android/log.h>
-
-static android_LogPriority
-to_android_priority (GLogLevelFlags log_level)
-{
- switch (log_level & G_LOG_LEVEL_MASK)
- {
- case G_LOG_LEVEL_ERROR: return ANDROID_LOG_FATAL;
- case G_LOG_LEVEL_CRITICAL: return ANDROID_LOG_ERROR;
- case G_LOG_LEVEL_WARNING: return ANDROID_LOG_WARN;
- case G_LOG_LEVEL_MESSAGE: return ANDROID_LOG_INFO;
- case G_LOG_LEVEL_INFO: return ANDROID_LOG_DEBUG;
- case G_LOG_LEVEL_DEBUG: return ANDROID_LOG_VERBOSE;
- }
- return ANDROID_LOG_UNKNOWN;
-}
-
-static void
-out_vfprintf (FILE *ignore, const gchar *format, va_list args)
-{
- /* TODO: provide a proper app name */
- __android_log_vprint (ANDROID_LOG_ERROR, "mono", format, args);
-}
-#elif MONOTOUCH && defined(__arm__)
-#include <asl.h>
-
-static int
-to_asl_priority (GLogLevelFlags log_level)
-{
- switch (log_level & G_LOG_LEVEL_MASK)
- {
- case G_LOG_LEVEL_ERROR: return ASL_LEVEL_CRIT;
- case G_LOG_LEVEL_CRITICAL: return ASL_LEVEL_ERR;
- case G_LOG_LEVEL_WARNING: return ASL_LEVEL_WARNING;
- case G_LOG_LEVEL_MESSAGE: return ASL_LEVEL_NOTICE;
- case G_LOG_LEVEL_INFO: return ASL_LEVEL_INFO;
- case G_LOG_LEVEL_DEBUG: return ASL_LEVEL_DEBUG;
- }
- return ASL_LEVEL_ERR;
-}
-
-static void
-out_vfprintf (FILE *ignore, const gchar *format, va_list args)
-{
- asl_vlog (NULL, NULL, ASL_LEVEL_WARNING, format, args);
-}
-
-#else
-static void
-out_vfprintf (FILE *file, const gchar *format, va_list args)
-{
- vfprintf (file, format, args);
-}
-#endif
+static void default_stdout_handler (const gchar *string);
+static void default_stderr_handler (const gchar *string);
void
g_print (const gchar *format, ...)
{
+ char *msg;
va_list args;
va_start (args, format);
+ if (vasprintf (&msg, format, args) < 0)
+ return;
+ va_end (args);
- out_vfprintf (stdout, format, args);
+ if (!stdout_handler)
+ stdout_handler = default_stdout_handler;
- va_end (args);
+ stdout_handler (msg);
+ free (msg);
}
void
g_printerr (const gchar *format, ...)
{
+ char *msg;
va_list args;
va_start (args, format);
+ if (vasprintf (&msg, format, args) < 0)
+ return;
+ va_end (args);
- out_vfprintf (stderr, format, args);
+ if (!stderr_handler)
+ stderr_handler = default_stderr_handler;
- va_end (args);
+ stderr_handler (msg);
+ free (msg);
}
GLogLevelFlags
void
g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args)
{
-#if PLATFORM_ANDROID
- __android_log_vprint (to_android_priority (log_level), log_domain, format, args);
-#elif MONOTOUCH && defined(__arm__)
- asl_vlog (NULL, NULL, to_asl_priority (log_level), format, args);
-#else
char *msg;
+
+ if (!default_log_func)
+ default_log_func = g_log_default_handler;
if (vasprintf (&msg, format, args) < 0)
return;
-#ifdef G_OS_WIN32
- printf ("%s%s%s\n",
- log_domain != NULL ? log_domain : "",
- log_domain != NULL ? ": " : "",
- msg);
-#else
-#if MONOTOUCH
- FILE *target = stderr;
-#else
- FILE *target = stdout;
-#endif
-
- fprintf (target, "%s%s%s\n",
- log_domain != NULL ? log_domain : "",
- log_domain != NULL ? ": " : "",
- msg);
-#endif
+ default_log_func (log_domain, log_level, msg, default_log_func_user_data);
free (msg);
- if (log_level & fatal){
- fflush (stdout);
- fflush (stderr);
- }
-#endif
- if (log_level & fatal){
- abort ();
- }
}
void
va_start (args, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
va_end (args);
- abort ();
+}
+
+
+#if PLATFORM_ANDROID
+#include <android/log.h>
+
+static android_LogPriority
+to_android_priority (GLogLevelFlags log_level)
+{
+ switch (log_level & G_LOG_LEVEL_MASK)
+ {
+ case G_LOG_LEVEL_ERROR: return ANDROID_LOG_FATAL;
+ case G_LOG_LEVEL_CRITICAL: return ANDROID_LOG_ERROR;
+ case G_LOG_LEVEL_WARNING: return ANDROID_LOG_WARN;
+ case G_LOG_LEVEL_MESSAGE: return ANDROID_LOG_INFO;
+ case G_LOG_LEVEL_INFO: return ANDROID_LOG_DEBUG;
+ case G_LOG_LEVEL_DEBUG: return ANDROID_LOG_VERBOSE;
+ }
+ return ANDROID_LOG_UNKNOWN;
+}
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+ __android_log_write (to_android_priority (log_level), log_domain, message);
+ if (log_level & fatal)
+ abort ();
+}
+
+static void
+default_stdout_handler (const gchar *message)
+{
+ /* TODO: provide a proper app name */
+ __android_log_write (ANDROID_LOG_ERROR, "mono", message);
+}
+
+static void
+default_stderr_handler (const gchar *message)
+{
+ /* TODO: provide a proper app name */
+ __android_log_write (ANDROID_LOG_ERROR, "mono", message);
+}
+
+
+#elif defined(HOST_IOS)
+#include <asl.h>
+
+static int
+to_asl_priority (GLogLevelFlags log_level)
+{
+ switch (log_level & G_LOG_LEVEL_MASK)
+ {
+ case G_LOG_LEVEL_ERROR: return ASL_LEVEL_CRIT;
+ case G_LOG_LEVEL_CRITICAL: return ASL_LEVEL_ERR;
+ case G_LOG_LEVEL_WARNING: return ASL_LEVEL_WARNING;
+ case G_LOG_LEVEL_MESSAGE: return ASL_LEVEL_NOTICE;
+ case G_LOG_LEVEL_INFO: return ASL_LEVEL_INFO;
+ case G_LOG_LEVEL_DEBUG: return ASL_LEVEL_DEBUG;
+ }
+ return ASL_LEVEL_ERR;
+}
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+ asl_log (NULL, NULL, to_asl_priority (log_level), "%s", message);
+ if (log_level & fatal)
+ abort ();
+}
+
+static void
+default_stdout_handler (const gchar *message)
+{
+ asl_log (NULL, NULL, ASL_LEVEL_WARNING, "%s", message);
+}
+
+static void
+default_stderr_handler (const gchar *message)
+{
+ asl_log (NULL, NULL, ASL_LEVEL_WARNING, "%s", message);
+}
+
+#else
+
+void
+g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
+{
+ FILE *target = stdout;
+
+ fprintf (target, "%s%s%s\n",
+ log_domain != NULL ? log_domain : "",
+ log_domain != NULL ? ": " : "",
+ message);
+
+ if (log_level & fatal) {
+ fflush (stdout);
+ fflush (stderr);
+ abort ();
+ }
+}
+
+static void
+default_stdout_handler (const gchar *string)
+{
+ fprintf (stdout, "%s", string);
+}
+
+static void
+default_stderr_handler (const gchar *string)
+{
+ fprintf (stderr, "%s", string);
+}
+
+#endif
+
+GLogFunc
+g_log_set_default_handler (GLogFunc log_func, gpointer user_data)
+{
+ GLogFunc old = default_log_func;
+ default_log_func = log_func;
+ default_log_func_user_data = user_data;
+ return old;
+}
+
+GPrintFunc
+g_set_print_handler (GPrintFunc func)
+{
+ GPrintFunc old = stdout_handler;
+ stdout_handler = func;
+ return old;
+}
+
+GPrintFunc
+g_set_printerr_handler (GPrintFunc func)
+{
+ GPrintFunc old = stderr_handler;
+ stderr_handler = func;
+ return old;
}
-Subproject commit 89cfb1d4079002394010fd351628ad057c94422f
+Subproject commit 33d50b874fd527118bc361d83de3d494e8bb55e1
-Subproject commit 92df59f033ef81a9b5a9cc6b09d44ed18d244517
+Subproject commit 22534de2098acbcf208f6b06836d122dab799e4b
AC_DEFINE(THREAD_LOCAL_ALLOC)
THREADDLLIBS="-lpthread -lrt"
;;
+ *-*-kfreebsd*-gnu)
+ AC_DEFINE(GC_FREEBSD_THREADS)
+ INCLUDES="$INCLUDES -pthread"
+ THREADDLLIBS=-pthread
+ AC_DEFINE(_REENTRANT)
+ if test "${enable_parallel_mark}" = yes; then
+ AC_DEFINE(PARALLEL_MARK)
+ fi
+ AC_DEFINE(THREAD_LOCAL_ALLOC)
+ AC_DEFINE(USE_COMPILER_TLS)
+ ;;
*-*-freebsd*)
AC_DEFINE(GC_FREEBSD_THREADS)
if test "x$PTHREAD_CFLAGS" != "x"; then
* None of this is safe with dlclose and incremental collection.
* But then not much of anything is safe in the presence of dlclose.
*/
-#if (defined(__linux__) || defined(__native_client__)) && !defined(_GNU_SOURCE)
+#if (defined(__linux__) || defined(__GLIBC__) || defined(__native_client__)) && !defined(_GNU_SOURCE)
/* Can't test LINUX, since this must be define before other includes */
# define _GNU_SOURCE
#endif
/* For glibc 2.2.4+. Unfortunately, it doesn't work for older */
/* versions. Thanks to Jakub Jelinek for most of the code. */
-# if (defined(LINUX) || defined(NACL)) /* Are others OK here, too? */ \
+# if (defined(LINUX) || defined (__GLIBC__) || defined(NACL)) /* Are others OK here, too? */ \
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
# define GC_RETURN_ADDR (GC_word)__return_address
#endif
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
# include <features.h>
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
&& !defined(__ia64__)
# endif
/* And one for FreeBSD: */
-# if defined(__FreeBSD__) && !defined(FREEBSD)
+# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(FREEBSD)
# define FREEBSD
# endif
# ifndef GC_FREEBSD_THREADS
# define MPROTECT_VDB
# endif
-# define SIG_SUSPEND SIGTSTP
-# define SIG_THR_RESTART SIGCONT
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (_end)
+# else
+# define SIG_SUSPEND SIGTSTP
+# define SIG_THR_RESTART SIGCONT
+# endif
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
# define DYNAMIC_LOADING
# ifndef GC_FREEBSD_THREADS
# define MPROTECT_VDB
# endif
-# define SIG_SUSPEND SIGTSTP
-# define SIG_THR_RESTART SIGCONT
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (_end)
+# else
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# endif
# define NEED_FIND_LIMIT
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
# define SUNOS5SIGS
# endif
-# if defined(FREEBSD) && (__FreeBSD__ >= 4)
+# if defined(FREEBSD) && ((__FreeBSD__ >= 4) || (__FreeBSD_kernel__ >= 4))
# define SUNOS5SIGS
# endif
# define CACHE_LINE_SIZE 32 /* Wild guess */
# endif
-# ifdef LINUX
+# if defined(LINUX) || defined(__GLIBC__)
# define REGISTER_LIBRARIES_EARLY
/* We sometimes use dl_iterate_phdr, which may acquire an internal */
/* lock. This isn't safe after the world has stopped. So we must */
#if defined(SPARC)
# define CAN_SAVE_CALL_ARGS
#endif
-#if (defined(I386) || defined(X86_64)) && defined(LINUX)
+#if (defined(I386) || defined(X86_64)) && (defined(LINUX) || defined(__GLIBC__))
/* SAVE_CALL_CHAIN is supported if the code is compiled to save */
/* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
# define CAN_SAVE_CALL_ARGS
Performs a check to make sure that no references are left to an
unloaded AppDomain.
.TP
+\fBclear-at-tlab-creation\fR
+Clears the nursery incrementally when the thread local allocation
+buffers (TLAB) are created. The default setting clears the whole
+nursery at GC time.
+.TP
+\fBdebug-clear-at-tlab-creation\fR
+Clears the nursery incrementally when the thread local allocation
+buffers (TLAB) are created, but at GC time fills it with the byte
+`0xff`, which should result in a crash more quickly if
+`clear-at-tlab-creation` doesn't work properly.
+.TP
\fBclear-at-gc\fR
This clears the nursery at GC time instead of doing it when the thread
local allocation buffer (TLAB) is created. The default is to clear
monotouch_runtime_SUBDIRS := build class
xammac_SUBDIRS := build class
mobile_SUBDIRS := build class
+mobile_static_SUBDIRS := build class
net_3_5_SUBDIRS := build class tools/xbuild
net_4_0_SUBDIRS := build class
net_4_5_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
@:
dir-check:
- @if [ "$(NO_DIR_CHECK)" = "" -a "$(PROFILE)" != "basic" ]; then make -C ../runtime; fi
+ @if [ "$(NO_DIR_CHECK)" = "" -a "$(PROFILE)" != "basic" ]; then $(MAKE) -C ../runtime; fi
# fun specialty targets
$(_boot_:%=profile-do--monotouch_runtime--%): profile-do--monotouch_runtime--%: profile-do--build--%
$(_boot_:%=profile-do--xammac--%): profile-do--xammac--%: profile-do--build--%
$(_boot_:%=profile-do--mobile--%): profile-do--mobile--%: profile-do--build--%
+$(_boot_:%=profile-do--mobile_static--%): profile-do--mobile_static--%: profile-do--build--%
$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--build--%
$(_boot_:%=profile-do--build--%): profile-do--build--%: profile-do--basic--%
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+
+PROFILE_MCS_FLAGS = \
+ -d:NET_1_1 \
+ -d:NET_2_0 \
+ -d:NET_2_1 \
+ -d:MOBILE \
+ -d:MOBILE_DYNAMIC \
+ -d:NET_3_5 \
+ -d:NET_4_0 \
+ -d:NET_4_5 \
+ -nowarn:1699 \
+ -nostdlib \
+ -lib:$(topdir)/class/lib/$(PROFILE) \
+ $(DEFAULT_REFERENCES) \
+ $(PLATFORM_DEBUG_FLAGS)
+
FRAMEWORK_VERSION = 2.1
NO_INSTALL = yes
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:FULL_AOT_RUNTIME -d:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+
+PROFILE_MCS_FLAGS = \
+ -d:NET_1_1 \
+ -d:NET_2_0 \
+ -d:NET_2_1 \
+ -d:NET_3_5 \
+ -d:NET_4_0 \
+ -d:NET_4_5 \
+ -d:MOBILE \
+ -d:FULL_AOT_RUNTIME \
+ -d:DISABLE_REMOTING \
+ -d:DISABLE_COM \
+ -nowarn:1699 \
+ -nostdlib \
+ -lib:$(topdir)/class/lib/$(PROFILE) \
+ $(DEFAULT_REFERENCES) \
+ $(PLATFORM_DEBUG_FLAGS)
+
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MOBILE_DYNAMIC -d:MONODROID -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+
+PROFILE_MCS_FLAGS = \
+ -d:NET_1_1 \
+ -d:NET_2_0 \
+ -d:NET_2_1 \
+ -d:NET_3_5 \
+ -d:NET_4_0 \
+ -d:NET_4_5 \
+ -d:MOBILE \
+ -d:MOBILE_DYNAMIC \
+ -d:MONODROID \
+ -d:ANDROID \
+ -nowarn:1699 \
+ -nostdlib \
+ -lib:$(topdir)/class/lib/$(PROFILE) \
+ $(DEFAULT_REFERENCES) \
+ $(PLATFORM_DEBUG_FLAGS)
+
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
@:
DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FULL_AOT_RUNTIME -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+
+PROFILE_MCS_FLAGS = \
+ -d:NET_1_1 \
+ -d:NET_2_0 \
+ -d:NET_2_1 \
+ -d:NET_3_5 \
+ -d:NET_4_0 \
+ -d:NET_4_5 \
+ -d:MOBILE \
+ -d:MONOTOUCH \
+ -d:DISABLE_REMOTING \
+ -d:DISABLE_COM \
+ -d:FULL_AOT_RUNTIME \
+ -nowarn:1699 \
+ -nostdlib \
+ -lib:$(topdir)/class/lib/$(PROFILE) \
+ $(DEFAULT_REFERENCES) \
+ $(PLATFORM_DEBUG_FLAGS)
+
FRAMEWORK_VERSION = 2.1
NO_TEST = yes
# the tuner takes care of the install
-NO_INSTALL = yes
\ No newline at end of file
+NO_INSTALL = yes
XBUILD_VERSION = 4.0
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
+
+# Ignore tests on net_4_0 as the 4.0 IL code is never used for running (just for metadata), so it doesn't make sense to execute tests there
+NO_TEST = yes
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{75D99998-A9C1-4B89-AD47-DA830E461DED}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>Accessibility</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <RootNamespace>Accessibility</RootNamespace>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;NET_1_1;NET_2_0;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;NET_1_1;NET_2_0;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="Accessibility\IAccessible.cs" />\r
- <Compile Include="Accessibility\IAccessibleHandler.cs" />\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Consts.cs.in</Link>\r
- </Compile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-system="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.6.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>\r
[assembly: Guid ("1ea4dbf0-3c3b-11cf-810c-00aa00389b71")]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: ImportedFromTypeLib ("Accessibility")]
using Commons.Xml.Nvdl;
using NUnit.Framework;
-namespace MonoTests.Commons.Xml.Nvdl
+namespace MonoTests.Commons.Xml.Relaxng
{
[TestFixture]
public class NvdlValidatingReaderTests
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <NoWarn>414</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="I18N">
- <HintPath>..\lib\net_2_0\I18N.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="big5.table"/>
- <EmbeddedResource Include="gb2312.table"/>
- <EmbeddedResource Include="jis.table"/>
- <EmbeddedResource Include="ks.table"/>
- <EmbeddedResource Include="gb18030.table"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <NoWarn>414</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <NoWarn>414</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="I18N">
- <HintPath>..\lib\net_2_0\I18N.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <NoWarn>414</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="I18N">
- <HintPath>..\lib\net_2_0\I18N.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <NoWarn>414</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="I18N">
- <HintPath>..\lib\net_2_0\I18N.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <NoWarn>414</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="I18N">
- <HintPath>..\lib\net_2_0\I18N.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
Mono.Posix \
System.Core
-net_1_1_java_SUBDIRS = \
- System.Xml \
- System.Data \
- System.Drawing \
- Novell.Directory.Ldap \
- System.DirectoryServices \
- System.Runtime.Serialization.Formatters.Soap \
- System.Runtime.Remoting
-
net_2_0_dirs := \
corlib \
System \
pcl_facade_dirs := Facades
-mobile_dirs := \
+mobile_common_dirs := \
corlib \
System \
System.Core \
System.Net \
System.Windows \
System.Xml.Serialization \
+ Mono.CSharp \
+ Microsoft.CSharp \
$(pcl_facade_dirs)
-monodroid_dirs := \
+mobile_static_dirs := \
+ $(mobile_common_dirs) \
+ Mono.Dynamic.Interpreter
+
+mobile_dynamic_dirs := \
+ $(mobile_common_dirs) \
Mono.CompilerServices.SymbolWriter \
- Mono.CSharp \
- Microsoft.CSharp \
System.Net.Http
xammac_dirs := \
- Mono.CompilerServices.SymbolWriter \
- Mono.CSharp \
- Microsoft.CSharp \
- System.Net.Http
+ $(mobile_dynamic_dirs)
+
+monodroid_dirs := \
+ $(mobile_dynamic_dirs)
+
+monotouch_dirs := \
+ $(mobile_static_dirs)
monotouch_runtime_dirs := \
corlib \
System.XML \
Mono.CSharp
-monotouch_dirs := \
- Mono.CSharp \
- Microsoft.CSharp \
- Mono.Dynamic.Interpreter
-
net_4_0_dirs := \
System.Numerics \
Microsoft.CSharp \
Microsoft.Build
net_2_0_SUBDIRS := $(net_2_0_dirs) $(net_2_0_only_dirs) $(xbuild_2_0_dirs) aot-compiler
-monodroid_SUBDIRS := $(mobile_dirs) $(monodroid_dirs)
-monotouch_SUBDIRS := $(mobile_dirs) $(monotouch_dirs)
+monodroid_SUBDIRS := $(monodroid_dirs)
+monotouch_SUBDIRS := $(monotouch_dirs)
monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
-mobile_static_SUBDIRS := $(mobile_dirs)
-mobile_SUBDIRS := $(mobile_dirs)
-xammac_SUBDIRS := $(mobile_dirs) $(xammac_dirs)
+mobile_static_SUBDIRS := $(mobile_static_dirs)
+mobile_SUBDIRS := $(mobile_dynamic_dirs)
+xammac_SUBDIRS := $(xammac_dirs)
net_3_5_SUBDIRS := $(xbuild_2_0_dirs)
net_4_0_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(xbuild_4_0_dirs)
net_4_5_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_5_dirs) $(xbuild_4_0_dirs) aot-compiler
include ../build/rules.make
-SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_dirs) $(monotouch_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
+SUBDIRS = $(net_2_0_dirs) $(net_2_0_only_dirs) $(mobile_static_dirs) $(mobile_dynamic_dirs) $(monotouch_dirs) $(monodroid_dirs) $(xammac_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(net_4_5_dirs)
DIST_ONLY_SUBDIRS = dlr aot-compiler $(xbuild_4_0_dirs)
EXTRA_DISTFILES = \
README System.Windows.Forms.dll.resources \
- $(RESX_RESOURCES:.resources=.resx) $(CUR_RESOURCES) $(PREBUILT) build-csproj build-csproj2k5 \
+ $(RESX_RESOURCES:.resources=.resx) $(CUR_RESOURCES) $(PREBUILT) \
$(IMAGES_RESOURCES) \
$(TEST_DISTFILES)
+++ /dev/null
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.10.3077"
- SchemaVersion = "2.0"
- ProjectGuid = "{5E6430B2-6B9F-4E76-802E-20207EF80391}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "System.Windows.Forms"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- PreBuildEvent = ""
- PostBuildEvent = ""
- RootNamespace = ""
- RunPostBuildEvent = "OnBuildSuccess"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "NET_1_1 ONLY_1_1"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- <Config
- Name = "Debug 2.0"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "NET_2_0"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "NET_1_1 ONLY_1_1"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- <Config
- Name = "Release 2.0"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "NET_2_0"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- </Settings>
- <References>
- <Reference
- Name = "Accessibility"
- AssemblyName = "Accessibility"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Accessibility.dll"
- />
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
- />
- <Reference
- Name = "System.Drawing"
- AssemblyName = "System.Drawing"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.XML"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "..\..\build\common\Consts.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "..\..\build\common\MonoTODOAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "Assembly\Locale.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Resources\ResXDataNode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Resources\ResXFileRef.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Resources\ResXNullRef.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Resources\ResXResourceReader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Resources\ResXResourceSet.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Resources\ResXResourceWriter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\ComponentEditorForm.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\ComponentEditorPage.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\EventsTab.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\IUIService.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\IWindowsFormsEditorService.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\PropertyTab.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\ToolStripItemDesignerAvailability.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\ToolStripItemDesignerAvailabilityAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Design\WindowsFormsComponentEditor.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Internal\Accessor.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Internal\DebugHelper.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.PropertyGridInternal\PropertiesTab.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\Charcode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\Charset.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\CharsetFlags.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\CharsetType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\ClassDelegate.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\Color.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\DestinationDelegate.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\Font.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\KeyStruct.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\KeysInit.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\Major.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\Minor.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\Picture.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\RTF.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\RTFException.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\StandardCharCode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\StandardCharName.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\Style.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\StyleElement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\StyleType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\TextMap.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.RTF\TokenClass.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\Default\LabelPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\Default\LinkLabelPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AccessibleEvents.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AccessibleNavigation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AccessibleObject.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AccessibleRole.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AccessibleSelection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AccessibleStates.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AmbientProperties.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AnchorStyles.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Appearance.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Application.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ApplicationContext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ArrangeDirection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ArrangeStartingPosition.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ArrowDirection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AsyncMethodData.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AsyncMethodResult.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AutoCompleteMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AutoCompleteSource.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AutoCompleteStringCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AutoScaleMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AutoSizeMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AutoValidate.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\AxHost.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BaseCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BatteryChargeStatus.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Binding.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingCompleteContext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingCompleteEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingCompleteEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingCompleteState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingContext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingManagerBase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingManagerDataErrorEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingManagerDataErrorEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingMemberInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingNavigator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingSource.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BindingsCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BootMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Border3DSide.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Border3DStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\BoundsSpecified.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Button.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ButtonBase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ButtonBorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ButtonRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ButtonState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CacheVirtualItemsEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CacheVirtualItemsEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CaptionButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CategoryGridEntry.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CharacterCasing.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CheckBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CheckBoxRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CheckState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CheckedListBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Clipboard.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CloseReason.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColorDepth.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColorDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnClickEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnClickEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnHeader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnHeaderAutoResizeStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnHeaderConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnHeaderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnReorderedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnReorderedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnWidthChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnWidthChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnWidthChangingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ColumnWidthChangingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ComboBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ComboBoxRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ComboBoxStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CommonDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ComponentModel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ContainerControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ContentsResizedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ContentsResizedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ContextMenu.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ContextMenuStrip.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Control.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ControlBindingsCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ControlEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ControlEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ControlPaint.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ControlStyles.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ControlUpdateMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ConvertEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ConvertEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CreateParams.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CurrencyManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Cursor.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\CursorConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Cursors.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataFormats.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGrid.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridBoolColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridColumnStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridLineStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridParentRowsLabelStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridPreferredColumnWidthTypeConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridTableStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridTextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridTextBoxColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridView.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAdvancedBorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAdvancedCellBorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeColumnMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeColumnModeEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeColumnModeEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeColumnsMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeColumnsModeEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeColumnsModeEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeModeEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeModeEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeRowMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewAutoSizeRowsMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewBand.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewBindingCompleteEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewBindingCompleteEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewButtonCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewButtonColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellBorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellCancelEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellCancelEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellContextMenuStripNeededEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellContextMenuStripNeededEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellErrorTextNeededEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellErrorTextNeededEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellFormattingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellFormattingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellMouseEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellMouseEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellPaintingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellPaintingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellParsingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellParsingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellStateChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellStateChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellStyleContentChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellStyleContentChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellStyleConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellStyleScopes.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellToolTipTextNeededEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellToolTipTextNeededEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellValidatingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellValidatingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellValueEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCellValueEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCheckBoxCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewCheckBoxColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewClipboardCopyMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnDesignTimeVisibleAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnDividerDoubleClickEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnDividerDoubleClickEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnHeaderCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnHeadersHeightSizeMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnSortMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnStateChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewColumnStateChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewComboBoxCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewComboBoxColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewComboBoxDisplayStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewComboBoxEditingControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewContentAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewDataErrorContexts.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewDataErrorEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewDataErrorEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewEditMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewEditingControlShowingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewEditingControlShowingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewElement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewElementStates.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewHeaderBorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewHeaderCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewHitTestType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewImageCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewImageCellLayout.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewImageColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewLinkCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewLinkColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewPaintParts.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRow.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowCancelEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowCancelEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowContextMenuStripNeededEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowContextMenuStripNeededEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowDividerDoubleClickEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowDividerDoubleClickEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowErrorTextNeededEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowErrorTextNeededEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowHeaderCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowHeadersWidthSizeMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowHeightInfoNeededEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowHeightInfoNeededEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowHeightInfoPushedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowHeightInfoPushedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowPostPaintEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowPostPaintEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowPrePaintEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowPrePaintEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowStateChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowStateChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowsAddedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowsAddedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowsRemovedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewRowsRemovedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewSelectedCellCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewSelectedColumnCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewSelectedRowCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewSelectionMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewSortCompareEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewSortCompareEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewTextBoxCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewTextBoxColumn.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewTextBoxEditingControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewTopLeftHeaderCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataGridViewTriState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataObject.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DataSourceUpdateMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DateBoldEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DateBoldEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DateRangeEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DateRangeEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DateTimePicker.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DateTimePickerFormat.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Day.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DialogResult.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DockingAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DockStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DockingBehavior.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DomainUpDown.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DragAction.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DragDropEffects.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DragEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DragEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawItemEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawItemEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawItemState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawListViewColumnHeaderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawListViewColumnHeaderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawListViewItemEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawListViewItemEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawListViewSubItemEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawListViewSubItemEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawToolTipEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawToolTipEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawTreeNodeEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\DrawTreeNodeEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ErrorBlinkStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ErrorIconAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ErrorProvider.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FeatureSupport.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FileDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FileDialogCustomPlace.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FileDialogCustomPlacesCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FixedPanel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FixedSizeTextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FlatButtonAppearance.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FlatStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FlowDirection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FlowLayoutPanel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FlowLayoutSettings.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FolderBrowserDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FontDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Form.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormBorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormClosedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormClosedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormClosingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormClosingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormStartPosition.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormWindowManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FormWindowState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\FrameStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GetChildAtPointSkip.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GiveFeedbackEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GiveFeedbackEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GridColumnStylesCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GridEntry.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GridItem.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GridItemCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GridItemType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GridTableStylesCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GridTablesFactory.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GroupBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\GroupBoxRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HScrollBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HandledMouseEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Help.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HelpEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HelpEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HelpNavigator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HelpProvider.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HorizontalAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HScrollProperties.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlDocument.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlElement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlElementCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlElementErrorEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlElementErrorEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlElementEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlElementEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlElementInsertionOrientation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlHistory.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlWindow.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\HtmlWindowCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Hwnd.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IButtonControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IBindableComponent.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IBounds.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ICommandExecutor.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IComponentEditorPageSite.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IContainerControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ICurrencyManagerProvider.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IDataGridColumnStyleEditingNotificationService.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IDataGridEditingService.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IDataGridViewEditingCell.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IDataGridViewEditingControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IDataObject.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IDeviceContext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IDropTarget.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IFeatureSupport.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IFileReaderService.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IKeyFilter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IMessageFilter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IRootGridEntry.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IWin32Window.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IWindowTarget.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImageIndexConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImageKeyConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImageLayout.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImageList.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImageListConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImageListStreamer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImeMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImplicitHScrollBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ImplicitVScrollBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InputLanguage.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InputLanguageChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InputLanguageChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InputLanguageChangingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InputLanguageChangingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InputLanguageCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InsertKeyMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InternalWindowManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InvalidateEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\InvalidateEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemActivation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemBoundsPortion.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemCheckEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemCheckEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemCheckedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemCheckedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemDragEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ItemDragEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\IToolStripData.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\KeyEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\KeyEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\KeyPressEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\KeyPressEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\KeyboardLayouts.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Keys.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\KeysConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Label.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LabelEditEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LabelEditEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LabelEditTextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LayoutEngine.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LayoutEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LayoutEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LayoutSettings.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LeftRightAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Line.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LineTag.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkArea.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkBehavior.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkClickedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkClickedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkLabel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkLabelLinkClickedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkLabelLinkClickedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\LinkState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListBindingConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListBindingHelper.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListControlConvertEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListControlConvertEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListView.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewGroup.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewGroupCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewHitTestInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewHitTestLocations.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewInsertionMark.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewItem.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewItemConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewItemMouseHoverEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewItemMouseHoverEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewItemSelectionChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewItemSelectionChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewItemStates.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewVirtualItemsSelectionRangeChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ListViewVirtualItemsSelectionRangeChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MWFCategoryAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MWFDescriptionAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MainMenu.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MaskFormat.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MaskInputRejectedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MaskInputRejectedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MaskedTextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MdiClient.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MdiControlStrip.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MdiLayout.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MdiWindowManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MeasureItemEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MeasureItemEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Menu.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MenuAPI.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MenuGlyph.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MenuItem.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MenuMerge.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MenuStrip.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MergeAction.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Message.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MessageBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MessageBoxButtons.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MessageBoxDefaultButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MessageBoxIcon.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MessageBoxOptions.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MethodInvoker.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Mime.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MimeIcon.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MonthCalendar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MouseButtons.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MouseEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\MouseEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NativeWindow.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NavigateEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NavigateEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NodeLabelEditEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NodeLabelEditEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NotifyIcon.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NumericTextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NumericUpDown.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NumericUpDownAcceleration.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\NumericUpDownAccelerationCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\OSFeature.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\OpacityConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\OpenFileDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\OpenTreeNodeEnumerator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Orientation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\OwnerDrawPropertyBag.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Padding.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PaddingConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PageSetupDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PaintEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PaintEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Panel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PictureBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PictureBoxSizeMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PopupEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PopupEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PowerLineStatus.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PowerState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PowerStatus.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PreProcessControlState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PreviewKeyDownEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PreviewKeyDownEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PrintControllerWithStatusDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PrintDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PrintPreviewControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PrintPreviewDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ProfessionalColors.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ProfessionalColorTable.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ProgressBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ProgressBarRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ProgressBarStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyGrid.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyGridCommands.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyGridTextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyGridView.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertySort.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyTabChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyTabChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyValueChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\PropertyValueChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\QueryAccessibilityHelpEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\QueryAccessibilityHelpEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\QueryContinueDragEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\QueryContinueDragEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\QuestionEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\QuestionEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RadioButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RadioButtonRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RelatedCurrencyManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RelatedImageListAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RelatedPropertyManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RetrieveVirtualItemEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RetrieveVirtualItemEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RichTextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RichTextBoxFinds.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RichTextBoxLanguageOptions.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RichTextBoxScrollBars.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RichTextBoxSelectionAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RichTextBoxSelectionTypes.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RichTextBoxStreamType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RichTextBoxWordPunctuations.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RightToLeft.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RootGridEntry.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\RowStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SaveFileDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Screen.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScreenOrientation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollBarRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollBars.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollEventType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollOrientation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollProperties.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ScrollableControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SearchDirectionHint.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SearchForVirtualItemEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SearchForVirtualItemEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SecurityIDType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SelectedGridItemChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SelectedGridItemChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SelectionMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SelectionRange.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SelectionRangeConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SendKeys.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Shortcut.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SizeGrip.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SizeGripStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SizeType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SortOrder.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SplitContainer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Splitter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SplitterCancelEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SplitterCancelEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SplitterEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SplitterEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SplitterPanel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBarDrawItemEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBarDrawItemEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBarPanel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBarPanelAutoSize.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBarPanelBorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBarPanelClickEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBarPanelClickEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusBarPanelStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StatusStrip.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\StructFormat.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SystemInformation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\SystemParameter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabAppearance.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabControlAction.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabControlCancelEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabControlCancelEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabControlEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabControlEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabDrawMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabPage.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TabSizeMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutCellPaintEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutCellPaintEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutColumnStyleCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutControlCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutPanel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutPanelCellBorderStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutPanelCellPosition.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutPanelGrowStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutRowStyleCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutSettings.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TableLayoutStyleCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextBoxBase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextBoxRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextBoxTextRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextDataFormat.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextFormatFlags.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextImageRelation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TextRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Theme.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ThemeEngine.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ThemeVisualStyles.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ThemeWin32Classic.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ThreadExceptionDialog.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TickStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Timer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolBarAppearance.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolBarButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolBarButtonClickEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolBarButtonClickEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolBarButtonStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolBarTextAlign.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStrip.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripArrowRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripArrowRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripComboBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripContainer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripContentPanel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripContentPanelRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripContentPanelRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripControlHost.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDown.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownCloseReason.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownClosedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownClosedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownClosingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownClosingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownDirection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownItem.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownItemAccessibleObject.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripDropDownMenu.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripGripDisplayStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripGripRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripGripRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripGripStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItem.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemClickedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemClickedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemDisplayStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemEventType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemImageRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemImageRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemImageScaling.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemOverflow.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemPlacement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemTextRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripItemTextRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripLabel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripLayoutStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripManagerRenderMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripMenuItem.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripOverflow.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripOverflowButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripPanel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripPanelRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripPanelRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripPanelRow.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripProfessionalRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripProgressBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripRenderMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripSeparator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripSeparatorRenderEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripSeparatorRenderEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripSplitButton.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripSplitStackLayout.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripStatusLabel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripStatusLabelBorderSides.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripSystemRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripTextBox.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolStripTextDirection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolTip.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolTipIcon.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ToolWindowManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TrackBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TrackBarRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeNode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeNodeCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeNodeConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeNodeMouseClickEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeNodeMouseClickEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeNodeMouseHoverEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeNodeMouseHoverEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeNodeStates.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeView.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewAction.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewCancelEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewCancelEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewDrawMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewHitTestInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewHitTestLocations.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewImageIndexConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TreeViewImageKeyConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TypeValidationEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\TypeValidationEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\UICues.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\UICuesEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\UICuesEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\UnhandledExceptionMode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\UpDownBase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\UpDownEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\UpDownEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\UserControl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\VScrollBar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\ValidationConstraints.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\View.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\VScrollProperties.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowser.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserBase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserDocumentCompletedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserDocumentCompletedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserEncryptionLevel.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserNavigatedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserNavigatedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserNavigatingEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserNavigatingEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserProgressChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserProgressChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserReadyState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserRefreshOption.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WebBrowserSiteBase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\Win32DnD.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WindowsFormsSection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\WindowsFormsSynchronizationContext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\X11DesktopColors.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\X11Dnd.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\X11Keyboard.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\X11Structs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\XEventQueue.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\XplatUI.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\XplatUICarbon.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\XplatUIDriver.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\XplatUIStructs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\XplatUIWin32.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms\XplatUIX11.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Layout\ArrangedElementCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Layout\DefaultLayout.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Layout\FlowLayout.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Layout\TableLayout.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Layout\TableLayoutSettingsTypeConverter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\ApplicationHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\ControlHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\Cursor.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\Dnd.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\EventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\EventHandlerBase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\Enums.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\HIObjectHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\IEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\KeyboardHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\MouseHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\Pasteboard.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\Structs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.CarbonInternal\WindowHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\ThemeElements.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\ThemeElementsDefault.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\ThemeElementsVisualStyles.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\Default\ButtonPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\Default\CheckBoxPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\Default\RadioButtonPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\Default\TabControlPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\Default\ToolStripPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\VisualStyles\CheckBoxPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\VisualStyles\RadioButtonPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\VisualStyles\TabControlPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.Theming\VisualStyles\ToolStripPainter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\BackgroundType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\BooleanProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\BorderType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\CheckBoxState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ColorProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ComboBoxState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ContentAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\EdgeEffects.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\Edges.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\EdgeStyle.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\EnumProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\FilenameProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\FillType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\FontProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\GlyphFontSizingType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\GlyphType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\GroupBoxState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\GtkPlus.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\HitTestCode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\HitTestOptions.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\HorizontalAlign.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\IconEffect.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ImageOrientation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ImageSelectType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\IntegerProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\IVisualStyles.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\MarginProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\OffsetType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\PointProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\PushButtonState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\RadioButtonState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ScrollBarArrowButtonState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ScrollBarSizeBoxState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ScrollBarState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\SizingType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\StringProperty.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\TabItemState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\TextBoxState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\TextMetrics.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\TextMetricsCharacterSet.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\TextMetricsPitchAndFamilyValues.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\TextShadowType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ThemeSizeType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\ToolBarState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\TrackBarThumbState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\TrueSizeScalingType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\UXTheme.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\VerticalAlignment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\VisualStyleElement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\VisualStyleInformation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\VisualStyleRenderer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\VisualStylesEngine.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\VisualStylesGtkPlus.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\VisualStylesNative.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.VisualStyles\VisualStyleState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.WebBrowserDialogs\AlertCheck.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.WebBrowserDialogs\ConfirmCheck.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.WebBrowserDialogs\Generic.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Windows.Forms.WebBrowserDialogs\Prompt.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "resources\SplitterNS.cur"
- CustomToolNameSpace = "System.Windows.Forms.SplitterNS.cur"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\SplitterWE.cur"
- CustomToolNameSpace = "System.Windows.Forms.SplitterWE.cur"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\NESW.cur"
- CustomToolNameSpace = "System.Windows.Forms.NESW.cur"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\NWSE.cur"
- CustomToolNameSpace = "System.Windows.Forms.NWSE.cur"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\DnDNo.cur"
- CustomToolNameSpace = "System.Windows.Forms.DnDNo.cur"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\DnDCopy.cur"
- CustomToolNameSpace = "System.Windows.Forms.DnDCopy.cur"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\DnDLink.cur"
- CustomToolNameSpace = "System.Windows.Forms.DnDLink.cur"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\DnDMove.cur"
- CustomToolNameSpace = "System.Windows.Forms.DnDMove.cur"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\keyboards.resources"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_computer.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\32_computer.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\computer.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_document-open.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\32_document-open.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\document-open.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_folder.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\folder-new.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\folder.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_folder-remote.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\32_folder-remote.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\folder-remote.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\go-previous.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\go-top.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\22_page-magnifier.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\preferences-system-windows.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_printer.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\32_printer.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\text-x-generic.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_user-desktop.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\32_user-desktop.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\user-desktop.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_user-home.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\32_user-home.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\user-home.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_dialog-error.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_dialog-information.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\16_dialog-warning.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\1-up.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\2-up.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\3-up.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\4-up.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\6-up.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\nav_delete.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\nav_end.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\nav_first.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\nav_next.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\nav_plus.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\nav_previous.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\image-missing.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\image-x-generic.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\propertygrid-alphabetical.png"
- CustomToolNameSpace = "System.Windows.Forms.propertygrid-alphabetical.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\propertygrid-categorized.png"
- CustomToolNameSpace = "System.Windows.Forms.propertygrid-categorized.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\propertygrid-propertypages.png"
- CustomToolNameSpace = "System.Windows.Forms.propertygrid-propertypages.png"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\EventsTab.bmp"
- CustomToolNameSpace = "System.Windows.Forms.Design.EventsTab.bmp"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\PropertiesTab.bmp"
- CustomToolNameSpace = "System.Windows.Forms.PropertyGridInternal.PropertiesTab.bmp"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\mono.ico"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "resources\errorProvider.ico"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "Consts.cs"
- Link = "common/Consts.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "MonoTODOAttribute.cs"
- Link = "common/MonoTODOAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual C# Express 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWF", "SWF.csproj", "{5E6430B2-6B9F-4E76-802E-20207EF80391}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testbed", "..\testbed\testbed.csproj", "{75D9EBE5-A54C-4FFF-B536-066577092A78}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug 2.0|Any CPU = Debug 2.0|Any CPU\r
- Debug|Any CPU = Debug|Any CPU\r
- Release 2.0|Any CPU = Release 2.0|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Debug 2.0|Any CPU.ActiveCfg = Debug 2.0|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Debug 2.0|Any CPU.Build.0 = Debug 2.0|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Release 2.0|Any CPU.ActiveCfg = Release 2.0|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Release 2.0|Any CPU.Build.0 = Release 2.0|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {75D9EBE5-A54C-4FFF-B536-066577092A78}.Debug 2.0|Any CPU.ActiveCfg = Debug|Any CPU\r
- {75D9EBE5-A54C-4FFF-B536-066577092A78}.Debug 2.0|Any CPU.Build.0 = Debug|Any CPU\r
- {75D9EBE5-A54C-4FFF-B536-066577092A78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {75D9EBE5-A54C-4FFF-B536-066577092A78}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {75D9EBE5-A54C-4FFF-B536-066577092A78}.Release 2.0|Any CPU.ActiveCfg = Release|Any CPU\r
- {75D9EBE5-A54C-4FFF-B536-066577092A78}.Release 2.0|Any CPU.Build.0 = Release|Any CPU\r
- {75D9EBE5-A54C-4FFF-B536-066577092A78}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {75D9EBE5-A54C-4FFF-B536-066577092A78}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <ProjectType>Local</ProjectType>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{5E6430B2-6B9F-4E76-802E-20207EF80391}</ProjectGuid>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ApplicationIcon>\r
- </ApplicationIcon>\r
- <AssemblyKeyContainerName>\r
- </AssemblyKeyContainerName>\r
- <AssemblyName>System.Windows.Forms_test</AssemblyName>\r
- <AssemblyOriginatorKeyFile>\r
- </AssemblyOriginatorKeyFile>\r
- <DefaultClientScript>JScript</DefaultClientScript>\r
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>\r
- <DefaultTargetSchema>IE50</DefaultTargetSchema>\r
- <DelaySign>false</DelaySign>\r
- <OutputType>Library</OutputType>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>\r
- <StartupObject>\r
- </StartupObject>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <OutputPath>.\</OutputPath>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <BaseAddress>285212672</BaseAddress>\r
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>\r
- <ConfigurationOverrideFile>\r
- </ConfigurationOverrideFile>\r
- <DefineConstants>NET_1_1,NET_2_0,__MonoCS__,DEBUG</DefineConstants>\r
- <DocumentationFile>\r
- </DocumentationFile>\r
- <DebugSymbols>true</DebugSymbols>\r
- <FileAlignment>4096</FileAlignment>\r
- <NoStdLib>false</NoStdLib>\r
- <NoWarn>\r
- </NoWarn>\r
- <Optimize>false</Optimize>\r
- <RegisterForComInterop>false</RegisterForComInterop>\r
- <RemoveIntegerChecks>false</RemoveIntegerChecks>\r
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r
- <WarningLevel>3</WarningLevel>\r
- <DebugType>full</DebugType>\r
- <ErrorReport>prompt</ErrorReport>\r
- <OutputType>Library</OutputType>\r
- <AssemblyName>System.Windows.Forms_test_net_2_0</AssemblyName>\r
- <RootNamespace>\r
- </RootNamespace>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug 2.0|AnyCPU' ">\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <BaseAddress>285212672</BaseAddress>\r
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>\r
- <ConfigurationOverrideFile>\r
- </ConfigurationOverrideFile>\r
- <DefineConstants>NET_2_0 __MonoCS__ DEBUG</DefineConstants>\r
- <DocumentationFile>\r
- </DocumentationFile>\r
- <DebugSymbols>true</DebugSymbols>\r
- <FileAlignment>4096</FileAlignment>\r
- <NoStdLib>false</NoStdLib>\r
- <NoWarn>\r
- </NoWarn>\r
- <Optimize>false</Optimize>\r
- <RegisterForComInterop>false</RegisterForComInterop>\r
- <RemoveIntegerChecks>false</RemoveIntegerChecks>\r
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r
- <WarningLevel>3</WarningLevel>\r
- <DebugType>full</DebugType>\r
- <ErrorReport>prompt</ErrorReport>\r
- <OutputType>Library</OutputType>\r
- <AssemblyName>System.Windows.Forms_test</AssemblyName>\r
- <RootNamespace>\r
- </RootNamespace>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <OutputPath>bin\Release\</OutputPath>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <BaseAddress>285212672</BaseAddress>\r
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>\r
- <ConfigurationOverrideFile>\r
- </ConfigurationOverrideFile>\r
- <DefineConstants>NET_1_1 ONLY_1_1 __MonoCS__</DefineConstants>\r
- <DocumentationFile>\r
- </DocumentationFile>\r
- <DebugSymbols>false</DebugSymbols>\r
- <FileAlignment>4096</FileAlignment>\r
- <NoStdLib>false</NoStdLib>\r
- <NoWarn>\r
- </NoWarn>\r
- <Optimize>false</Optimize>\r
- <RegisterForComInterop>false</RegisterForComInterop>\r
- <RemoveIntegerChecks>false</RemoveIntegerChecks>\r
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r
- <WarningLevel>3</WarningLevel>\r
- <DebugType>none</DebugType>\r
- <ErrorReport>prompt</ErrorReport>\r
- <OutputType>Library</OutputType>\r
- <AssemblyName>System.Windows.Forms_test</AssemblyName>\r
- <RootNamespace>\r
- </RootNamespace>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release 2.0|AnyCPU' ">\r
- <OutputPath>bin\Release\</OutputPath>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <BaseAddress>285212672</BaseAddress>\r
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>\r
- <ConfigurationOverrideFile>\r
- </ConfigurationOverrideFile>\r
- <DefineConstants>NET_2_0 __MonoCS__</DefineConstants>\r
- <DocumentationFile>\r
- </DocumentationFile>\r
- <DebugSymbols>false</DebugSymbols>\r
- <FileAlignment>4096</FileAlignment>\r
- <NoStdLib>false</NoStdLib>\r
- <NoWarn>\r
- </NoWarn>\r
- <Optimize>false</Optimize>\r
- <RegisterForComInterop>false</RegisterForComInterop>\r
- <RemoveIntegerChecks>false</RemoveIntegerChecks>\r
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r
- <WarningLevel>3</WarningLevel>\r
- <DebugType>none</DebugType>\r
- <ErrorReport>prompt</ErrorReport>\r
- <OutputType>Library</OutputType>\r
- <AssemblyName>System.Windows.Forms_test</AssemblyName>\r
- <RootNamespace>\r
- </RootNamespace>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">\r
- <OutputPath>.\</OutputPath>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <BaseAddress>285212672</BaseAddress>\r
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>\r
- <ConfigurationOverrideFile>\r
- </ConfigurationOverrideFile>\r
- <DefineConstants>NET_1_1,NET_2_0,__MonoCS__,DEBUG</DefineConstants>\r
- <DocumentationFile>\r
- </DocumentationFile>\r
- <DebugSymbols>true</DebugSymbols>\r
- <FileAlignment>4096</FileAlignment>\r
- <NoStdLib>false</NoStdLib>\r
- <NoWarn>\r
- </NoWarn>\r
- <Optimize>false</Optimize>\r
- <RegisterForComInterop>false</RegisterForComInterop>\r
- <RemoveIntegerChecks>false</RemoveIntegerChecks>\r
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r
- <WarningLevel>3</WarningLevel>\r
- <DebugType>full</DebugType>\r
- <ErrorReport>prompt</ErrorReport>\r
- <AssemblyName>System.Windows.Forms_test_net_2_0</AssemblyName>\r
- <OutputType>Library</OutputType>\r
- <RootNamespace>\r
- </RootNamespace>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>C:\winforms-unittests\nunit.framework.dll</HintPath>\r
- </Reference>\r
- <Reference Include="Accessibility">\r
- <Name>Accessibility</Name>\r
- </Reference>\r
- <Reference Include="System">\r
- <Name>System</Name>\r
- </Reference>\r
- <Reference Include="System.Data">\r
- <Name>System.Data</Name>\r
- </Reference>\r
- <Reference Include="System.Data">\r
- <Name>System.Data</Name>\r
- </Reference>\r
- <Reference Include="System.Drawing">\r
- <Name>System.Drawing</Name>\r
- </Reference>\r
- <Reference Include="System.Windows.Forms">\r
- <Name>System.Windows.Forms</Name>\r
- </Reference>\r
- <Reference Include="System.Xml">\r
- <Name>System.Xml</Name>\r
- </Reference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="Test\System.Windows.Forms\ApplicationTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\AutoCompleteStringCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ApplicationContextTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\BindingTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\BindingsCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\BindingContextTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\BindingManagerBaseTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\BindingMemberInfoTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\BindingNavigatorTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\BindingSourceTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ButtonBaseTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ButtonTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\CheckBoxEventTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\CheckBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\CheckedListBoxEventTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\CheckedListBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ColumnClickEventArgsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ColumnHeaderTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ColumnStyleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ComboBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\Common.cs" />\r
- <Compile Include="Test\System.Windows.Forms\CommonDialogsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ContainerControlTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ContextMenuTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlBindingsCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlBindingsConverterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlEventTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlHandleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlLogger.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlLogger2.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlPaintTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlPropertyEventsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ControlStyleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\CursorTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\CurrencyManagerTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataBindingTests.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridColumnStyleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridTableStyleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridTextBoxColumnTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridTextBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewAdvancedBorderStyleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewBandTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewButtonCellTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewCellCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewCellStyleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewCellTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewCheckBoxCellTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewClipboardHeaderTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewClipboardTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewColumnCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewColumnHeaderTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewColumnTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewComboBoxCellTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewCommon.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewDataBindingTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewElementTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewLinkCellTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewImageCellTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewRowCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewRowHeaderTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewRowTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewTextBoxCellTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataGridViewTextBoxColumnTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DataObjectTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DateTimePickerTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DefaultLayoutTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\DragEventArgsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ErrorProviderTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\FlowPanelTests.cs" />\r
- <Compile Include="Test\System.Windows.Forms\FocusTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\FolderBrowserDialogTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\FormEventTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\FormHandleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\FormTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\EventArgsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\EventLogger.cs" />\r
- <Compile Include="Test\System.Windows.Forms\GridColumnStylesCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\GridTableStylesCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\GroupBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\HelpProviderTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\HScrollPropertiesTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ImageKeyConverterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ImageListStreamerTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ImageListTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\InputLanguageTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\KeyEventArgsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\KeysConverterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\LabelTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\LinkAreaTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\LinkConverterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\LinkLabelTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListControlTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListBindingHelperTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListBoxEventTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListViewCollectionsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListViewEventTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListViewTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListViewGroupTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListViewGroupCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ListViewItemTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\MaskedTextBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\MdiFormHandleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\MdiFormTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\MessageTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\MenuStripTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\MenuTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\MenuItemTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\MonthCalendarTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\NotifyIconTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\NumericUpDownTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\PaddingTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\PaddingConverterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\PaintEventArgsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\PanelTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\PictureBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\PrintDialogTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ProgressBarTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\PropertyGridTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\PropertyManagerTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\RadioButtonTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\RowStyleTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\RichTextBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\SaveFileDialogTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ScrollableControlTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ScrollBarTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\SelectionRangeTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\SendKeysTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\SplitterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\SplitContainerTests.cs" />\r
- <Compile Include="Test\System.Windows.Forms\StatusBarPanelTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\StatusBarTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\StatusStripTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\SystemInformationTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TabControlTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TableLayoutTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TestHelper.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TestImageIndexConverter.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TextBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TimerTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolBarTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolBarButtonTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripButtonTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripComboBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripContainerTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripContentPanelTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripControlHostTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripDropDownTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripItemCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripItemTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripLabelTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripManagerTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripMenuItemTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripOverflowButtonTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripOverflowTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripPanelTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripProgressBarTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripSeparatorTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripStatusLabelTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolStripTextBoxTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\ToolTipTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TrackBarTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TreeNodeCollectionTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TreeNodeTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TreeViewHitTestInfoTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TreeViewImageKeyConverterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TreeViewImageIndexConverterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TreeViewTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\TreeViewEventsTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\UpDownTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\UserControlTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms\VScrollPropertiesTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms.Layout\TableLayoutSettingsTypeConverterTest.cs" />\r
- <Compile Include="Test\System.Windows.Forms.Layout\ArrangedElementCollectionTest.cs" />\r
- <Compile Include="Test\System.Resources\CompatTest.cs" />\r
- <Compile Include="Test\System.Resources\CultureTest.cs" />\r
- <Compile Include="Test\System.Resources\ResXDataNodeTest.cs" />\r
- <Compile Include="Test\System.Resources\ResXFileRefTest.cs" />\r
- <Compile Include="Test\System.Resources\ResXResourceReaderTest.cs" />\r
- <Compile Include="Test\System.Resources\WriterTest.cs" />\r
- <Compile Include="..\..\build\common\Consts.cs">\r
- <Link>Consts.cs</Link>\r
- </Compile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="Test\System.Windows.Forms\ChangeLog" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="Test\System.Resources\ChangeLog" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="Test\System.Windows.Forms.Layout\ChangeLog" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
- <PropertyGroup>\r
- <PreBuildEvent>\r
- </PreBuildEvent>\r
- <PostBuildEvent>\r
- </PostBuildEvent>\r
- <ProjectGuid>{5E6430B2-6B9F-4E76-802E-20207EF80391}</ProjectGuid>\r
- <RootNamespace>\r
- </RootNamespace>\r
- </PropertyGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectType>Local</ProjectType>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{5E6430B2-6B9F-4E76-802E-20207EF80391}</ProjectGuid>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ApplicationIcon>
- </ApplicationIcon>
- <AssemblyKeyContainerName>
- </AssemblyKeyContainerName>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
- <DefaultClientScript>JScript</DefaultClientScript>
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
- <DefaultTargetSchema>IE50</DefaultTargetSchema>
- <DelaySign>false</DelaySign>
- <OutputType>Library</OutputType>
- <RootNamespace>
- </RootNamespace>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <StartupObject>
- </StartupObject>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 NET_2_0 MWF_ON_MSRUNTIME</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>612,618,3021</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <OutputType>Library</OutputType>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 NET_2_0 MWF_ON_MSRUNTIME</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>612,618,3021</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <OutputType>Library</OutputType>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug 1.1|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 ONLY_1_1 MWF_ON_MSRUNTIME</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>612,618,3021</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <OutputType>Library</OutputType>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release 1.1|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 ONLY_1_1 MWF_ON_MSRUNTIME</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>612,618,3021</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <OutputType>Library</OutputType>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Accessibility">
- <Name>Accessibility</Name>
- </Reference>
- <Reference Include="System">
- <Name>System</Name>
- </Reference>
- <Reference Include="System.configuration" />
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Drawing">
- <Name>System.Drawing</Name>
- </Reference>
- <Reference Include="System.Xml">
- <Name>System.Xml</Name>
- </Reference>
- <Reference Include="Mono.WebBrowser2K5">
- <Name>Mono.WebBrowser2K5</Name>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Mono.WebBrowser\Mono.WebBrowser2K5.csproj">
- <Project>{5E6C996A-007F-40CE-B244-006EFCFB77D2}</Project>
- <Name>Mono.WebBrowser2K5</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="common\Consts.cs" />
- <Compile Include="common\MonoTODOAttribute.cs" />
- <Compile Include="Assembly\Locale.cs" />
- <Compile Include="System.Resources\ResXDataNode.cs" />
- <Compile Include="System.Resources\ResXFileRef.cs" />
- <Compile Include="System.Resources\ResXNullRef.cs" />
- <Compile Include="System.Resources\ResXResourceReader.cs" />
- <Compile Include="System.Resources\ResXResourceSet.cs" />
- <Compile Include="System.Resources\ResXResourceWriter.cs" />
- <Compile Include="System.Windows.Forms.Design\ComponentEditorForm.cs" />
- <Compile Include="System.Windows.Forms.Design\ComponentEditorPage.cs" />
- <Compile Include="System.Windows.Forms.Design\EventsTab.cs" />
- <Compile Include="System.Windows.Forms.Design\IUIService.cs" />
- <Compile Include="System.Windows.Forms.Design\IWindowsFormsEditorService.cs" />
- <Compile Include="System.Windows.Forms.Design\PropertyTab.cs" />
- <Compile Include="System.Windows.Forms.Design\ToolStripItemDesignerAvailability.cs" />
- <Compile Include="System.Windows.Forms.Design\ToolStripItemDesignerAvailabilityAttribute.cs" />
- <Compile Include="System.Windows.Forms.Design\WindowsFormsComponentEditor.cs" />
- <Compile Include="System.Windows.Forms.Internal\Accessor.cs" />
- <Compile Include="System.Windows.Forms.Internal\DebugHelper.cs" />
- <Compile Include="System.Windows.Forms.PropertyGridInternal\PropertiesTab.cs" />
- <Compile Include="System.Windows.Forms.RTF\Charcode.cs" />
- <Compile Include="System.Windows.Forms.RTF\Charset.cs" />
- <Compile Include="System.Windows.Forms.RTF\CharsetFlags.cs" />
- <Compile Include="System.Windows.Forms.RTF\CharsetType.cs" />
- <Compile Include="System.Windows.Forms.RTF\ClassDelegate.cs" />
- <Compile Include="System.Windows.Forms.RTF\Color.cs" />
- <Compile Include="System.Windows.Forms.RTF\DestinationDelegate.cs" />
- <Compile Include="System.Windows.Forms.RTF\Font.cs" />
- <Compile Include="System.Windows.Forms.RTF\KeyStruct.cs" />
- <Compile Include="System.Windows.Forms.RTF\KeysInit.cs" />
- <Compile Include="System.Windows.Forms.RTF\Major.cs" />
- <Compile Include="System.Windows.Forms.RTF\Minor.cs" />
- <Compile Include="System.Windows.Forms.RTF\Picture.cs" />
- <Compile Include="System.Windows.Forms.RTF\RTF.cs" />
- <Compile Include="System.Windows.Forms.RTF\RTFException.cs" />
- <Compile Include="System.Windows.Forms.RTF\StandardCharCode.cs" />
- <Compile Include="System.Windows.Forms.RTF\StandardCharName.cs" />
- <Compile Include="System.Windows.Forms.RTF\Style.cs" />
- <Compile Include="System.Windows.Forms.RTF\StyleElement.cs" />
- <Compile Include="System.Windows.Forms.RTF\StyleType.cs" />
- <Compile Include="System.Windows.Forms.RTF\TextMap.cs" />
- <Compile Include="System.Windows.Forms.RTF\TokenClass.cs" />
- <Compile Include="System.Windows.Forms.Theming\Default\LabelPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\Default\LinkLabelPainter.cs" />
- <Compile Include="System.Windows.Forms\AccessibleEvents.cs" />
- <Compile Include="System.Windows.Forms\AccessibleNavigation.cs" />
- <Compile Include="System.Windows.Forms\AccessibleObject.cs" />
- <Compile Include="System.Windows.Forms\AccessibleRole.cs" />
- <Compile Include="System.Windows.Forms\AccessibleSelection.cs" />
- <Compile Include="System.Windows.Forms\AccessibleStates.cs" />
- <Compile Include="System.Windows.Forms\AmbientProperties.cs" />
- <Compile Include="System.Windows.Forms\AnchorStyles.cs" />
- <Compile Include="System.Windows.Forms\Appearance.cs" />
- <Compile Include="System.Windows.Forms\Application.cs" />
- <Compile Include="System.Windows.Forms\ApplicationContext.cs" />
- <Compile Include="System.Windows.Forms\ArrangeDirection.cs" />
- <Compile Include="System.Windows.Forms\ArrangeStartingPosition.cs" />
- <Compile Include="System.Windows.Forms\ArrowDirection.cs" />
- <Compile Include="System.Windows.Forms\AsyncMethodData.cs" />
- <Compile Include="System.Windows.Forms\AsyncMethodResult.cs" />
- <Compile Include="System.Windows.Forms\AutoCompleteMode.cs" />
- <Compile Include="System.Windows.Forms\AutoCompleteSource.cs" />
- <Compile Include="System.Windows.Forms\AutoCompleteStringCollection.cs" />
- <Compile Include="System.Windows.Forms\AutoScaleMode.cs" />
- <Compile Include="System.Windows.Forms\AutoSizeMode.cs" />
- <Compile Include="System.Windows.Forms\AutoValidate.cs" />
- <Compile Include="System.Windows.Forms\AxHost.cs" />
- <Compile Include="System.Windows.Forms\BaseCollection.cs" />
- <Compile Include="System.Windows.Forms\BatteryChargeStatus.cs" />
- <Compile Include="System.Windows.Forms\Binding.cs" />
- <Compile Include="System.Windows.Forms\BindingCompleteContext.cs" />
- <Compile Include="System.Windows.Forms\BindingCompleteEventArgs.cs" />
- <Compile Include="System.Windows.Forms\BindingCompleteEventHandler.cs" />
- <Compile Include="System.Windows.Forms\BindingCompleteState.cs" />
- <Compile Include="System.Windows.Forms\BindingContext.cs" />
- <Compile Include="System.Windows.Forms\BindingManagerBase.cs" />
- <Compile Include="System.Windows.Forms\BindingManagerDataErrorEventArgs.cs" />
- <Compile Include="System.Windows.Forms\BindingManagerDataErrorEventHandler.cs" />
- <Compile Include="System.Windows.Forms\BindingMemberInfo.cs" />
- <Compile Include="System.Windows.Forms\BindingNavigator.cs" />
- <Compile Include="System.Windows.Forms\BindingSource.cs" />
- <Compile Include="System.Windows.Forms\BindingsCollection.cs" />
- <Compile Include="System.Windows.Forms\BootMode.cs" />
- <Compile Include="System.Windows.Forms\Border3DSide.cs" />
- <Compile Include="System.Windows.Forms\Border3DStyle.cs" />
- <Compile Include="System.Windows.Forms\BorderStyle.cs" />
- <Compile Include="System.Windows.Forms\BoundsSpecified.cs" />
- <Compile Include="System.Windows.Forms\Button.cs" />
- <Compile Include="System.Windows.Forms\ButtonBase.cs" />
- <Compile Include="System.Windows.Forms\ButtonBorderStyle.cs" />
- <Compile Include="System.Windows.Forms\ButtonRenderer.cs" />
- <Compile Include="System.Windows.Forms\ButtonState.cs" />
- <Compile Include="System.Windows.Forms\CacheVirtualItemsEventArgs.cs" />
- <Compile Include="System.Windows.Forms\CacheVirtualItemsEventHandler.cs" />
- <Compile Include="System.Windows.Forms\CaptionButton.cs" />
- <Compile Include="System.Windows.Forms\CategoryGridEntry.cs" />
- <Compile Include="System.Windows.Forms\CharacterCasing.cs" />
- <Compile Include="System.Windows.Forms\CheckBox.cs" />
- <Compile Include="System.Windows.Forms\CheckBoxRenderer.cs" />
- <Compile Include="System.Windows.Forms\CheckState.cs" />
- <Compile Include="System.Windows.Forms\CheckedListBox.cs" />
- <Compile Include="System.Windows.Forms\Clipboard.cs" />
- <Compile Include="System.Windows.Forms\CloseReason.cs" />
- <Compile Include="System.Windows.Forms\ColorDepth.cs" />
- <Compile Include="System.Windows.Forms\ColorDialog.cs" />
- <Compile Include="System.Windows.Forms\ColumnClickEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ColumnClickEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ColumnHeader.cs" />
- <Compile Include="System.Windows.Forms\ColumnHeaderAutoResizeStyle.cs" />
- <Compile Include="System.Windows.Forms\ColumnHeaderConverter.cs" />
- <Compile Include="System.Windows.Forms\ColumnHeaderStyle.cs" />
- <Compile Include="System.Windows.Forms\ColumnReorderedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ColumnReorderedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ColumnStyle.cs" />
- <Compile Include="System.Windows.Forms\ColumnWidthChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ColumnWidthChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ColumnWidthChangingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ColumnWidthChangingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ComboBox.cs" />
- <Compile Include="System.Windows.Forms\ComboBoxRenderer.cs" />
- <Compile Include="System.Windows.Forms\ComboBoxStyle.cs" />
- <Compile Include="System.Windows.Forms\CommonDialog.cs" />
- <Compile Include="System.Windows.Forms\ComponentModel.cs" />
- <Compile Include="System.Windows.Forms\ContainerControl.cs" />
- <Compile Include="System.Windows.Forms\ContentsResizedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ContentsResizedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ContextMenu.cs" />
- <Compile Include="System.Windows.Forms\ContextMenuStrip.cs" />
- <Compile Include="System.Windows.Forms\Control.cs" />
- <Compile Include="System.Windows.Forms\ControlBindingsCollection.cs" />
- <Compile Include="System.Windows.Forms\ControlEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ControlEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ControlPaint.cs" />
- <Compile Include="System.Windows.Forms\ControlStyles.cs" />
- <Compile Include="System.Windows.Forms\ControlUpdateMode.cs" />
- <Compile Include="System.Windows.Forms\ConvertEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ConvertEventHandler.cs" />
- <Compile Include="System.Windows.Forms\CreateParams.cs" />
- <Compile Include="System.Windows.Forms\CurrencyManager.cs" />
- <Compile Include="System.Windows.Forms\Cursor.cs" />
- <Compile Include="System.Windows.Forms\CursorConverter.cs" />
- <Compile Include="System.Windows.Forms\Cursors.cs" />
- <Compile Include="System.Windows.Forms\DataFormats.cs" />
- <Compile Include="System.Windows.Forms\DataGrid.cs" />
- <Compile Include="System.Windows.Forms\DataGridBoolColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridColumnStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridLineStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridParentRowsLabelStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridPreferredColumnWidthTypeConverter.cs" />
- <Compile Include="System.Windows.Forms\DataGridTableStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridTextBox.cs" />
- <Compile Include="System.Windows.Forms\DataGridTextBoxColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridView.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAdvancedBorderStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAdvancedCellBorderStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeColumnMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeColumnModeEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeColumnModeEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeColumnsMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeColumnsModeEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeColumnsModeEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeModeEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeModeEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeRowMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewAutoSizeRowsMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewBand.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewBindingCompleteEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewBindingCompleteEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewButtonCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewButtonColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellBorderStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellCancelEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellCancelEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellCollection.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellContextMenuStripNeededEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellContextMenuStripNeededEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellErrorTextNeededEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellErrorTextNeededEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellFormattingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellFormattingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellMouseEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellMouseEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellPaintingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellPaintingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellParsingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellParsingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellStateChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellStateChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellStyleContentChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellStyleContentChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellStyleConverter.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellStyleScopes.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellToolTipTextNeededEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellToolTipTextNeededEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellValidatingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellValidatingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellValueEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCellValueEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCheckBoxCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewCheckBoxColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewClipboardCopyMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnCollection.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnDesignTimeVisibleAttribute.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnDividerDoubleClickEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnDividerDoubleClickEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnHeaderCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnHeadersHeightSizeMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnSortMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnStateChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewColumnStateChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewComboBoxCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewComboBoxColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewComboBoxDisplayStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewComboBoxEditingControl.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewContentAlignment.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewDataErrorContexts.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewDataErrorEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewDataErrorEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewEditMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewEditingControlShowingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewEditingControlShowingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewElement.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewElementStates.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewHeaderBorderStyle.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewHeaderCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewHitTestType.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewImageCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewImageCellLayout.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewImageColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewLinkCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewLinkColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewPaintParts.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRow.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowCancelEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowCancelEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowCollection.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowContextMenuStripNeededEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowContextMenuStripNeededEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowDividerDoubleClickEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowDividerDoubleClickEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowErrorTextNeededEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowErrorTextNeededEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowHeaderCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowHeadersWidthSizeMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowHeightInfoNeededEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowHeightInfoNeededEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowHeightInfoPushedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowHeightInfoPushedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowPostPaintEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowPostPaintEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowPrePaintEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowPrePaintEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowStateChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowStateChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowsAddedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowsAddedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowsRemovedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewRowsRemovedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewSelectedCellCollection.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewSelectedColumnCollection.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewSelectedRowCollection.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewSelectionMode.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewSortCompareEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewSortCompareEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewTextBoxCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewTextBoxColumn.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewTextBoxEditingControl.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewTopLeftHeaderCell.cs" />
- <Compile Include="System.Windows.Forms\DataGridViewTriState.cs" />
- <Compile Include="System.Windows.Forms\DataObject.cs" />
- <Compile Include="System.Windows.Forms\DataSourceUpdateMode.cs" />
- <Compile Include="System.Windows.Forms\DateBoldEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DateBoldEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DateRangeEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DateRangeEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DateTimePicker.cs" />
- <Compile Include="System.Windows.Forms\DateTimePickerFormat.cs" />
- <Compile Include="System.Windows.Forms\Day.cs" />
- <Compile Include="System.Windows.Forms\DialogResult.cs" />
- <Compile Include="System.Windows.Forms\DockingAttribute.cs" />
- <Compile Include="System.Windows.Forms\DockStyle.cs" />
- <Compile Include="System.Windows.Forms\DockingBehavior.cs" />
- <Compile Include="System.Windows.Forms\DomainUpDown.cs" />
- <Compile Include="System.Windows.Forms\DragAction.cs" />
- <Compile Include="System.Windows.Forms\DragDropEffects.cs" />
- <Compile Include="System.Windows.Forms\DragEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DragEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DrawItemEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DrawItemEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DrawItemState.cs" />
- <Compile Include="System.Windows.Forms\DrawListViewColumnHeaderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DrawListViewColumnHeaderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DrawListViewItemEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DrawListViewItemEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DrawListViewSubItemEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DrawListViewSubItemEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DrawMode.cs" />
- <Compile Include="System.Windows.Forms\DrawToolTipEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DrawToolTipEventHandler.cs" />
- <Compile Include="System.Windows.Forms\DrawTreeNodeEventArgs.cs" />
- <Compile Include="System.Windows.Forms\DrawTreeNodeEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ErrorBlinkStyle.cs" />
- <Compile Include="System.Windows.Forms\ErrorIconAlignment.cs" />
- <Compile Include="System.Windows.Forms\ErrorProvider.cs" />
- <Compile Include="System.Windows.Forms\FeatureSupport.cs" />
- <Compile Include="System.Windows.Forms\FileDialog.cs" />
- <Compile Include="System.Windows.Forms\FileDialogCustomPlace.cs" />
- <Compile Include="System.Windows.Forms\FileDialogCustomPlacesCollection.cs" />
- <Compile Include="System.Windows.Forms\FixedPanel.cs" />
- <Compile Include="System.Windows.Forms\FixedSizeTextBox.cs" />
- <Compile Include="System.Windows.Forms\FlatButtonAppearance.cs" />
- <Compile Include="System.Windows.Forms\FlatStyle.cs" />
- <Compile Include="System.Windows.Forms\FlowDirection.cs" />
- <Compile Include="System.Windows.Forms\FlowLayoutPanel.cs" />
- <Compile Include="System.Windows.Forms\FlowLayoutSettings.cs" />
- <Compile Include="System.Windows.Forms\FolderBrowserDialog.cs" />
- <Compile Include="System.Windows.Forms\FontDialog.cs" />
- <Compile Include="System.Windows.Forms\Form.cs" />
- <Compile Include="System.Windows.Forms\FormBorderStyle.cs" />
- <Compile Include="System.Windows.Forms\FormClosedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\FormClosedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\FormClosingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\FormClosingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\FormCollection.cs" />
- <Compile Include="System.Windows.Forms\FormStartPosition.cs" />
- <Compile Include="System.Windows.Forms\FormWindowManager.cs" />
- <Compile Include="System.Windows.Forms\FormWindowState.cs" />
- <Compile Include="System.Windows.Forms\FrameStyle.cs" />
- <Compile Include="System.Windows.Forms\GetChildAtPointSkip.cs" />
- <Compile Include="System.Windows.Forms\GiveFeedbackEventArgs.cs" />
- <Compile Include="System.Windows.Forms\GiveFeedbackEventHandler.cs" />
- <Compile Include="System.Windows.Forms\GridColumnStylesCollection.cs" />
- <Compile Include="System.Windows.Forms\GridEntry.cs" />
- <Compile Include="System.Windows.Forms\GridItem.cs" />
- <Compile Include="System.Windows.Forms\GridItemCollection.cs" />
- <Compile Include="System.Windows.Forms\GridItemType.cs" />
- <Compile Include="System.Windows.Forms\GridTableStylesCollection.cs" />
- <Compile Include="System.Windows.Forms\GridTablesFactory.cs" />
- <Compile Include="System.Windows.Forms\GroupBox.cs" />
- <Compile Include="System.Windows.Forms\GroupBoxRenderer.cs" />
- <Compile Include="System.Windows.Forms\HScrollBar.cs" />
- <Compile Include="System.Windows.Forms\HandledMouseEventArgs.cs" />
- <Compile Include="System.Windows.Forms\Help.cs" />
- <Compile Include="System.Windows.Forms\HelpEventArgs.cs" />
- <Compile Include="System.Windows.Forms\HelpEventHandler.cs" />
- <Compile Include="System.Windows.Forms\HelpNavigator.cs" />
- <Compile Include="System.Windows.Forms\HelpProvider.cs" />
- <Compile Include="System.Windows.Forms\HorizontalAlignment.cs" />
- <Compile Include="System.Windows.Forms\HScrollProperties.cs" />
- <Compile Include="System.Windows.Forms\HtmlDocument.cs" />
- <Compile Include="System.Windows.Forms\HtmlElement.cs" />
- <Compile Include="System.Windows.Forms\HtmlElementCollection.cs" />
- <Compile Include="System.Windows.Forms\HtmlElementErrorEventArgs.cs" />
- <Compile Include="System.Windows.Forms\HtmlElementErrorEventHandler.cs" />
- <Compile Include="System.Windows.Forms\HtmlElementEventArgs.cs" />
- <Compile Include="System.Windows.Forms\HtmlElementEventHandler.cs" />
- <Compile Include="System.Windows.Forms\HtmlElementInsertionOrientation.cs" />
- <Compile Include="System.Windows.Forms\HtmlHistory.cs" />
- <Compile Include="System.Windows.Forms\HtmlWindow.cs" />
- <Compile Include="System.Windows.Forms\HtmlWindowCollection.cs" />
- <Compile Include="System.Windows.Forms\Hwnd.cs" />
- <Compile Include="System.Windows.Forms\IButtonControl.cs" />
- <Compile Include="System.Windows.Forms\IBindableComponent.cs" />
- <Compile Include="System.Windows.Forms\IBounds.cs" />
- <Compile Include="System.Windows.Forms\ICommandExecutor.cs" />
- <Compile Include="System.Windows.Forms\IComponentEditorPageSite.cs" />
- <Compile Include="System.Windows.Forms\IContainerControl.cs" />
- <Compile Include="System.Windows.Forms\ICurrencyManagerProvider.cs" />
- <Compile Include="System.Windows.Forms\IDataGridColumnStyleEditingNotificationService.cs" />
- <Compile Include="System.Windows.Forms\IDataGridEditingService.cs" />
- <Compile Include="System.Windows.Forms\IDataGridViewEditingCell.cs" />
- <Compile Include="System.Windows.Forms\IDataGridViewEditingControl.cs" />
- <Compile Include="System.Windows.Forms\IDataObject.cs" />
- <Compile Include="System.Windows.Forms\IDeviceContext.cs" />
- <Compile Include="System.Windows.Forms\IDropTarget.cs" />
- <Compile Include="System.Windows.Forms\IFeatureSupport.cs" />
- <Compile Include="System.Windows.Forms\IFileReaderService.cs" />
- <Compile Include="System.Windows.Forms\IKeyFilter.cs" />
- <Compile Include="System.Windows.Forms\IMessageFilter.cs" />
- <Compile Include="System.Windows.Forms\IRootGridEntry.cs" />
- <Compile Include="System.Windows.Forms\IWin32Window.cs" />
- <Compile Include="System.Windows.Forms\IWindowTarget.cs" />
- <Compile Include="System.Windows.Forms\ImageIndexConverter.cs" />
- <Compile Include="System.Windows.Forms\ImageKeyConverter.cs" />
- <Compile Include="System.Windows.Forms\ImageLayout.cs" />
- <Compile Include="System.Windows.Forms\ImageList.cs" />
- <Compile Include="System.Windows.Forms\ImageListConverter.cs" />
- <Compile Include="System.Windows.Forms\ImageListStreamer.cs" />
- <Compile Include="System.Windows.Forms\ImeMode.cs" />
- <Compile Include="System.Windows.Forms\ImplicitHScrollBar.cs" />
- <Compile Include="System.Windows.Forms\ImplicitVScrollBar.cs" />
- <Compile Include="System.Windows.Forms\InputLanguage.cs" />
- <Compile Include="System.Windows.Forms\InputLanguageChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\InputLanguageChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\InputLanguageChangingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\InputLanguageChangingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\InputLanguageCollection.cs" />
- <Compile Include="System.Windows.Forms\InsertKeyMode.cs" />
- <Compile Include="System.Windows.Forms\InternalWindowManager.cs" />
- <Compile Include="System.Windows.Forms\InvalidateEventArgs.cs" />
- <Compile Include="System.Windows.Forms\InvalidateEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ItemActivation.cs" />
- <Compile Include="System.Windows.Forms\ItemBoundsPortion.cs" />
- <Compile Include="System.Windows.Forms\ItemChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ItemChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ItemCheckEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ItemCheckEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ItemCheckedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ItemCheckedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ItemDragEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ItemDragEventHandler.cs" />
- <Compile Include="System.Windows.Forms\IToolStripData.cs" />
- <Compile Include="System.Windows.Forms\KeyEventArgs.cs" />
- <Compile Include="System.Windows.Forms\KeyEventHandler.cs" />
- <Compile Include="System.Windows.Forms\KeyPressEventArgs.cs" />
- <Compile Include="System.Windows.Forms\KeyPressEventHandler.cs" />
- <Compile Include="System.Windows.Forms\KeyboardLayouts.cs" />
- <Compile Include="System.Windows.Forms\Keys.cs" />
- <Compile Include="System.Windows.Forms\KeysConverter.cs" />
- <Compile Include="System.Windows.Forms\Label.cs" />
- <Compile Include="System.Windows.Forms\LabelEditEventArgs.cs" />
- <Compile Include="System.Windows.Forms\LabelEditEventHandler.cs" />
- <Compile Include="System.Windows.Forms\LabelEditTextBox.cs" />
- <Compile Include="System.Windows.Forms\LayoutEngine.cs" />
- <Compile Include="System.Windows.Forms\LayoutEventArgs.cs" />
- <Compile Include="System.Windows.Forms\LayoutEventHandler.cs" />
- <Compile Include="System.Windows.Forms\LayoutSettings.cs" />
- <Compile Include="System.Windows.Forms\LeftRightAlignment.cs" />
- <Compile Include="System.Windows.Forms\Line.cs" />
- <Compile Include="System.Windows.Forms\LineTag.cs" />
- <Compile Include="System.Windows.Forms\LinkArea.cs" />
- <Compile Include="System.Windows.Forms\LinkBehavior.cs" />
- <Compile Include="System.Windows.Forms\LinkClickedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\LinkClickedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\LinkConverter.cs" />
- <Compile Include="System.Windows.Forms\LinkLabel.cs" />
- <Compile Include="System.Windows.Forms\LinkLabelLinkClickedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\LinkLabelLinkClickedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\LinkState.cs" />
- <Compile Include="System.Windows.Forms\ListBindingConverter.cs" />
- <Compile Include="System.Windows.Forms\ListBindingHelper.cs" />
- <Compile Include="System.Windows.Forms\ListBox.cs" />
- <Compile Include="System.Windows.Forms\ListControl.cs" />
- <Compile Include="System.Windows.Forms\ListControlConvertEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ListControlConvertEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ListView.cs" />
- <Compile Include="System.Windows.Forms\ListViewAlignment.cs" />
- <Compile Include="System.Windows.Forms\ListViewGroup.cs" />
- <Compile Include="System.Windows.Forms\ListViewGroupCollection.cs" />
- <Compile Include="System.Windows.Forms\ListViewHitTestInfo.cs" />
- <Compile Include="System.Windows.Forms\ListViewHitTestLocations.cs" />
- <Compile Include="System.Windows.Forms\ListViewInsertionMark.cs" />
- <Compile Include="System.Windows.Forms\ListViewItem.cs" />
- <Compile Include="System.Windows.Forms\ListViewItemConverter.cs" />
- <Compile Include="System.Windows.Forms\ListViewItemMouseHoverEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ListViewItemMouseHoverEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ListViewItemSelectionChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ListViewItemSelectionChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ListViewItemStates.cs" />
- <Compile Include="System.Windows.Forms\ListViewVirtualItemsSelectionRangeChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ListViewVirtualItemsSelectionRangeChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\MWFCategoryAttribute.cs" />
- <Compile Include="System.Windows.Forms\MWFDescriptionAttribute.cs" />
- <Compile Include="System.Windows.Forms\MainMenu.cs" />
- <Compile Include="System.Windows.Forms\MaskFormat.cs" />
- <Compile Include="System.Windows.Forms\MaskInputRejectedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\MaskInputRejectedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\MaskedTextBox.cs" />
- <Compile Include="System.Windows.Forms\MdiClient.cs" />
- <Compile Include="System.Windows.Forms\MdiControlStrip.cs" />
- <Compile Include="System.Windows.Forms\MdiLayout.cs" />
- <Compile Include="System.Windows.Forms\MdiWindowManager.cs" />
- <Compile Include="System.Windows.Forms\MeasureItemEventArgs.cs" />
- <Compile Include="System.Windows.Forms\MeasureItemEventHandler.cs" />
- <Compile Include="System.Windows.Forms\Menu.cs" />
- <Compile Include="System.Windows.Forms\MenuAPI.cs" />
- <Compile Include="System.Windows.Forms\MenuGlyph.cs" />
- <Compile Include="System.Windows.Forms\MenuItem.cs" />
- <Compile Include="System.Windows.Forms\MenuMerge.cs" />
- <Compile Include="System.Windows.Forms\MenuStrip.cs" />
- <Compile Include="System.Windows.Forms\MergeAction.cs" />
- <Compile Include="System.Windows.Forms\Message.cs" />
- <Compile Include="System.Windows.Forms\MessageBox.cs" />
- <Compile Include="System.Windows.Forms\MessageBoxButtons.cs" />
- <Compile Include="System.Windows.Forms\MessageBoxDefaultButton.cs" />
- <Compile Include="System.Windows.Forms\MessageBoxIcon.cs" />
- <Compile Include="System.Windows.Forms\MessageBoxOptions.cs" />
- <Compile Include="System.Windows.Forms\MethodInvoker.cs" />
- <Compile Include="System.Windows.Forms\Mime.cs" />
- <Compile Include="System.Windows.Forms\MimeIcon.cs" />
- <Compile Include="System.Windows.Forms\MonthCalendar.cs" />
- <Compile Include="System.Windows.Forms\MouseButtons.cs" />
- <Compile Include="System.Windows.Forms\MouseEventArgs.cs" />
- <Compile Include="System.Windows.Forms\MouseEventHandler.cs" />
- <Compile Include="System.Windows.Forms\NativeWindow.cs" />
- <Compile Include="System.Windows.Forms\NavigateEventArgs.cs" />
- <Compile Include="System.Windows.Forms\NavigateEventHandler.cs" />
- <Compile Include="System.Windows.Forms\NodeLabelEditEventArgs.cs" />
- <Compile Include="System.Windows.Forms\NodeLabelEditEventHandler.cs" />
- <Compile Include="System.Windows.Forms\NotifyIcon.cs" />
- <Compile Include="System.Windows.Forms\NumericTextBox.cs" />
- <Compile Include="System.Windows.Forms\NumericUpDown.cs" />
- <Compile Include="System.Windows.Forms\NumericUpDownAcceleration.cs" />
- <Compile Include="System.Windows.Forms\NumericUpDownAccelerationCollection.cs" />
- <Compile Include="System.Windows.Forms\OSFeature.cs" />
- <Compile Include="System.Windows.Forms\OpacityConverter.cs" />
- <Compile Include="System.Windows.Forms\OpenFileDialog.cs" />
- <Compile Include="System.Windows.Forms\OpenTreeNodeEnumerator.cs" />
- <Compile Include="System.Windows.Forms\Orientation.cs" />
- <Compile Include="System.Windows.Forms\OwnerDrawPropertyBag.cs" />
- <Compile Include="System.Windows.Forms\Padding.cs" />
- <Compile Include="System.Windows.Forms\PaddingConverter.cs" />
- <Compile Include="System.Windows.Forms\PageSetupDialog.cs" />
- <Compile Include="System.Windows.Forms\PaintEventArgs.cs" />
- <Compile Include="System.Windows.Forms\PaintEventHandler.cs" />
- <Compile Include="System.Windows.Forms\Panel.cs" />
- <Compile Include="System.Windows.Forms\PictureBox.cs" />
- <Compile Include="System.Windows.Forms\PictureBoxSizeMode.cs" />
- <Compile Include="System.Windows.Forms\PopupEventArgs.cs" />
- <Compile Include="System.Windows.Forms\PopupEventHandler.cs" />
- <Compile Include="System.Windows.Forms\PowerLineStatus.cs" />
- <Compile Include="System.Windows.Forms\PowerState.cs" />
- <Compile Include="System.Windows.Forms\PowerStatus.cs" />
- <Compile Include="System.Windows.Forms\PreProcessControlState.cs" />
- <Compile Include="System.Windows.Forms\PreviewKeyDownEventArgs.cs" />
- <Compile Include="System.Windows.Forms\PreviewKeyDownEventHandler.cs" />
- <Compile Include="System.Windows.Forms\PrintControllerWithStatusDialog.cs" />
- <Compile Include="System.Windows.Forms\PrintDialog.cs" />
- <Compile Include="System.Windows.Forms\PrintPreviewControl.cs" />
- <Compile Include="System.Windows.Forms\PrintPreviewDialog.cs" />
- <Compile Include="System.Windows.Forms\ProfessionalColors.cs" />
- <Compile Include="System.Windows.Forms\ProfessionalColorTable.cs" />
- <Compile Include="System.Windows.Forms\ProgressBar.cs" />
- <Compile Include="System.Windows.Forms\ProgressBarRenderer.cs" />
- <Compile Include="System.Windows.Forms\ProgressBarStyle.cs" />
- <Compile Include="System.Windows.Forms\PropertyGrid.cs" />
- <Compile Include="System.Windows.Forms\PropertyGridCommands.cs" />
- <Compile Include="System.Windows.Forms\PropertyGridTextBox.cs" />
- <Compile Include="System.Windows.Forms\PropertyGridView.cs" />
- <Compile Include="System.Windows.Forms\PropertyManager.cs" />
- <Compile Include="System.Windows.Forms\PropertySort.cs" />
- <Compile Include="System.Windows.Forms\PropertyTabChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\PropertyTabChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\PropertyValueChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\PropertyValueChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\QueryAccessibilityHelpEventArgs.cs" />
- <Compile Include="System.Windows.Forms\QueryAccessibilityHelpEventHandler.cs" />
- <Compile Include="System.Windows.Forms\QueryContinueDragEventArgs.cs" />
- <Compile Include="System.Windows.Forms\QueryContinueDragEventHandler.cs" />
- <Compile Include="System.Windows.Forms\QuestionEventArgs.cs" />
- <Compile Include="System.Windows.Forms\QuestionEventHandler.cs" />
- <Compile Include="System.Windows.Forms\RadioButton.cs" />
- <Compile Include="System.Windows.Forms\RadioButtonRenderer.cs" />
- <Compile Include="System.Windows.Forms\RelatedCurrencyManager.cs" />
- <Compile Include="System.Windows.Forms\RelatedImageListAttribute.cs" />
- <Compile Include="System.Windows.Forms\RelatedPropertyManager.cs" />
- <Compile Include="System.Windows.Forms\RetrieveVirtualItemEventArgs.cs" />
- <Compile Include="System.Windows.Forms\RetrieveVirtualItemEventHandler.cs" />
- <Compile Include="System.Windows.Forms\RichTextBox.cs" />
- <Compile Include="System.Windows.Forms\RichTextBoxFinds.cs" />
- <Compile Include="System.Windows.Forms\RichTextBoxLanguageOptions.cs" />
- <Compile Include="System.Windows.Forms\RichTextBoxScrollBars.cs" />
- <Compile Include="System.Windows.Forms\RichTextBoxSelectionAttribute.cs" />
- <Compile Include="System.Windows.Forms\RichTextBoxSelectionTypes.cs" />
- <Compile Include="System.Windows.Forms\RichTextBoxStreamType.cs" />
- <Compile Include="System.Windows.Forms\RichTextBoxWordPunctuations.cs" />
- <Compile Include="System.Windows.Forms\RightToLeft.cs" />
- <Compile Include="System.Windows.Forms\RootGridEntry.cs" />
- <Compile Include="System.Windows.Forms\RowStyle.cs" />
- <Compile Include="System.Windows.Forms\SaveFileDialog.cs" />
- <Compile Include="System.Windows.Forms\Screen.cs" />
- <Compile Include="System.Windows.Forms\ScreenOrientation.cs" />
- <Compile Include="System.Windows.Forms\ScrollBar.cs" />
- <Compile Include="System.Windows.Forms\ScrollBarRenderer.cs" />
- <Compile Include="System.Windows.Forms\ScrollBars.cs" />
- <Compile Include="System.Windows.Forms\ScrollButton.cs" />
- <Compile Include="System.Windows.Forms\ScrollEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ScrollEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ScrollEventType.cs" />
- <Compile Include="System.Windows.Forms\ScrollOrientation.cs" />
- <Compile Include="System.Windows.Forms\ScrollProperties.cs" />
- <Compile Include="System.Windows.Forms\ScrollableControl.cs" />
- <Compile Include="System.Windows.Forms\SearchDirectionHint.cs" />
- <Compile Include="System.Windows.Forms\SearchForVirtualItemEventArgs.cs" />
- <Compile Include="System.Windows.Forms\SearchForVirtualItemEventHandler.cs" />
- <Compile Include="System.Windows.Forms\SecurityIDType.cs" />
- <Compile Include="System.Windows.Forms\SelectedGridItemChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\SelectedGridItemChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\SelectionMode.cs" />
- <Compile Include="System.Windows.Forms\SelectionRange.cs" />
- <Compile Include="System.Windows.Forms\SelectionRangeConverter.cs" />
- <Compile Include="System.Windows.Forms\SendKeys.cs" />
- <Compile Include="System.Windows.Forms\Shortcut.cs" />
- <Compile Include="System.Windows.Forms\SizeGrip.cs" />
- <Compile Include="System.Windows.Forms\SizeGripStyle.cs" />
- <Compile Include="System.Windows.Forms\SizeType.cs" />
- <Compile Include="System.Windows.Forms\SortOrder.cs" />
- <Compile Include="System.Windows.Forms\SplitContainer.cs" />
- <Compile Include="System.Windows.Forms\Splitter.cs" />
- <Compile Include="System.Windows.Forms\SplitterCancelEventArgs.cs" />
- <Compile Include="System.Windows.Forms\SplitterCancelEventHandler.cs" />
- <Compile Include="System.Windows.Forms\SplitterEventArgs.cs" />
- <Compile Include="System.Windows.Forms\SplitterEventHandler.cs" />
- <Compile Include="System.Windows.Forms\SplitterPanel.cs" />
- <Compile Include="System.Windows.Forms\StatusBar.cs" />
- <Compile Include="System.Windows.Forms\StatusBarDrawItemEventArgs.cs" />
- <Compile Include="System.Windows.Forms\StatusBarDrawItemEventHandler.cs" />
- <Compile Include="System.Windows.Forms\StatusBarPanel.cs" />
- <Compile Include="System.Windows.Forms\StatusBarPanelAutoSize.cs" />
- <Compile Include="System.Windows.Forms\StatusBarPanelBorderStyle.cs" />
- <Compile Include="System.Windows.Forms\StatusBarPanelClickEventArgs.cs" />
- <Compile Include="System.Windows.Forms\StatusBarPanelClickEventHandler.cs" />
- <Compile Include="System.Windows.Forms\StatusBarPanelStyle.cs" />
- <Compile Include="System.Windows.Forms\StatusStrip.cs" />
- <Compile Include="System.Windows.Forms\StructFormat.cs" />
- <Compile Include="System.Windows.Forms\SystemInformation.cs" />
- <Compile Include="System.Windows.Forms\SystemParameter.cs" />
- <Compile Include="System.Windows.Forms\TabAlignment.cs" />
- <Compile Include="System.Windows.Forms\TabAppearance.cs" />
- <Compile Include="System.Windows.Forms\TabControl.cs" />
- <Compile Include="System.Windows.Forms\TabControlAction.cs" />
- <Compile Include="System.Windows.Forms\TabControlCancelEventArgs.cs" />
- <Compile Include="System.Windows.Forms\TabControlCancelEventHandler.cs" />
- <Compile Include="System.Windows.Forms\TabControlEventArgs.cs" />
- <Compile Include="System.Windows.Forms\TabControlEventHandler.cs" />
- <Compile Include="System.Windows.Forms\TabDrawMode.cs" />
- <Compile Include="System.Windows.Forms\TabPage.cs" />
- <Compile Include="System.Windows.Forms\TabRenderer.cs" />
- <Compile Include="System.Windows.Forms\TabSizeMode.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutCellPaintEventArgs.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutCellPaintEventHandler.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutColumnStyleCollection.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutControlCollection.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutPanel.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutPanelCellBorderStyle.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutPanelCellPosition.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutPanelGrowStyle.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutRowStyleCollection.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutSettings.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutStyle.cs" />
- <Compile Include="System.Windows.Forms\TableLayoutStyleCollection.cs" />
- <Compile Include="System.Windows.Forms\TextBox.cs" />
- <Compile Include="System.Windows.Forms\TextBoxBase.cs" />
- <Compile Include="System.Windows.Forms\TextBoxRenderer.cs" />
- <Compile Include="System.Windows.Forms\TextBoxTextRenderer.cs" />
- <Compile Include="System.Windows.Forms\TextControl.cs" />
- <Compile Include="System.Windows.Forms\TextDataFormat.cs" />
- <Compile Include="System.Windows.Forms\TextFormatFlags.cs" />
- <Compile Include="System.Windows.Forms\TextImageRelation.cs" />
- <Compile Include="System.Windows.Forms\TextRenderer.cs" />
- <Compile Include="System.Windows.Forms\Theme.cs" />
- <Compile Include="System.Windows.Forms\ThemeEngine.cs" />
- <Compile Include="System.Windows.Forms\ThemeVisualStyles.cs" />
- <Compile Include="System.Windows.Forms\ThemeWin32Classic.cs" />
- <Compile Include="System.Windows.Forms\ThreadExceptionDialog.cs" />
- <Compile Include="System.Windows.Forms\TickStyle.cs" />
- <Compile Include="System.Windows.Forms\Timer.cs" />
- <Compile Include="System.Windows.Forms\ToolBar.cs" />
- <Compile Include="System.Windows.Forms\ToolBarAppearance.cs" />
- <Compile Include="System.Windows.Forms\ToolBarButton.cs" />
- <Compile Include="System.Windows.Forms\ToolBarButtonClickEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolBarButtonClickEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolBarButtonStyle.cs" />
- <Compile Include="System.Windows.Forms\ToolBarTextAlign.cs" />
- <Compile Include="System.Windows.Forms\ToolStrip.cs" />
- <Compile Include="System.Windows.Forms\ToolStripArrowRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripArrowRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripButton.cs" />
- <Compile Include="System.Windows.Forms\ToolStripComboBox.cs" />
- <Compile Include="System.Windows.Forms\ToolStripContainer.cs" />
- <Compile Include="System.Windows.Forms\ToolStripContentPanel.cs" />
- <Compile Include="System.Windows.Forms\ToolStripContentPanelRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripContentPanelRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripControlHost.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDown.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownButton.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownCloseReason.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownClosedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownClosedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownClosingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownClosingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownDirection.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownItem.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownItemAccessibleObject.cs" />
- <Compile Include="System.Windows.Forms\ToolStripDropDownMenu.cs" />
- <Compile Include="System.Windows.Forms\ToolStripGripDisplayStyle.cs" />
- <Compile Include="System.Windows.Forms\ToolStripGripRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripGripRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripGripStyle.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItem.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemAlignment.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemClickedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemClickedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemCollection.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemDisplayStyle.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemEventType.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemImageRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemImageRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemImageScaling.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemOverflow.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemPlacement.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemTextRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripItemTextRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripLabel.cs" />
- <Compile Include="System.Windows.Forms\ToolStripLayoutStyle.cs" />
- <Compile Include="System.Windows.Forms\ToolStripManager.cs" />
- <Compile Include="System.Windows.Forms\ToolStripManagerRenderMode.cs" />
- <Compile Include="System.Windows.Forms\ToolStripMenuItem.cs" />
- <Compile Include="System.Windows.Forms\ToolStripOverflow.cs" />
- <Compile Include="System.Windows.Forms\ToolStripOverflowButton.cs" />
- <Compile Include="System.Windows.Forms\ToolStripPanel.cs" />
- <Compile Include="System.Windows.Forms\ToolStripPanelRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripPanelRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripPanelRow.cs" />
- <Compile Include="System.Windows.Forms\ToolStripProfessionalRenderer.cs" />
- <Compile Include="System.Windows.Forms\ToolStripProgressBar.cs" />
- <Compile Include="System.Windows.Forms\ToolStripRenderer.cs" />
- <Compile Include="System.Windows.Forms\ToolStripRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripRenderMode.cs" />
- <Compile Include="System.Windows.Forms\ToolStripSeparator.cs" />
- <Compile Include="System.Windows.Forms\ToolStripSeparatorRenderEventArgs.cs" />
- <Compile Include="System.Windows.Forms\ToolStripSeparatorRenderEventHandler.cs" />
- <Compile Include="System.Windows.Forms\ToolStripSplitButton.cs" />
- <Compile Include="System.Windows.Forms\ToolStripSplitStackLayout.cs" />
- <Compile Include="System.Windows.Forms\ToolStripStatusLabel.cs" />
- <Compile Include="System.Windows.Forms\ToolStripStatusLabelBorderSides.cs" />
- <Compile Include="System.Windows.Forms\ToolStripSystemRenderer.cs" />
- <Compile Include="System.Windows.Forms\ToolStripTextBox.cs" />
- <Compile Include="System.Windows.Forms\ToolStripTextDirection.cs" />
- <Compile Include="System.Windows.Forms\ToolTip.cs" />
- <Compile Include="System.Windows.Forms\ToolTipIcon.cs" />
- <Compile Include="System.Windows.Forms\ToolWindowManager.cs" />
- <Compile Include="System.Windows.Forms\TrackBar.cs" />
- <Compile Include="System.Windows.Forms\TrackBarRenderer.cs" />
- <Compile Include="System.Windows.Forms\TreeNode.cs" />
- <Compile Include="System.Windows.Forms\TreeNodeCollection.cs" />
- <Compile Include="System.Windows.Forms\TreeNodeConverter.cs" />
- <Compile Include="System.Windows.Forms\TreeNodeMouseClickEventArgs.cs" />
- <Compile Include="System.Windows.Forms\TreeNodeMouseClickEventHandler.cs" />
- <Compile Include="System.Windows.Forms\TreeNodeMouseHoverEventArgs.cs" />
- <Compile Include="System.Windows.Forms\TreeNodeMouseHoverEventHandler.cs" />
- <Compile Include="System.Windows.Forms\TreeNodeStates.cs" />
- <Compile Include="System.Windows.Forms\TreeView.cs" />
- <Compile Include="System.Windows.Forms\TreeViewAction.cs" />
- <Compile Include="System.Windows.Forms\TreeViewCancelEventArgs.cs" />
- <Compile Include="System.Windows.Forms\TreeViewCancelEventHandler.cs" />
- <Compile Include="System.Windows.Forms\TreeViewDrawMode.cs" />
- <Compile Include="System.Windows.Forms\TreeViewEventArgs.cs" />
- <Compile Include="System.Windows.Forms\TreeViewEventHandler.cs" />
- <Compile Include="System.Windows.Forms\TreeViewHitTestInfo.cs" />
- <Compile Include="System.Windows.Forms\TreeViewHitTestLocations.cs" />
- <Compile Include="System.Windows.Forms\TreeViewImageIndexConverter.cs" />
- <Compile Include="System.Windows.Forms\TreeViewImageKeyConverter.cs" />
- <Compile Include="System.Windows.Forms\TypeValidationEventArgs.cs" />
- <Compile Include="System.Windows.Forms\TypeValidationEventHandler.cs" />
- <Compile Include="System.Windows.Forms\UICues.cs" />
- <Compile Include="System.Windows.Forms\UICuesEventArgs.cs" />
- <Compile Include="System.Windows.Forms\UICuesEventHandler.cs" />
- <Compile Include="System.Windows.Forms\UnhandledExceptionMode.cs" />
- <Compile Include="System.Windows.Forms\UpDownBase.cs" />
- <Compile Include="System.Windows.Forms\UpDownEventArgs.cs" />
- <Compile Include="System.Windows.Forms\UpDownEventHandler.cs" />
- <Compile Include="System.Windows.Forms\UserControl.cs" />
- <Compile Include="System.Windows.Forms\VScrollBar.cs" />
- <Compile Include="System.Windows.Forms\ValidationConstraints.cs" />
- <Compile Include="System.Windows.Forms\View.cs" />
- <Compile Include="System.Windows.Forms\VScrollProperties.cs" />
- <Compile Include="System.Windows.Forms\WebBrowser.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserBase.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserDocumentCompletedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserDocumentCompletedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserEncryptionLevel.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserNavigatedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserNavigatedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserNavigatingEventArgs.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserNavigatingEventHandler.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserProgressChangedEventArgs.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserProgressChangedEventHandler.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserReadyState.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserRefreshOption.cs" />
- <Compile Include="System.Windows.Forms\WebBrowserSiteBase.cs" />
- <Compile Include="System.Windows.Forms\Win32DnD.cs" />
- <Compile Include="System.Windows.Forms\WindowsFormsSection.cs" />
- <Compile Include="System.Windows.Forms\WindowsFormsSynchronizationContext.cs" />
- <Compile Include="System.Windows.Forms\X11DesktopColors.cs" />
- <Compile Include="System.Windows.Forms\X11Dnd.cs" />
- <Compile Include="System.Windows.Forms\X11Keyboard.cs" />
- <Compile Include="System.Windows.Forms\X11Structs.cs" />
- <Compile Include="System.Windows.Forms\XEventQueue.cs" />
- <Compile Include="System.Windows.Forms\XplatUI.cs" />
- <Compile Include="System.Windows.Forms\XplatUICarbon.cs" />
- <Compile Include="System.Windows.Forms\XplatUIDriver.cs" />
- <Compile Include="System.Windows.Forms\XplatUIStructs.cs" />
- <Compile Include="System.Windows.Forms\XplatUIWin32.cs" />
- <Compile Include="System.Windows.Forms\XplatUIX11.cs" />
- <Compile Include="System.Windows.Forms.Layout\ArrangedElementCollection.cs" />
- <Compile Include="System.Windows.Forms.Layout\DefaultLayout.cs" />
- <Compile Include="System.Windows.Forms.Layout\FlowLayout.cs" />
- <Compile Include="System.Windows.Forms.Layout\TableLayout.cs" />
- <Compile Include="System.Windows.Forms.Layout\TableLayoutSettingsTypeConverter.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\ApplicationHandler.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\ControlHandler.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\Cursor.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\Dnd.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\EventHandler.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\EventHandlerBase.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\Enums.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\HIObjectHandler.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\IEventHandler.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\KeyboardHandler.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\MouseHandler.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\Pasteboard.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\Structs.cs" />
- <Compile Include="System.Windows.Forms.CarbonInternal\WindowHandler.cs" />
- <Compile Include="System.Windows.Forms.Theming\ThemeElements.cs" />
- <Compile Include="System.Windows.Forms.Theming\ThemeElementsDefault.cs" />
- <Compile Include="System.Windows.Forms.Theming\ThemeElementsVisualStyles.cs" />
- <Compile Include="System.Windows.Forms.Theming\Default\ButtonPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\Default\CheckBoxPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\Default\RadioButtonPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\Default\TabControlPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\Default\ToolStripPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\VisualStyles\CheckBoxPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\VisualStyles\RadioButtonPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\VisualStyles\TabControlPainter.cs" />
- <Compile Include="System.Windows.Forms.Theming\VisualStyles\ToolStripPainter.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\BackgroundType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\BooleanProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\BorderType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\CheckBoxState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ColorProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ComboBoxState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ContentAlignment.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\EdgeEffects.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\Edges.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\EdgeStyle.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\EnumProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\FilenameProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\FillType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\FontProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\GlyphFontSizingType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\GlyphType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\GroupBoxState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\GtkPlus.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\HitTestCode.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\HitTestOptions.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\HorizontalAlign.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\IconEffect.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ImageOrientation.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ImageSelectType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\IntegerProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\IVisualStyles.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\MarginProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\OffsetType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\PointProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\PushButtonState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\RadioButtonState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ScrollBarArrowButtonState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ScrollBarSizeBoxState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ScrollBarState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\SizingType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\StringProperty.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\TabItemState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\TextBoxState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\TextMetrics.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\TextMetricsCharacterSet.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\TextMetricsPitchAndFamilyValues.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\TextShadowType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ThemeSizeType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\ToolBarState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\TrackBarThumbState.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\TrueSizeScalingType.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\UXTheme.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\VerticalAlignment.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\VisualStyleElement.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\VisualStyleInformation.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\VisualStyleRenderer.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\VisualStylesEngine.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\VisualStylesGtkPlus.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\VisualStylesNative.cs" />
- <Compile Include="System.Windows.Forms.VisualStyles\VisualStyleState.cs" />
- <Compile Include="System.Windows.Forms.WebBrowserDialogs\AlertCheck.cs" />
- <Compile Include="System.Windows.Forms.WebBrowserDialogs\ConfirmCheck.cs" />
- <Compile Include="System.Windows.Forms.WebBrowserDialogs\Generic.cs" />
- <Compile Include="System.Windows.Forms.WebBrowserDialogs\Prompt.cs" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="resources\SplitterNS.cur">
- <LogicalName>System.Windows.Forms.SplitterNS.cur</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\SplitterWE.cur">
- <LogicalName>System.Windows.Forms.SplitterWE.cur</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\NESW.cur">
- <LogicalName>System.Windows.Forms.NESW.cur</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\NWSE.cur">
- <LogicalName>System.Windows.Forms.NWSE.cur</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\DnDNo.cur">
- <LogicalName>System.Windows.Forms.DnDNo.cur</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\DnDCopy.cur">
- <LogicalName>System.Windows.Forms.DnDCopy.cur</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\DnDLink.cur">
- <LogicalName>System.Windows.Forms.DnDLink.cur</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\DnDMove.cur">
- <LogicalName>System.Windows.Forms.DnDMove.cur</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\keyboards.resources.prebuilt">
- <LogicalName>keyboards.resources</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_computer.png">
- <LogicalName>16_computer.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\32_computer.png">
- <LogicalName>32_computer.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\computer.png">
- <LogicalName>computer.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_document-open.png">
- <LogicalName>16_document-open.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\32_document-open.png">
- <LogicalName>32_document-open.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\document-open.png">
- <LogicalName>document-open.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_folder.png">
- <LogicalName>16_folder.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\folder-new.png">
- <LogicalName>folder-new.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\folder.png">
- <LogicalName>folder.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_folder-remote.png">
- <LogicalName>16_folder-remote.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\32_folder-remote.png">
- <LogicalName>32_folder-remote.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\folder-remote.png">
- <LogicalName>folder-remote.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\go-previous.png">
- <LogicalName>go-previous.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\go-top.png">
- <LogicalName>go-top.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\22_page-magnifier.png">
- <LogicalName>22_page-magnifier.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\preferences-system-windows.png">
- <LogicalName>preferences-system-windows.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_printer.png">
- <LogicalName>16_printer.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\32_printer.png">
- <LogicalName>32_printer.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\text-x-generic.png">
- <LogicalName>text-x-generic.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_user-desktop.png">
- <LogicalName>16_user-desktop.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\32_user-desktop.png">
- <LogicalName>32_user-desktop.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\user-desktop.png">
- <LogicalName>user-desktop.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_user-home.png">
- <LogicalName>16_user-home.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\32_user-home.png">
- <LogicalName>32_user-home.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\user-home.png">
- <LogicalName>user-home.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_dialog-error.png">
- <LogicalName>16_dialog-error.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_dialog-information.png">
- <LogicalName>16_dialog-information.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\16_dialog-warning.png">
- <LogicalName>16_dialog-warning.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\1-up.png">
- <LogicalName>1-up.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\2-up.png">
- <LogicalName>2-up.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\3-up.png">
- <LogicalName>3-up.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\4-up.png">
- <LogicalName>4-up.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\6-up.png">
- <LogicalName>6-up.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\nav_delete.png">
- <LogicalName>nav_delete.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\nav_end.png">
- <LogicalName>nav_end.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\nav_first.png">
- <LogicalName>nav_first.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\nav_next.png">
- <LogicalName>nav_next.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\nav_plus.png">
- <LogicalName>nav_plus.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\nav_previous.png">
- <LogicalName>nav_previous.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\image-missing.png">
- <LogicalName>image-missing.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\image-x-generic.png">
- <LogicalName>image-x-generic.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\propertygrid-alphabetical.png">
- <LogicalName>System.Windows.Forms.propertygrid-alphabetical.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\propertygrid-categorized.png">
- <LogicalName>System.Windows.Forms.propertygrid-categorized.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\propertygrid-propertypages.png">
- <LogicalName>System.Windows.Forms.propertygrid-propertypages.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\EventsTab.bmp">
- <LogicalName>System.Windows.Forms.Design.EventsTab.bmp</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\PropertiesTab.bmp">
- <LogicalName>System.Windows.Forms.PropertyGridInternal.PropertiesTab.bmp</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\mono.ico">
- <LogicalName>mono.ico</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\errorProvider.ico">
- <LogicalName>errorProvider.ico</LogicalName>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <None Include="System.Windows.Forms\ChangeLog" />
- </ItemGroup>
- <ItemGroup>
- <None Include="ChangeLog" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWF2k5", "SWF2k5.csproj", "{5E6430B2-6B9F-4E76-802E-20207EF80391}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.WebBrowser2K5", "..\Mono.WebBrowser\Mono.WebBrowser2K5.csproj", "{5E6C996A-007F-40CE-B244-006EFCFB77D2}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Debug 1.1|Any CPU = Debug 1.1|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- Release 1.1|Any CPU = Release 1.1|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Debug 1.1|Any CPU.ActiveCfg = Debug 1.1|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Debug 1.1|Any CPU.Build.0 = Debug 1.1|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Release 1.1|Any CPU.ActiveCfg = Release 1.1|Any CPU\r
- {5E6430B2-6B9F-4E76-802E-20207EF80391}.Release 1.1|Any CPU.Build.0 = Release 1.1|Any CPU\r
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}.Debug 1.1|Any CPU.ActiveCfg = Debug 1.1|Any CPU\r
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}.Debug 1.1|Any CPU.Build.0 = Debug 1.1|Any CPU\r
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}.Release 1.1|Any CPU.ActiveCfg = Release 1.1|Any CPU\r
- {5E6C996A-007F-40CE-B244-006EFCFB77D2}.Release 1.1|Any CPU.Build.0 = Release 1.1|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Default.targets"/>
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <CodePage>65001</CodePage>
- <NoWarn>618,612,809</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="System"/>
- <Reference Include="System.Xml"/>
- <Reference Include="System.Drawing"/>
- <Reference Include="Accessibility"/>
- <Reference Include="System.Data"/>
- <Reference Include="System.Configuration"/>
- <Reference Include="Mono.Posix">
- <HintPath>..\lib\net_2_0\Mono.Posix.dll</HintPath>
- </Reference>
- <Reference Include="Mono.WebBrowser">
- <HintPath>..\lib\net_2_0\Mono.WebBrowser.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
if (View != View.Details) {
if (bounds.Left < 0)
h_scroll.Value += bounds.Left;
- else if (bounds.Right > view_rect.Right)
+ // Don't shift right unless right-to-left layout is active. (Xamarin bug 22483)
+ else if (this.RightToLeftLayout && bounds.Right > view_rect.Right)
h_scroll.Value += (bounds.Right - view_rect.Right);
}
+++ /dev/null
-#!/bin/bash
-#
-# I got tired of editing the SWF.csproj
-# This script will generate it from our System.Windows.Forms.dll.sources
-#
-#
-
-tr=tr
-OutFile=SWF.csproj
-Source=System.Windows.Forms.dll.sources
-Resource=System.Windows.Forms.dll.resources
-
-SWFhead()
-{
-cat << EOT
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.10.3077"
- SchemaVersion = "2.0"
- ProjectGuid = "{5E6430B2-6B9F-4E76-802E-20207EF80391}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "System.Windows.Forms"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- PreBuildEvent = ""
- PostBuildEvent = ""
- RootNamespace = ""
- RunPostBuildEvent = "OnBuildSuccess"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "NET_1_1 ONLY_1_1"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- <Config
- Name = "Debug 2.0"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "NET_2_0"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "NET_1_1 ONLY_1_1"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- <Config
- Name = "Release 2.0"
- AllowUnsafeBlocks = "true"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "NET_2_0"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- NoStdLib = "false"
- NoWarn = ""
- Optimize = "false"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "1"
- />
- </Settings>
- <References>
- <Reference
- Name = "Accessibility"
- AssemblyName = "Accessibility"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Accessibility.dll"
- />
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
- />
- <Reference
- Name = "System.Drawing"
- AssemblyName = "System.Drawing"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.XML"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
-EOT
-}
-
-SWFfilelist()
-{
-cat $Source | while read SRC; do
-# Don't do AssemblyInfo, it's got signing requests and such that we don't want
-if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" ] ; then
-SRC=`echo $SRC | $tr '/' '\\\\'`
-cat << EOT
- <File
- RelPath = "$SRC"
- SubType = "Code"
- BuildAction = "Compile"
- />
-EOT
-fi
-done
-}
-
-SWFresourcelist()
-{
-cat $Resource | while read SRC; do
-SRC=`echo $SRC | $tr '/' '\\\\'`
-SRC=`echo $SRC | sed 's/-resource://' | awk -F , '{print " RelPath = \"" $1 "\"\n CustomToolNameSpace = \"" $2 "\""}' | fgrep -v \"\"`
-
-cat << EOT
- <File
-$SRC
- BuildAction = "EmbeddedResource"
- />
-EOT
-done
-}
-
-SWFtail()
-{
-cat << EOT
- <File
- RelPath = "Consts.cs"
- Link = "common/Consts.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "MonoTODOAttribute.cs"
- Link = "common/MonoTODOAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-EOT
-}
-
-SWFhead > $OutFile
-SWFfilelist >> $OutFile
-SWFresourcelist >> $OutFile
-SWFtail >> $OutFile
-
+++ /dev/null
-#!/bin/bash
-#
-# This script will generate SWF.cs.target from our System.Windows.Forms.dll.sources
-#
-#
-
-exec > SWF2k5.csproj
-
-Source=System.Windows.Forms.dll.sources
-Resource=System.Windows.Forms.dll.resources
-
-SWFhead()
-{
- cat <<EOF
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectType>Local</ProjectType>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{5E6430B2-6B9F-4E76-802E-20207EF80391}</ProjectGuid>
- <Configuration Condition=" '\$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '\$(Platform)' == '' ">AnyCPU</Platform>
- <ApplicationIcon>
- </ApplicationIcon>
- <AssemblyKeyContainerName>
- </AssemblyKeyContainerName>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
- <DefaultClientScript>JScript</DefaultClientScript>
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
- <DefaultTargetSchema>IE50</DefaultTargetSchema>
- <DelaySign>false</DelaySign>
- <OutputType>Library</OutputType>
- <RootNamespace>
- </RootNamespace>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <StartupObject>
- </StartupObject>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 NET_2_0 MWF_ON_MSRUNTIME</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>612,618,3021</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <OutputType>Library</OutputType>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 NET_2_0 MWF_ON_MSRUNTIME</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>612,618,3021</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <OutputType>Library</OutputType>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Debug 1.1|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 ONLY_1_1 MWF_ON_MSRUNTIME</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>612,618,3021</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <OutputType>Library</OutputType>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Release 1.1|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 ONLY_1_1 MWF_ON_MSRUNTIME</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>612,618,3021</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <OutputType>Library</OutputType>
- <AssemblyName>System.Windows.Forms</AssemblyName>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Accessibility">
- <Name>Accessibility</Name>
- </Reference>
- <Reference Include="System">
- <Name>System</Name>
- </Reference>
- <Reference Include="System.configuration" />
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Drawing">
- <Name>System.Drawing</Name>
- </Reference>
- <Reference Include="System.Xml">
- <Name>System.Xml</Name>
- </Reference>
- <Reference Include="Mono.WebBrowser2K5">
- <Name>Mono.WebBrowser2K5</Name>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Mono.WebBrowser\Mono.WebBrowser2K5.csproj">
- <Project>{5E6C996A-007F-40CE-B244-006EFCFB77D2}</Project>
- <Name>Mono.WebBrowser2K5</Name>
- </ProjectReference>
- </ItemGroup>
-EOF
-}
-
-SWFtail()
-{
- cat <<EOF
- <ItemGroup>
- <None Include="System.Windows.Forms\ChangeLog" />
- </ItemGroup>
- <ItemGroup>
- <None Include="ChangeLog" />
- </ItemGroup>
- <Import Project="\$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
-EOF
-}
-
-SWFfilelist()
-{
-echo " <ItemGroup>"
-cat $Source | while read SRC; do
-# Don't do AssemblyInfo, it's got signing requests and such that we don't want
-if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" ] ; then
-SRC=`echo $SRC | sed 's/..\/..\/build\///'`
-SRC=`echo $SRC | tr '/' '\\\\'`
-cat <<EOF
- <Compile Include="$SRC" />
-EOF
-fi
-done
-echo " </ItemGroup>"
-}
-
-SWFresourcelist()
-{
-echo " <ItemGroup>"
- cat $Resource | while read SRC; do
- CUSTOMTOOLNAMESPACE=""
-
- # strip out that -resource:
- SRC=`echo $SRC | sed 's/-resource://'`
-
- CUSTOMTOOLNAMESPACE=`echo $SRC | awk -F, '{print $2}'`
-
- INCLUDE=`echo $SRC | awk -F, '{print $1}'`
-
- if test -f $INCLUDE.prebuilt; then
- INCLUDE=$INCLUDE.prebuilt
- fi
-
- # strip off the path from the name of the resource and the .prebuilt if there is one
- LOGICALNAME=`echo $INCLUDE | sed 's/resources\///;s/.prebuilt//'`
-
- # convert all /'s to \\'s
- INCLUDE=`echo $INCLUDE | sed 's/\//\\\\/'`
-
- echo " <EmbeddedResource Include=\"$INCLUDE\">"
- if test "x$CUSTOMTOOLNAMESPACE" != "x"; then
- echo " <LogicalName>$CUSTOMTOOLNAMESPACE</LogicalName>"
- else
- echo " <LogicalName>$LOGICALNAME</LogicalName>"
- fi
- echo " </EmbeddedResource>"
- done
-echo " </ItemGroup>"
-}
-
-SWFhead
-SWFfilelist
-SWFresourcelist
-SWFtail
+++ /dev/null
-#!/bin/bash
-#
-# This script will generate SWF2K5-tests.cs.target from our System.Windows.Forms.dll.sources
-#
-#
-
-exec > SWF2k5-tests.csproj
-
-Source=System.Windows.Forms_test.dll.sources
-Resource=System.Windows.Forms.dll.resources
-
-SWFhead()
-{
- cat <<EOF
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectType>Local</ProjectType>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{5E6430B2-6B9F-4E76-802E-20207EF80391}</ProjectGuid>
- <Configuration Condition=" '\$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '\$(Platform)' == '' ">AnyCPU</Platform>
- <ApplicationIcon>
- </ApplicationIcon>
- <AssemblyKeyContainerName>
- </AssemblyKeyContainerName>
- <AssemblyName>System.Windows.Forms_test</AssemblyName>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
- <DefaultClientScript>JScript</DefaultClientScript>
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
- <DefaultTargetSchema>IE50</DefaultTargetSchema>
- <DelaySign>false</DelaySign>
- <OutputType>Library</OutputType>
- <RootNamespace>
- </RootNamespace>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <StartupObject>
- </StartupObject>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 ONLY_1_1 __MonoCS__ DEBUG</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Debug 2.0|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_2_0 __MonoCS__ DEBUG</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 ONLY_1_1 __MonoCS__</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Release 2.0|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_2_0 __MonoCS__</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'net_2_0|AnyCPU' ">
- <OutputPath>.\</OutputPath>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>NET_1_1 NET_2_0 __MonoCS__ DEBUG</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>3</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- <AssemblyName>System.Windows.Forms_test_net_2_0</AssemblyName>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>C:\winforms-unittests\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="Accessibility">
- <Name>Accessibility</Name>
- </Reference>
- <Reference Include="System">
- <Name>System</Name>
- </Reference>
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Drawing">
- <Name>System.Drawing</Name>
- </Reference>
- <Reference Include="System.Windows.Forms">
- <Name>System.Windows.Forms</Name>
- </Reference>
- <Reference Include="System.Xml">
- <Name>System.Xml</Name>
- </Reference>
- </ItemGroup>
-EOF
-}
-
-SWFtail()
-{
- cat <<EOF
- <ItemGroup>
- <None Include="Test\System.Windows.Forms\ChangeLog" />
- </ItemGroup>
- <ItemGroup>
- <None Include="Test\System.Resources\ChangeLog" />
- </ItemGroup>
- <ItemGroup>
- <None Include="Test\System.Windows.Forms.Layout\ChangeLog" />
- </ItemGroup>
- <Import Project="\$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
-EOF
-}
-
-SWFfilelist()
-{
-echo " <ItemGroup>"
-cat $Source | while read SRC; do
-# Don't do AssemblyInfo, it's got signing requests and such that we don't want
-if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" ] ; then
-SRC=`echo Test/$SRC`
-SRC=`echo $SRC | sed 's/Test\/..\/..\/..\/build\///'`
-SRC=`echo $SRC | tr '/' '\\\\'`
-cat <<EOF
- <Compile Include="$SRC" />
-EOF
-fi
-done
-echo " </ItemGroup>"
-}
-
-SWFresourcelist()
-{
-echo " <ItemGroup>"
- cat $Resource | while read SRC; do
- CUSTOMTOOLNAMESPACE=""
-
- # strip out that -resource:
- SRC=`echo $SRC | sed 's/-resource://'`
-
- CUSTOMTOOLNAMESPACE=`echo $SRC | awk -F, '{print $2}'`
-
- INCLUDE=`echo $SRC | awk -F, '{print $1}'`
-
- if test -f $INCLUDE.prebuilt; then
- INCLUDE=$INCLUDE.prebuilt
- fi
-
- # strip off the path from the name of the resource and the .prebuilt if there is one
- LOGICALNAME=`echo $INCLUDE | sed 's/resources\///;s/.prebuilt//'`
-
- # convert all /'s to \\'s
- INCLUDE=`echo $INCLUDE | sed 's/\//\\\\/'`
-
- echo " <EmbeddedResource Include=\"$INCLUDE\">"
- echo " <LogicalName>$LOGICALNAME</LogicalName>"
- if test "x$CUSTOMTOOLNAMESPACE" != "x"; then
- echo " <CustomToolNameSpace>$CUSTOMTOOLNAMESPACE</CustomToolNameSpace>"
- fi
- echo " </EmbeddedResource>"
- done
-echo " </ItemGroup>"
-}
-
-SWFhead
-SWFfilelist
-#SWFresourcelist
-SWFtail
if (propertyName != null)
element.SetAttribute ("PropertyName", propertyName);
}
-
- [MonoTODO]
+
public bool Execute ()
{
- bool result = false;
TaskEngine taskEngine;
LogTaskStarted ();
- ITask task = null;
+ ITask task;
try {
- try {
- task = InitializeTask ();
- } catch (Exception e) {
- LogError ("Error initializing task {0}: {1}", taskElement.LocalName, e.Message);
- LogMessage (MessageImportance.Low, "Error initializing task {0}: {1}",
- taskElement.LocalName, e.ToString ());
- return false;
- }
+ task = InitializeTask ();
+ } catch (Exception e) {
+ LogError ("Error initializing task {0}: {1}", taskElement.LocalName, e.Message);
+ LogMessage (MessageImportance.Low, "Error initializing task {0}: {1}",
+ taskElement.LocalName, e.ToString ());
+ return false;
+ }
+
+ try {
+ taskEngine = new TaskEngine (parentTarget.Project, task, Type);
+ taskEngine.Prepare (GetParameters ());
+ var result = taskEngine.Execute ();
+ if (result)
+ taskEngine.PublishOutput (taskElement, taskEngine.ValueFromExecution);
- try {
- taskEngine = new TaskEngine (parentTarget.Project);
- taskEngine.Prepare (task, this.taskElement, GetParameters (), this.Type);
- result = taskEngine.Execute ();
- if (result)
- taskEngine.PublishOutput ();
- } catch (Exception e) {
- task_logger.LogError ("Error executing task {0}: {1}", taskElement.LocalName, e.Message);
- task_logger.LogMessage (MessageImportance.Low,
- "Error executing task {0}: {1}", taskElement.LocalName, e.ToString ());
- result = false;
- }
- } finally {
LogTaskFinished (result);
+ return result;
+ } catch (Exception e) {
+ task_logger.LogError ("Error executing task {0}: {1}", taskElement.LocalName, e.Message);
+ task_logger.LogMessage (MessageImportance.Low,
+ "Error executing task {0}: {1}", taskElement.LocalName, e.ToString ());
+ return false;
}
-
- return result;
}
return taskElement.GetAttribute (attributeName);
}
+
+ bool IBuildTask.ResolveOutputItems ()
+ {
+ var taskEngine = new TaskEngine (parentTarget.Project, null, Type);
+
+ taskEngine.PublishOutput (taskElement, l => {
+ var pv = GetParameterValue (l.Name);
+
+ Expression exp = new Expression ();
+ exp.Parse (pv, ParseOptions.AllowItemsMetadataAndSplit);
+ return exp.ConvertTo (parentTarget.Project, l.PropertyType);
+ });
+
+ return true;
+ }
public void SetParameterValue (string parameterName,
string parameterValue)
foreach (XmlAttribute attrib in XmlElement.Attributes)
yield return attrib.Value;
}
+
+ public bool ResolveOutputItems ()
+ {
+ return true;
+ }
}
}
{
return GetAttributes ();
}
-
+
+ public bool ResolveOutputItems ()
+ {
+ return true;
+ }
}
}
if (!StartHandlerHasExecuted)
return;
- if (EventArgs is ProjectStartedEventArgs)
- ConsoleLogger.ProjectFinishedHandler (Sender, finished_args as ProjectFinishedEventArgs);
- else if (EventArgs is TargetStartedEventArgs)
- ConsoleLogger.TargetFinishedHandler (Sender, finished_args as TargetFinishedEventArgs);
- else if (EventArgs is TaskStartedEventArgs)
- ConsoleLogger.TaskFinishedHandler (Sender, finished_args as TaskFinishedEventArgs);
- else if (!(EventArgs is BuildStartedEventArgs))
+ if (EventArgs is ProjectStartedEventArgs) {
+ var pfa = finished_args as ProjectFinishedEventArgs;
+ // FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
+ if (pfa == null)
+ return;
+
+ ConsoleLogger.ProjectFinishedHandler (Sender, pfa);
+ } else if (EventArgs is TargetStartedEventArgs) {
+ var fa = finished_args as TargetFinishedEventArgs;
+ // FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
+ if (fa == null)
+ return;
+
+ ConsoleLogger.TargetFinishedHandler (Sender, fa);
+ } else if (EventArgs is TaskStartedEventArgs) {
+ // FIXME: BuildFinishedHandlerActual sends us BuildFinishedEventArgs via PopEvent
+ if (!(finished_args is TaskFinishedEventArgs))
+ return;
+
+ ConsoleLogger.TaskFinishedHandler (Sender, (TaskFinishedEventArgs) finished_args);
+ } else if (!(EventArgs is BuildStartedEventArgs))
throw new InvalidOperationException ("Unexpected event on the stack, type: " + EventArgs.GetType ());
}
}
}
bool Execute ();
+ bool ResolveOutputItems ();
IEnumerable<string> GetAttributes ();
}
using Microsoft.Build.Framework;
namespace Microsoft.Build.BuildEngine {
-
internal class TargetBatchingImpl : BatchingImplBase
{
string inputs;
{
executeOnErrors = false;
try {
- string reason;
- if (!BuildTargetNeeded (out reason)) {
- LogTargetStarted (target);
- LogTargetSkipped (target, reason);
- LogTargetFinished (target, true);
- return true;
- }
-
- if (!String.IsNullOrEmpty (reason))
- target.Engine.LogMessage (MessageImportance.Low, reason);
-
Init ();
ParseTargetAttributes (target);
executeOnErrors = false;
LogTargetStarted (target);
+
if (bucket != null)
project.PushBatch (bucket, commonItemsByName);
+
try {
+ TaskExecutionMode taskExecutionMode;
string reason;
- if (!BuildTargetNeeded (out reason)) {
+ bool skip_completely;
+ if (!BuildTargetNeeded (out reason, out skip_completely)) {
LogTargetSkipped (target, reason);
- return true;
- }
+ if (skip_completely)
+ return true;
- if (!String.IsNullOrEmpty (reason))
- target.Engine.LogMessage (MessageImportance.Low, reason);
+ taskExecutionMode = TaskExecutionMode.SkipAndSetOutput;
+ } else {
+ taskExecutionMode = TaskExecutionMode.Complete;
+
+ if (!String.IsNullOrEmpty (reason))
+ target.Engine.LogMessage (MessageImportance.Low, reason);
+ }
for (int i = 0; i < target.BuildTasks.Count; i ++) {
//FIXME: parsing attributes repeatedly
IBuildTask bt = target.BuildTasks [i];
+ // HACK: need some form of cross references checks
+ var tem = taskExecutionMode;
+ if (tem == TaskExecutionMode.SkipAndSetOutput) {
+ var bti = bt as BuildTask;
+
+ //
+ // BuildTargetNeeded checks only files timestamps but ignores any metadata dependencies
+ // that way we can end up in the situation when output metadata are populated but from
+ // incomplete dependencies.
+ //
+ // E.g.
+ // <CreateItem Include="$(IntermediateOutputPath)%(_PngImage.LogicalName)" AdditionalMetadata="LogicalName=%(_PngImage.LogicalName)">
+ // <Output TaskParameter="Include" />
+ // </CreateItem>
+ //
+ if (bti != null && bti.Name == "CreateItem")
+ tem = TaskExecutionMode.Complete;
+ }
+
TaskBatchingImpl batchingImpl = new TaskBatchingImpl (project);
- bool task_result = batchingImpl.Build (bt, out executeOnErrors);
+ bool task_result = batchingImpl.Build (bt, tem, out executeOnErrors);
if (task_result)
continue;
} finally {
if (bucket != null)
project.PopBatch ();
+
LogTargetFinished (target, target_result);
}
ParseAttribute (outputs);
}
- bool BuildTargetNeeded (out string reason)
+ bool BuildTargetNeeded (out string reason, out bool skipCompletely)
{
reason = String.Empty;
ITaskItem [] inputFiles;
ITaskItem [] outputFiles;
DateTime youngestInput, oldestOutput;
+ skipCompletely = false;
- if (String.IsNullOrEmpty (inputs.Trim ()))
+ if (String.IsNullOrEmpty (inputs.Trim ())) {
return true;
+ }
if (String.IsNullOrEmpty (outputs.Trim ())) {
project.ParentEngine.LogError ("Target {0} has inputs but no outputs specified.", name);
}
if (inputFiles == null || inputFiles.Length == 0) {
+ skipCompletely = true;
reason = String.Format ("No input files were specified for target {0}, skipping.", name);
return false;
}
{
}
- public bool Build (IBuildTask buildTask, out bool executeOnErrors)
+ public bool Build (IBuildTask buildTask, TaskExecutionMode taskExecutionMode, out bool executeOnErrors)
{
executeOnErrors = false;
try {
// populate list of referenced items and metadata
ParseTaskAttributes (buildTask);
if (consumedMetadataReferences.Count == 0) {
- // No batching required
- if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project))
- return buildTask.Execute ();
- else // skipped, it should be logged
- return true;
+ return Execute (buildTask, taskExecutionMode);
}
BatchAndPrepareBuckets ();
- return Run (buildTask, out executeOnErrors);
+ return Run (buildTask, taskExecutionMode, out executeOnErrors);
} finally {
consumedItemsByName = null;
consumedMetadataReferences = null;
}
}
- bool Run (IBuildTask buildTask, out bool executeOnErrors)
+ bool Run (IBuildTask buildTask, TaskExecutionMode taskExecutionMode, out bool executeOnErrors)
{
executeOnErrors = false;
bool retval = true;
if (buckets.Count == 0) {
// batched mode, but no values in the corresponding items!
- if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
- retval = buildTask.Execute ();
- if (!retval && !buildTask.ContinueOnError)
- executeOnErrors = true;
- }
+ retval = Execute (buildTask, taskExecutionMode);
+ if (!retval && !buildTask.ContinueOnError)
+ executeOnErrors = true;
return retval;
}
foreach (Dictionary<string, BuildItemGroup> bucket in buckets) {
project.PushBatch (bucket, commonItemsByName);
try {
- if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
- retval = buildTask.Execute ();
- if (!retval && !buildTask.ContinueOnError) {
- executeOnErrors = true;
- break;
- }
+ retval = Execute (buildTask, taskExecutionMode);
+ if (!retval && !buildTask.ContinueOnError) {
+ executeOnErrors = true;
+ break;
}
} finally {
project.PopBatch ();
return retval;
}
+ bool Execute (IBuildTask buildTask, TaskExecutionMode taskExecutionMode)
+ {
+ if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
+ switch (taskExecutionMode) {
+ case TaskExecutionMode.Complete:
+ return buildTask.Execute ();
+ case TaskExecutionMode.SkipAndSetOutput:
+ return buildTask.ResolveOutputItems ();
+ default:
+ throw new NotImplementedException ();
+ }
+ }
+
+ return true;
+ }
+
// Parse task attributes to get list of referenced metadata and items
// to determine batching
namespace Microsoft.Build.BuildEngine {
internal class TaskEngine {
- ITask task;
- XmlElement taskElement;
Type taskType;
Project parentProject;
+ ITask task;
static Type requiredAttribute;
static Type outputAttribute;
outputAttribute = typeof (Microsoft.Build.Framework.OutputAttribute);
}
- public TaskEngine (Project project)
+ public TaskEngine (Project project, ITask task, Type taskType)
{
parentProject = project;
+ this.task = task;
+ this.taskType = taskType;
}
// Rules (inferred) for property values incase of empty data
// string/
// ITaskItem[] empty/whitespace null No
- public void Prepare (ITask task, XmlElement taskElement,
- IDictionary <string, string> parameters, Type taskType)
+ public void Prepare (IDictionary <string, string> parameters)
{
Dictionary <string, object> values;
PropertyInfo currentProperty;
PropertyInfo[] properties;
object value;
- this.task = task;
- this.taskElement = taskElement;
- this.taskType = taskType;
values = new Dictionary <string, object> (StringComparer.OrdinalIgnoreCase);
foreach (KeyValuePair <string, string> de in parameters) {
InitializeParameter (pi, val);
}
}
-
+
public bool Execute ()
{
return task.Execute ();
}
- public void PublishOutput ()
+ public void PublishOutput (XmlElement taskElement, Func<PropertyInfo, object> valueProvider)
{
XmlElement xmlElement;
- PropertyInfo propertyInfo;
string propertyName;
string taskParameter;
string itemName;
- object o;
foreach (XmlNode xmlNode in taskElement.ChildNodes) {
if (!(xmlNode is XmlElement))
taskParameter = xmlElement.GetAttribute ("TaskParameter");
itemName = xmlElement.GetAttribute ("ItemName");
propertyName = xmlElement.GetAttribute ("PropertyName");
-
- propertyInfo = taskType.GetProperty (taskParameter, BindingFlags.Public | BindingFlags.Instance |
- BindingFlags.IgnoreCase);
+
+ var propertyInfo = taskType.GetProperty (taskParameter, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
+
if (propertyInfo == null)
- throw new InvalidProjectFileException (String.Format (
- "The parameter '{0}' was not found for the '{1}' task.", taskParameter, taskElement.Name));
+ throw new InvalidProjectFileException (String.Format ("The parameter '{0}' was not found for the '{1}' task.", taskParameter, taskElement.Name));
+
if (!propertyInfo.IsDefined (outputAttribute, false))
- throw new InvalidProjectFileException ("This is not output property.");
+ throw new InvalidProjectFileException ("This is not output property.");
- o = propertyInfo.GetValue (task, null);
+ var o = valueProvider (propertyInfo);
+
if (itemName != String.Empty) {
PublishItemGroup (propertyInfo, o, itemName);
} else {
return true;
}
+
+ public object ValueFromExecution (PropertyInfo propertyInfo)
+ {
+ return propertyInfo.GetValue (task, null);
+ }
}
}
--- /dev/null
+//
+// TaskExecutionMode.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2014 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 Microsoft.Build.BuildEngine
+{
+ enum TaskExecutionMode
+ {
+ Complete = 0,
+ SkipAndSetOutput = 1
+ }
+}
\ No newline at end of file
Microsoft.Build.BuildEngine/Target.cs
Microsoft.Build.BuildEngine/TaskDatabase.cs
Microsoft.Build.BuildEngine/TaskEngine.cs
+Microsoft.Build.BuildEngine/TaskExecutionMode.cs
Microsoft.Build.BuildEngine/Token.cs
Microsoft.Build.BuildEngine/Toolset.cs
Microsoft.Build.BuildEngine/ToolsetCollection.cs
}
[Test]
+ // Fails on wrench
+ [Category ("NotWorking")]
public void TestItemsWithWildcards ()
{
Engine engine = new Engine (Consts.BinPath);
}
[Test]
+ // Fails on wrench
+ [Category ("NotWorking")]
public void TestReservedMetadata ()
{
Engine engine = new Engine (Consts.BinPath);
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{1D0190A3-E345-45EC-9DCD-7B12BB6A7CC9}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Microsoft.Build.Framework.Test</RootNamespace>
- <AssemblyName>Microsoft.Build.Framework.Test</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>.\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.Build.Framework" />
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Test\Microsoft.Build.Framework\BuildErrorEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\BuildEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\BuildFinishedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\BuildMessageEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\BuildStartedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\BuildWarningEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\ExternalProjectFinishedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\ExternalProjectStartedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\LoggerExceptionTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\ProjectFinishedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\ProjectStartedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\TargetFinishedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\TargetStartedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\TaskCommandLineEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\TaskFinishedEventArgsTest.cs" />
- <Compile Include="Test\Microsoft.Build.Framework\TaskStartedEventArgsTest.cs" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Properties\" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Framework.Test", "Microsoft.Build.Framework.Test.csproj", "{1D0190A3-E345-45EC-9DCD-7B12BB6A7CC9}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {1D0190A3-E345-45EC-9DCD-7B12BB6A7CC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {1D0190A3-E345-45EC-9DCD-7B12BB6A7CC9}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {1D0190A3-E345-45EC-9DCD-7B12BB6A7CC9}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {1D0190A3-E345-45EC-9DCD-7B12BB6A7CC9}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
get {
return message;
}
+#if NET_4_0
+ protected set {
+ message = value;
+ }
+#endif
}
public string SenderName {
{
}
- public BuildEventContext (int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId)
- : this (rnd.Next (), nodeId, projectInstanceId, targetId, projectContextId, taskId)
+ public BuildEventContext (int nodeId, int projectInstanceId, int projectContextId, int targetId, int taskId)
+ : this (rnd.Next (), nodeId, projectInstanceId, projectContextId, targetId, taskId)
{
}
- public BuildEventContext (int submissionId, int nodeId, int projectInstanceId, int targetId, int projectContextId, int taskId)
+ public BuildEventContext (int submissionId, int nodeId, int projectInstanceId, int projectContextId, int targetId, int taskId)
{
SubmissionId = submissionId;
NodeId = nodeId;
public int TaskId { get; private set; }
// MSDN document says "true if the references are equal, false otherwise." but that doesn't make sense.
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- var o = other as BuildEventContext;
+ var o = obj as BuildEventContext;
return (object) o != null &&
o.NodeId == NodeId &&
o.ProjectContextId == ProjectContextId &&
namespace Microsoft.Build.Framework
{
[Serializable]
- public abstract class LazyFormattedBuildEventArgs : BuildEventArgs {
+ public class LazyFormattedBuildEventArgs : BuildEventArgs {
string message, format;
object[] args;
{
public enum RegisteredTaskObjectLifetime
{
- AppDomain,
- Build
+ Build,
+ AppDomain
}
}
#endif
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{01D4DF2C-F88B-43F1-B935-25CC0EE900C7}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Microsoft.Build.Tasks.Test</RootNamespace>
- <AssemblyName>Microsoft.Build.Tasks.Test</AssemblyName>
- <StartupObject>
- </StartupObject>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>False</Optimize>
- <OutputPath>./</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <OutputType>Library</OutputType>
- <AssemblyName>Microsoft.Build.Tasks.Test</AssemblyName>
- <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
- <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>True</Optimize>
- <OutputPath>./bin/Release/</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <OutputType>Library</OutputType>
- <AssemblyName>Microsoft.Build.Tasks.Test</AssemblyName>
- <DebugSymbols>True</DebugSymbols>
- <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
- <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->
- <ItemGroup>
- <Compile Include="Test\Microsoft.Build.Tasks\ALTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\Consts.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\CreateItemTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\CreatePropertyTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\CscTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\ErrorTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\GetFrameworkPathTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\GetFrameworkSdkPathTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\MakeDirTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\ManagedCompilerTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\MessageTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\RemoveDirTest.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\TestEngine.cs" />
- <Compile Include="Test\Microsoft.Build.Tasks\WarningTest.cs" />
- </ItemGroup>
- <ItemGroup>
- <Reference Include="Microsoft.Build.Engine" />
- <Reference Include="Microsoft.Build.Framework" />
- <Reference Include="Microsoft.Build.Tasks" />
- <Reference Include="Microsoft.Build.Utilities" />
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual C# Express 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Tasks.Test", "Microsoft.Build.Tasks.Test.csproj", "{01D4DF2C-F88B-43F1-B935-25CC0EE900C7}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {01D4DF2C-F88B-43F1-B935-25CC0EE900C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {01D4DF2C-F88B-43F1-B935-25CC0EE900C7}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {01D4DF2C-F88B-43F1-B935-25CC0EE900C7}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {01D4DF2C-F88B-43F1-B935-25CC0EE900C7}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
namespace Microsoft.Build.Tasks
{
- public class CodeTaskFactory : ITaskFactory2
+ public class CodeTaskFactory : ITaskFactory
{
public CodeTaskFactory ()
{
public void CleanupTask (ITask task)
{
}
- public ITask CreateTask (IBuildEngine taskFactoryLoggingHost)
+ public ITask CreateTask (IBuildEngine loggingHost)
{
- return CreateTask (taskFactoryLoggingHost, null);
+ return CreateTask (loggingHost, null);
}
- public ITask CreateTask (IBuildEngine taskFactoryLoggingHost, IDictionary<string, string> taskIdentityParameters)
+
+ ITask CreateTask (IBuildEngine taskFactoryLoggingHost, IDictionary<string, string> taskIdentityParameters)
{
if (assembly == null)
return null;
{
return parameter_group != null ? parameter_group.Values.ToArray () : new TaskPropertyInfo [0];
}
- public bool Initialize (string taskName, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
+ public bool Initialize (string taskName, IDictionary<string, TaskPropertyInfo> taskParameters, string taskElementContents, IBuildEngine taskFactoryLoggingHost)
{
- return Initialize (taskName, null, parameterGroup, taskBody, taskFactoryLoggingHost);
+ return Initialize (taskName, null, taskParameters, taskElementContents, taskFactoryLoggingHost);
}
- public bool Initialize (string taskName, IDictionary<string, string> factoryIdentityParameters, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
+ bool Initialize (string taskName, IDictionary<string, string> factoryIdentityParameters, IDictionary<string, TaskPropertyInfo> parameterGroup, string taskBody, IBuildEngine taskFactoryLoggingHost)
{
task_name = taskName;
if (parameterGroup != null)
protected abstract string CreateManifestName (string fileName,
string linkFileName,
- string rootNamespace,
+ string rootNamespaceName,
string dependentUponFileName,
Stream binaryStream);
///// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/////
-#if NET_2_0
+#if !NET_4_0
using System;
using Microsoft.Build.Framework;
// 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 Microsoft.Build.Framework;
//
if (References != null)
foreach (ITaskItem item in References) {
- string aliases = item.GetMetadata ("Aliases") ?? String.Empty;
- aliases = aliases.Trim ();
- if (aliases.Length > 0)
- commandLine.AppendSwitchIfNotNull ("/reference:" + aliases + "=", item.ItemSpec);
- else
+ string aliases = item.GetMetadata ("Aliases");
+ if (!string.IsNullOrEmpty (aliases)) {
+ AddAliasesReference (commandLine, aliases, item.ItemSpec);
+ } else {
commandLine.AppendSwitchIfNotNull ("/reference:", item.ItemSpec);
+ }
}
if (ResponseFiles != null)
commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
}
+ static void AddAliasesReference (CommandLineBuilderExtension commandLine, string aliases, string reference)
+ {
+ foreach (var alias in aliases.Split (',')) {
+ var a = alias.Trim ();
+ if (a.Length == null)
+ continue;
+
+ var r = "/reference:";
+ if (!string.Equals (a, "global", StringComparison.OrdinalIgnoreCase))
+ r += a + "=";
+
+ commandLine.AppendSwitchIfNotNull (r, reference);
+ }
+ }
+
[MonoTODO]
protected override bool CallHostObjectToExecute ()
{
}
}
-#endif
Log.LogMessage (MessageImportance.Normal, "Executing: " + command);
}
- protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+ protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
{
#if NET_4_0
if (IgnoreStandardErrorWarningFormat ||
(!errorMatcher (singleLine) && !warningMatcher (singleLine)))
#endif
- Log.LogMessage (importance, singleLine);
+ Log.LogMessage (messageImportance, singleLine);
}
#if NET_4_0
namespace Microsoft.Build.Tasks {
//FIXME: This should be in v3.5 only
- public sealed class FindAppConfigFile : TaskExtension {
+ public class FindAppConfigFile : TaskExtension {
public FindAppConfigFile ()
{
"It should have either 2 or 3 comma separated components.", moniker_literal);
}
- [Required]
public string TargetFrameworkMoniker { get; set; }
public string RootPath { get; set; }
public string TargetFrameworkMonikerDisplayName { get; set; }
[Output]
- public string[] ReferenceAssemblyPaths { get; set; }
+ public string[] ReferenceAssemblyPaths { get; private set; }
[Output]
- public string[] FullFrameworkReferenceAssemblyPaths { get; set; }
+ public string[] FullFrameworkReferenceAssemblyPaths { get; private set; }
static string DefaultFrameworksBasePath {
get {
bool findRelatedFiles;
bool findSatellites;
bool findSerializationAssemblies;
- string[] installedAssemblyTables;
ITaskItem[] relatedFiles;
ITaskItem[] resolvedDependencyFiles;
ITaskItem[] resolvedFiles;
LogWithPrecedingNewLine (MessageImportance.Low, "Primary Reference {0}", item.ItemSpec);
ResolvedReference resolved_ref = ResolveReference (item, searchPaths, true);
+ if (resolved_ref == null)
+ resolved_ref = ResolveWithAlternateName (item, allowedAssemblyExtensions ?? default_assembly_extensions);
+
if (resolved_ref == null) {
Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec);
assembly_resolver.LogSearchLoggerMessages (MessageImportance.Normal);
}
}
+
+ ResolvedReference ResolveWithAlternateName (ITaskItem item, string[] extensions)
+ {
+ foreach (string extn in extensions) {
+ if (item.ItemSpec.EndsWith (extn)) {
+ ITaskItem altitem = new TaskItem (item.ItemSpec.Substring (0, item.ItemSpec.Length - extn.Length));
+ item.CopyMetadataTo (altitem);
+ return ResolveReference (altitem, searchPaths, true);
+ }
+ }
+ return null;
+ }
+
// Use @search_paths to resolve the reference
ResolvedReference ResolveReference (ITaskItem item, IEnumerable<string> search_paths, bool set_copy_local)
{
get { return findSerializationAssemblies; }
set { findSerializationAssemblies = value; }
}
-
- public string[] InstalledAssemblyTables {
- get { return installedAssemblyTables; }
- set { installedAssemblyTables = value; }
- }
-
+
+ public
+#if NET_4_0
+ ITaskItem[]
+#else
+ string[]
+#endif
+ InstalledAssemblyTables { get; set; }
+
[Output]
public ITaskItem[] RelatedFiles {
get { return relatedFiles; }
//
-// UpdateManifest.cs
+// VCBuild.cs
//
// Author:
// Leszek Ciesielski <skolima@gmail.com>
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
+#if !NET_4_0
using System;
using System.Collections.Specialized;
return true;
}
- protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+ protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
{
singleLine = singleLine.Trim ();
if (singleLine.Length == 0)
Match match = ErrorRegex.Match (singleLine);
if (!match.Success) {
- Log.LogMessage (importance, singleLine);
+ Log.LogMessage (messageImportance, singleLine);
return;
}
Log.LogError (null, code, null, filename, lineNumber, columnNumber, -1,
-1, text, null);
} else {
- Log.LogMessage (importance, singleLine);
+ Log.LogMessage (messageImportance, singleLine);
}
}
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
}
+ [Test]
+ public void TestReferencesAlias ()
+ {
+ CscExtended csc = new CscExtended ();
+ CommandLineBuilderExtension c1 = new CommandLineBuilderExtension ();
+ CommandLineBuilderExtension c2 = new CommandLineBuilderExtension ();
+
+ TaskItem ti1 = new TaskItem ("A");
+ ti1.SetMetadata ("Aliases", "r1,global,r2");
+
+ csc.References = new ITaskItem[2] { ti1, new TaskItem ("B") };
+ csc.ARFC (c1);
+ csc.ACLC (c2);
+
+ Assert.AreEqual ("/reference:r1=A /reference:A /reference:r2=A /reference:B", c1.ToString (), "A1");
+ Assert.AreEqual (String.Empty, c2.ToString (), "A2");
+ }
+
[Test]
public void TestResponseFiles ()
{
";
}
+ [Test]
+ public void TestSystemDll ()
+ {
+ var gacDir = GetGacDir ();
+
+ if (gacDir == null || !System.IO.Directory.Exists (gacDir))
+ Assert.Ignore ("GAC not found.");
+
+ string documentString = @"
+ <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+ <ItemGroup>
+ <Reference Include='System.dll' />
+ </ItemGroup>
+ <PropertyGroup>
+ <SearchPaths>
+ {CandidateAssemblyFiles};
+ $(ReferencePath);
+ {HintPathFromItem};
+ {TargetFrameworkDirectory};
+ {AssemblyFolders};
+ {GAC};
+ {RawFileName};
+ $(OutputPath)
+ </SearchPaths>
+ </PropertyGroup>
+ <Target Name='A'>
+ <ResolveAssemblyReference
+ Assemblies='@(Reference)'
+ SearchPaths='$(SearchPaths)'
+ >
+ <Output TaskParameter='ResolvedFiles' ItemName='ResolvedFiles'/>
+ </ResolveAssemblyReference>
+ </Target>
+ </Project>
+ ";
+
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big [0].Include.EndsWith (".dll"), "A3");
+ }
+
string GetGacDir ()
{
// copied from mcs/tools/gacutil/driver.cs
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{DC97F667-4341-4764-8F35-E1E0B2705A51}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Microsoft.Build.Utilities.Test</RootNamespace>
- <AssemblyName>Microsoft.Build.Utilities.Test</AssemblyName>
- <StartupObject>
- </StartupObject>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>.\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <ItemGroup>
- <Reference Include="Microsoft.Build.Framework" />
- <Reference Include="Microsoft.Build.Utilities" />
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Test\Microsoft.Build.Utilities\CommandLineBuilderTest.cs" />
- <Compile Include="Test\Microsoft.Build.Utilities\LoggerTest.cs" />
- <Compile Include="Test\Microsoft.Build.Utilities\TaskItemTest.cs" />
- <Compile Include="Test\Microsoft.Build.Utilities\TaskLoggingHelperTest.cs" />
- <Compile Include="Test\Microsoft.Build.Utilities\ToolTaskTest.cs" />
- </ItemGroup>
-</Project>
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual C# Express 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Utilities.Test", "Microsoft.Build.Utilities.Test.csproj", "{DC97F667-4341-4764-8F35-E1E0B2705A51}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {DC97F667-4341-4764-8F35-E1E0B2705A51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {DC97F667-4341-4764-8F35-E1E0B2705A51}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {DC97F667-4341-4764-8F35-E1E0B2705A51}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {DC97F667-4341-4764-8F35-E1E0B2705A51}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
}
[MonoTODO]
- public bool IsVerbosityAtLeast (LoggerVerbosity verbosity)
+ public bool IsVerbosityAtLeast (LoggerVerbosity checkVerbosity)
{
- return (this.verbosity >= verbosity) ? true : false;
+ return this.verbosity >= checkVerbosity;
}
}
}
hasLoggedErrors = true;
}
- public void LogErrorFromException (Exception e)
+ public void LogErrorFromException (Exception exception)
{
- LogErrorFromException (e, true);
+ LogErrorFromException (exception, true);
}
- public void LogErrorFromException (Exception e,
+ public void LogErrorFromException (Exception exception,
bool showStackTrace)
{
- LogErrorFromException (e, showStackTrace, true, String.Empty);
+ LogErrorFromException (exception, showStackTrace, true, String.Empty);
}
[MonoTODO ("Arguments @showDetail and @file are not honored")]
- public void LogErrorFromException (Exception e,
+ public void LogErrorFromException (Exception exception,
bool showStackTrace, bool showDetail, string file)
{
- if (e == null)
- throw new ArgumentNullException ("e");
+ if (exception == null)
+ throw new ArgumentNullException ("exception");
StringBuilder sb = new StringBuilder ();
- sb.Append (e.Message);
+ sb.Append (exception.Message);
if (showStackTrace == true)
- sb.Append (e.StackTrace);
+ sb.Append (exception.StackTrace);
BuildErrorEventArgs beea = new BuildErrorEventArgs (
null, null, buildEngine.ProjectFileOfTaskNode, 0, 0, 0, 0, sb.ToString (),
- e.HelpLink, e.Source);
+ exception.HelpLink, exception.Source);
buildEngine.LogErrorEvent (beea);
hasLoggedErrors = true;
}
messageResourceName), messageArgs);
}
- public bool LogMessagesFromFile (string filename)
+ public bool LogMessagesFromFile (string fileName)
{
- return LogMessagesFromFile (filename, MessageImportance.Normal);
+ return LogMessagesFromFile (fileName, MessageImportance.Normal);
}
- public bool LogMessagesFromFile (string filename,
+ public bool LogMessagesFromFile (string fileName,
MessageImportance messageImportance)
{
try {
- StreamReader sr = new StreamReader (filename);
+ StreamReader sr = new StreamReader (fileName);
LogMessage (messageImportance, sr.ReadToEnd (),
null);
sr.Close ();
}
public bool LogMessageFromText (string lineOfText,
- MessageImportance importance)
+ MessageImportance messageImportance)
{
if (lineOfText == null)
throw new ArgumentNullException ("lineOfText");
BuildMessageEventArgs bmea = new BuildMessageEventArgs (
lineOfText, helpKeywordPrefix,
- null, importance);
+ null, messageImportance);
buildEngine.LogMessageEvent (bmea);
return true;
buildEngine.LogWarningEvent (bwea);
}
- public void LogWarningFromException (Exception e)
+ public void LogWarningFromException (Exception exception)
{
- LogWarningFromException (e, false);
+ LogWarningFromException (exception, false);
}
- public void LogWarningFromException (Exception e,
+ public void LogWarningFromException (Exception exception,
bool showStackTrace)
{
StringBuilder sb = new StringBuilder ();
- sb.Append (e.Message);
+ sb.Append (exception.Message);
if (showStackTrace)
- sb.Append (e.StackTrace);
+ sb.Append (exception.StackTrace);
LogWarning (null, null, null, null, 0, 0, 0, 0,
sb.ToString (), null);
}
//
// ToolTask.cs: Base class for command line tool tasks.
//
-// Author:
+// Authors:
// Marek Sieradzki (marek.sieradzki@gmail.com)
// Ankit Jain (jankit@novell.com)
+// Marek Safar (marek.safar@gmail.com)
//
// (C) 2005 Marek Sieradzki
// Copyright 2009 Novell, Inc (http://www.novell.com)
+// Copyright 2014 Xamarin Inc
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
return true;
}
+ string CreateToolPath ()
+ {
+ string tp;
+ if (string.IsNullOrEmpty (ToolPath)) {
+ tp = GenerateFullPathToTool ();
+ if (string.IsNullOrEmpty (tp))
+ return null;
+
+ //
+ // GenerateFullPathToTool can return path including tool name
+ //
+ if (string.IsNullOrEmpty (ToolExe))
+ return tp;
+
+ tp = Path.GetDirectoryName (tp);
+ } else {
+ tp = ToolPath;
+ }
+
+ var path = Path.Combine (tp, ToolExe);
+ if (!File.Exists (path)) {
+ if (Log != null)
+ Log.LogError ("Tool executable '{0}' could not be found", path);
+ return null;
+ }
+
+ return path;
+ }
+
public override bool Execute ()
{
if (SkipTaskExecution ())
return true;
- exitCode = ExecuteTool (GenerateFullPathToTool (), GenerateResponseFileCommands (),
+ var tool_path = CreateToolPath ();
+ if (tool_path == null)
+ return false;
+
+ exitCode = ExecuteTool (tool_path, GenerateResponseFileCommands (),
GenerateCommandLineCommands ());
// HandleTaskExecutionErrors is called only if exitCode != 0
}
}
- protected virtual void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+ protected virtual void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
{
if (singleLine.Length == 0) {
- Log.LogMessage (singleLine, importance);
+ Log.LogMessage (singleLine, messageImportance);
return;
}
var result = MSBuildErrorParser.TryParseLine (singleLine);
if (result == null) {
- Log.LogMessage (importance, singleLine);
+ Log.LogMessage (messageImportance, singleLine);
return;
}
protected virtual string GenerateCommandLineCommands ()
{
- return null;
+ return "";
}
protected abstract string GenerateFullPathToTool ();
protected virtual string GenerateResponseFileCommands ()
{
- return null;
+ return "";
}
protected virtual string GetResponseFileSwitch (string responseFilePath)
return String.Format ("@{0}", responseFilePath);
}
- protected virtual ProcessStartInfo GetProcessStartInfo (string pathToTool, string commandLineCommands, string responseFileSwitch)
+ protected ProcessStartInfo GetProcessStartInfo (string pathToTool, string commandLineCommands, string responseFileSwitch)
{
var pinfo = new ProcessStartInfo (pathToTool, String.Format ("{0} {1}", commandLineCommands, responseFileSwitch));
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Assert.AreEqual (a.ToolPath, "Bar", "#5");
a.ToolPath = "";
Assert.AreEqual (a.ToolPath, "", "#6");
+
+ a.Execute ();
+ }
+
+ [Test]
+ public void Execute_1 ()
+ {
+ var t = new TestExecuteToolTask ();
+ t.OnExecuteTool = delegate { Assert.Fail ("#1"); };
+ t.BuildEngine = new MockBuildEngine ();
+ Assert.IsFalse (t.Execute (), "result");
+ }
+
+ [Test]
+ public void Execute_2 ()
+ {
+ var t = new TestExecuteToolTask ();
+ t.BuildEngine = new MockBuildEngine ();
+ t.ToolPath = Directory.GetCurrentDirectory ();
+ t.ToolExe = "Makefile";
+
+ t.OnExecuteTool = (pathToTool, responseFileCommands, commandLineCommands) => {
+ Assert.AreEqual (Path.Combine (Directory.GetCurrentDirectory (), "Makefile"), pathToTool, "#1");
+ Assert.AreEqual ("", responseFileCommands, "#2");
+ Assert.AreEqual ("", commandLineCommands, "#3");
+
+ };
+
+ Assert.IsTrue (t.Execute (), "result");
+ }
+
+ [Test]
+ public void Execute_3 ()
+ {
+ var t = new TestExecuteToolTask ();
+ t.FullPathToTool = "fpt";
+ t.BuildEngine = new MockBuildEngine ();
+ t.ToolExe = "Makefile.mk";
+
+ t.OnExecuteTool = (pathToTool, responseFileCommands, commandLineCommands) => {
+ Assert.AreEqual ("Makefile.mk", pathToTool, "#1");
+ Assert.AreEqual ("", responseFileCommands, "#2");
+ Assert.AreEqual ("", commandLineCommands, "#3");
+
+ };
+
+ Assert.IsFalse (t.Execute (), "result");
}
}
}
protected override string GenerateFullPathToTool ()
+ {
+ return "";
+ }
+ }
+
+ class MockBuildEngine : IBuildEngine
+ {
+ public int ColumnNumberOfTaskNode {
+ get {
+ return 0;
+ }
+ }
+
+ public bool ContinueOnError {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int LineNumberOfTaskNode {
+ get {
+ return 0;
+ }
+ }
+
+ public string ProjectFileOfTaskNode {
+ get {
+ return "ProjectFileOfTaskNode";
+ }
+ }
+
+ public bool BuildProjectFile (string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs)
{
throw new NotImplementedException ();
}
+
+ public void LogCustomEvent (CustomBuildEventArgs e)
+ {
+ }
+
+ public void LogErrorEvent (BuildErrorEventArgs e)
+ {
+ Console.WriteLine (e.Message);
+ }
+
+ public void LogMessageEvent (BuildMessageEventArgs e)
+ {
+ }
+
+ public void LogWarningEvent (BuildWarningEventArgs e)
+ {
+ }
+ }
+
+ class TestExecuteToolTask : ToolTask
+ {
+ public Action<string, string, string> OnExecuteTool;
+ public string FullPathToTool;
+
+ protected override string ToolName {
+ get { return "TestTool.exe"; }
+ }
+
+ protected override bool CallHostObjectToExecute ()
+ {
+ return base.CallHostObjectToExecute ();
+ }
+
+ protected override string GenerateFullPathToTool ()
+ {
+ return FullPathToTool;
+ }
+
+ protected override int ExecuteTool (string pathToTool, string responseFileCommands, string commandLineCommands)
+ {
+ if (OnExecuteTool != null)
+ OnExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
+
+ return 0;
+ }
}
}
}
string @remove;
public string Remove { get { return @remove ?? String.Empty; } set { @remove = value; } }
- #if NET_4_5
string keepDuplicates;
- public string KeepDuplicates { get { return keepDuplicates ?? String.Empty; } set { keepDuplicates = value; } }
- string keepMetadata;
- public string KeepMetadata { get { return keepMetadata ?? String.Empty; } set { keepMetadata = value; } }
- string removeMetadata;
- public string RemoveMetadata { get { return removeMetadata ?? String.Empty; } set { removeMetadata = value; } }
+ string keepMetadata;
+ string removeMetadata;
+ #if NET_4_5
+ public
+ #else
+ internal
#endif
+ string KeepDuplicates { get { return keepDuplicates ?? String.Empty; } set { keepDuplicates = value; } }
+ #if NET_4_5
+ public
+ #else
+ internal
+ #endif
+ string KeepMetadata { get { return keepMetadata ?? String.Empty; } set { keepMetadata = value; } }
+ #if NET_4_5
+ public
+ #else
+ internal
+ #endif
+ string RemoveMetadata { get { return removeMetadata ?? String.Empty; } set { removeMetadata = value; } }
+
public ProjectMetadataElement AddMetadata (string name, string unevaluatedValue)
{
var metadata = ContainingProject.CreateMetadataElement (name, unevaluatedValue);
{
SaveAttribute (writer, "Include", Include);
SaveAttribute (writer, "Exclude", Exclude);
-#if NET_4_5
SaveAttribute (writer, "KeepDuplicates", KeepDuplicates);
SaveAttribute (writer, "KeepMetadata", KeepMetadata);
SaveAttribute (writer, "RemoveMetadata", RemoveMetadata);
-#endif
SaveAttribute (writer, "Remove", Remove);
base.SaveValue (writer);
}
case "Exclude":
Exclude = value;
break;
-#if NET_4_5
case "KeepDuplicates":
KeepDuplicates = value;
break;
case "RemoveMetadata":
RemoveMetadata = value;
break;
-#endif
case "Remove":
Remove = value;
break;
~BuildManager ()
{
// maybe processes created by out-of-process nodes should be signaled.
- BuildNodeManager.Stop ();
}
readonly List<BuildSubmission> submissions = new List<BuildSubmission> ();
foreach (DictionaryEntry p in globalProperties)
globalPropertiesThatMakeSense [(string) p.Key] = (string) p.Value;
var projectToBuild = new ProjectInstance (ProjectRootElement.Create (XmlReader.Create (projectFileName)), globalPropertiesThatMakeSense, toolsVersion, Projects);
+ // Not very sure if ALL of these properties should be added, but some are certainly needed.
+ foreach (var p in this.project.Properties.Where (p => !globalProperties.Contains (p.Name)))
+ projectToBuild.SetProperty (p.Name, p.EvaluatedValue);
+
IDictionary<string,TargetResult> outs;
var ret = projectToBuild.Build (targetNames ?? new string [] {"Build"}, Projects.Loggers, out outs);
foreach (var p in outs)
Microsoft.Build.Execution/ProjectInstanceTest.cs
Microsoft.Build.Execution/ProjectMetadataInstanceTest.cs
Microsoft.Build.Execution/ProjectTargetInstanceTest.cs
+Microsoft.Build.Execution/ProjectTaskInstanceTest.cs
Microsoft.Build.Internal/CollectionFromEnumerableTest.cs
Microsoft.Build.Internal/ExpressionParserTest.cs
Microsoft.Build.Logging/ConsoleLoggerTest.cs
public class ProjectCollectionTest
{
[Test]
-#if NET_4_0
- // BXC #20961
- [Category ("NotWorking")]
-#endif
public void GlobalProperties ()
{
var g = ProjectCollection.GlobalProjectCollection;
Assert.AreEqual (0, g.GlobalProperties.Count, "#1");
+ #if NET_4_5
Assert.IsTrue (g.GlobalProperties.IsReadOnly, "#2");
+ #endif
}
[Test]
[Test]
public void BuildCSharpTargetGetFrameworkPaths ()
{
- string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' />
</Project>";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
- var proj = new Project (root);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
+ var proj = new Project (root);
root.FullPath = "ProjectTest.BuildCSharpTargetGetFrameworkPaths.proj";
Assert.IsTrue (proj.Build ("GetFrameworkPaths", new ILogger [] {/*new ConsoleLogger ()*/}));
}
[Test]
public void ProperiesMustBeDistinct ()
{
- string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<PropertyGroup>
<AssemblyName>Foo</AssemblyName>
<OutputPath>Test</OutputPath>
</PropertyGroup>
</Project>";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
root.FullPath = "ProjectTest.BuildCSharpTargetBuild.proj";
var proj = new Project (root);
var list = new List<ProjectProperty> ();
}
[Test]
-#if NET_4_0
- // BXC #20961
- [Category ("NotWorking")]
-#endif
public void BuildCSharpTargetBuild ()
{
- string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<PropertyGroup>
<AssemblyName>Foo</AssemblyName>
</PropertyGroup>
<Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' />
</Project>";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
root.FullPath = "ProjectTest.BuildCSharpTargetBuild.proj";
var proj = new Project (root, null, "4.0");
Assert.IsFalse (proj.Build ("Build", new ILogger [] {/*new ConsoleLogger (LoggerVerbosity.Diagnostic)*/})); // missing mandatory properties
[Test]
public void EvaluateItemConditionThenIgnored ()
{
- string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<PropertyGroup>
<P></P>
</PropertyGroup>
public void EvaluateSamePropertiesInOrder ()
{
// used in Microsoft.Common.targets
- string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<PropertyGroup>
<BaseIntermediateOutputPath Condition=""'$(BaseIntermediateOutputPath)' == ''"">obj\</BaseIntermediateOutputPath>
</PropertyGroup>
}
[Test]
-#if NET_4_0
- // BXC #20961
- [Category ("NotWorking")]
-#endif
public void CreateProjectInstance ()
{
- string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<PropertyGroup>
<AssemblyName>Foo</AssemblyName>
</PropertyGroup>
<Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' />
</Project>";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
var proj = new Project (root, null, "4.0");
var inst = proj.CreateProjectInstance ();
Assert.AreEqual ("4.0", inst.ToolsVersion, "#1");
}
[Test]
-#if NET_4_0
- // BXC #20961
- [Category ("NotWorking")]
-#endif
public void LoadCaseInsensitive ()
{
- string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<PropertyGroup>
<AssemblyName>Foo</AssemblyName>
</PropertyGroup>
<Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.Targets' />
</Project>";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
new Project (root, null, "4.0");
}
[Test]
public void SameNameTargets ()
{
- string project_xml = @"<Project DefaultTargets='Foo' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ string project_xml = @"<Project DefaultTargets='Foo' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name='Foo'><Message Text='This should not be written' /></Target>
<Target Name='Foo'><Message Text='This will be written' /></Target>
</Project>";
- var xml = XmlReader.Create (new StringReader (project_xml));
- var root = ProjectRootElement.Create (xml);
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
var proj = new Project (root, null, "4.0");
var sw = new StringWriter ();
proj.Build (new ConsoleLogger (LoggerVerbosity.Diagnostic, sw.WriteLine, null, null));
}
}
}
-
Assert.AreEqual (";_AddCorlibReference", p.EvaluatedValue, "#2");
}
+ [Test]
+ public void ItemsAndPostEvaluationCondition ()
+ {
+ // target-assigned property X is not considered when evaluating condition for C.
+ string project_xml = @"<Project DefaultTargets='X;Y' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ <ItemGroup>
+ <A Include='foo.txt' />
+ <B Condition='False' Include='bar.txt' />
+ <C Condition=""'$(X)'=='True'"" Include='baz.txt' />
+ </ItemGroup>
+ <Target Name='X'>
+ <CreateProperty Value='True'>
+ <Output TaskParameter='Value' PropertyName='X' />
+ </CreateProperty>
+ </Target>
+ <Target Name='Y'>
+ <Error Condition=""'@(C)'==''"" Text='missing C. X is $(X)' />
+ </Target>
+</Project>";
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
+ root.FullPath = "ProjectInstanceTest.ItemsAndPostEvaluationCondition.proj";
+ var proj = new ProjectInstance (root);
+ Assert.AreEqual (1, proj.Items.Count, "Count1");
+ Assert.IsFalse (proj.Build (), "Build");
+ Assert.AreEqual (1, proj.Items.Count, "Count2");
+ }
+
[Test]
[Category ("NotWorking")] // until we figure out why it fails on wrench.
public void ItemsInTargets ()
Assert.IsTrue (items.Any (), "items.Any");
Assert.IsTrue (!string.IsNullOrEmpty (items.First ().EvaluatedInclude), "item.EvaluatedInclude");
}
+
+ [Test]
+ [Category ("NotWorking")]
+ public void ConditionalCyclicDependence ()
+ {
+ string project_xml = @"<Project DefaultTargets='Build' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ <PropertyGroup>
+ <C>False</C>
+ </PropertyGroup>
+ <Target Name='Build' DependsOnTargets='ResolveReferences' />
+ <Target Name='Build2' DependsOnTargets='Bar' />
+ <Target Name='ResolveReferences' DependsOnTargets='Foo;Bar' />
+ <Target Name='Foo'>
+ <CreateProperty Value='True'>
+ <Output TaskParameter='Value' PropertyName='C' />
+ </CreateProperty>
+ </Target>
+ <Target Name='Bar' Condition='!($(C))' DependsOnTargets='ResolveReferences'>
+ </Target>
+</Project>";
+ var xml = XmlReader.Create (new StringReader (project_xml));
+ var root = ProjectRootElement.Create (xml);
+ root.FullPath = "ProjectInstanceTest.ConditionalCyclicDependence.proj";
+ var proj = new ProjectInstance (root, null, "4.0", ProjectCollection.GlobalProjectCollection);
+ Assert.IsTrue (proj.Build (), "#1");
+ Assert.IsFalse (proj.Build ("Build2", new ILogger [0]), "#2");
+ }
}
namespace SubNamespace
--- /dev/null
+//
+// ProjectInstanceTest.cs
+//
+// Author:
+// Atsushi Enomoto (atsushi@xamarin.com)
+//
+// Copyright (C) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.IO;
+using System.Linq;
+using System.Xml;
+using Microsoft.Build.Construction;
+using Microsoft.Build.Execution;
+using NUnit.Framework;
+using Microsoft.Build.Evaluation;
+using Microsoft.Build.Utilities;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Logging;
+
+namespace MonoTests.Microsoft.Build.Execution
+{
+ [TestFixture]
+ public class ProjectTaskInstanceTest
+ {
+#if NET_4_5
+ [Test]
+ public void OutputPropertyExists ()
+ {
+ string project_xml = @"
+<Project DefaultTargets='Build' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ <PropertyGroup>
+ <C>False</C>
+ </PropertyGroup>
+ <Target Name='Build' DependsOnTargets='ResolveReferences' />
+ <Target Name='Build2' DependsOnTargets='Bar' />
+ <Target Name='ResolveReferences' DependsOnTargets='Foo;Bar' />
+ <Target Name='Foo'>
+ <CreateProperty Value='True'>
+ <Output TaskParameter='Value' PropertyName='C' />
+ </CreateProperty>
+ </Target>
+ <Target Name='Bar' Condition='!($(C))' DependsOnTargets='ResolveReferences'>
+ </Target>
+</Project>";
+ var xml = XmlReader.Create (new StringReader(project_xml));
+ var root = ProjectRootElement.Create (xml);
+ var proj = new ProjectInstance (root);
+ Assert.AreEqual (5, proj.Targets.Count, "#1");
+ var foo = proj.Targets ["Foo"];
+ Assert.IsNotNull (foo, "#2");
+ Assert.AreEqual (1, foo.Tasks.Count, "#3");
+ var cp = foo.Tasks.First ();
+ Assert.AreEqual (1, cp.Outputs.Count, "#4");
+ var po = cp.Outputs.First () as ProjectTaskOutputPropertyInstance;
+ Assert.IsNotNull (po, "#5");
+ Assert.AreEqual ("C", po.PropertyName, "#5");
+ proj.Build ("Build", null);
+ Assert.AreEqual (string.Empty, foo.Outputs, "#6");
+ Assert.AreEqual ("True", proj.GetPropertyValue ("C"), "#7");
+ }
+#endif
+ }
+}
+
LIB_MCS_FLAGS = -r:System.Core.dll -r:System.Xml.dll -r:System.dll
-ifeq (monotouch, $(PROFILE))
+MOBILE_STATIC := $(filter mobile_static monotouch, $(PROFILE))
+
+ifdef MOBILE_STATIC
LIB_MCS_FLAGS += -d:IOS_REFLECTION
endif
<PropertyGroup>\r
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
+ <ProductVersion>8.0.30703</ProductVersion>\r
<SchemaVersion>2.0</SchemaVersion>\r
<ProjectGuid>{817CE046-07E8-409D-84BF-A6EA4F2879DE}</ProjectGuid>\r
<OutputType>Library</OutputType>\r
<AppDesignerFolder>Properties</AppDesignerFolder>\r
<RootNamespace>Mono.CSharp</RootNamespace>\r
<AssemblyName>Mono.CSharp</AssemblyName>\r
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
<FileAlignment>512</FileAlignment>\r
<FileUpgradeFlags>\r
</FileUpgradeFlags>\r
</PropertyGroup>\r
<ItemGroup>\r
<Reference Include="System" />\r
- <Reference Include="System.Core">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.XML" />\r
+ <Reference Include="System.Core" />\r
+ <Reference Include="System.Xml" />\r
</ItemGroup>\r
<ItemGroup>\r
- <Compile Include="..\..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolFile.cs">\r
- <Link>MonoSymbolFile.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolTable.cs">\r
- <Link>MonoSymbolTable.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolWriter.cs">\r
- <Link>MonoSymbolWriter.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\class\Mono.CompilerServices.SymbolWriter\SourceMethodBuilder.cs">\r
- <Link>SourceMethodBuilder.cs</Link>\r
- </Compile>\r
<Compile Include="..\..\mcs\anonymous.cs">\r
<Link>anonymous.cs</Link>\r
</Compile>\r
<Link>CryptoConvert.cs</Link>\r
</Compile>\r
<Compile Include="cs-parser.cs" />\r
+ <Compile Include="..\Mono.CompilerServices.SymbolWriter\MonoSymbolFile.cs">\r
+ <Link>MonoSymbolFile.cs</Link>\r
+ </Compile>\r
+ <Compile Include="..\Mono.CompilerServices.SymbolWriter\MonoSymbolTable.cs">\r
+ <Link>MonoSymbolTable.cs</Link>\r
+ </Compile>\r
+ <Compile Include="..\Mono.CompilerServices.SymbolWriter\MonoSymbolWriter.cs">\r
+ <Link>MonoSymbolWriter.cs</Link>\r
+ </Compile>\r
+ <Compile Include="..\Mono.CompilerServices.SymbolWriter\SourceMethodBuilder.cs">\r
+ <Link>SourceMethodBuilder.cs</Link>\r
+ </Compile>\r
</ItemGroup>\r
<ItemGroup>\r
<Folder Include="Properties\" />\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.CSharp", "Mono.CSharp.csproj", "{817CE046-07E8-409D-84BF-A6EA4F2879DE}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537} = {5D485D32-3B9F-4287-AB24-C8DA5B89F537}\r
- EndProjectSection\r
-EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jay2010", "..\..\jay\jay2010.vcxproj", "{5D485D32-3B9F-4287-AB24-C8DA5B89F537}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Debug|Mixed Platforms = Debug|Mixed Platforms\r
- Debug|Win32 = Debug|Win32\r
- Release|Any CPU = Release|Any CPU\r
- Release|Mixed Platforms = Release|Mixed Platforms\r
- Release|Win32 = Release|Win32\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Win32.ActiveCfg = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Mixed Platforms.Build.0 = Release|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Win32.ActiveCfg = Release|Any CPU\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Debug|Any CPU.ActiveCfg = Debug|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Debug|Mixed Platforms.Build.0 = Debug|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Debug|Win32.Build.0 = Debug|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Release|Any CPU.ActiveCfg = Release|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Release|Mixed Platforms.ActiveCfg = Release|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Release|Mixed Platforms.Build.0 = Release|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Release|Win32.ActiveCfg = Release|Win32\r
- {5D485D32-3B9F-4287-AB24-C8DA5B89F537}.Release|Win32.Build.0 = Release|Win32\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>\r
- <ProductVersion>8.0.30703</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{4FCB063A-0731-4286-843F-7B85910C30D5}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>Mono.CSharp.Tests</RootNamespace>\r
- <AssemblyName>Mono.CSharp.Tests</AssemblyName>\r
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r
- <TargetFrameworkProfile>\r
- </TargetFrameworkProfile>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
- <PlatformTarget>x86</PlatformTarget>\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">\r
- <PlatformTarget>x86</PlatformTarget>\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <StartupObject />\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="nunit.framework, Version=2.5.9.10348, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />\r
- <Reference Include="System" />\r
- <Reference Include="System.Core" />\r
- <Reference Include="System.Xml.Linq" />\r
- <Reference Include="System.Data.DataSetExtensions" />\r
- <Reference Include="Microsoft.CSharp" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="AssertReportPrinter.cs" />\r
- <Compile Include="Evaluator\BuildinCommands.cs" />\r
- <Compile Include="Evaluator\CompletionTest.cs" />\r
- <Compile Include="Evaluator\EvaluatorFixture.cs" />\r
- <Compile Include="Evaluator\EvaluatorTest.cs" />\r
- <Compile Include="Evaluator\ExpressionsTest.cs" />\r
- <Compile Include="Evaluator\TypesTest.cs" />\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\Mono.CSharp.csproj">\r
- <Project>{817CE046-07E8-409D-84BF-A6EA4F2879DE}</Project>\r
- <Name>Mono.CSharp</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual Studio 2010\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.CSharp.Tests", "Mono.CSharp.Tests.csproj", "{4FCB063A-0731-4286-843F-7B85910C30D5}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.CSharp", "..\Mono.CSharp.csproj", "{817CE046-07E8-409D-84BF-A6EA4F2879DE}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Debug|Mixed Platforms = Debug|Mixed Platforms\r
- Debug|x86 = Debug|x86\r
- Release|Any CPU = Release|Any CPU\r
- Release|Mixed Platforms = Release|Mixed Platforms\r
- Release|x86 = Release|x86\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Debug|Any CPU.ActiveCfg = Debug|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Debug|Mixed Platforms.ActiveCfg = Debug|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Debug|Mixed Platforms.Build.0 = Debug|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Debug|x86.ActiveCfg = Debug|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Debug|x86.Build.0 = Debug|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Release|Any CPU.ActiveCfg = Release|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Release|Mixed Platforms.ActiveCfg = Release|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Release|Mixed Platforms.Build.0 = Release|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Release|x86.ActiveCfg = Release|x86\r
- {4FCB063A-0731-4286-843F-7B85910C30D5}.Release|x86.Build.0 = Release|x86\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Debug|x86.ActiveCfg = Debug|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|Mixed Platforms.Build.0 = Release|Any CPU\r
- {817CE046-07E8-409D-84BF-A6EA4F2879DE}.Release|x86.ActiveCfg = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
--- /dev/null
+#include Mono.CSharp.dll.sources
+../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
+../corlib/System.Reflection.Emit/FlowControl.cs
+../corlib/System.Reflection.Emit/OpCode.cs
+../corlib/System.Reflection.Emit/OpCodeNames.cs
+../corlib/System.Reflection.Emit/OpCodes.cs
+../corlib/System.Reflection.Emit/OpCodeType.cs
+../corlib/System.Reflection.Emit/OperandType.cs
+../corlib/System.Reflection.Emit/PEFileKinds.cs
+../corlib/System.Reflection.Emit/Label.cs
+../corlib/System.Reflection.Emit/MethodToken.cs
+../corlib/System.Reflection.Emit/StackBehaviour.cs
+monotouch.cs
\ No newline at end of file
-#include Mono.CSharp.dll.sources
-../corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
-../corlib/System.Reflection.Emit/FlowControl.cs
-../corlib/System.Reflection.Emit/OpCode.cs
-../corlib/System.Reflection.Emit/OpCodeNames.cs
-../corlib/System.Reflection.Emit/OpCodes.cs
-../corlib/System.Reflection.Emit/OpCodeType.cs
-../corlib/System.Reflection.Emit/OperandType.cs
-../corlib/System.Reflection.Emit/PEFileKinds.cs
-../corlib/System.Reflection.Emit/Label.cs
-../corlib/System.Reflection.Emit/MethodToken.cs
-../corlib/System.Reflection.Emit/StackBehaviour.cs
-monotouch.cs
\ No newline at end of file
+#include mobile_static_Mono.CSharp.dll.sources
+monotouch.cs
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'basic|AnyCPU' ">
- <DefineConstants>BOOTSTRAP_BASIC,NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System.dll"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Default.targets"/>
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0,SQLITE_STANDARD</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="System"/>
- <Reference Include="System.Data"/>
- <Reference Include="System.Xml"/>
- <Reference Include="System.Transactions"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
using System.Diagnostics;
using System.Net.Sockets;
using System.Globalization;
+using System.Security;
using System.Text;
+using System.Runtime.InteropServices;
namespace Mono.Data.Tds.Protocol
{
t3.Domain = this.connectionParms.DefaultDomain;
t3.Host = this.connectionParms.Hostname;
t3.Username = this.connectionParms.User;
- t3.Password = this.connectionParms.Password;
+ t3.Password = GetPlainPassword(this.connectionParms.Password);
Comm.StartPacket (TdsPacketType.SspAuth); // 0x11
Comm.Append (t3.GetBytes ());
comm.Skip(4);
}
+ public static string GetPlainPassword(SecureString secPass)
+ {
+ IntPtr plainString = IntPtr.Zero;
+ try
+ {
+ plainString = Marshal.SecureStringToGlobalAllocUnicode(secPass);
+ return Marshal.PtrToStringUni(plainString);
+ }
+ finally
+ {
+ Marshal.ZeroFreeGlobalAllocUnicode(plainString);
+ }
+ }
+
#endregion // Private Methods
#if NET_2_0
//
using System;
+using System.Security;
namespace Mono.Data.Tds.Protocol {
public sealed class Tds42 : Tds
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// password (offset 62 0x3e)
- tmp = Comm.Append (connectionParameters.Password, 30, pad);
+ tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 30, pad);
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// hostproc (offset 93 0x5d)
// remote passwords
Comm.Append (empty, 2, pad);
- tmp = Comm.Append (connectionParameters.Password, 253, pad);
+ tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 253, pad);
Comm.Append ((byte) (tmp.Length < 253 ? tmp.Length + 2 : 253 + 2));
// tds version
using Mono.Data.Tds;
using System;
using System.Text;
+using System.Security;
namespace Mono.Data.Tds.Protocol
{
// password (offset 62 0x3e)
// 62-92
- tmp = Comm.Append (connectionParameters.Password, 30, pad);
+ tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 30, pad);
Comm.Append ((byte) (tmp.Length < 30 ? tmp.Length : 30));
// hostproc (offset 93 0x5d)
// remote passwords
// 202-457
Comm.Append (empty, 2, pad);
- tmp = Comm.Append (connectionParameters.Password, 253, pad);
+ tmp = Comm.Append (GetPlainPassword(connectionParameters.Password), 253, pad);
Comm.Append ((byte) (tmp.Length < 253 ? tmp.Length + 2 : 253 + 2));
// tds version
using System;
using System.Globalization;
using System.Text;
+using System.Security;
using Mono.Security.Protocol.Ntlm;
return IsConnected;
}
- private static string EncryptPassword (string pass)
+ private static string EncryptPassword (SecureString secPass)
{
int xormask = 0x5a5a;
- int len = pass.Length;
+ int len = secPass.Length;
char[] chars = new char[len];
+ string pass = GetPlainPassword(secPass);
for (int i = 0; i < len; ++i) {
int c = ((int) (pass[i])) ^ xormask;
//
using System;
+using System.Security;
namespace Mono.Data.Tds.Protocol
{
public string Hostname;
public string Language;
public string LibraryName;
- public string Password;
+ public SecureString Password;
+ public bool PasswordSet;
public string ProgName;
public string User;
public bool DomainLogin;
Hostname = System.Net.Dns.GetHostName();
Language = String.Empty;
LibraryName = "Mono";
- Password = String.Empty;
+ Password = new SecureString();
+ PasswordSet = false;
ProgName = "Mono";
User = String.Empty;
DomainLogin = false;
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="System"/>
- <Reference Include="System.Xml"/>
- <Reference Include="Mono.Security">
- <HintPath>..\lib\net_2_0\Mono.Security.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace bug4786test
+namespace MonoTests.Mono.Data.Tds
{
using NUnit.Framework;
- using Mono.Data.Tds.Protocol;
+ using global::Mono.Data.Tds.Protocol;
using System;
using System.Net;
using System.Net.Sockets;
-d:MONO_INTERPRETER \
-delaysign -keyfile:../mono.pub
-ifeq (monotouch, $(subst _runtime,,$(PROFILE)))
+MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
+
+ifdef MOBILE_STATIC
mono_dynamic_interpreter_deps = $(the_libdir_base)plaincore/System.Core.dll
LIB_MCS_FLAGS += -lib:$(the_libdir_base)plaincore
endif
$(the_libdir_base)plaincore/System.Core.dll:
(cd ../System.Core; $(MAKE) $@)
-.NOTPARALLEL: $(the_libdir_base)plaincore/System.Core.dll
\ No newline at end of file
+.NOTPARALLEL: $(the_libdir_base)plaincore/System.Core.dll
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
-namespace Tests.Mono.Options
+namespace MonoTests.Mono.Options
#endif
{
[TestFixture]
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
-namespace Tests.Mono.Options
+namespace MonoTests.Mono.Options
#endif
{
class FooConverter : TypeConverter {
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
-namespace Tests.Mono.Options
+namespace MonoTests.Mono.Options
#endif
{
class DefaultOption : Option {
#if NDESK_OPTIONS
namespace Tests.NDesk.Options
#else
-namespace Tests.Mono.Options
+namespace MonoTests.Mono.Options
#endif
{
static class Utils {
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoWarn>0618,612</NoWarn>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System.dll"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
// clear keys
protected override void Dispose(bool disposing) {
if (!m_Disposed) {
- m_P.Clear();
- m_G.Clear();
- m_X.Clear();
+ if (m_P != null) m_P.Clear();
+ if (m_G != null) m_G.Clear();
+ if (m_X != null) m_X.Clear();
}
m_Disposed = true;
}
string msg = Locale.GetText ("Could not create user key store '{0}'.");
throw new CryptographicException (String.Format (msg, _userPath), e);
}
-
- if (!ProtectUser (_userPath)) {
- string msg = Locale.GetText ("Could not secure user key store '{0}'.");
- throw new IOException (String.Format (msg, _userPath));
- }
-
_userPathExists = true;
}
}
+ if (!IsUserProtected (_userPath) && !ProtectUser (_userPath)) {
+ string msg = Locale.GetText ("Could not secure user key store '{0}'.");
+ throw new IOException (String.Format (msg, _userPath));
+ }
}
// is it properly protected ?
if (!IsUserProtected (_userPath)) {
string msg = Locale.GetText ("Could not create machine key store '{0}'.");
throw new CryptographicException (String.Format (msg, _machinePath), e);
}
-
- if (!ProtectMachine (_machinePath)) {
- string msg = Locale.GetText ("Could not secure machine key store '{0}'.");
- throw new IOException (String.Format (msg, _machinePath));
- }
-
_machinePathExists = true;
}
}
+ if (!IsMachineProtected (_machinePath) && !ProtectMachine (_machinePath)) {
+ string msg = Locale.GetText ("Could not secure machine key store '{0}'.");
+ throw new IOException (String.Format (msg, _machinePath));
+ }
}
// is it properly protected ?
if (!IsMachineProtected (_machinePath)) {
e = new BigInteger (parameters.Exponent);
n = new BigInteger (parameters.Modulus);
+
+ //reset all private key values to null
+ d = dp = dq = qInv = p = q = null;
+
// only if the private key is present
if (parameters.D != null)
d = new BigInteger (parameters.D);
cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
KeyPairPersistence kpp = new KeyPairPersistence (cspParams);
- if (!kpp.Load ())
+ try {
+ if (!kpp.Load ())
+ return cert;
+ }
+ catch {
return cert;
+ }
if (cert.RSA != null)
cert.RSA = new RSACryptoServiceProvider (cspParams);
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'basic|AnyCPU' ">
- <DefineConstants>BOOTSTRAP_BASIC,NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System.dll"/>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
byte [] bytes = Convert.FromBase64String (b64);
rsa.DecryptValue (bytes);
}
+
+ [Test]
+ public void Bug18482 ()
+ {
+ RSAManaged privateRsa = new RSAManaged ();
+ privateRsa.FromXmlString (MonoXml384);
+
+ var rsaParameters = privateRsa.ExportParameters (false);
+
+ RSAManaged publicRsa = new RSAManaged ();
+
+ //Generates a key pair with private key values
+ publicRsa.ExportParameters (false);
+
+ //Sets public key values and should reset private key values
+ publicRsa.ImportParameters (rsaParameters);
+
+ //Should export valid parameters without throwing an exception.
+ publicRsa.ExportParameters (false);
+ }
}
}
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
-EXTRA_DISTFILES = README build-csproj2k5
-
-Mono.WebBrowser2K5.csproj: Mono.WebBrowser.dll.sources build-csproj2k5
- ./build-csproj2k5
+EXTRA_DISTFILES = README
include ../../build/library.make
-$(the_lib): Mono.WebBrowser2K5.csproj
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Default.targets"/>
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <NoWarn>108</NoWarn>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="System"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectType>Local</ProjectType>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{5E6C996A-007F-40CE-B244-006EFCFB77D2}</ProjectGuid>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ApplicationIcon>
- </ApplicationIcon>
- <AssemblyKeyContainerName>
- </AssemblyKeyContainerName>
- <AssemblyName>Mono.WebBrowser</AssemblyName>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
- <DefaultClientScript>JScript</DefaultClientScript>
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
- <DefaultTargetSchema>IE50</DefaultTargetSchema>
- <DelaySign>false</DelaySign>
- <OutputType>Library</OutputType>
- <RootNamespace>Mono.WebBrowser</RootNamespace>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <StartupObject>
- </StartupObject>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
- <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>4</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
- <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>TRACE</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>true</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>4</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System">
- <Name>System</Name>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Mono.Mozilla\AsciiString.cs" />
- <Compile Include="Mono.Mozilla\Base.cs" />
- <Compile Include="Mono.Mozilla\Callback.cs" />
- <Compile Include="Mono.Mozilla\DOM\ContentListener.cs" />
- <Compile Include="Mono.Mozilla\DOM\DocumentEncoder.cs" />
- <Compile Include="Mono.Mozilla\DOM\DocumentType.cs" />
- <Compile Include="Mono.Mozilla\DOM\DOMImplementation.cs" />
- <Compile Include="Mono.Mozilla\DOM\EventListener.cs" />
- <Compile Include="Mono.Mozilla\DOM\NamedNodeMap.cs" />
- <Compile Include="Mono.Mozilla\DOM\Stream.cs" />
- <Compile Include="Mono.Mozilla\DOM\Stylesheet.cs" />
- <Compile Include="Mono.Mozilla\DOM\StylesheetList.cs" />
- <Compile Include="Mono.Mozilla\interfaces\extras\DocumentEncoderFlags.cs" />
- <Compile Include="Mono.Mozilla\interfaces\extras\nsIReadSegmentFun.cs" />
- <Compile Include="Mono.Mozilla\interfaces\extras\nsITimerCallbackDelegate.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIAccessibilityService.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIAccessible.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIAccessibleDocument.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIAccessibleRelation.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIAccessibleRetrieval.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIAccessNode.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIArray.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsICancelable.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIChannel.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIClassInfo.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDocumentEncoder.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDocumentEncoderNodeFixup.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCounter.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCSSPrimitiveValue.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCSSRule.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCSSRuleList.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCSSStyleDeclaration.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCSSStyleSheet.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCSSValue.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDocumentEvent.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDocumentStyle.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDOMStringList.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMEvent.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMEventListener.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMEventTarget.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMHTMLStyleElement.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMKeyEvent.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMMediaList.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMMouseEvent.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMNSRange.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMRect.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMRGBColor.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMStyleSheet.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMStyleSheetList.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMUIEvent.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMViewCSS.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIErrorService.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIFile.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIIOService.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsILoadGroup.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIObserver.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIOutputStream.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIPersistentProperties.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIPrefBranch.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIPrefService.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIProperties.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIProtocolHandler.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIRequest.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIRequestObserver.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIServiceManager.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIStreamListener.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsITimer.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsITimerCallback.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIURIContentListener.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWeakReference.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebBrowser.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebBrowserChrome.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebBrowserPersist.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebBrowserStream.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebProgress.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebProgressListener.cs" />
- <Compile Include="Mono.Mozilla\UniString.cs" />
- <Compile Include="Mono.Mozilla\WebBrowser.cs" />
- <Compile Include="Mono.Mozilla\DOM\Attribute.cs" />
- <Compile Include="Mono.Mozilla\DOM\AttributeCollection.cs" />
- <Compile Include="Mono.Mozilla\DOM\Document.cs" />
- <Compile Include="Mono.Mozilla\DOM\DOMObject.cs" />
- <Compile Include="Mono.Mozilla\DOM\Element.cs" />
- <Compile Include="Mono.Mozilla\DOM\HTMLElement.cs" />
- <Compile Include="Mono.Mozilla\DOM\HTMLElementCollection.cs" />
- <Compile Include="Mono.Mozilla\DOM\History.cs" />
- <Compile Include="Mono.Mozilla\DOM\Navigation.cs" />
- <Compile Include="Mono.Mozilla\DOM\Node.cs" />
- <Compile Include="Mono.Mozilla\DOM\NodeList.cs" />
- <Compile Include="Mono.Mozilla\DOM\Window.cs" />
- <Compile Include="Mono.Mozilla\DOM\WindowCollection.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDocCharset.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMAbstractView.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMBarProp.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDocumentView.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMWindow.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMWindowCollection.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIInterfaceRequestor.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsISelection.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebBrowserChromeFocus.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebBrowserFocus.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMAttr.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCDATASection.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMCharacterData.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMComment.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDocument.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDocumentFragment.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDocumentRange.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDocumentType.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMDOMImplementation.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMElement.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMEntityReference.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMHTMLBodyElement.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMHTMLCollection.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMHTMLDocument.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMHTMLElement.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMNamedNodeMap.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMNode.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMNodeList.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMNSHTMLElement.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMProcessingInstruction.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMRange.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIDOMText.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIHistoryEntry.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIInputStream.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsISHistory.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsISHistoryListener.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsISimpleEnumerator.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIURI.cs" />
- <Compile Include="Mono.Mozilla\interfaces\nsIWebNavigation.cs" />
- <Compile Include="Mono.Mozilla\interfaces\extras\NodeType.cs" />
- <Compile Include="Mono.Mozilla\interfaces\extras\nsIWriteSegmentFun.cs" />
- <Compile Include="Mono.Mozilla\interfaces\extras\Options.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IDocumentType.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IDOMImplementation.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IMediaList.cs" />
- <Compile Include="Mono.WebBrowser\DOM\INamedNodeMap.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IStylesheet.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IStylesheetList.cs" />
- <Compile Include="Mono.WebBrowser\DOM\EventArgs.cs" />
- <Compile Include="Mono.WebBrowser\DOM\EventHandlers.cs" />
- <Compile Include="Mono.WebBrowser\IWebBrowser.cs" />
- <Compile Include="Mono.WebBrowser\Manager.cs" />
- <Compile Include="Mono.WebBrowser\Exception.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IAttribute.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IAttributeCollection.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IDocument.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IElement.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IElementCollection.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IHistory.cs" />
- <Compile Include="Mono.WebBrowser\DOM\INavigation.cs" />
- <Compile Include="Mono.WebBrowser\DOM\INode.cs" />
- <Compile Include="Mono.WebBrowser\DOM\INodeList.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IWindow.cs" />
- <Compile Include="Mono.WebBrowser\DOM\IWindowCollection.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="ChangeLog" />
- <None Include="Mono.WebBrowser.dll.sources" />
- <None Include="README" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
+++ /dev/null
-#!/bin/sh
-#
-# This script will generate SWF.cs.target from our System.Windows.Forms.dll.sources
-#
-#
-
-exec > Mono.WebBrowser2K5.csproj
-
-Source=Mono.WebBrowser.dll.sources
-
-dohead()
-{
- cat <<EOF
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectType>Local</ProjectType>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{5E6C996A-007F-40CE-B244-006EFCFB77D2}</ProjectGuid>
- <Configuration Condition=" '\$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '\$(Platform)' == '' ">AnyCPU</Platform>
- <ApplicationIcon>
- </ApplicationIcon>
- <AssemblyKeyContainerName>
- </AssemblyKeyContainerName>
- <AssemblyName>Mono.WebBrowser</AssemblyName>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
- <DefaultClientScript>JScript</DefaultClientScript>
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
- <DefaultTargetSchema>IE50</DefaultTargetSchema>
- <DelaySign>false</DelaySign>
- <OutputType>Library</OutputType>
- <RootNamespace>Mono.WebBrowser</RootNamespace>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <StartupObject>
- </StartupObject>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug\</OutputPath>
- <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>4</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '\$(Configuration)|\$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release\</OutputPath>
- <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>TRACE</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>
- </NoWarn>
- <Optimize>true</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>4</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System">
- <Name>System</Name>
- </Reference>
- </ItemGroup>
-EOF
-}
-
-dotail()
-{
- cat <<EOF
- <ItemGroup>
- <None Include="ChangeLog" />
- <None Include="Mono.WebBrowser.dll.sources" />
- <None Include="README" />
- </ItemGroup>
- <Import Project="\$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
-EOF
-}
-
-dofilelist()
-{
-echo " <ItemGroup>"
-cat $Source | while read SRC; do
-# Don't do AssemblyInfo, it's got signing requests and such that we don't want
-if [ "x$SRC" != "xAssembly/AssemblyInfo.cs" -a "x$SRC" != "x../../build/common/Consts.cs" ] ; then
-SRC=`echo $SRC | sed 's/..\/..\/build\///'`
-SRC=`echo $SRC | tr '/' '\\\\'`
-cat <<EOF
- <Compile Include="$SRC" />
-EOF
-fi
-done
-echo " </ItemGroup>"
-}
-
-dohead
-dofilelist
-dotail
/makefile.build -crlf
-/net_1_1_java_Novell.Directory.Ldap.dll.sources -crlf
LIBRARY = Novell.Directory.Ldap.dll
-ifeq (net_1_1_java, $(PROFILE))
-LIB_MCS_FLAGS = \
- /nowarn:649 /nowarn:169 /nowarn:219 /nowarn:168 \
- -r:$(corlib) \
- -r:System.dll \
- -r:rt.dll \
- -r:J2SE.Helpers.dll \
- $(RESX_RES:%=/res:%)
-else
LIB_MCS_FLAGS = \
-warn:1 -nowarn:612 \
-r:$(corlib) \
-r:System.dll \
-r:Mono.Security.dll \
$(RESX_RES:%=/res:%)
-endif
include ../../build/library.make
$(RESGEN) $< $@
EXTRA_DISTFILES = \
- net_1_1_java_Novell.Directory.Ldap.dll.sources \
Novell.Directory.Ldap.Rfc2251/RfcLdapURL.cs \
- Novell.Directory.Ldap.Security.jvm/AuthenticationCallbackHandler.cs \
- Novell.Directory.Ldap.Security.jvm/ChangeLog \
- Novell.Directory.Ldap.Security.jvm/CreateContextPrivilegedAction.cs \
- Novell.Directory.Ldap.Security.jvm/ExchangeTokenPrivilegedAction.cs \
- Novell.Directory.Ldap.Security.jvm/Krb5Helper.cs \
- Novell.Directory.Ldap.Security.jvm/SecureStream.cs \
- Novell.Directory.Ldap.Security.jvm/UnwrapPrivilegedAction.cs \
- Novell.Directory.Ldap.Security.jvm/WrapPrivilegedAction.cs \
Novell.Directory.Ldap.Utilclass/ExceptionMessages.resx \
Novell.Directory.Ldap.Utilclass/ExceptionMessages.txt \
Novell.Directory.Ldap.Utilclass/ResultCodeMessages.resx \
+++ /dev/null
-/AuthenticationCallbackHandler.cs -crlf
-/CreateContextPrivilegedAction.cs -crlf
-/ExchangeTokenPrivilegedAction.cs -crlf
-/Krb5Helper.cs -crlf
-/SecureStream.cs -crlf
-/UnwrapPrivilegedAction.cs -crlf
-/WrapPrivilegedAction.cs -crlf
+++ /dev/null
-//
-// Novell.Directory.Ldap.Security.AuthenticationCallbackHandler.cs
-//
-// Authors:
-// Boris Kirzner <borsk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-using System;\r
-\r
-using javax.security.auth.callback;\r
-using java.io;\r
-\r
-namespace Novell.Directory.Ldap.Security\r
-{\r
- internal class AuthenticationCallbackHandler : CallbackHandler\r
- {\r
-\r
- #region Fields\r
-\r
- private readonly string _username;\r
- private readonly string _password;\r
-\r
- #endregion //Fields\r
-\r
- #region Constructors\r
-\r
- public AuthenticationCallbackHandler(string username, string password)\r
- {\r
- _username = username;\r
- _password = password;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- public void handle(Callback [] callbacks)\r
- {\r
- for (int i = 0; i < callbacks.Length; i++) {\r
- if (callbacks [i] is NameCallback) {\r
- NameCallback nc = (NameCallback) callbacks [i];\r
- nc.setName (_username);\r
- }\r
- else if (callbacks [i] is PasswordCallback) {\r
- PasswordCallback pc = (PasswordCallback) callbacks [i];\r
- pc.setPassword (_password.ToCharArray ());\r
- }\r
- else {\r
- throw new UnsupportedCallbackException (callbacks [i], "Unrecognized Callback");\r
- }\r
- }\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-2005-11-06 Konstantin Triger <kostat@mainsoft.com>
-
- * SecureStream.cs, CreateContextPrivilegedAction.cs, Krb5Helper.cs:
- create GSSCredential only once, cleanup
-
-2005-11-03 Konstantin Triger <kostat@mainsoft.com>
-
- * CreateContextPrivilegedAction.cs: always require mutual auth;
- require integrity by default.
- * Krb5Helper.cs: for wrap/unwrap: always create MessageProp with
- pribState set.
-
-2005-14-08 Boris Kirzner <borisk@mainsoft.com>
- * Krb5Helper.cs: ExchangeTokens does proper final handshaking. Wrap/Unwrap
- perform no action if no integrity and encryption accured.
- * SecureStream.cs: Private convertion methods became internal, used by
- Krb5Helper.
-
-2005-28-07 Boris Kirzner <borisk@mainsoft.com>
- * Novell.Directory.Ldap.Security.jvm/ExchangeTokenPrivilegedAction.cs,
- Novell.Directory.Ldap.Security.jvm/CreateContextPrivilegedAction.cs,
- Novell.Directory.Ldap.Security.jvm/SecureStream.cs,
- Novell.Directory.Ldap.Security.jvm/WrapPrivilegedAction.cs,
- Novell.Directory.Ldap.Security.jvm/Krb5Helper.cs,
- Novell.Directory.Ldap.Security.jvm/UnwrapPrivilegedAction.cs,
- Novell.Directory.Ldap.Security.jvm/AuthenticationCallbackHandler.cs: added
- new classes implementing kerberos authntication support.
+++ /dev/null
-//
-// Novell.Directory.Ldap.Security.CreateContextPrivilegedAction.cs
-//
-// Authors:
-// Boris Kirzner <borsk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-using System;\r
-\r
-using java.security;\r
-using org.ietf.jgss;\r
-\r
-namespace Novell.Directory.Ldap.Security\r
-{\r
- internal class CreateContextPrivilegedAction : PrivilegedAction\r
- {\r
- #region Fields\r
-\r
- private readonly bool _encryption;\r
- private readonly bool _signing;\r
- private readonly bool _delegation;\r
- private readonly string _name;\r
- private readonly string _clientName;\r
- private readonly string _mech;\r
-\r
- #endregion //Fields\r
-\r
- #region Constructors\r
-\r
- public CreateContextPrivilegedAction(string name, string clientName, string mech, bool encryption, bool signing, bool delegation)\r
- {\r
- _name = name;\r
- _clientName = clientName;\r
- _mech = mech;\r
- _encryption = encryption;\r
- _signing = signing;\r
- _delegation = delegation;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- public object run()\r
- {\r
- try { \r
- Oid krb5Oid = new Oid (_mech);\r
- GSSManager manager = GSSManager.getInstance ();\r
- GSSName clientName = \r
- manager.createName(_clientName, GSSName__Finals.NT_USER_NAME);\r
- GSSCredential clientCreds =\r
- manager.createCredential(clientName,\r
- GSSContext__Finals.INDEFINITE_LIFETIME,\r
- krb5Oid,\r
- GSSCredential__Finals.INITIATE_ONLY);\r
-\r
-// try {\r
- GSSName serverName = manager.createName (_name, GSSName__Finals.NT_HOSTBASED_SERVICE, krb5Oid);\r
- GSSContext context = manager.createContext (serverName, krb5Oid, clientCreds, GSSContext__Finals.INDEFINITE_LIFETIME);\r
-\r
- context.requestMutualAuth(true); \r
- context.requestConf (_encryption);\r
- if (!_encryption || _signing)\r
- context.requestInteg (!_encryption || _signing); \r
- context.requestCredDeleg (_delegation);\r
-\r
- return context;\r
-// }\r
-// finally {\r
-// // Calling this throws GSSException: Operation unavailable...\r
-// clientCreds.dispose();\r
-// }\r
- }\r
- catch (GSSException e) {\r
- throw new PrivilegedActionException (e);\r
- }\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-//
-// Novell.Directory.Ldap.Security.ExchangeTokenPrivilegedAction.cs
-//
-// Authors:
-// Boris Kirzner <borsk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-using System;\r
-\r
-using org.ietf.jgss;\r
-using java.security;\r
-\r
-namespace Novell.Directory.Ldap.Security\r
-{\r
- internal class ExchangeTokenPrivilegedAction : PrivilegedAction\r
- {\r
- #region Fields\r
-\r
- private readonly sbyte [] _token;\r
- private readonly GSSContext _context;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public ExchangeTokenPrivilegedAction(GSSContext context, sbyte [] token)\r
- {\r
- _token = token;\r
- _context = context;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- public object run()\r
- {\r
- try {\r
- sbyte [] token = _context.initSecContext (_token, 0, _token.Length);\r
- return token;\r
- }\r
- catch (GSSException e) {\r
- throw new PrivilegedActionException (e);\r
- }\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-// \r
-// Novell.Directory.Ldap.Security.Krb5Helper.cs\r
-//\r
-// Authors:\r
-// Boris Kirzner <borsk@mainsoft.com>\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using vmw.common;\r
-\r
-using java.security;\r
-using javax.security.auth;\r
-using org.ietf.jgss;\r
-\r
-\r
-namespace Novell.Directory.Ldap.Security\r
-{\r
- internal class Krb5Helper : IDisposable\r
- {\r
- enum QOP {\r
- NO_PROTECTION = 1,\r
- INTEGRITY_ONLY_PROTECTION = 2,\r
- PRIVACY_PROTECTION = 4\r
- }\r
-\r
- #region Fields\r
-\r
- internal static readonly sbyte [] EmptyToken = new sbyte [0];\r
- \r
- private readonly bool _encryption;\r
- private readonly bool _signing;\r
- private readonly bool _delegation;\r
-\r
- private readonly GSSContext _context;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public Krb5Helper(string name, string clientName, Subject subject, AuthenticationTypes authenticationTypes, string mech)\r
- {\r
- _encryption = (authenticationTypes & AuthenticationTypes.Sealing) != 0;\r
- _signing = (authenticationTypes & AuthenticationTypes.Signing) != 0;\r
- _delegation = (authenticationTypes & AuthenticationTypes.Delegation) != 0;\r
-\r
- CreateContextPrivilegedAction action = new CreateContextPrivilegedAction (name, clientName, mech,_encryption,_signing,_delegation);\r
- try {\r
- _context = (GSSContext) Subject.doAs (subject,action);\r
- }\r
- catch (PrivilegedActionException e) {\r
- throw new LdapException ("Problem performing token exchange with the server",LdapException.OTHER,"",e.getCause()); \r
- }\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- internal GSSContext Context\r
- {\r
- get { return _context; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public sbyte [] ExchangeTokens(sbyte [] clientToken)\r
- {\r
- if (Context.isEstablished ()) {\r
- if (clientToken == null || clientToken.Length == 0)\r
- return Krb5Helper.EmptyToken;\r
-\r
- //final handshake\r
- byte [] challengeData = (byte []) TypeUtils.ToByteArray (clientToken);\r
- byte [] gssOutToken = Unwrap (challengeData, 0, challengeData.Length, new MessageProp (false));\r
-\r
- QOP myCop = QOP.NO_PROTECTION;\r
-\r
- if (_encryption)\r
- myCop = QOP.PRIVACY_PROTECTION;\r
- else if (_signing || (((QOP)gssOutToken [0] & QOP.INTEGRITY_ONLY_PROTECTION) != 0))\r
- myCop = QOP.INTEGRITY_ONLY_PROTECTION;\r
-\r
- if ((myCop & (QOP)gssOutToken [0]) == 0)\r
- throw new LdapException ("Server does not support the requested security level", 80, "");\r
-\r
- int srvMaxBufSize = SecureStream.NetworkByteOrderToInt (gssOutToken, 1, 3);\r
-\r
- //int rawSendSize = Context.getWrapSizeLimit(0, _encryption, srvMaxBufSize);\r
-\r
- byte [] gssInToken = new byte [4];\r
- gssInToken [0] = (byte) myCop;\r
-\r
- SecureStream.IntToNetworkByteOrder (srvMaxBufSize, gssInToken, 1, 3);\r
-\r
- gssOutToken = Wrap (gssInToken, 0, gssInToken.Length, new MessageProp (true));\r
-\r
- return TypeUtils.ToSByteArray (gssOutToken);\r
- }\r
-\r
- sbyte [] token = Context.initSecContext (clientToken, 0, clientToken.Length);\r
-\r
- if (Context.isEstablished ()) {\r
- \r
- if (Context.getConfState () != _encryption)\r
- throw new LdapException ("Encryption protocol was not established layer between client and server", 80, "");\r
- \r
- if (Context.getCredDelegState () != _delegation) \r
- throw new LdapException ("Credential delegation was not established layer between client and server", 80, "");\r
- \r
- if (_signing && (Context.getIntegState () != _signing))\r
- throw new LdapException ("Signing protocol was not established layer between client and server", 80, "");\r
- \r
- if (token == null) \r
- return EmptyToken;\r
- }\r
- return token;\r
- }\r
-\r
- public byte [] Wrap(byte [] outgoing, int start, int len) \r
- {\r
- return Wrap (outgoing, start, len, new MessageProp(true));\r
- }\r
-\r
- public byte [] Wrap(byte [] outgoing, int start, int len, MessageProp messageProp)\r
- {\r
- if (!Context.isEstablished ())\r
- throw new LdapException ("GSSAPI authentication not completed",LdapException.OTHER,"");\r
-\r
- if (!(Context.getConfState () || Context.getIntegState ())) {\r
- // in the case no encryption and no integrity required - return the original data\r
- byte [] buff = new byte [len];\r
- Array.Copy (outgoing, start, buff, 0, len);\r
- return buff;\r
- }\r
-\r
- sbyte [] result = Context.wrap (TypeUtils.ToSByteArray (outgoing), start, len, messageProp);\r
- return (byte []) TypeUtils.ToByteArray (result);\r
- }\r
-\r
- public byte [] Unwrap(byte [] incoming, int start, int len) \r
- {\r
- return Unwrap (incoming, start, len, new MessageProp(true));\r
- }\r
-\r
- public byte [] Unwrap(byte [] incoming, int start, int len, MessageProp messageProp)\r
- {\r
- if (!Context.isEstablished ())\r
- throw new LdapException ("GSSAPI authentication not completed",LdapException.OTHER,"");\r
-\r
- if (!(Context.getConfState () || Context.getIntegState ())) {\r
- // in the case no encryption and no integrity required - return the original data\r
- byte [] buff = new byte [len];\r
- Array.Copy (incoming, start, buff, 0, len);\r
- return buff;\r
- }\r
-\r
- sbyte [] result = Context.unwrap (TypeUtils.ToSByteArray (incoming), start, len, messageProp);\r
- return (byte []) TypeUtils.ToByteArray (result);\r
- }\r
-\r
- #endregion // Methods\r
-\r
- #region IDisposable Members\r
-\r
- public void Dispose() {\r
- Context.dispose();\r
- }\r
-\r
- #endregion\r
- }\r
-}\r
+++ /dev/null
-// \r
-// Novell.Directory.Ldap.Security.SecureStream.cs\r
-//\r
-// Authors:\r
-// Boris Kirzner <borsk@mainsoft.com>\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.IO;\r
-\r
-namespace Novell.Directory.Ldap.Security\r
-{\r
- internal class SecureStream : Stream\r
- {\r
- #region Fields\r
-\r
- private readonly Stream _stream;\r
- private readonly Krb5Helper _helper;\r
-\r
- private readonly byte [] _lenBuf = new byte [4]; \r
- private byte [] _buffer;\r
- private int _bufferPosition;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public SecureStream(Stream stream, Krb5Helper helper): base () \r
- {\r
- _stream = stream;\r
- _helper = helper;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public override bool CanRead \r
- { \r
- get { return _stream.CanRead; }\r
- }\r
-\r
- public override bool CanSeek \r
- { \r
- get { return _stream.CanSeek; } \r
- }\r
-\r
- public override bool CanWrite \r
- { \r
- get { return _stream.CanWrite; } \r
- }\r
-\r
- public override long Length \r
- { \r
- get { throw new NotSupportedException (); } \r
- }\r
-\r
- public override long Position \r
- { \r
- get { throw new NotSupportedException (); }\r
- set { throw new NotSupportedException (); }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public override void Flush()\r
- {\r
- _stream.Flush ();\r
- }\r
-\r
- public override int Read( byte [] buffer, int offset, int count)\r
- {\r
- if (_buffer == null || _bufferPosition >= _buffer.Length) {\r
- int actual = Fill ();\r
- while (actual == 0)\r
- actual = Fill ();\r
-\r
- if (actual == -1)\r
- return -1; \r
- }\r
-\r
- int available = _buffer.Length - _bufferPosition;\r
- if (count > available) {\r
- Array.Copy (_buffer, _bufferPosition, buffer, offset, available);\r
- _bufferPosition = _buffer.Length;\r
- return available;\r
- }\r
- else {\r
- Array.Copy (_buffer, _bufferPosition, buffer, offset, count);\r
- _bufferPosition += count;\r
- return count;\r
- } \r
- }\r
-\r
- public override void Close() {\r
- _stream.Close();\r
- _helper.Dispose();\r
- }\r
-\r
- private int Fill()\r
- {\r
- int actual = ReadAll (_lenBuf, 4);\r
- \r
- if (actual != 4) \r
- return -1;\r
-\r
- int length = NetworkByteOrderToInt (_lenBuf, 0, 4);\r
-\r
-// if (length > _recvMaxBufSize)\r
-// throw new LdapException(length + " exceeds the negotiated receive buffer size limit: " + _recvMaxBufSize, 80, "");\r
-\r
- byte [] rawBuffer = new byte [length];\r
- actual = ReadAll (rawBuffer, length);\r
-\r
- if (actual != length)\r
- throw new LdapException("Expected to read " + length + " bytes, but get " + actual, 80, "");\r
-\r
- _buffer = _helper.Unwrap (rawBuffer, 0, length);\r
- _bufferPosition = 0;\r
- return _buffer.Length;\r
- }\r
-\r
- private int ReadAll(byte [] buffer, int total)\r
- {\r
- int count = 0;\r
- int pos = 0;\r
- while (total > 0) {\r
- count = _stream.Read (buffer, pos, total);\r
-\r
- if (count == -1)\r
- break;\r
- //return ((pos == 0) ? -1 : pos);\r
-\r
- pos += count;\r
- total -= count;\r
- }\r
- return pos;\r
- }\r
-\r
- public override long Seek(long offset, SeekOrigin loc)\r
- {\r
- return _stream.Seek (offset, loc);\r
- }\r
-\r
- public override void SetLength(long value)\r
- {\r
- _stream.SetLength (value);\r
- }\r
-\r
- public override void Write(byte [] buffer, int offset, int count)\r
- {\r
- // FIXME: use GSSCOntext.getWrapSizeLimit to divide the buffer\r
- // Generate wrapped token \r
- byte [] wrappedToken = _helper.Wrap (buffer, offset, count);\r
- // Write out length\r
- IntToNetworkByteOrder (wrappedToken.Length, _lenBuf, 0, 4);\r
- _stream.Write (_lenBuf, 0, 4);\r
- // Write out wrapped token\r
- _stream.Write (wrappedToken, 0, wrappedToken.Length);\r
- }\r
-\r
- internal static int NetworkByteOrderToInt(byte [] buf, int start, int count) \r
- {\r
- int answer = 0;\r
- for (int i = 0; i < count; i++) {\r
- answer <<= 8;\r
- answer |= ((int)buf [start + i] & 0xff);\r
- }\r
- return answer;\r
- }\r
-\r
- internal static void IntToNetworkByteOrder(int num, byte [] buf, int start, int count) \r
- {\r
- for (int i = count-1; i >= 0; i--) {\r
- buf [start + i] = (byte)(num & 0xff);\r
- num >>= 8;\r
- }\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-//
-// Novell.Directory.Ldap.Security.UnwrapPrivilegedAction.cs
-//
-// Authors:
-// Boris Kirzner <borsk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-using System;\r
-using vmw.common;\r
-\r
-using java.security;\r
-using org.ietf.jgss;\r
-\r
-namespace Novell.Directory.Ldap.Security\r
-{\r
- internal class UnwrapPrivilegedAction : PrivilegedAction\r
- {\r
- #region Fields\r
-\r
- private readonly byte [] _buffer;\r
- private readonly int _start;\r
- private readonly int _len;\r
- private readonly GSSContext _context;\r
- private readonly MessageProp _messageProperties;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public UnwrapPrivilegedAction(GSSContext context, byte [] buffer, int start, int len, MessageProp messageProperties)\r
- {\r
- _buffer = buffer;\r
- _start = start;\r
- _len = len;\r
- _context = context;\r
- _messageProperties = messageProperties;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- public object run()\r
- {\r
- try { \r
- sbyte [] result = _context.unwrap (TypeUtils.ToSByteArray (_buffer), _start, _len, _messageProperties);\r
- return (byte []) TypeUtils.ToByteArray (result);\r
- }\r
- catch (GSSException e) {\r
- throw new PrivilegedActionException (e);\r
- }\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-//
-// Novell.Directory.Ldap.Security.WrapPrivilegedAction.cs
-//
-// Authors:
-// Boris Kirzner <borsk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-using System;\r
-using vmw.common;\r
-\r
-using java.security;\r
-using org.ietf.jgss;\r
-\r
-namespace Novell.Directory.Ldap.Security\r
-{\r
- internal class WrapPrivilegedAction : PrivilegedAction\r
- {\r
- #region Fields\r
-\r
- private readonly byte [] _buffer;\r
- private readonly int _start;\r
- private readonly int _len;\r
- private readonly GSSContext _context;\r
- private readonly MessageProp _messageProperties;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public WrapPrivilegedAction(GSSContext context, byte [] buffer, int start, int len, MessageProp messageProperties)\r
- {\r
- _buffer = buffer;\r
- _start = start;\r
- _len = len;\r
- _context = context;\r
- _messageProperties = messageProperties;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- public object run()\r
- {\r
- try {\r
- sbyte [] result = _context.wrap (TypeUtils.ToSByteArray (_buffer), _start, _len, _messageProperties);\r
- return (byte []) TypeUtils.ToByteArray (result);\r
- }\r
- catch (GSSException e) {\r
- throw new PrivilegedActionException (e);\r
- }\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
namespace Novell.Directory.Ldap.Utilclass
{
-#if TARGET_JVM
- // This dummy class workarounds a MS CSC bug by using SupportClass before
- // using its inner class (SupportClass.AbstractSetSupport)
- class RespExtensionSetDummy : SupportClass {}
-#endif
/// <summary> This class extends the AbstractSet and Implements the Set
/// so that it can be used to maintain a list of currently
[assembly: AssemblyCopyright(" (C) 2003 Novell, Inc")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-#if !TARGET_JVM
[assembly: CLSCompliant(true)]
-#endif
//
// Version information for an assembly consists of the following four values:
[assembly: AssemblyVersion (Consts.FxVersion)]
-#if (!TARGET_JVM)
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../mono.pub")]
-#endif
using Novell.Directory.Ldap.Asn1;
using Novell.Directory.Ldap.Rfc2251;
using Novell.Directory.Ldap.Utilclass;
-#if !TARGET_JVM
using Mono.Security.Protocol.Tls;
using Mono.Security.X509.Extensions;
-#endif
using Syscert = System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using System.Net;
using System.Collections;
using System.IO;
using System.Text;
-#if !TARGET_JVM
using Mono.Security.X509;
-#endif
using System.Text.RegularExpressions;
using System.Globalization;
using System.Reflection;
{
if ((in_Renamed == null) || (out_Renamed == null))
{
-#if !TARGET_JVM
if(Ssl)
{
this.host = host;
out_Renamed = (System.IO.Stream) sslstream;*/
}
else{
-#endif
socket = new System.Net.Sockets.TcpClient(host, port);
in_Renamed = (System.IO.Stream) socket.GetStream();
out_Renamed = (System.IO.Stream) socket.GetStream();
-#if !TARGET_JVM
}
-#endif
}
else
{
if (socket != null || sock != null)
{
-#if !TARGET_JVM
// Just before closing the sockets, abort the reader thread
if ((reader != null) && (reason != "reader: thread stopping"))
reader.Abort();
-#endif
// Close the socket
try
{
/* package */
internal void startTLS()
{
-#if !TARGET_JVM
try
{
waitForReader(null);
throw new LdapException("The host is unknown", LdapException.CONNECT_ERROR, null, uhe);
}
return ;
-#endif
}
/*
// before closing sockets, from shutdown
return;
}
-#if TARGET_JVM
- catch (ObjectDisposedException)
- {
- // we do not support Thread.Abort under java
- // so we close the stream and the working thread
- // catches ObjectDisposedException exception
- return;
- }
-#endif
catch (System.IO.IOException ioe)
{
using Novell.Directory.Ldap.Asn1;
using Novell.Directory.Ldap.Rfc2251;
using Novell.Directory.Ldap.Utilclass;
-#if !TARGET_JVM
using Mono.Security.Protocol.Tls;
-#else
-using org.ietf.jgss;
-using javax.security.auth;
-using javax.security.auth.login;
-using java.security;
-
-using Novell.Directory.Ldap.Security;
-using System.Collections.Specialized;
-using System.Configuration;
-#endif
using System.Security.Cryptography.X509Certificates;
namespace Novell.Directory.Ldap
public virtual void Bind(System.String dn, System.String passwd, AuthenticationTypes authenticationTypes)
{
-#if TARGET_JVM
- if (authenticationTypes != AuthenticationTypes.None &&
- authenticationTypes != AuthenticationTypes.ServerBind &&
- authenticationTypes != AuthenticationTypes.Anonymous)
- BindSecure(dn, passwd, authenticationTypes);
- else
-#endif
Bind(Ldap_V3, dn, passwd, defSearchCons);
return ;
}
LdapMessage msg;
-#if TARGET_JVM
- if (mech != null)
- msg = new LdapBindRequest(version, "", mech, passwd, cons.getControls());
- else
-#endif
msg = new LdapBindRequest(version, dn, passwd, cons.getControls());
msgId = msg.MessageID;
}
}
-#if TARGET_JVM
- // stopping reader to enable stream replace after secure binding is complete, see Connection.ReplaceStreams()
- if (mech != null)
- {
- if (conn.BindSemIdClear) {
- // need to acquire a semaphore only if bindSemId is clear
- // because if we receive SASL_BIND_IN_PROGRESS the semaphore is not
- // released when the response is queued
- conn.acquireWriteSemaphore(msgId);
- conn.BindSemId = msgId;
- }
- conn.stopReaderOnReply(msgId);
- }
- else
-#endif
// The semaphore is released when the bind response is queued.
conn.acquireWriteSemaphore(msgId);
return SendRequestToServer(msg, cons.TimeLimit, queue, bindProps);
}
-#if TARGET_JVM
- private void BindSecure(System.String username, System.String password, AuthenticationTypes authenticationTypes)
- {
- if ((authenticationTypes & AuthenticationTypes.Secure) != 0) {
- LoginContext loginContext = null;
- try {
- if (username != null && password != null) {
- AuthenticationCallbackHandler callbackHandler = new AuthenticationCallbackHandler (username,password);
- loginContext = new LoginContext (SecurityAppName, callbackHandler);
- }
- else
- loginContext = new LoginContext (SecurityAppName);
-
- loginContext.login ();
- }
- catch (Exception e) {
- throw new LdapException ("Failed to create login security context", 80, "", e);
- }
-
- Krb5Helper krb5Helper = null;
- try {
- krb5Helper = new Krb5Helper ("ldap@" + conn.Host, username, loginContext.getSubject (), authenticationTypes, SecurityMech);
- }
- finally {
- loginContext.logout();
- }
- sbyte [] token = krb5Helper.ExchangeTokens (Krb5Helper.EmptyToken);
-
- for (;;) {
- LdapResponseQueue queue = Bind(LdapConnection.Ldap_V3, username, token, null, null, AuthenticationMech);
- LdapResponse res = (LdapResponse) queue.getResponse ();
- if (res.ResultCode != LdapException.SASL_BIND_IN_PROGRESS &&
- res.ResultCode != LdapException.SUCCESS) {
- krb5Helper.Dispose();
- throw new LdapException(ExceptionMessages.CONNECTION_ERROR, res.ResultCode, res.ErrorMessage);
- }
- Asn1OctetString serverSaslCreds = ((RfcBindResponse)res.Asn1Object.Response).ServerSaslCreds;
- token = serverSaslCreds != null ? serverSaslCreds.byteValue () : null;
-
- token = krb5Helper.ExchangeTokens(token == null ? Krb5Helper.EmptyToken : token);
-
- if (res.ResultCode != LdapException.SASL_BIND_IN_PROGRESS)
- break;
-
- conn.ReplaceStreams (conn.InputStream,conn.OutputStream);
- }
-
- System.IO.Stream inStream = conn.InputStream;
- System.IO.Stream newIn = new SecureStream (inStream, krb5Helper);
- System.IO.Stream outStream = conn.OutputStream;
- System.IO.Stream newOut = new SecureStream (outStream, krb5Helper);
- conn.ReplaceStreams (newIn,newOut);
- }
- }
-
- static string SecurityMech
- {
- get {
- string securityMech = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- securityMech = config ["securitymech"];
-
- if (securityMech == null)
- throw new ArgumentException("Security mechanism id not found in application settings");
-
- return securityMech;
- }
- }
-
- static string SecurityAppName
- {
- get {
- string securityAppName = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- securityAppName = config ["securityappname"];
-
- if (securityAppName == null)
- throw new ArgumentException("Application section name not found in application settings");
-
- return securityAppName;
- }
- }
-
- static string AuthenticationMech
- {
- get {
- string authenticationMech = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- authenticationMech = config ["authenticationmech"];
-
- if (authenticationMech == null)
- throw new ArgumentException("Authentication mechanism not found in application settings");
-
- return authenticationMech;
- }
- }
-#endif
//*************************************************************************
// compare methods
[CLSCompliantAttribute(false)]
public static sbyte[] ToSByteArray(byte[] byteArray)
{
-#if TARGET_JVM
- return vmw.common.TypeUtils.ToSByteArray(byteArray);
-#else
sbyte[] sbyteArray = new sbyte[byteArray.Length];
for(int index=0; index < byteArray.Length; index++)
sbyteArray[index] = (sbyte) byteArray[index];
return sbyteArray;
-#endif
}
/*******************************/
/// <summary>
[CLSCompliantAttribute(false)]
public static byte[] ToByteArray(sbyte[] sbyteArray)
{
-#if TARGET_JVM
- return (byte[])vmw.common.TypeUtils.ToByteArray(sbyteArray);;
-#else
byte[] byteArray = new byte[sbyteArray.Length];
for(int index=0; index < sbyteArray.Length; index++)
byteArray[index] = (byte) sbyteArray[index];
return byteArray;
-#endif
}
/// <summary>
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{7BA54046-FD05-4209-9508-D6367CDAFBC0}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>Novell.Directory.Ldap</RootNamespace>\r
- <AssemblyName>Novell.Directory.Ldap</AssemblyName>\r
- <JDKName>1.4.2</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <GHProjectKind>framework</GHProjectKind>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="J2SE.Helpers">\r
- <HintPath>..\lib\J2SE.Helpers.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Boolean.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Choice.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Decoder.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Encoder.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Enumerated.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Identifier.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Integer.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Length.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Null.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Numeric.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Object.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1OctetString.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Sequence.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1SequenceOf.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Set.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1SetOf.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Structured.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\Asn1Tagged.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\LBERDecoder.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Asn1\LBEREncoder.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Controls\LdapEntryChangeControl.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Controls\LdapPersistSearchControl.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Controls\LdapSortControl.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Controls\LdapSortKey.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Controls\LdapSortResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Controls\LdapVirtualListControl.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Controls\LdapVirtualListResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\BaseEventArgs.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\DirectoryEventArgs.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\DirectoryExceptionEventArgs.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\LdapEventArgs.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\LdapEventConstants.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\LdapEventSource.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir\EdirEventArgs.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir\EdirEventConstants.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir\EdirEventIntermediateResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir\EdirEventSource.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir\EdirEventSpecifier.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir\MonitorEventRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir\MonitorEventResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\BaseEdirEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\BinderyObjectEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\ChangeAddressEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\ConnectionStateEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\DebugEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\DebugParameter.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\DSETimeStamp.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\EntryEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\GeneralDSEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\ModuleStateEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\NetworkAddressEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\ReferralAddress.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\SecurityEquivalenceEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events.Edir.EventData\ValueEventData.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\PSearchEventSource.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\SearchReferralEventArgs.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Events\SearchResultEventArgs.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\AbortPartitionOperationRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\AddReplicaRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\ChangeReplicaTypeRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\GetBindDNRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\GetBindDNResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\GetEffectivePrivilegesRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\GetEffectivePrivilegesResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\GetReplicaInfoRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\GetReplicaInfoResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\GetReplicationFilterRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\GetReplicationFilterResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\ListReplicasRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\ListReplicasResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\MergePartitionsRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\NamingContextConstants.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\PartitionEntryCountRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\PartitionEntryCountResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\PartitionSyncRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\ReceiveAllUpdatesRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\RefreshLdapServerRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\RemoveOrphanPartitionRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\RemoveReplicaRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\ReplicationConstants.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\SchemaSyncRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\SendAllUpdatesRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\SetReplicationFilterRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\SplitOrphanPartitionRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\SplitPartitionRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\TriggerBackgroundProcessRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\BackupRestoreConstants.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\LdapBackupRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\LdapBackupResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Extensions\LdapRestoreRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAbandonRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAddRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAddResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAssertionValue.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAttributeDescription.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAttributeDescriptionList.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAttributeList.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAttributeTypeAndValues.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAttributeValue.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAttributeValueAssertion.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcAuthenticationChoice.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcBindRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcBindResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcCompareRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcCompareResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcControl.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcControls.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcDelRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcDelResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcExtendedRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcExtendedResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcFilter.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcIntermediateResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcLdapDN.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcLdapMessage.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcLdapOID.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcLdapResult.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcLdapString.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcLdapSuperDN.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcLdapURL.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcMatchingRuleAssertion.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcMatchingRuleId.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcMessageID.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcModifyDNRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcModifyDNResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcModifyRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcModifyResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcReferral.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcRelativeLdapDN.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcSaslCredentials.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcSearchRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcSearchResultDone.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcSearchResultEntry.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcSearchResultReference.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcSubstringFilter.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Rfc2251\RfcUnbindRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Security.jvm\AuthenticationCallbackHandler.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Security.jvm\CreateContextPrivilegedAction.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Security.jvm\ExchangeTokenPrivilegedAction.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Security.jvm\Krb5Helper.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Security.jvm\SecureStream.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Security.jvm\UnwrapPrivilegedAction.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Security.jvm\WrapPrivilegedAction.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\ArrayEnumeration.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\AttributeQualifier.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\Base64.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\BindProperties.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\CharacterTypes.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\DN.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\EnumeratedIterator.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\ExceptionMessages.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\ExtResponseFactory.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\IntermediateResponseFactory.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\RDN.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\ReferralInfo.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\ResourcesHandler.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\RespControlVector.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\RespExtensionSet.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\ResultCodeMessages.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\SchemaParser.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\SchemaTokenCreator.cs" />\r
- <Compile Include="Novell.Directory.Ldap.Utilclass\TokenTypes.cs" />\r
- <Compile Include="Novell.Directory.Ldap\AssemblyInfo.cs" />\r
- <Compile Include="Novell.Directory.Ldap\AuthenticationTypes.cs" />\r
- <Compile Include="Novell.Directory.Ldap\Connection.cs" />\r
- <Compile Include="Novell.Directory.Ldap\InterThreadException.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapAbandonRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapAddRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapAttribute.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapAttributeSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapAttributeSet.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapAuthHandler.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapAuthProvider.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapBindHandler.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapBindRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapCompareAttrNames.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapCompareRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapConnection.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapConstraints.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapControl.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapDeleteRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapDITContentRuleSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapDITStructureRuleSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapDN.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapDSConstants.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapEntry.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapException.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapExtendedOperation.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapExtendedRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapExtendedResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapIntermediateResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapLocalException.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapMatchingRuleSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapMatchingRuleUseSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapMessage.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapMessageQueue.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapModification.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapModifyDNRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapModifyRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapNameFormSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapObjectClassSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapReferralException.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapReferralHandler.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapResponse.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapResponseQueue.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSchemaElement.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSearchConstraints.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSearchQueue.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSearchRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSearchResult.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSearchResultReference.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSearchResults.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapSyntaxSchema.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapUnbindRequest.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapUnsolicitedNotificationListener.cs" />\r
- <Compile Include="Novell.Directory.Ldap\LdapUrl.cs" />\r
- <Compile Include="Novell.Directory.Ldap\Message.cs" />\r
- <Compile Include="Novell.Directory.Ldap\MessageAgent.cs" />\r
- <Compile Include="Novell.Directory.Ldap\MessageVector.cs" />\r
- <Compile Include="Novell.Directory.Ldap\SupportClass.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="Novell.Directory.Ldap.Utilclass\ExceptionMessages.resx">\r
- <DependentUpon>ExceptionMessages.cs</DependentUpon>\r
- <LogicalName>ExceptionMessages.resources</LogicalName>\r
- <SubType>Designer</SubType>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="Novell.Directory.Ldap.Utilclass\ResultCodeMessages.resx">\r
- <DependentUpon>ResultCodeMessages.cs</DependentUpon>\r
- <LogicalName>ResultCodeMessages.resources</LogicalName>\r
- <SubType>Designer</SubType>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Properties\Consts.cs.in</Link>\r
- </Compile>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.4.2" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-j2se-helpers="..\lib\J2SE.Helpers.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>\r
+++ /dev/null
-#include Novell.Directory.Ldap.dll.sources\r
-Novell.Directory.Ldap.Rfc2251/RfcLdapURL.cs\r
-Novell.Directory.Ldap.Security.jvm/*.cs\r
EXTRA_DISTFILES = \
src/ComponentModel/Strings.resx
-VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid xammac mobile_static, $(PROFILE))
+VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid xammac mobile mobile_static, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.ComponentModel.Composition.dll
NO_INSTALL = yes
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
# This is a .NET 3.5+ assembly
-VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid xammac mobile_static, $(PROFILE))
+VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid xammac mobile mobile_static, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.ComponentModel.DataAnnotations.dll
NO_INSTALL = yes
--- /dev/null
+#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM //TARGET_JVM does not support signing
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="System"/>
- <Reference Include="System.Xml"/>
- <Reference Include="System.Security">
- <HintPath>..\lib\net_2_0\System.Security.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
internal class ElementMap
{
-#if TARGET_JVM
- const string elementMapsKey = "ElementMap_elementMaps";
- static Hashtable elementMaps
- {
- get
- {
- Hashtable tbl = (Hashtable) AppDomain.CurrentDomain.GetData (elementMapsKey);
- if (tbl == null) {
- lock (typeof (ElementMap)) {
- tbl = (Hashtable) AppDomain.CurrentDomain.GetData (elementMapsKey);
- if (tbl == null) {
- tbl = Hashtable.Synchronized (new Hashtable ());
- AppDomain.CurrentDomain.SetData (elementMapsKey, tbl);
- }
- }
- }
- return tbl;
- }
- }
-#else
static readonly Hashtable elementMaps = Hashtable.Synchronized (new Hashtable ());
-#endif
readonly ConfigurationPropertyCollection properties;
readonly ConfigurationCollectionAttribute collectionAttribute;
return ConfigurationFactory.Create (typeof(ExeConfigurationHost), map, userLevel);
}
-#if TARGET_JVM
- [MonoLimitation ("Supported only when the userLevel parameter is set to ConfigurationUserLevel.None. Other values are not supported because Environment.GetFolderPath method is not implemented.")]
-#endif
public static Configuration OpenExeConfiguration (ConfigurationUserLevel userLevel)
{
return OpenExeConfigurationInternal (userLevel, Assembly.GetEntryAssembly () ?? Assembly.GetCallingAssembly (), null);
using System.Collections;
using System.Xml;
using System.IO;
-#if !TARGET_JVM
using System.Security.Cryptography.Xml;
-#endif
using System.Configuration.Internal;
namespace System.Configuration
{
throw new NotImplementedException ();
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_machine_config ();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_app_config ();
-#endif
public virtual Stream OpenStreamForRead (string streamName)
{
if (String.CompareOrdinal (streamName, System.Runtime.InteropServices.RuntimeEnvironment.SystemConfigurationFile) == 0) {
-#if TARGET_JVM
- return (Stream) vmw.common.IOUtils.getStreamForGHConfigs (streamName);
-#else
string bundle = get_bundled_machine_config ();
if (bundle != null)
return new MemoryStream (System.Text.Encoding.UTF8.GetBytes (bundle));
-#endif
}
if (String.CompareOrdinal (streamName, AppDomain.CurrentDomain.SetupInformation.ConfigurationFile) == 0) {
-#if TARGET_JVM
- throw new NotImplementedException();
-#else
string bundle = get_bundled_app_config ();
if (bundle != null)
return new MemoryStream (System.Text.Encoding.UTF8.GetBytes (bundle));
-#endif
}
if (!File.Exists (streamName))
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{7262AA8D-840C-4123-B99E-180F64F13A76}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Configuration</RootNamespace>\r
- <AssemblyName>System.Configuration</AssemblyName>\r
- <JDKName>1.4.2</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <GHProjectKind>framework</GHProjectKind>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <OldToolsVersion>2.0</OldToolsVersion>\r
- <jarserver>ip2</jarserver>\r
- <PublishUrl>publish\</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Disk</InstallFrom>\r
- <UpdateEnabled>false</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>false</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <NoStdLib>false</NoStdLib>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral">\r
- <HintPath>..\lib\J2SE.Helpers.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System" />\r
- <Reference Include="System.XML" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Consts.cs.in</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="System.Configuration.Internal\DelegatingConfigHost.cs" />\r
- <Compile Include="System.Configuration.Internal\IConfigErrorInfo.cs" />\r
- <Compile Include="System.Configuration.Internal\IConfigSystem.cs" />\r
- <Compile Include="System.Configuration.Internal\IConfigurationManagerHelper.cs" />\r
- <Compile Include="System.Configuration.Internal\IConfigurationManagerInternal.cs" />\r
- <Compile Include="System.Configuration.Internal\IInternalConfigClientHost.cs" />\r
- <Compile Include="System.Configuration.Internal\IInternalConfigConfigurationFactory.cs" />\r
- <Compile Include="System.Configuration.Internal\IInternalConfigHost.cs" />\r
- <Compile Include="System.Configuration.Internal\IInternalConfigRecord.cs" />\r
- <Compile Include="System.Configuration.Internal\IInternalConfigRoot.cs" />\r
- <Compile Include="System.Configuration.Internal\IInternalConfigSettingsFactory.cs" />\r
- <Compile Include="System.Configuration.Internal\IInternalConfigSystem.cs" />\r
- <Compile Include="System.Configuration.Internal\InternalConfigEventArgs.cs" />\r
- <Compile Include="System.Configuration.Internal\InternalConfigEventHandler.cs" />\r
- <Compile Include="System.Configuration.Internal\StreamChangeCallback.cs" />\r
- <Compile Include="System.Configuration.Provider\ProviderBase.cs" />\r
- <Compile Include="System.Configuration.Provider\ProviderCollection.cs" />\r
- <Compile Include="System.Configuration.Provider\ProviderException.cs" />\r
- <Compile Include="System.Configuration\AppSettingsSection.cs" />\r
- <Compile Include="System.Configuration\CallbackValidator.cs" />\r
- <Compile Include="System.Configuration\CallbackValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\ClientConfigurationSystem.cs" />\r
- <Compile Include="System.Configuration\CommaDelimitedStringCollection.cs" />\r
- <Compile Include="System.Configuration\CommaDelimitedStringCollectionConverter.cs" />\r
- <Compile Include="System.Configuration\ConfigHelper.cs" />\r
- <Compile Include="System.Configuration\ConfigInfo.cs" />\r
- <Compile Include="System.Configuration\Configuration.cs" />\r
- <Compile Include="System.Configuration\ConfigurationAllowDefinition.cs" />\r
- <Compile Include="System.Configuration\ConfigurationAllowExeDefinition.cs" />\r
- <Compile Include="System.Configuration\ConfigurationCollectionAttribute.cs" />\r
- <Compile Include="System.Configuration\ConfigurationConverterBase.cs" />\r
- <Compile Include="System.Configuration\ConfigurationElement.cs" />\r
- <Compile Include="System.Configuration\ConfigurationElementCollection.cs" />\r
- <Compile Include="System.Configuration\ConfigurationElementCollectionType.cs" />\r
- <Compile Include="System.Configuration\ConfigurationElementProperty.cs" />\r
- <Compile Include="System.Configuration\ConfigurationErrorsException.cs" />\r
- <Compile Include="System.Configuration\ConfigurationFileMap.cs" />\r
- <Compile Include="System.Configuration\ConfigurationLocation.cs" />\r
- <Compile Include="System.Configuration\ConfigurationLocationCollection.cs" />\r
- <Compile Include="System.Configuration\ConfigurationLockCollection.cs" />\r
- <Compile Include="System.Configuration\ConfigurationManager.cs" />\r
- <Compile Include="System.Configuration\ConfigurationPermission.cs" />\r
- <Compile Include="System.Configuration\ConfigurationPermissionAttribute.cs" />\r
- <Compile Include="System.Configuration\ConfigurationProperty.cs" />\r
- <Compile Include="System.Configuration\ConfigurationPropertyAttribute.cs" />\r
- <Compile Include="System.Configuration\ConfigurationPropertyCollection.cs" />\r
- <Compile Include="System.Configuration\ConfigurationPropertyOptions.cs" />\r
- <Compile Include="System.Configuration\ConfigurationRemoveElement.cs" />\r
- <Compile Include="System.Configuration\ConfigurationSaveMode.cs" />\r
- <Compile Include="System.Configuration\ConfigurationSection.cs" />\r
- <Compile Include="System.Configuration\ConfigurationSectionCollection.cs" />\r
- <Compile Include="System.Configuration\ConfigurationSectionGroup.cs" />\r
- <Compile Include="System.Configuration\ConfigurationSectionGroupCollection.cs" />\r
- <Compile Include="System.Configuration\ConfigurationUserLevel.cs" />\r
- <Compile Include="System.Configuration\ConfigurationValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\ConfigurationValidatorBase.cs" />\r
- <Compile Include="System.Configuration\ConnectionStringSettings.cs" />\r
- <Compile Include="System.Configuration\ConnectionStringSettingsCollection.cs" />\r
- <Compile Include="System.Configuration\ConnectionStringsSection.cs" />\r
- <Compile Include="System.Configuration\ContextInformation.cs" />\r
- <Compile Include="System.Configuration\DefaultSection.cs" />\r
- <Compile Include="System.Configuration\DefaultValidator.cs" />\r
- <Compile Include="System.Configuration\DpapiProtectedConfigurationProvider.cs" />\r
- <Compile Include="System.Configuration\ElementInformation.cs" />\r
- <Compile Include="System.Configuration\ExeConfigurationFileMap.cs" />\r
- <Compile Include="System.Configuration\ExeContext.cs" />\r
- <Compile Include="System.Configuration\GenericEnumConverter.cs" />\r
- <Compile Include="System.Configuration\IConfigXmlNode.cs" />\r
- <Compile Include="System.Configuration\IgnoreSection.cs" />\r
- <Compile Include="System.Configuration\InfiniteIntConverter.cs" />\r
- <Compile Include="System.Configuration\InfiniteTimeSpanConverter.cs" />\r
- <Compile Include="System.Configuration\IntegerValidator.cs" />\r
- <Compile Include="System.Configuration\IntegerValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\InternalConfigurationFactory.cs" />\r
- <Compile Include="System.Configuration\InternalConfigurationHost.cs" />\r
- <Compile Include="System.Configuration\InternalConfigurationRoot.cs" />\r
- <Compile Include="System.Configuration\KeyValueConfigurationCollection.cs" />\r
- <Compile Include="System.Configuration\KeyValueConfigurationElement.cs" />\r
- <Compile Include="System.Configuration\KeyValueInternalCollection.cs" />\r
- <Compile Include="System.Configuration\LongValidator.cs" />\r
- <Compile Include="System.Configuration\LongValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\NameValueConfigurationCollection.cs" />\r
- <Compile Include="System.Configuration\NameValueConfigurationElement.cs" />\r
- <Compile Include="System.Configuration\NonEmptyStringFlags.cs" />\r
- <Compile Include="System.Configuration\PathLevel.cs" />\r
- <Compile Include="System.Configuration\PositiveTimeSpanValidator.cs" />\r
- <Compile Include="System.Configuration\PositiveTimeSpanValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\PropertyInformation.cs" />\r
- <Compile Include="System.Configuration\PropertyInformationCollection.cs" />\r
- <Compile Include="System.Configuration\PropertyValueOrigin.cs" />\r
- <Compile Include="System.Configuration\ProtectedConfiguration.cs" />\r
- <Compile Include="System.Configuration\ProtectedConfigurationProvider.cs" />\r
- <Compile Include="System.Configuration\ProtectedConfigurationProviderCollection.cs" />\r
- <Compile Include="System.Configuration\ProtectedConfigurationSection.cs" />\r
- <Compile Include="System.Configuration\ProtectedProviderSettings.cs" />\r
- <Compile Include="System.Configuration\ProviderSettings.cs" />\r
- <Compile Include="System.Configuration\ProviderSettingsCollection.cs" />\r
- <Compile Include="System.Configuration\RegexStringValidator.cs" />\r
- <Compile Include="System.Configuration\RegexStringValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\SectionGroupInfo.cs" />\r
- <Compile Include="System.Configuration\SectionInfo.cs" />\r
- <Compile Include="System.Configuration\SectionInformation.cs" />\r
- <Compile Include="System.Configuration\StringValidator.cs" />\r
- <Compile Include="System.Configuration\StringValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\SubclassTypeValidator.cs" />\r
- <Compile Include="System.Configuration\SubclassTypeValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\TimeSpanMinutesConverter.cs" />\r
- <Compile Include="System.Configuration\TimeSpanMinutesOrInfiniteConverter.cs" />\r
- <Compile Include="System.Configuration\TimeSpanPropertyFlags.cs" />\r
- <Compile Include="System.Configuration\TimeSpanSecondsConverter.cs" />\r
- <Compile Include="System.Configuration\TimeSpanSecondsOrInfiniteConverter.cs" />\r
- <Compile Include="System.Configuration\TimeSpanSerializedFormat.cs" />\r
- <Compile Include="System.Configuration\TimeSpanValidator.cs" />\r
- <Compile Include="System.Configuration\TimeSpanValidatorAttribute.cs" />\r
- <Compile Include="System.Configuration\TypeNameConverter.cs" />\r
- <Compile Include="System.Configuration\ValidatorCallback.cs" />\r
- <Compile Include="System.Configuration\WhiteSpaceTrimStringConverter.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-j2se-helpers="..\lib\J2SE.Helpers.jar" REFS-JarPath-system="..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-system-xml="..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-RefInfo-rt="repository:jre:sun:1.4.2" REFS-JarPath-rt="" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\Debug_Java20\</OutputPath>
- <DefineConstants>TRACE;DEBUG;JAVA;NET_2_0;TARGET_JVM</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>False</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.5.0_05</JDKName>
- <TargetPlatform>0</TargetPlatform>
- </PropertyGroup>
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{A9AEBFBA-4D4C-495A-8851-C70E5132DC10}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>System.Configuration.Test</RootNamespace>
- <AssemblyName>System.Configuration.Test20</AssemblyName>
- <JDKName>1.5.0_05</JDKName>
- <GHProjectType>1</GHProjectType>
- <Version>2.0</Version>
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Java\</OutputPath>
- <DefineConstants>TRACE;DEBUG;JAVA;TARGET_JVM</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Java\</OutputPath>
- <DefineConstants>TRACE;JAVA;NET_2_0;TARGET_JVM</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.framework.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="rt, Version=0.0.0.0, Culture=neutral">
- <Private>False</Private>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Configuration">
- <Private>False</Private>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="System.Configuration\AppSettingsSectionTest.cs" />
- <Compile Include="System.Configuration\CallbackValidatorTest.cs" />
- <Compile Include="System.Configuration\CommaDelimitedStringCollectionConverterTest.cs" />
- <Compile Include="System.Configuration\CommaDelimitedStringCollectionTest.cs" />
- <Compile Include="System.Configuration\ConfigurationElementTest.cs" />
- <Compile Include="System.Configuration\ConfigurationLockCollectionTest.cs" />
- <Compile Include="System.Configuration\ConfigurationManagerTest.cs" />
- <Compile Include="System.Configuration\ConfigurationPermissionTest.cs" />
- <Compile Include="System.Configuration\ConfigurationPropertyTest.cs" />
- <Compile Include="System.Configuration\ConnectionStringSettingsTest.cs" />
- <Compile Include="System.Configuration\DefaultValidatorTest.cs" />
- <Compile Include="System.Configuration\ExeConfigurationFileMapTest.cs" />
- <Compile Include="System.Configuration\GenericEnumConverterTest.cs" />
- <Compile Include="System.Configuration\InfiniteIntConverterTest.cs" />
- <Compile Include="System.Configuration\InfiniteTimeSpanConverterTest.cs" />
- <Compile Include="System.Configuration\IntegerValidatorTest.cs" />
- <Compile Include="System.Configuration\KeyValueConfigurationCollectionTest.cs" />
- <Compile Include="System.Configuration\KeyValueConfigurationElementTest.cs" />
- <Compile Include="System.Configuration\LongValidatorTest.cs" />
- <Compile Include="System.Configuration\PositiveTimeSpanValidatorTest.cs" />
- <Compile Include="System.Configuration\RegexStringValidatorTest.cs" />
- <Compile Include="System.Configuration\StringValidatorTest.cs" />
- <Compile Include="System.Configuration\SubclassTypeValidatorTest.cs" />
- <Compile Include="System.Configuration\TimeSpanMinutesConverterTest.cs" />
- <Compile Include="System.Configuration\TimeSpanMinutesOrInfiniteConverterTest.cs" />
- <Compile Include="System.Configuration\TimeSpanSecondsConverterTest.cs" />
- <Compile Include="System.Configuration\TimeSpanSecondsOrInfiniteConverterTest.cs" />
- <Compile Include="System.Configuration\TimeSpanValidatorTest.cs" />
- <Compile Include="System.Configuration\TypeNameConverterTest.cs" />
- <Compile Include="System.Configuration\WhiteSpaceTrimStringConverterTest.cs" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Properties\" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <ProjectExtensions>
- <VisualStudio>
- <UserProperties REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Data.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-nunit-core="..\..\..\..\nunit20\core\bin\Debug_Java20\nunit.core.jar" REFS-JarPath-nunit-framework="..\..\..\..\nunit20\core\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-system-configuration="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Configuration.jar" />
- </VisualStudio>
- </ProjectExtensions>
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Configuration.Test20", "System.Configuration.Test20.csproj", "{A9AEBFBA-4D4C-495A-8851-C70E5132DC10}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {A9AEBFBA-4D4C-495A-8851-C70E5132DC10}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {A9AEBFBA-4D4C-495A-8851-C70E5132DC10}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {A9AEBFBA-4D4C-495A-8851-C70E5132DC10}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {A9AEBFBA-4D4C-495A-8851-C70E5132DC10}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {A9AEBFBA-4D4C-495A-8851-C70E5132DC10}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {A9AEBFBA-4D4C-495A-8851-C70E5132DC10}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
{
SysConfig cfg = ConfigurationManager.OpenMachineConfiguration ();
Assert.IsTrue (cfg.Sections.Count > 0, "#1");
-#if !TARGET_JVM
ConfigurationSection s = cfg.SectionGroups ["system.net"].Sections ["connectionManagement"];
Assert.IsNotNull (s, "#2");
Assert.IsTrue (s is ConnectionManagementSection, "#3");
-#endif
}
[Test]
Assert.IsNull (p3, "A1");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Intersect_wrongtype ()
IPermission p3 = p1.Intersect (new StrongNameIdentityPermission (PermissionState.Unrestricted));
}
-#endif
[Test]
public void Union ()
Assert.IsTrue (((ConfigurationPermission)p3).IsUnrestricted(), "A2");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Union_wrongtypee ()
IPermission p3 = p1.Union (new StrongNameIdentityPermission (PermissionState.Unrestricted));
}
-#endif
[Test]
public void Subset ()
Assert.IsTrue (p2.IsSubsetOf (null), "A6");
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Subset_wrongtype ()
Assert.IsFalse (p1.IsSubsetOf (new StrongNameIdentityPermission (PermissionState.Unrestricted)));
}
-#endif
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void ToXml ()
{
ConfigurationPermission p = new ConfigurationPermission (PermissionState.Unrestricted);
public static string ThisConfigFileName {
get {
-#if TARGET_JVM
- return "System.Configuration.Test20.jar.config";
-#else
var asm = Assembly.GetCallingAssembly ();
var exe = Path.GetFileName (asm.Location);
return exe + ".config";
-#endif
}
}
}
LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720
endif
-ifeq (monodroid, $(PROFILE))
-LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT,ANDROID
-endif
+MOBILE_DYNAMIC := $(filter monodroid xammac mobile, $(PROFILE))
+MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime, $(PROFILE))
-ifeq (xammac, $(PROFILE))
+ifdef MOBILE_DYNAMIC
LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR,FEATURE_REFEMIT
endif
system_core_plain_libdir = $(the_libdir_base)plaincore
-ifeq (monotouch, $(subst _runtime,,$(PROFILE)))
+ifdef MOBILE_STATIC
extra_test_flags := -exclude:NotWorkingInterpreter
system_core_library_deps = $(the_libdir_base)Mono.Dynamic.Interpreter.dll $(system_core_plain_libdir)/System.Core.dll
LIB_MCS_FLAGS += -d:FEATURE_CORE_DLR
csproj-local:
$(MAKE) csproj-local intermediate=plaincore/
endif
-endif
\ No newline at end of file
+endif
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <NoWarn>1720</NoWarn>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'basic|AnyCPU' ">
- <DefineConstants>BOOTSTRAP_BASIC,NET_1_1,NET_2_0,INSIDE_SYSCORE,LIBC,NET_3_5</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0,INSIDE_SYSCORE,LIBC,NET_3_5</DefineConstants>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System.dll"/>
- <Reference Include="Mono.Posix">
- <HintPath>..\lib\net_2_0\Mono.Posix.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
+System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System.Runtime.CompilerServices/DynamicAttribute.cs
System/TimeZoneInfoTest.cs
System/TimeZoneInfo.AdjustmentRuleTest.cs
+System/TimeZoneInfo.SerializationTest.cs
System/TimeZoneInfo.TransitionTimeTest.cs
System.Collections.Generic/HashSetTest.cs
System.IO.MemoryMappedFiles/MemoryMappedFileTest.cs
internal static bool IsUnsigned (Type t)
{
-#if !TARGET_JVM
if (t.IsPointer)
return IsUnsigned (t.GetElementType ());
-#endif
return t == typeof (ushort) ||
t == typeof (uint) ||
t == typeof (ulong) ||
var implementerToken = options.ImplementerToken;
try {
+ // Avoid cache thrashing of locals array
+ var local = locals [index];
+
if (seedFunc == null) {
if (!enumerator.MoveNext ())
return;
- locals[index] = (U)(object)enumerator.Current;
+ local = (U)(object)enumerator.Current;
}
while (enumerator.MoveNext ()) {
if (implementerToken.IsCancellationRequested)
break;
token.ThrowIfCancellationRequested ();
- locals[index] = localCall (locals[index], enumerator.Current);
+ local = localCall (local, enumerator.Current);
}
+
+ locals [index] = local;
} finally {
enumerator.Dispose ();
}
[DllImport ("__Internal")]
extern static IntPtr monotouch_timezone_get_data (string name, ref int size);
- static Stream GetMonoTouchData (string name)
+ static Stream GetMonoTouchData (string name, bool throw_on_error = true)
{
int size = 0;
IntPtr data = monotouch_timezone_get_data (name, ref size);
- if (size <= 0)
- throw new TimeZoneNotFoundException ();
+ if (size <= 0) {
+ if (throw_on_error)
+ throw new TimeZoneNotFoundException ();
+ return null;
+ }
unsafe {
var s = new UnmanagedMemoryStream ((byte*) data, size);
--- /dev/null
+/*
+ * System.TimeZoneInfo.Serialization
+ *
+ * Author(s)
+ * Sasha Kotlyar <sasha@arktronic.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 (INSIDE_CORLIB && NET_4_0) || (!INSIDE_CORLIB && (NET_3_5 && !NET_4_0 && !MOBILE))
+
+using System.Collections.Generic;
+using System.Globalization;
+using System.Runtime.Serialization;
+using System.Text;
+
+namespace System
+{
+ public partial class TimeZoneInfo
+ {
+ public static TimeZoneInfo FromSerializedString (string source)
+ {
+ var input = new StringBuilder (source);
+ var tzId = DeserializeString (ref input);
+ var offset = DeserializeInt (ref input);
+ var displayName = DeserializeString (ref input);
+ var standardName = DeserializeString (ref input);
+ var daylightName = DeserializeString (ref input);
+ var rules = new List<TimeZoneInfo.AdjustmentRule> ();
+ while (input [0] != ';') {
+ rules.Add (DeserializeAdjustmentRule (ref input));
+ }
+ var offsetSpan = TimeSpan.FromMinutes (offset);
+ return TimeZoneInfo.CreateCustomTimeZone (tzId, offsetSpan, displayName, standardName, daylightName, rules.ToArray ());
+ }
+
+ public string ToSerializedString ()
+ {
+ var stb = new StringBuilder ();
+ var daylightName = (string.IsNullOrEmpty(this.DaylightName) ? this.StandardName : this.DaylightName);
+ stb.AppendFormat ("{0};{1};{2};{3};{4};", EscapeForSerialization (this.Id), (int)this.BaseUtcOffset.TotalMinutes,
+ EscapeForSerialization (this.DisplayName), EscapeForSerialization (this.StandardName), EscapeForSerialization (daylightName));
+
+ if (this.SupportsDaylightSavingTime) {
+ foreach (var rule in this.GetAdjustmentRules()) {
+ var start = rule.DateStart.ToString ("MM:dd:yyyy", CultureInfo.InvariantCulture);
+ var end = rule.DateEnd.ToString ("MM:dd:yyyy", CultureInfo.InvariantCulture);
+ var delta = (int)rule.DaylightDelta.TotalMinutes;
+ var transitionStart = SerializeTransitionTime (rule.DaylightTransitionStart);
+ var transitionEnd = SerializeTransitionTime (rule.DaylightTransitionEnd);
+ stb.AppendFormat ("[{0};{1};{2};{3};{4};]", start, end, delta,
+ transitionStart, transitionEnd);
+ }
+ }
+
+ stb.Append (";");
+ return stb.ToString ();
+ }
+
+ private static TimeZoneInfo.AdjustmentRule DeserializeAdjustmentRule (ref StringBuilder input)
+ {
+ // Similar to: [01:01:0001;12:31:9999;60;[0;01:00:00;3;5;0;];[0;02:00:00;10;5;0;];]
+ if (input [0] != '[')
+ throw new SerializationException ();
+ input.Remove (0, 1); // [
+ var dateStart = DeserializeDate (ref input);
+ var dateEnd = DeserializeDate (ref input);
+ var delta = DeserializeInt (ref input);
+ var transitionStart = DeserializeTransitionTime (ref input);
+ var transitionEnd = DeserializeTransitionTime (ref input);
+ input.Remove (0, 1); // ]
+ var deltaSpan = TimeSpan.FromMinutes (delta);
+ return TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, deltaSpan,
+ transitionStart, transitionEnd);
+ }
+
+ private static TimeZoneInfo.TransitionTime DeserializeTransitionTime (ref StringBuilder input)
+ {
+ if (input [0] != '[' || (input [1] != '0' && input [1] != '1') || input [2] != ';')
+ throw new SerializationException ();
+ var rule = input [1];
+ input.Remove (0, 3); // [#;
+ var timeOfDay = DeserializeTime (ref input);
+ var month = DeserializeInt (ref input);
+ if (rule == '0') {
+ // Floating rule such as: [0;01:00:00;3;5;0;];
+ var week = DeserializeInt (ref input);
+ var dayOfWeek = DeserializeInt (ref input);
+ input.Remove (0, 2); // ];
+ return TimeZoneInfo.TransitionTime.CreateFloatingDateRule (timeOfDay, month, week, (DayOfWeek)dayOfWeek);
+ }
+
+ // Fixed rule such as: [1;02:15:59.999;6;2;];
+ var day = DeserializeInt (ref input);
+ input.Remove (0, 2); // ];
+ return TimeZoneInfo.TransitionTime.CreateFixedDateRule (timeOfDay, month, day);
+ }
+
+ private static string DeserializeString (ref StringBuilder input)
+ {
+ var stb = new StringBuilder ();
+ var isEscaped = false;
+ int charCount;
+ for (charCount = 0; charCount < input.Length; charCount++) {
+ var inChar = input [charCount];
+ if (isEscaped) {
+ isEscaped = false;
+ stb.Append (inChar);
+ } else if (inChar == '\\') {
+ isEscaped = true;
+ continue;
+ } else if (inChar == ';') {
+ break;
+ } else {
+ stb.Append (inChar);
+ }
+ }
+ input.Remove (0, charCount + 1);
+ return stb.ToString ();
+ }
+
+ private static int DeserializeInt(ref StringBuilder input)
+ {
+ int charCount = 0;
+ while(charCount++ < input.Length)
+ {
+ if (input[charCount] == ';')
+ break;
+ }
+ int result;
+ if(!int.TryParse(input.ToString(0, charCount), NumberStyles.Integer, CultureInfo.InvariantCulture, out result))
+ throw new SerializationException();
+ input.Remove(0, charCount + 1);
+ return result;
+ }
+
+ private static DateTime DeserializeDate (ref StringBuilder input)
+ {
+ var inChars = new char[11];
+ input.CopyTo (0, inChars, 0, inChars.Length);
+ DateTime result;
+ if (!DateTime.TryParseExact (new string (inChars), "MM:dd:yyyy;", CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
+ throw new SerializationException ();
+ input.Remove (0, inChars.Length);
+ return result;
+ }
+
+ private static DateTime DeserializeTime (ref StringBuilder input)
+ {
+ if (input [8] == ';') {
+ // Without milliseconds
+ var inChars = new char[9];
+ input.CopyTo (0, inChars, 0, inChars.Length);
+ DateTime result;
+ if (!DateTime.TryParseExact (new string (inChars), "HH:mm:ss;", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out result))
+ throw new SerializationException ();
+ input.Remove (0, inChars.Length);
+ return result;
+ } else if (input [12] == ';') {
+ // With milliseconds
+ char[] inChars = new char[13];
+ input.CopyTo (0, inChars, 0, inChars.Length);
+ var inString = new string (inChars);
+ DateTime result;
+ if (!DateTime.TryParseExact (inString, "HH:mm:ss.fff;", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out result))
+ throw new SerializationException ();
+ input.Remove (0, inChars.Length);
+ return result;
+ }
+ throw new SerializationException ();
+ }
+
+ private static string EscapeForSerialization (string unescaped)
+ {
+ return unescaped.Replace (@"\", @"\\").Replace (";", "\\;");
+ }
+
+ private static string SerializeTransitionTime (TimeZoneInfo.TransitionTime transition)
+ {
+ string timeOfDay;
+ if (transition.TimeOfDay.Millisecond > 0)
+ timeOfDay = transition.TimeOfDay.ToString ("HH:mm:ss.fff");
+ else
+ timeOfDay = transition.TimeOfDay.ToString ("HH:mm:ss");
+
+ if (transition.IsFixedDateRule) {
+ return string.Format ("[1;{0};{1};{2};]", timeOfDay, transition.Month, transition.Day);
+ }
+
+ return string.Format ("[0;{0};{1};{2};{3};]", timeOfDay, transition.Month,
+ transition.Week, (int)transition.DayOfWeek);
+ }
+ }
+}
+
+#endif
}
#endif
- public static TimeZoneInfo FromSerializedString (string source)
- {
- throw new NotImplementedException ();
- }
-
public AdjustmentRule [] GetAdjustmentRules ()
{
if (!supportsDaylightSavingTime)
#elif MONOTOUCH
if (systemTimeZones.Count == 0) {
foreach (string name in GetMonoTouchNames ()) {
- using (Stream stream = GetMonoTouchData (name)) {
+ using (Stream stream = GetMonoTouchData (name, false)) {
+ if (stream == null)
+ continue;
systemTimeZones.Add (BuildFromStream (name, stream));
}
}
}
}
- public string ToSerializedString ()
- {
- throw new NotImplementedException ();
- }
-
public override string ToString ()
{
return DisplayName;
int day = 1 + (transition.Week - 1) * 7 + (transition.DayOfWeek - first) % 7;
if (day > DateTime.DaysInMonth (year, transition.Month))
day -= 7;
+ if (day < 1)
+ day += 7;
return new DateTime (year, transition.Month, day) + transition.TimeOfDay.TimeOfDay;
}
}
[Test]
- [Category("TargetJvmNotWorking")]
public void TestCopyTo ()
{
var data = new [] {1, 2, 3, 4, 5};
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{79C9301F-06F0-431C-B72A-0FF2F63C0BF8}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Core.Tests</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <OldToolsVersion>3.5</OldToolsVersion>\r
- <RootNamespace>System.Core.Tests</RootNamespace>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <jarserver>ipa</jarserver>\r
- <PublishUrl>http://localhost/System.Core.Tests-2008.JavaEE/</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Web</InstallFrom>\r
- <UpdateEnabled>true</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>true</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- <StartupObject>\r
- </StartupObject>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;NET_3_5;TARGET_JVM;DEBUG</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <PreCompile>true</PreCompile>\r
- <DeploymentMethod>0</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <UseTestingPage>true</UseTestingPage>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;NET_3_5;TARGET_JVM</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <PreCompile>true</PreCompile>\r
- <DeploymentMethod>0</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <UseTestingPage>true</UseTestingPage>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-system-core="repository:vmw:framework:2.0" REFS-JarPath-system-core="" REFS-RefInfo-system-core-2008-javaee="j2il:" REFS-JarPath-system-core-2008-javaee="..\bin\Debug_Java\System.Core-2008.JavaEE.jar" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system="" REFS-RefInfo-nunit-framework="j2il:" REFS-JarPath-nunit-framework="..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.6.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <ItemGroup>\r
- <Reference Include="nunit.framework">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="rt, Version=1.6.0.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="System.Collections.Generic\ChangeLog" />\r
- <None Include="System.Linq.Expressions\ChangeLog" />\r
- <None Include="System.Linq\ChangeLog" />\r
- <None Include="System\ChangeLog" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="System.Collections.Generic\HashSetTest.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Add.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_AddChecked.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_And.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_AndAlso.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ArrayIndex.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ArrayLength.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Bind.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Call.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Coalesce.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Condition.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Constant.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Convert.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Divide.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ElementInit.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Equal.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ExclusiveOr.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Field.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_GreaterThan.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_GreaterThanOrEqual.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Invoke.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Lambda.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_LeftShift.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_LessThan.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_LessThanOrEqual.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Lift.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ListBind.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ListInit.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_MakeBinary.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_MemberBind.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_MemberInit.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Modulo.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Multiply.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_MultiplyChecked.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Negate.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_New.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_NewArrayBounds.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_NewArrayInit.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Not.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Or.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_OrElse.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Power.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Property.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_PropertyOrField.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Quote.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_RightShift.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Subtract.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_SubtractChecked.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_TypeAs.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_TypeIs.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_UnaryPlus.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Utils.cs" />\r
- <Compile Include="System.Linq\EnumerableAsQueryableTest.cs" />\r
- <Compile Include="System.Linq\EnumerableMoreTest.cs" />\r
- <Compile Include="System.Linq\EnumerableTest.cs" />\r
- <Compile Include="System.Linq\QueryableProviderTest.cs" />\r
- <Compile Include="System.Linq\QueryableTest.cs" />\r
- <Compile Include="System\TimeZoneInfo.AdjustmentRuleTest.cs" />\r
- <Compile Include="System\TimeZoneInfo.TransitionTimeTest.cs" />\r
- <Compile Include="System\TimeZoneInfoTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{F902A50D-6156-4935-A1AC-E82DF0EB83D3}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Core.Tests</RootNamespace>\r
- <AssemblyName>System.Core.Tests</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Test.NET|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Test.NET\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE</DefineConstants>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <ErrorReport>prompt</ErrorReport>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="nunit.framework" />\r
- <Reference Include="System" />\r
- <Reference Condition=" '$(Configuration)' == 'Test.NET' " Include="System.Core" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="System.Collections.Generic\ChangeLog" />\r
- <None Include="System.Linq\ChangeLog" />\r
- <None Include="System\ChangeLog" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="System.Collections.Generic\HashSetTest.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Convert.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Add.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_AddChecked.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_And.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_AndAlso.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ArrayIndex.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ArrayLength.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Bind.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Call.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Coalesce.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Condition.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Constant.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Divide.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ElementInit.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Equal.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ExclusiveOr.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Field.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_GreaterThan.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_GreaterThanOrEqual.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Invoke.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Lambda.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_LeftShift.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_LessThan.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_LessThanOrEqual.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Lift.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ListBind.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_ListInit.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_MakeBinary.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_MemberBind.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_MemberInit.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Modulo.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Multiply.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_MultiplyChecked.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Negate.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_New.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_NewArrayBounds.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_NewArrayInit.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Not.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_NotEqual.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Or.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_OrElse.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Power.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Property.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_PropertyOrField.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Quote.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_RightShift.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Subtract.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_SubtractChecked.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_TypeAs.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_TypeIs.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_UnaryPlus.cs" />\r
- <Compile Include="System.Linq.Expressions\ExpressionTest_Utils.cs" />\r
- <Compile Include="System.Linq\EnumerableAsQueryableTest.cs" />\r
- <Compile Include="System.Linq\EnumerableFixture.cs" />\r
- <Compile Include="System.Linq\EnumerableMoreTest.cs" />\r
- <Compile Include="System.Linq\EnumerableTest.cs" />\r
- <Compile Include="System.Linq\LookupTest.cs" />\r
- <Compile Include="System.Linq\QueryableProviderTest.cs" />\r
- <Compile Include="System.Linq\QueryableTest.cs" />\r
- <Compile Include="System\TimeZoneInfo.AdjustmentRuleTest.cs" />\r
- <Compile Include="System\TimeZoneInfo.TransitionTimeTest.cs" />\r
- <Compile Include="System\TimeZoneInfoTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Condition=" '$(Configuration)' == 'Debug' or '$(Configuration)' == 'Release' " Include="..\System.Core-2008.csproj">\r
- <Project>{D287D5CA-4F81-4215-AFC8-8A1413696884}</Project>\r
- <Name>System.Core-2008</Name>\r
- <Private>True</Private>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>
\ No newline at end of file
}
[Test]
- [Category("TargetJvmNotSupported")]
public void ExpressionDelegateTarget ()
{
var p = Expression.Parameter (typeof (string), "str");
#if !NET_4_0
[Test]
- [Category ("TargetJvmNotSupported")]
public void GlobalsInScope ()
{
var foo = new Foo { gazonk = "gazonk" };
--- /dev/null
+using System;
+using System.IO;
+using NUnit.Framework;
+
+namespace MonoTests.System
+{
+ [TestFixture]
+ public class SerializedStringTests
+ {
+ [Test]
+ public void SerializeUtc ()
+ {
+ Assert.AreEqual ("UTC;0;UTC;UTC;UTC;;", TimeZoneInfo.Utc.ToSerializedString ());
+ }
+
+ [Test]
+ public void DeserializeUtc ()
+ {
+ var utc = TimeZoneInfo.FromSerializedString ("UTC;0;UTC;UTC;UTC;;");
+ Assert.AreEqual ("UTC", utc.Id);
+ Assert.AreEqual ("UTC", utc.DisplayName);
+ Assert.AreEqual ("UTC", utc.StandardName);
+ Assert.IsFalse (utc.SupportsDaylightSavingTime);
+ Assert.AreEqual (0, utc.GetAdjustmentRules ().Length);
+ }
+
+ [Test]
+ public void SerializeCustomUtcZoneWithOddNaming ()
+ {
+ var tz1 = TimeZoneInfo.CreateCustomTimeZone (@"My\; Zone, @1!.", TimeSpan.FromMinutes (0), @"My\\; Zone 1 Name", "My; Zone 1 Standard Time");
+ Assert.AreEqual (@"My\\\; Zone, @1!.;0;My\\\\\; Zone 1 Name;My\; Zone 1 Standard Time;My\; Zone 1 Standard Time;;", tz1.ToSerializedString ());
+ }
+
+ [Test]
+ public void SerializeCustomZoneWithOddOffset ()
+ {
+ var tz2 = TimeZoneInfo.CreateCustomTimeZone ("My Zone 2", TimeSpan.FromHours (1.25), "My Zone 2 Name", "My Zone 2 Standard Time");
+ Assert.AreEqual ("My Zone 2;75;My Zone 2 Name;My Zone 2 Standard Time;My Zone 2 Standard Time;;", tz2.ToSerializedString ());
+ }
+
+ [Test]
+ public void SerializeCustomZoneWithFloatingDaylightTransitions ()
+ {
+ var tz3rules = new TimeZoneInfo.AdjustmentRule[] { TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (1, 1, 1), new DateTime (9999, 12, 31), TimeSpan.FromMinutes (23), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 58, 0), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday)) };
+ var tz3 = TimeZoneInfo.CreateCustomTimeZone ("My Zone 3", TimeSpan.FromHours (-4), "My Zone 3 Name", "My Zone 3 Standard Time", "My Zone 3 Daylight Time", tz3rules);
+ Assert.AreEqual ("My Zone 3;-240;My Zone 3 Name;My Zone 3 Standard Time;My Zone 3 Daylight Time;[01:01:0001;12:31:9999;23;[0;02:15:58;3;2;2;];[0;02:15:59.999;6;2;2;];];", tz3.ToSerializedString ());
+ }
+
+ [Test]
+ public void SerializeCustomZoneWithFixedDaylightTransitions ()
+ {
+ var tz4rules = new TimeZoneInfo.AdjustmentRule[] { TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (1, 1, 1), new DateTime (9999, 12, 31), TimeSpan.FromMinutes (23), TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1, 1, 1, 2, 15, 59, 48), 3, 2), TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2)) };
+ var tz4 = TimeZoneInfo.CreateCustomTimeZone ("My Zone 4", TimeSpan.FromHours (-4), "My Zone 4 Name", "My Zone 4 Standard Time", "My Zone 4 Daylight Time", tz4rules);
+ Assert.AreEqual ("My Zone 4;-240;My Zone 4 Name;My Zone 4 Standard Time;My Zone 4 Daylight Time;[01:01:0001;12:31:9999;23;[1;02:15:59.048;3;2;];[1;02:15:59.999;6;2;];];", tz4.ToSerializedString ());
+ }
+
+ [Test]
+ public void SerializeCustomZoneWithMultipleDaylightRules ()
+ {
+ var tz5rules = new TimeZoneInfo.AdjustmentRule[] {
+ TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (1, 1, 1), new DateTime (2012, 12, 31), TimeSpan.FromMinutes (23), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday)),
+ TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (2013, 1, 1), new DateTime (9999, 12, 31), TimeSpan.FromMinutes (48), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday))
+ };
+ var tz5 = TimeZoneInfo.CreateCustomTimeZone ("My Zone 5", TimeSpan.FromHours (-6.75), "My Zone 5 Name", "My Zone 5 Standard Time", "My Zone 5 Daylight Time", tz5rules);
+ Assert.AreEqual ("My Zone 5;-405;My Zone 5 Name;My Zone 5 Standard Time;My Zone 5 Daylight Time;[01:01:0001;12:31:2012;23;[0;02:15:59.999;3;2;2;];[0;02:15:59.999;6;2;2;];][01:01:2013;12:31:9999;48;[0;02:15:59.999;3;2;2;];[0;02:15:59.999;6;2;2;];];", tz5.ToSerializedString ());
+ }
+
+ [Test]
+ public void DeserializeCustomZoneWithOddNamingAndMultipleDaylightRules ()
+ {
+ var rule1 = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (1, 1, 1), new DateTime (2012, 12, 31), TimeSpan.FromMinutes (23), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday));
+ var rule2 = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (new DateTime (2013, 1, 1), new DateTime (9999, 12, 31), TimeSpan.FromMinutes (48), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 3, 2, DayOfWeek.Tuesday), TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1, 1, 1, 2, 15, 59, 999), 6, 2, DayOfWeek.Tuesday));
+
+ var tz1 = TimeZoneInfo.FromSerializedString ("My\\; Zone 5;-405;My Zone\\; 5 Name;My Zone 5\\; Standard Time;My Zone 5 Daylight\\; Time;[01:01:0001;12:31:2012;23;[0;02:15:59.999;3;2;2;];[0;02:15:59.999;6;2;2;];][01:01:2013;12:31:9999;48;[0;02:15:59.999;3;2;2;];[0;02:15:59.999;6;2;2;];];");
+ Assert.AreEqual ("My; Zone 5", tz1.Id);
+ Assert.AreEqual ("My Zone; 5 Name", tz1.DisplayName);
+ Assert.AreEqual ("My Zone 5; Standard Time", tz1.StandardName);
+ Assert.AreEqual ("My Zone 5 Daylight; Time", tz1.DaylightName);
+ Assert.AreEqual (TimeSpan.FromMinutes (-405), tz1.BaseUtcOffset);
+ Assert.IsTrue (tz1.SupportsDaylightSavingTime);
+
+ var deserializedRules = tz1.GetAdjustmentRules ();
+ Assert.AreEqual (2, deserializedRules.Length);
+ Assert.IsFalse (deserializedRules [0].Equals (deserializedRules [1]));
+ Assert.IsTrue (rule1.Equals (deserializedRules [0]));
+ Assert.IsTrue (rule2.Equals (deserializedRules [1]));
+ }
+
+ [Test]
+ public void DeserializeAndUseEasternTimeZone ()
+ {
+ var et = TimeZoneInfo.FromSerializedString (@"Eastern Standard Time;-300;(UTC-05:00) Eastern Time (US & Canada);Eastern Standard Time;Eastern Daylight Time;[01:01:0001;12:31:2006;60;[0;02:00:00;4;1;0;];[0;02:00:00;10;5;0;];][01:01:2007;12:31:9999;60;[0;02:00:00;3;2;0;];[0;02:00:00;11;1;0;];];");
+ var testDate = new DateTime (2014, 8, 1, 6, 0, 0, DateTimeKind.Unspecified);
+ Assert.AreEqual (TimeSpan.FromHours (-4), et.GetUtcOffset (testDate));
+ }
+ }
+}
-Assembly/AssemblyInfo.cs
-System/Actions.cs
-System/Funcs.cs
-System/InvalidTimeZoneException.cs
-System/TimeZoneInfo.AdjustmentRule.cs
-System/TimeZoneInfo.cs
-System/TimeZoneInfo.TransitionTime.cs
-System/TimeZoneNotFoundException.cs
-System/Util.cs
-System.Runtime.CompilerServices/DynamicAttribute.cs
-System.Runtime.CompilerServices/ExecutionScope.cs
-System.Runtime.CompilerServices/ExtensionAttribute.cs
-System.Runtime.CompilerServices/IStrongBox.cs
-System.Runtime.CompilerServices/StrongBox_T.cs
-System.Linq/Check.cs
-System.Linq/Enumerable.cs
-System.Linq/QueryableEnumerable.cs
-System.Linq/QueryableTransformer.cs
-System.Linq/Grouping.cs
-System.Linq/IGrouping.cs
-System.Linq/IOrderedQueryable.cs
-System.Linq/IOrderedQueryable_T.cs
-System.Linq/IOrderedEnumerable_T.cs
-System.Linq/IQueryable.cs
-System.Linq/IQueryable_T.cs
-System.Linq/Lookup.cs
-System.Linq/ILookup_T.cs
-System.Linq/OrderedEnumerable.cs
-System.Linq/OrderedSequence.cs
-System.Linq/Queryable.cs
-System.Linq/QuickSort.cs
-System.Linq/SortContext.cs
-System.Linq/SortDirection.cs
-System.Linq/SortSequenceContext.cs
-System.Linq/IQueryProvider.cs
-System.Collections.Generic/HashSet.cs
-System.Security.Cryptography/Aes.cs
-System.Threading/LockRecursionPolicy.cs
-System.Threading/ReaderWriterLockSlim.cs
-System.Threading/ThreadLockState.cs
-System.Threading/ReaderWriterLockSlimExtensions.cs
-System.Linq.Parallel.QueryNodes/QueryBaseNode.cs
-System.Linq.Parallel.QueryNodes/QueryCastNode.cs
-System.Linq.Parallel.QueryNodes/QueryChildNode.cs
-System.Linq.Parallel.QueryNodes/QueryConcatNode.cs
-System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs
-System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs
-System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs
-System.Linq.Parallel.QueryNodes/QueryJoinNode.cs
-System.Linq.Parallel.QueryNodes/QueryMuxNode.cs
-System.Linq.Parallel.QueryNodes/QueryOptionNode.cs
-System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs
-System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs
-System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs
-System.Linq.Parallel.QueryNodes/QueryReverseNode.cs
-System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs
-System.Linq.Parallel.QueryNodes/QuerySelectNode.cs
-System.Linq.Parallel.QueryNodes/QuerySetNode.cs
-System.Linq.Parallel.QueryNodes/QueryStartNode.cs
-System.Linq.Parallel.QueryNodes/QueryStreamNode.cs
-System.Linq.Parallel.QueryNodes/QueryWhereNode.cs
-System.Linq.Parallel.QueryNodes/QueryZipNode.cs
-System.Linq.Parallel.QueryNodes/SetInclusion.cs
-System.Linq.Parallel.QueryNodes/WrapHelper.cs
-System.Linq.Parallel/AggregationList.cs
-System.Linq.Parallel/ConcurrentGrouping.cs
-System.Linq.Parallel/ConcurrentLookup.cs
-System.Linq.Parallel/INodeVisitor.cs
-System.Linq.Parallel/IVisitableNode.cs
-System.Linq.Parallel/OrderingEnumerator.cs
-System.Linq.Parallel/ParallelExecuter.cs
-System.Linq.Parallel/ParallelPartitioner.cs
-System.Linq.Parallel/ParallelQueryEnumerator.cs
-System.Linq.Parallel/ParallelQuickSort.cs
-System.Linq.Parallel/QueryCheckerVisitor.cs
-System.Linq.Parallel/QueryIsOrderedVisitor.cs
-System.Linq.Parallel/QueryOptions.cs
-System.Linq.Parallel/RangeList.cs
-System.Linq.Parallel/RepeatList.cs
-System.Linq.Parallel/ReverseList.cs
-System.Linq.Parallel/StripPartitioner.cs
-System.Linq.Parallel/TemporaryArea.cs
-System.Linq/EnumerableExecutor.cs
-System.Linq/EnumerableExecutor_T.cs
-System.Linq/EnumerableQuery.cs
-System.Linq/EnumerableQuery_T.cs
-System.Linq/OrderedParallelQuery.cs
-System.Linq/ParallelEnumerable.cs
-System.Linq/ParallelExecutionMode.cs
-System.Linq/ParallelMergeOptions.cs
-System.Linq/ParallelQuery.cs
-System.IO.MemoryMappedFiles/MemoryMappedFile.cs
-System.IO.MemoryMappedFiles/MemoryMappedFileAccess.cs
-System.IO.MemoryMappedFiles/MemoryMappedFileOptions.cs
-System.IO.MemoryMappedFiles/MemoryMappedFileRights.cs
-System.IO.MemoryMappedFiles/MemoryMappedFileSecurity.cs
-System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs
-System.IO.MemoryMappedFiles/MemoryMappedViewAccessor.cs
-Microsoft.Win32.SafeHandles/SafeMemoryMappedFileHandle.cs
-Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs
-System.IO/HandleInheritability.cs
-System.Threading.Tasks/TaskExtensions.cs
-System.Linq.Expressions/Extensions.cs
-System.Linq.Expressions/ExpressionTransformer.cs
-../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs
-../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs
-System.Linq.Expressions/DynamicExpressionVisitor.cs
+#include mobile_common_System.Core.dll.sources
+
+#include dynamic_System.Core.dll.sources
--- /dev/null
+Assembly/AssemblyInfo.cs
+System/Actions.cs
+System/Funcs.cs
+System/InvalidTimeZoneException.cs
+System/TimeZoneInfo.AdjustmentRule.cs
+System/TimeZoneInfo.cs
+System/TimeZoneInfo.Serialization.cs
+System/TimeZoneInfo.TransitionTime.cs
+System/TimeZoneNotFoundException.cs
+System/Util.cs
+System.Runtime.CompilerServices/DynamicAttribute.cs
+System.Runtime.CompilerServices/ExecutionScope.cs
+System.Runtime.CompilerServices/ExtensionAttribute.cs
+System.Runtime.CompilerServices/IStrongBox.cs
+System.Runtime.CompilerServices/StrongBox_T.cs
+System.Linq/Check.cs
+System.Linq/Enumerable.cs
+System.Linq/QueryableEnumerable.cs
+System.Linq/QueryableTransformer.cs
+System.Linq/Grouping.cs
+System.Linq/IGrouping.cs
+System.Linq/IOrderedQueryable.cs
+System.Linq/IOrderedQueryable_T.cs
+System.Linq/IOrderedEnumerable_T.cs
+System.Linq/IQueryable.cs
+System.Linq/IQueryable_T.cs
+System.Linq/Lookup.cs
+System.Linq/ILookup_T.cs
+System.Linq/OrderedEnumerable.cs
+System.Linq/OrderedSequence.cs
+System.Linq/Queryable.cs
+System.Linq/QuickSort.cs
+System.Linq/SortContext.cs
+System.Linq/SortDirection.cs
+System.Linq/SortSequenceContext.cs
+System.Linq/IQueryProvider.cs
+System.Collections.Generic/HashSet.cs
+System.Security.Cryptography/Aes.cs
+System.Threading/LockRecursionPolicy.cs
+System.Threading/ReaderWriterLockSlim.cs
+System.Threading/ThreadLockState.cs
+System.Threading/ReaderWriterLockSlimExtensions.cs
+System.Linq.Parallel.QueryNodes/QueryBaseNode.cs
+System.Linq.Parallel.QueryNodes/QueryCastNode.cs
+System.Linq.Parallel.QueryNodes/QueryChildNode.cs
+System.Linq.Parallel.QueryNodes/QueryConcatNode.cs
+System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs
+System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs
+System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs
+System.Linq.Parallel.QueryNodes/QueryJoinNode.cs
+System.Linq.Parallel.QueryNodes/QueryMuxNode.cs
+System.Linq.Parallel.QueryNodes/QueryOptionNode.cs
+System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs
+System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs
+System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs
+System.Linq.Parallel.QueryNodes/QueryReverseNode.cs
+System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs
+System.Linq.Parallel.QueryNodes/QuerySelectNode.cs
+System.Linq.Parallel.QueryNodes/QuerySetNode.cs
+System.Linq.Parallel.QueryNodes/QueryStartNode.cs
+System.Linq.Parallel.QueryNodes/QueryStreamNode.cs
+System.Linq.Parallel.QueryNodes/QueryWhereNode.cs
+System.Linq.Parallel.QueryNodes/QueryZipNode.cs
+System.Linq.Parallel.QueryNodes/SetInclusion.cs
+System.Linq.Parallel.QueryNodes/WrapHelper.cs
+System.Linq.Parallel/AggregationList.cs
+System.Linq.Parallel/ConcurrentGrouping.cs
+System.Linq.Parallel/ConcurrentLookup.cs
+System.Linq.Parallel/INodeVisitor.cs
+System.Linq.Parallel/IVisitableNode.cs
+System.Linq.Parallel/OrderingEnumerator.cs
+System.Linq.Parallel/ParallelExecuter.cs
+System.Linq.Parallel/ParallelPartitioner.cs
+System.Linq.Parallel/ParallelQueryEnumerator.cs
+System.Linq.Parallel/ParallelQuickSort.cs
+System.Linq.Parallel/QueryCheckerVisitor.cs
+System.Linq.Parallel/QueryIsOrderedVisitor.cs
+System.Linq.Parallel/QueryOptions.cs
+System.Linq.Parallel/RangeList.cs
+System.Linq.Parallel/RepeatList.cs
+System.Linq.Parallel/ReverseList.cs
+System.Linq.Parallel/StripPartitioner.cs
+System.Linq.Parallel/TemporaryArea.cs
+System.Linq/EnumerableExecutor.cs
+System.Linq/EnumerableExecutor_T.cs
+System.Linq/EnumerableQuery.cs
+System.Linq/EnumerableQuery_T.cs
+System.Linq/OrderedParallelQuery.cs
+System.Linq/ParallelEnumerable.cs
+System.Linq/ParallelExecutionMode.cs
+System.Linq/ParallelMergeOptions.cs
+System.Linq/ParallelQuery.cs
+System.IO.MemoryMappedFiles/MemoryMappedFile.cs
+System.IO.MemoryMappedFiles/MemoryMappedFileAccess.cs
+System.IO.MemoryMappedFiles/MemoryMappedFileOptions.cs
+System.IO.MemoryMappedFiles/MemoryMappedFileRights.cs
+System.IO.MemoryMappedFiles/MemoryMappedFileSecurity.cs
+System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs
+System.IO.MemoryMappedFiles/MemoryMappedViewAccessor.cs
+Microsoft.Win32.SafeHandles/SafeMemoryMappedFileHandle.cs
+Microsoft.Win32.SafeHandles/SafeMemoryMappedViewHandle.cs
+System.IO/HandleInheritability.cs
+System.Threading.Tasks/TaskExtensions.cs
+System.Linq.Expressions/Extensions.cs
+System.Linq.Expressions/ExpressionTransformer.cs
+../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs
+../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs
+System.Linq.Expressions/DynamicExpressionVisitor.cs
--- /dev/null
+#include mobile_common_System.Core.dll.sources
+#include interpreter_System.Core.dll.sources
-#include mobile_System.Core.dll.sources
+#include mobile_common_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
-#include mobile_System.Core.dll.sources
+#include mobile_common_System.Core.dll.sources
#include interpreter_System.Core.dll.sources
System/TimeZoneInfo.MonoTouch.cs
System/InvalidTimeZoneException.cs
System/TimeZoneInfo.AdjustmentRule.cs
System/TimeZoneInfo.cs
+System/TimeZoneInfo.Serialization.cs
System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System/Util.cs
-#include mobile_System.Core.dll.sources
+#include mobile_common_System.Core.dll.sources
#include dynamic_System.Core.dll.sources
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
-#if TARGET_JVM
-[assembly: AssemblyDelaySign (false)]
-#else
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../ecma.pub")]
-#endif
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{7FD742E6-7FAB-47B7-B6DD-99ABB44B5914}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Data.DataSetExtensions</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <OldToolsVersion>2.0</OldToolsVersion>\r
- <RootNamespace>System.Data.DataSetExtensions</RootNamespace>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <jarserver>ip2</jarserver>\r
- <PublishUrl>http://localhost/System.Data.DataSetExtensions/</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Web</InstallFrom>\r
- <UpdateEnabled>true</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>true</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;NET_3_5;TARGET_JVM</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <PreCompile>true</PreCompile>\r
- <DeploymentMethod>0</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <UseTestingPage>true</UseTestingPage>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;NET_3_5;TARGET_JVM</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <PreCompile>true</PreCompile>\r
- <DeploymentMethod>0</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <UseTestingPage>true</UseTestingPage>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs">\r
- <Link>Consts.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Data\DataRowComparer.cs" />\r
- <Compile Include="System.Data\DataRowComparer_1.cs" />\r
- <Compile Include="System.Data\DataRowExtensions.cs" />\r
- <Compile Include="System.Data\DataTableExtensions.cs" />\r
- <Compile Include="System.Data\EnumerableRowCollection.cs" />\r
- <Compile Include="System.Data\EnumerableRowCollectionExtensions.cs" />\r
- <Compile Include="System.Data\EnumerableRowCollection_1.cs" />\r
- <Compile Include="System.Data\OrderedEnumerableRowCollection.cs" />\r
- <Compile Include="System.Data\RowEnumerableDataReader.cs" />\r
- <Compile Include="System.Data\TypedTableBase.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Data\TypedTableBaseExtensions.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=1.6.0.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\System.Data\System.Data20.csproj">\r
- <Project>{BD83C476-AEC7-4535-8158-977B04887AF0}</Project>\r
- <Name>System.Data20</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-rt="repository:jre:sun:1.6.0" REFS-JarPath-rt="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system="" REFS-JarPath-system-core="" REFS-RefInfo-system-core="repository:vmw:framework:2.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.DataSetExtensions", "System.Data.DataSetExtensions.csproj", "{7FD742E6-7FAB-47B7-B6DD-99ABB44B5914}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data20", "..\System.Data\System.Data20.csproj", "{BD83C476-AEC7-4535-8158-977B04887AF0}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {7FD742E6-7FAB-47B7-B6DD-99ABB44B5914}.Debug_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {7FD742E6-7FAB-47B7-B6DD-99ABB44B5914}.Debug_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {7FD742E6-7FAB-47B7-B6DD-99ABB44B5914}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {7FD742E6-7FAB-47B7-B6DD-99ABB44B5914}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Debug_Java|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Release_Java|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Release_Java|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{D6170533-C107-4282-B8BB-571C5BAD1D1C}</ProjectGuid>\r
- <ProjectTypeGuids>{f6b19d50-1e2e-4e87-adfb-10393b439de0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Data.DataSetExtensions.Test</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <RootNamespace>System.Data.DataSetExtensions.Test</RootNamespace>\r
- <jarserver>ip2</jarserver>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="System.Data\DataRowComparerTest.cs" />\r
- <Compile Include="System.Data\DataTableExtensionsTest.cs" />\r
- <Compile Include="System.Data\EnumerableRowCollectionTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=1.6.0.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86" />\r
- <Reference Include="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj">\r
- <Project>{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}</Project>\r
- <Name>nunit.framework.dll20.J2EE</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-system="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system-core="" REFS-RefInfo-system-core="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-data-datasetextensions="" REFS-RefInfo-system-data-datasetextensions="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-system-xml-linq="" REFS-RefInfo-system-xml-linq="repository:vmw:framework:2.0" REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.6.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.DataSetExtensions.Test.JavaEE", "System.Data.DataSetExtensions.Test.JavaEE.csproj", "{D6170533-C107-4282-B8BB-571C5BAD1D1C}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll20.J2EE", "..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj", "{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.DataSetExtensions.Test", "System.Data.DataSetExtensions.Test.csproj", "{7C7649EB-F476-4D07-B9DA-896C97148DE8}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Debug|Any CPU = Debug|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Debug_Java20|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Debug|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Debug|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Release_Java20|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Release_Java20|Any CPU.Build.0 = Release_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Release|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {D6170533-C107-4282-B8BB-571C5BAD1D1C}.Release|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release|Any CPU.Build.0 = Release_Java|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Debug_Java|Any CPU.ActiveCfg = Debug|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Debug_Java|Any CPU.Build.0 = Debug|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Debug_Java20|Any CPU.ActiveCfg = Debug|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Debug_Java20|Any CPU.Build.0 = Debug|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Release_Java|Any CPU.ActiveCfg = Release|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Release_Java|Any CPU.Build.0 = Release|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Release_Java20|Any CPU.ActiveCfg = Release|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Release_Java20|Any CPU.Build.0 = Release|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {7C7649EB-F476-4D07-B9DA-896C97148DE8}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
}\r
}\r
\r
- private static MethodInfo _WhereMethod = typeof(Queryable).GetMethods().First(m => m.Name == "Where");\r
+ private static MethodInfo _WhereMethod;\r
internal object GetOtherTableQuery(Expression predicate, ParameterExpression parameter, Type otherTableType, IQueryable otherTable)\r
{\r
+ if (_WhereMethod == null)\r
+ System.Threading.Interlocked.CompareExchange (ref _WhereMethod, typeof(Queryable).GetMethods().First(m => m.Name == "Where"), null);\r
+\r
//predicate: other.EmployeeID== "WARTH"\r
Expression lambdaPredicate = Expression.Lambda(predicate, parameter);\r
//lambdaPredicate: other=>other.EmployeeID== "WARTH"\r
}
}
- #if !TARGET_JVM
#if !MONO_STRICT
public
#endif
}
}
- #endif
}
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
include ../../build/rules.make
LIBRARY = System.Data.OracleClient.dll
-ifeq (net_1_1_java, $(PROFILE))
-LIB_MCS_FLAGS = \
- -r:rt.dll \
- -r:J2SE.Helpers.dll \
- /r:System.dll \
- /r:System.Xml.dll /r:../../class/lib/net_1_1_java/System.Data.dll \
- -nowarn:649 -nowarn:169 -nowarn:219 -nowarn:168 -nowarn:1595 \
- -r:$(corlib) \
- -r:System.Xml.dll \
- /r:System.Drawing.dll
-
-else
LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll \
/r:System.Xml.dll /r:System.Data.dll \
/r:System.EnterpriseServices.dll \
/r:System.Drawing.dll
-endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) /nowarn:618
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U4)] OciDataType dty,
- ref short indp,
- ref short rlenp,
+ IntPtr indp,
+ IntPtr rlenp,
IntPtr rcodep,
uint mode);
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U4)] OciDataType dty,
- ref short indp,
- ref short rlenp,
+ IntPtr indp,
+ IntPtr rlenp,
IntPtr rcodep,
uint mode);
IntPtr valuep,
int value_sz,
OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByName (stmtp, out bindpp, errhp, placeholder, placeh_len, valuep,
- value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
+ value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByNameRef (IntPtr stmtp,
ref IntPtr valuep,
int value_sz,
OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByNameRef (stmtp, out bindpp, errhp, placeholder, placeh_len, ref valuep,
- value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
+ value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByNameBytes (IntPtr stmtp,
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
Trace.WriteLineIf(traceOci, "OCIBindByName", "OCI");
#endif
return OciNativeCalls.OCIBindByNameBytes (stmtp, out bindpp, errhp, placeholder, placeh_len, valuep,
- value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
+ value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPos (IntPtr stmtp,
IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPos (stmtp, out bindpp, errhp, position, valuep,
- value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
+ value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPosRef (IntPtr stmtp,
ref IntPtr valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPosRef (stmtp, out bindpp, errhp, position, ref valuep,
- value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
+ value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
}
internal static int OCIBindByPosBytes (IntPtr stmtp,
byte[] valuep,
int value_sz,
[MarshalAs (UnmanagedType.U2)] OciDataType dty,
- ref short indp,
+ IntPtr indp,
IntPtr alenp,
IntPtr rcodep,
uint maxarr_len,
Trace.WriteLineIf(traceOci, "OCIBindByPos", "OCI");
#endif
return OciNativeCalls.OCIBindByPosBytes (stmtp, out bindpp, errhp, position, valuep,
- value_sz, dty, ref indp, alenp, rcodep, maxarr_len, curelp, mode);
+ value_sz, dty, indp, alenp, rcodep, maxarr_len, curelp, mode);
}
[DllImport ("oci")]
IntPtr valuep,
int value_sz,
OciDataType dty,
- ref short indp,
- ref short rlenp,
+ IntPtr indp,
+ IntPtr rlenp,
IntPtr rcodep,
uint mode)
{
Trace.WriteLineIf(traceOci, "OCIDefineByPos", "OCI");
#endif
return OciNativeCalls.OCIDefineByPos (stmtp, out defnpp, errhp, position, valuep,
- value_sz, dty, ref indp, ref rlenp, rcodep, mode);
+ value_sz, dty, indp, rlenp, rcodep, mode);
}
internal static int OCIDefineByPosPtr (IntPtr stmtp,
ref IntPtr valuep,
int value_sz,
OciDataType dty,
- ref short indp,
- ref short rlenp,
+ IntPtr indp,
+ IntPtr rlenp,
IntPtr rcodep,
uint mode)
{
Trace.WriteLineIf(traceOci, "OCIDefineByPosPtr", "OCI");
#endif
return OciNativeCalls.OCIDefineByPosPtr (stmtp, out defnpp, errhp, position, ref valuep,
- value_sz, dty, ref indp, ref rlenp, rcodep, mode);
+ value_sz, dty, indp, rlenp, rcodep, mode);
}
internal static int OCIDescriptorFree (IntPtr hndlp,
//IntPtr handle;
IntPtr value;
- short indicator;
+ IntPtr indicator;
//OracleType type;
OciDataType ociType;
OciDataType definedType;
int definedSize;
- short rlenp = 0;
+ IntPtr rlenp;
//short precision;
short scale;
Type fieldType;
- //string name;
+ string name;
// Oracle defines the LONG VARCHAR and LONG VARRAW to have a size of 2 to the 31 power - 5
// see DefineLongVarChar and DefineLongVarRaw
{
OciParameterDescriptor parameter = ((OciStatementHandle) Parent).GetParameter (position);
- //name = parameter.GetName ();
+ name = parameter.GetName ();
definedType = parameter.GetDataType ();
definedSize = parameter.GetDataSize ();
//precision = parameter.GetPrecision ();
scale = parameter.GetScale ();
+ rlenp = OciCalls.AllocateClear (sizeof(short));
+ indicator = OciCalls.AllocateClear (sizeof(short));
Define (position, connection);
}
internal bool IsNull {
- get { return (indicator == -1); }
+ get { return (Indicator == -1); }
}
internal short Scale {
}
internal short Size {
- get { return rlenp; }
+ get { return(Marshal.ReadInt16(rlenp)); }
+ set { Marshal.WriteInt16(rlenp, value); }
+ }
+
+ internal short Indicator {
+ get { return(Marshal.ReadInt16(indicator)); }
+ set { Marshal.WriteInt16(indicator, value); }
}
internal IntPtr Value {
ref value,
definedSize,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero,
0);
value,
definedSize,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero,
0);
value,
definedSize,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero, 0);
- rlenp = (short) definedSize;
+ Size = (short) definedSize;
if (status != 0) {
OciErrorInfo info = ErrorHandle.HandleError ();
value,
maxByteCount,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero,
0);
OciErrorHandle.ThrowExceptionIfError (ErrorHandle, status);
ErrorHandle,
position + 1,
value,
- definedSize * 2,
+ definedSize,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero,
0);
ref value,
definedSize,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero,
0);
value,
definedSize,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero, 0);
if (status != 0) {
value,
definedSize,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero, 0);
if (status != 0) {
ref value,
definedSize,
ociType,
- ref indicator,
- ref rlenp,
+ indicator,
+ rlenp,
IntPtr.Zero,
0);
}
disposed = true;
} finally {
+ Marshal.FreeHGlobal (indicator);
+ Marshal.FreeHGlobal (rlenp);
base.Dispose (disposing);
value = IntPtr.Zero;
}
+++ /dev/null
-//\r
-// System.Data.OracleClient.OracleCommand\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Text;\r
-using System.Text.RegularExpressions;\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Data.ProviderBase;\r
-using System.Globalization;\r
-\r
-using java.sql;\r
-// Cannot use this because it makes ArrayList ambiguous reference\r
-//using java.util;\r
-#if !USE_DOTNET_REGEXP\r
-using java.util.regex;\r
-#endif\r
-\r
-namespace System.Data.OracleClient {\r
- public sealed class OracleCommand : AbstractDbCommand {\r
-\r
- #region Fields\r
-#if USE_DOTNET_REGEXP \r
- internal static readonly Regex NamedParameterStoredProcedureRegExp = new Regex(@"^\s*{?\s*((?<RETVAL>\:\w+)\s*=\s*)?call\s+(?<PROCNAME>(((\[[^\]]*\])|([^\.\(])*)\s*\.\s*){0,2}(\[[^\]]*\]|((\s*[^\.\(\)\{\}\s])+)))\s*(\(\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)?\s*(,\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)\s*)*\))?\s*}?\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
-#else\r
- internal static readonly Pattern NamedParameterStoredProcedureRegExp = Pattern.compile(@"^\s*\{?\s*(?:(\:\w+)\s*=\s*)?call\s+((?:(?:(?:\[[^\]]*\])|(?:[^\.\(\)\{\}\[\]])*)\s*\.\s*){0,2}(?:\[[^\]]*\]|(?:(?:\s*[^\.\(\)\{\}\[\]])+)))\s*(?:\((.*)\))?\s*\}?\s*$", Pattern.CASE_INSENSITIVE);\r
-#endif\r
- internal static readonly SimpleRegex NamedParameterRegExp = new OracleParamsRegex();\r
-\r
-// internal static readonly int oracleTypeRefCursor = java.sql.Types.OTHER;\r
- \r
- private int _currentParameterIndex = 0;\r
- private ResultSet _currentRefCursor;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- /**\r
- * Initializes a new instance of the OracleCommand class.\r
- * The base constructor initializes all fields to their default values.\r
- * The following table shows initial property values for an instance of SqlCommand.\r
- */\r
- public OracleCommand() : this(null, null, null) {\r
- }\r
-\r
- public OracleCommand(OracleConnection connection) : this(null, connection, null) {\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the OracleCommand class with the text of the query.\r
- * @param cmdText The text of the query.\r
- */\r
- public OracleCommand(String cmdText) : this(cmdText, null, null) {\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the OracleCommand class with the text of the query and a SqlConnection.\r
- * @param cmdText The text of the query.\r
- * @param connection A SqlConnection that represents the connection to an instance of SQL Server.\r
- */\r
- public OracleCommand(String cmdText, OracleConnection connection) : this(cmdText, connection, null) {\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the OracleCommand class with the text of the query, a SqlConnection, and the Transaction.\r
- * @param cmdText The text of the query.\r
- * @param connection A SqlConnection that represents the connection to an instance of SQL Server.\r
- * @param transaction The SqlTransaction in which the OracleCommand executes.\r
- */\r
- public OracleCommand(\r
- String cmdText,\r
- OracleConnection connection,\r
- OracleTransaction transaction)\r
- : base(cmdText, connection, transaction) {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public new OracleConnection Connection {\r
- get { return (OracleConnection)base.Connection; }\r
- set { base.Connection = (AbstractDBConnection)value; }\r
- }\r
-\r
- public new OracleParameterCollection Parameters {\r
- get { \r
- return (OracleParameterCollection)base.Parameters; \r
- }\r
- }\r
-\r
- public new OracleTransaction Transaction {\r
- get { return (OracleTransaction)base.Transaction; }\r
- set { base.Transaction = (DbTransaction)value; }\r
- }\r
-\r
- protected override bool SkipParameter(DbParameter parameter) {\r
- return ((OracleParameter)parameter).OracleType == OracleType.Cursor;\r
- }\r
-\r
- protected sealed override ResultSet CurrentResultSet {\r
- get { \r
- try {\r
- ResultSet resultSet = base.CurrentResultSet;\r
- \r
- if (resultSet != null) {\r
- return resultSet; \r
- }\r
- return CurrentRefCursor;\r
- }\r
- catch(SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
- }\r
-\r
- private ResultSet CurrentRefCursor {\r
- get {\r
- if (_currentParameterIndex < 0) {\r
- NextRefCursor();\r
- }\r
- if (_currentRefCursor == null && _currentParameterIndex < InternalParameters.Count) {\r
- _currentRefCursor = (ResultSet)((CallableStatement)Statement).getObject(_currentParameterIndex + 1);\r
- }\r
- return _currentRefCursor;\r
- }\r
- }\r
-\r
-#if USE_DOTNET_REGEX\r
- protected override Regex StoredProcedureRegExp\r
-#else\r
- protected override java.util.regex.Pattern StoredProcedureRegExp {\r
-#endif\r
- get { return NamedParameterStoredProcedureRegExp; }\r
- }\r
-\r
- protected override SimpleRegex ParameterRegExp {\r
- get { return NamedParameterRegExp; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- protected override bool NextResultSet() {\r
- try { \r
- bool hasMoreResults = base.NextResultSet();\r
-\r
- if (hasMoreResults) {\r
- return true;\r
- }\r
- else {\r
- return NextRefCursor();\r
- }\r
- }\r
- catch (SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
-\r
- private bool NextRefCursor() {\r
- _currentRefCursor = null;\r
- for (_currentParameterIndex++;InternalParameters.Count > _currentParameterIndex;_currentParameterIndex++) {\r
- OracleParameter param = (OracleParameter)InternalParameters[_currentParameterIndex];\r
- if (param.OracleType == OracleType.Cursor && ((param.Direction & ParameterDirection.Output) == ParameterDirection.Output))\r
- return true; \r
- }\r
- return false;\r
- }\r
-\r
- public new OracleDataReader ExecuteReader() {\r
- return (OracleDataReader)ExecuteReader(CommandBehavior.Default);\r
- }\r
-\r
- public new OracleDataReader ExecuteReader(CommandBehavior behavior) {\r
- return (OracleDataReader)base.ExecuteReader(behavior);\r
- }\r
-\r
- public new OracleParameter CreateParameter() {\r
- return (OracleParameter)CreateParameterInternal();\r
- } \r
-\r
- protected sealed override void CheckParameters() {\r
- //TBD\r
- }\r
-\r
- protected override AbstractDbParameter GetUserParameter(string parameterName, IList userParametersList, int userParametersListPosition) {\r
- for(int i=0; i < userParametersList.Count; i++) {\r
- OracleParameter userParameter = (OracleParameter)userParametersList[i];\r
- if (String.Compare(parameterName, userParameter.InternalPlaceholder.Trim(), true, CultureInfo.InvariantCulture) == 0) {\r
- return userParameter;\r
- }\r
- }\r
-\r
- return null;\r
- }\r
-\r
- protected override AbstractDbParameter GetReturnParameter (IList userParametersList) {\r
- for(int i=0; i < userParametersList.Count; i++) {\r
- AbstractDbParameter userParameter = (AbstractDbParameter)userParametersList[i];\r
- if (userParameter.Direction == ParameterDirection.ReturnValue) {\r
- return userParameter;\r
- }\r
- }\r
-\r
- return null; \r
- }\r
-\r
- protected sealed override DbParameter CreateParameterInternal() {\r
- return new OracleParameter();\r
- }\r
-\r
- protected sealed override DbParameterCollection CreateParameterCollection(AbstractDbCommand parent) {\r
- return new OracleParameterCollection((OracleCommand)parent);\r
- }\r
-\r
- public override object Clone() {\r
- OracleCommand clone = (OracleCommand)base.Clone();\r
- clone._currentParameterIndex = 0;\r
- clone._currentRefCursor = null;\r
- return clone;\r
- }\r
-\r
- protected override void PrepareInternalParameters() {\r
- InternalParameters.Clear();\r
- _currentParameterIndex = -1;\r
- }\r
-\r
- \r
- protected sealed override DbDataReader CreateReader() {\r
- return new OracleDataReader(this);\r
- }\r
-\r
- protected sealed override SystemException CreateException(SQLException e) {\r
- return new OracleException(e,Connection); \r
- }\r
-\r
- public object ExecuteOracleScalar() {\r
- throw new NotImplementedException();\r
- }\r
-\r
-#if SUPPORT_ORACLE_TYPES\r
- public int ExecuteOracleNonQuery(\r
- out OracleString rowid\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-#endif\r
-\r
- #endregion // Methods\r
- \r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.OracleClient.OracleConnection\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-\r
-\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Data.ProviderBase;\r
-using System.Collections;\r
-\r
-using java.sql;\r
-\r
-using System.Configuration;\r
-using Mainsoft.Data.Configuration;\r
-using Mainsoft.Data.Jdbc.Providers;\r
-\r
-namespace System.Data.OracleClient {\r
- public sealed class OracleConnection : AbstractDBConnection, System.ICloneable {\r
- #region Events\r
-\r
- public event OracleInfoMessageEventHandler InfoMessage;\r
-\r
- #endregion // Events\r
- \r
- #region Constructors\r
-\r
- public OracleConnection() : this(null) {\r
- }\r
-\r
- public OracleConnection(String connectionString) : base(connectionString) { \r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- protected override IConnectionProvider GetConnectionProvider() {\r
- IDictionary conProviderDict = ConnectionStringDictionary.Parse(ConnectionString);\r
- string provider = (string)conProviderDict["Provider"];\r
- if (provider == null)\r
- provider = "ORACLECLIENT";\r
-\r
- return GetConnectionProvider("Mainsoft.Data.Configuration/OracleClientProviders", provider);\r
- }\r
-\r
- public new OracleTransaction BeginTransaction(IsolationLevel level) {\r
- return new OracleTransaction(level, this);\r
- }\r
-\r
- public new OracleTransaction BeginTransaction() {\r
- return BeginTransaction(IsolationLevel.ReadCommitted);\r
- }\r
-\r
- public new OracleCommand CreateCommand() {\r
- return new OracleCommand(this);\r
- }\r
-\r
- protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) {\r
- return BeginTransaction();\r
- }\r
-\r
- protected override DbCommand CreateDbCommand() {\r
- return CreateCommand();\r
- }\r
-\r
- protected sealed override SystemException CreateException(SQLException e) {\r
- return new OracleException(e,this); \r
- }\r
-\r
- protected sealed override SystemException CreateException(string message) {\r
- return new OracleException(message, null, this); \r
- }\r
-\r
- protected sealed override void OnSqlWarning(SQLWarning warning) {\r
- OracleErrorCollection col = new OracleErrorCollection(warning, this);\r
- OnOracleInfoMessage(new OracleInfoMessageEventArgs(col));\r
- }\r
-\r
- private void OnOracleInfoMessage (OracleInfoMessageEventArgs value) {
- if (InfoMessage != null) {
- InfoMessage (this, value);
- }
- }\r
-\r
- #endregion // Methods\r
-\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.Oracle.OracleConvert\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Data.Common;\r
-using System.Data.ProviderBase;\r
-\r
-using java.sql;\r
-\r
-namespace System.Data.OracleClient {\r
- #region oracle.sql.Types constants\r
-\r
- internal enum JavaSqlTypes {\r
- ARRAY = 2003 ,\r
- BIGINT = -5, \r
- BINARY = -2 ,\r
- BIT = -7 ,\r
- BLOB = 2004, \r
- BOOLEAN = 16, \r
- CHAR = 1, \r
- CLOB = 2005, \r
- DATALINK = 70, \r
- DATE = 91, \r
- DECIMAL = 3, \r
- DISTINCT = 2001, \r
- DOUBLE = 8, \r
- FLOAT = 6, \r
- INTEGER = 4, \r
- JAVA_OBJECT = 2000, \r
- LONGVARBINARY = -4,\r
- LONGVARCHAR = -1, \r
- NULL = 0, \r
- NUMERIC = 2 ,\r
- OTHER = 1111 ,\r
- REAL = 7 ,\r
- REF = 2006 ,\r
- SMALLINT = 5,\r
- STRUCT = 2002, \r
- TIME = 92, \r
- TIMESTAMP = 93, \r
- TINYINT = -6, \r
- VARBINARY = -3, \r
- VARCHAR = 12,\r
-\r
- //ORACLE types, see oracle.jdbc.OracleTypes\r
- BINARY_FLOAT = 100,\r
- BINARY_DOUBLE = 101,\r
- ROWID = -8,\r
- CURSOR = -10,\r
- TIMESTAMPNS = -100,\r
- TIMESTAMPTZ = -101,\r
- TIMESTAMPLTZ = -102,\r
- INTERVALYM = -103,\r
- INTERVALDS = -104,\r
- }\r
-\r
- #endregion\r
- sealed class OracleConvert : DbConvert {\r
-\r
- #region .Net types constants\r
-\r
- internal static readonly Type TypeOfBoolean = typeof(Boolean);\r
- internal static readonly Type TypeOfSByte = typeof(SByte);\r
- internal static readonly Type TypeOfChar = typeof(Char);\r
- internal static readonly Type TypeOfInt16 = typeof(Int16);\r
- internal static readonly Type TypeOfInt32 = typeof(Int32);\r
- internal static readonly Type TypeOfInt64 = typeof(Int64);\r
- internal static readonly Type TypeOfByte = typeof(Byte);\r
- internal static readonly Type TypeOfUInt16 = typeof(UInt16);\r
- internal static readonly Type TypeOfUInt32 = typeof(UInt32);\r
- internal static readonly Type TypeOfUInt64 = typeof(UInt64);\r
- internal static readonly Type TypeOfDouble = typeof(Double);\r
- internal static readonly Type TypeOfSingle = typeof(Single);\r
- internal static readonly Type TypeOfDecimal = typeof(Decimal);\r
- internal static readonly Type TypeOfString = typeof(String);\r
- internal static readonly Type TypeOfDateTime = typeof(DateTime); \r
- internal static readonly Type TypeOfObject = typeof(object);\r
- internal static readonly Type TypeOfGuid = typeof(Guid);\r
- internal static readonly Type TypeOfType = typeof(Type);\r
-\r
- // additional types\r
- internal static readonly Type TypeOfByteArray = typeof(Byte[]);\r
- internal static readonly Type TypeOfCharArray = typeof(Char[]);\r
- internal static readonly Type TypeOfFloat = typeof (float);\r
- internal static readonly Type TypeOfTimespan = typeof (TimeSpan);\r
- static readonly Type TypeOfIDataReader = typeof(IDataReader);\r
-\r
- #endregion\r
-\r
- #region Methods\r
-\r
- internal static String JdbcTypeNameToDbTypeName(string jdbcTypeName) {\r
- return jdbcTypeName.Trim();;\r
- }\r
-\r
- internal static OracleType JdbcTypeToOracleType(int jdbcType) {\r
- switch ((JavaSqlTypes)jdbcType) {\r
- case JavaSqlTypes.ARRAY: return OracleType.Blob;\r
- case JavaSqlTypes.BIGINT: return OracleType.Number;\r
- case JavaSqlTypes.BINARY: return OracleType.Blob;\r
- case JavaSqlTypes.BIT: return OracleType.Byte;\r
- case JavaSqlTypes.BLOB: return OracleType.Blob;\r
- case JavaSqlTypes.BOOLEAN: return OracleType.Byte;\r
- case JavaSqlTypes.CHAR: return OracleType.Char;\r
- case JavaSqlTypes.CLOB: return OracleType.Clob;\r
-// case JavaSqlTypes.DATALINK: return OracleType.IUnknown;\r
- case JavaSqlTypes.DATE: return OracleType.DateTime;\r
- case JavaSqlTypes.DECIMAL: return OracleType.Number;\r
-// case JavaSqlTypes.DISTINCT: return OracleType.IUnknown; \r
- case JavaSqlTypes.DOUBLE: return OracleType.Double;\r
- case JavaSqlTypes.FLOAT: return OracleType.Float;\r
- case JavaSqlTypes.INTEGER: return OracleType.Int32;\r
-// case JavaSqlTypes.JAVA_OBJECT: return OracleType.IUnknown;\r
- case JavaSqlTypes.LONGVARBINARY: return OracleType.LongRaw;\r
- case JavaSqlTypes.LONGVARCHAR: return OracleType.LongVarChar;\r
-// case JavaSqlTypes.NULL: return OracleType.Empty;\r
- case JavaSqlTypes.NUMERIC: return OracleType.Number;\r
-// case JavaSqlTypes.OTHER: return OracleType.IUnknown;\r
-// case JavaSqlTypes.REAL: return OracleType.Single;\r
-// case JavaSqlTypes.REF: return OracleType.IUnknown;\r
- case JavaSqlTypes.SMALLINT: return OracleType.Int16;\r
-// case JavaSqlTypes.STRUCT: return OracleType.IUnknown;\r
- case JavaSqlTypes.TIME: return OracleType.TimestampLocal;\r
- case JavaSqlTypes.TIMESTAMP: return OracleType.Timestamp;\r
- case JavaSqlTypes.TINYINT: return OracleType.Byte;\r
- case JavaSqlTypes.VARBINARY: return OracleType.LongVarChar;\r
- default:\r
- case JavaSqlTypes.VARCHAR: return OracleType.VarChar;\r
-\r
- case JavaSqlTypes.BINARY_FLOAT: return OracleType.Float;\r
- case JavaSqlTypes.BINARY_DOUBLE: return OracleType.Double;\r
- case JavaSqlTypes.ROWID: return OracleType.RowId;\r
- case JavaSqlTypes.CURSOR: return OracleType.Cursor;\r
- case JavaSqlTypes.TIMESTAMPNS: return OracleType.Timestamp;\r
- case JavaSqlTypes.TIMESTAMPTZ: return OracleType.TimestampWithTZ;\r
- case JavaSqlTypes.TIMESTAMPLTZ: return OracleType.TimestampLocal; \r
- case JavaSqlTypes.INTERVALYM: return OracleType.IntervalYearToMonth;\r
- case JavaSqlTypes.INTERVALDS: return OracleType.IntervalDayToSecond;\r
- }\r
- }\r
-\r
- internal static OracleType ValueTypeToOracleType(Type type) {\r
- switch (Type.GetTypeCode(type)) {\r
- case TypeCode.Boolean: return OracleType.Byte;\r
- case TypeCode.Byte: return OracleType.Byte;\r
- case TypeCode.Char: return OracleType.Char;\r
- case TypeCode.DateTime: return OracleType.DateTime;\r
-// case TypeCode.DBNull: return OracleType.Empty;\r
- case TypeCode.Decimal: return OracleType.Number;\r
- case TypeCode.Double: return OracleType.Double;\r
-// case TypeCode.Empty: return OracleType.Empty;\r
- case TypeCode.Int16: return OracleType.Int16;\r
- case TypeCode.Int32: return OracleType.Int32;\r
- case TypeCode.Int64: return OracleType.Number;\r
- default:\r
- case TypeCode.Object: {\r
- if (type.Equals(TypeOfByteArray)) return OracleType.Blob;\r
- if (type.Equals(TypeOfTimespan)) return OracleType.Timestamp;\r
- if (type.IsSubclassOf(TypeOfIDataReader)) return OracleType.Cursor;\r
-// if (type.Equals(DbTypes.TypeOfGuid)) return OracleType.Guid;\r
-//\r
- if (type.IsEnum)\r
- return ValueTypeToOracleType (Enum.GetUnderlyingType (type));\r
-//\r
- return OracleType.VarChar;\r
- }\r
- case TypeCode.SByte: return OracleType.SByte;\r
- case TypeCode.Single: return OracleType.Float;\r
- case TypeCode.String: return OracleType.VarChar;\r
- case TypeCode.UInt16: return OracleType.UInt16;\r
- case TypeCode.UInt32: return OracleType.UInt32;\r
- case TypeCode.UInt64: return OracleType.Number;\r
- }\r
- }\r
-\r
- internal static Type OracleTypeToValueType(OracleType oleDbType) {\r
- switch (oleDbType) {\r
-// case OracleType.BigInt : return DbTypes.TypeOfInt64;// typeof(long);\r
-// case OracleType.Binary : return DbTypes.TypeOfByteArray;\r
-// case OracleType.Boolean : return DbTypes.TypeOfBoolean;\r
-// case OracleType.BSTR : return DbTypes.TypeOfString;\r
- case OracleType.BFile : return TypeOfByteArray;\r
- case OracleType.Blob : return TypeOfByteArray;\r
- case OracleType.Byte : return TypeOfByte;\r
- case OracleType.Char : return TypeOfString;\r
- case OracleType.Clob : return TypeOfCharArray;\r
- case OracleType.Cursor : return TypeOfIDataReader;\r
- case OracleType.DateTime : return TypeOfDateTime;\r
-// case OracleType.Currency : return TypeOfDecimal;\r
-// case OracleType.Date : return TypeOfDateTime;\r
-// case OracleType.DBDate : return TypeOfDateTime;\r
-// case OracleType.DBTime : return TypeOfTimespan;\r
-// case OracleType.DBTimeStamp : return TypeOfDateTime;\r
-// case OracleType.Decimal : return TypeOfDecimal;\r
- case OracleType.Double : return TypeOfDouble;\r
- case OracleType.Float : return TypeOfFloat;\r
- case OracleType.Int16 : return TypeOfInt16;\r
- case OracleType.Int32 : return TypeOfInt32;\r
- case OracleType.IntervalDayToSecond : return TypeOfTimespan;\r
- case OracleType.IntervalYearToMonth : return TypeOfInt32;\r
- case OracleType.LongRaw : return TypeOfByteArray;\r
-// case OracleType.Empty : return null; //typeof(DBNull);\r
-// case OracleType.Error : return typeof(Exception);\r
-// case OracleType.Filetime : return TypeOfDateTime;\r
-// case OracleType.Guid : return TypeOfGuid;\r
-// case OracleType.IDispatch : return TypeOfObject;\r
-// case OracleType.Integer : return TypeOfInt32;\r
-// case OracleType.IUnknown : return TypeOfObject;\r
-// case OracleType.LongVarBinary : return TypeOfByteArray;\r
- case OracleType.LongVarChar : return TypeOfString;\r
- case OracleType.NChar : return TypeOfString;\r
- case OracleType.NClob : return TypeOfString;\r
- case OracleType.Number : return TypeOfDecimal;\r
- case OracleType.NVarChar : return TypeOfString;\r
- case OracleType.Raw : return TypeOfByteArray;\r
-\r
- case OracleType.RowId : return TypeOfString;\r
- case OracleType.SByte : return TypeOfSByte;\r
- case OracleType.Timestamp : return TypeOfTimespan;\r
- case OracleType.TimestampLocal : return TypeOfTimespan;\r
- case OracleType.TimestampWithTZ : return TypeOfTimespan;\r
- case OracleType.UInt16 : return TypeOfUInt16;\r
-\r
- case OracleType.UInt32 : return TypeOfUInt32;\r
- case OracleType.VarChar : return TypeOfString;\r
-// case OracleType.LongVarWChar : return TypeOfString;\r
-// case OracleType.Numeric : return TypeOfDecimal;\r
-// case OracleType.PropVariant : return TypeOfObject;\r
-// case OracleType.Single : return TypeOfFloat;\r
-// case OracleType.SmallInt : return TypeOfInt16;\r
-// case OracleType.TinyInt : return TypeOfSByte;\r
-// case OracleType.UnsignedBigInt : return TypeOfUInt64;\r
-// case OracleType.UnsignedInt : return TypeOfUInt32;\r
-// case OracleType.UnsignedSmallInt : return TypeOfUInt16;\r
-// case OracleType.UnsignedTinyInt : return TypeOfByte;\r
-// case OracleType.VarBinary : return TypeOfByteArray;\r
-// case OracleType.VarChar : return TypeOfString;\r
-// case OracleType.Variant : return TypeOfObject;\r
-// case OracleType.VarNumeric : return TypeOfDecimal;\r
-// case OracleType.VarWChar : return TypeOfString;\r
-// case OracleType.WChar : return TypeOfString;\r
- default : return TypeOfObject;\r
- }\r
- }\r
-\r
- internal static OracleType DbTypeToOracleType(DbType dbType) {\r
- switch (dbType) {\r
- case DbType.AnsiString : return OracleType.VarChar;\r
- case DbType.Binary : return OracleType.Blob;\r
- case DbType.Byte : return OracleType.Byte;\r
- case DbType.Boolean : return OracleType.Byte;\r
- case DbType.Currency : return OracleType.Number;\r
- case DbType.Date : return OracleType.DateTime;\r
- case DbType.DateTime : return OracleType.DateTime;\r
- case DbType.Decimal : return OracleType.Number;\r
- case DbType.Double : return OracleType.Double;\r
- case DbType.Guid : return OracleType.Char;\r
- case DbType.Int16 : return OracleType.Int16;\r
- case DbType.Int32 : return OracleType.Int32;\r
- case DbType.Int64 : return OracleType.Number;\r
- case DbType.Object : return OracleType.Cursor;\r
- case DbType.SByte : return OracleType.SByte;\r
- case DbType.Single : return OracleType.Float;\r
- case DbType.String : return OracleType.VarChar;\r
- case DbType.Time : return OracleType.Timestamp;\r
- case DbType.UInt16 : return OracleType.UInt16;\r
- case DbType.UInt32 : return OracleType.UInt32;\r
- case DbType.UInt64 : return OracleType.Number;\r
- case DbType.VarNumeric : return OracleType.Number;\r
- case DbType.AnsiStringFixedLength : return OracleType.NChar;\r
- case DbType.StringFixedLength : return OracleType.Char;\r
- default : throw ExceptionHelper.InvalidDbType((int)dbType);\r
- }\r
- }\r
-\r
- internal static DbType OracleTypeToDbType(OracleType oleDbType) {\r
- switch (oleDbType) {\r
- case OracleType.BFile : return DbType.Binary;\r
- case OracleType.Blob : return DbType.Binary;\r
- case OracleType.Byte : return DbType.Byte;\r
- case OracleType.Char : return DbType.StringFixedLength;\r
- case OracleType.Clob : return DbType.String;\r
- case OracleType.Cursor : return DbType.Object;\r
- case OracleType.DateTime : return DbType.DateTime;\r
- case OracleType.Double : return DbType.Double;\r
- case OracleType.Float : return DbType.Single;\r
- case OracleType.Int16 : return DbType.Int16;\r
- case OracleType.Int32 : return DbType.Int32;\r
- case OracleType.IntervalDayToSecond : return DbType.Time;\r
- case OracleType.IntervalYearToMonth : return DbType.Int32;\r
- case OracleType.LongRaw : return DbType.Binary;\r
- case OracleType.LongVarChar : return DbType.String;\r
- case OracleType.NChar : return DbType.AnsiStringFixedLength;\r
- case OracleType.NClob : return DbType.AnsiString;\r
- case OracleType.Number : return DbType.VarNumeric;\r
- case OracleType.NVarChar : return DbType.AnsiString;\r
- case OracleType.Raw : return DbType.Binary;\r
-\r
- case OracleType.RowId : return DbType.AnsiStringFixedLength;\r
- case OracleType.SByte : return DbType.SByte;\r
- case OracleType.Timestamp : return DbType.Time;\r
- case OracleType.TimestampLocal : return DbType.Time;\r
- case OracleType.TimestampWithTZ : return DbType.Time;\r
- case OracleType.UInt16 : return DbType.UInt16;\r
-\r
- case OracleType.UInt32 : return DbType.UInt32;\r
- case OracleType.VarChar : return DbType.String;\r
-// case OracleType.Empty : return DbType.Object;\r
-// case OracleType.SmallInt : return DbType.Int16;\r
-// case OracleType.Integer : return DbType.Int32;\r
-// case OracleType.Single : return DbType.Single;\r
-// case OracleType.Double : return DbType.Double;\r
-// case OracleType.Currency : return DbType.Currency;\r
-// case OracleType.Date : return DbType.DateTime;\r
-// case OracleType.BSTR : return DbType.String;\r
-// case OracleType.IDispatch : return DbType.Object;\r
-// case OracleType.Error : return DbType.Object;\r
-// case OracleType.Boolean : return DbType.Boolean;\r
-// case OracleType.Variant : return DbType.Object;\r
-// case OracleType.IUnknown : return DbType.Object;\r
-// case OracleType.Decimal : return DbType.Decimal;\r
-// case OracleType.TinyInt : return DbType.SByte;\r
-// case OracleType.UnsignedTinyInt : return DbType.Byte;\r
-// case OracleType.UnsignedSmallInt : return DbType.UInt16;\r
-// case OracleType.UnsignedInt : return DbType.UInt32;\r
-// case OracleType.BigInt : return DbType.Int64;\r
-// case OracleType.UnsignedBigInt : return DbType.UInt64;\r
-// case OracleType.Filetime : return DbType.DateTime;\r
-// case OracleType.Guid : return DbType.Guid;\r
-// case OracleType.Binary : return DbType.Binary;\r
-// case OracleType.Char : return DbType.AnsiStringFixedLength;\r
-// case OracleType.WChar : return DbType.StringFixedLength;\r
-// case OracleType.Numeric : return DbType.Decimal;\r
-// case OracleType.DBDate : return DbType.Date;\r
-// case OracleType.DBTime : return DbType.Time;\r
-// case OracleType.DBTimeStamp : return DbType.DateTime;\r
-// case OracleType.PropVariant : return DbType.Object;\r
-// case OracleType.VarNumeric : return DbType.VarNumeric;\r
-// case OracleType.VarChar : return DbType.AnsiString;\r
-// case OracleType.LongVarChar : return DbType.AnsiString;\r
-// case OracleType.VarWChar : return DbType.String;\r
-// case OracleType.LongVarWChar : return DbType.String;\r
-// case OracleType.VarBinary : return DbType.Binary;\r
-// case OracleType.LongVarBinary : return DbType.Binary;\r
- default : throw ExceptionHelper.InvalidOleDbType((int)oleDbType);\r
- }\r
- }\r
-\r
- internal static int OracleTypeToJdbcType(OracleType oleDbType) {\r
- switch(oleDbType) {\r
- case OracleType.BFile : return (int)JavaSqlTypes.BINARY;\r
- case OracleType.Blob : return (int)JavaSqlTypes.BINARY;\r
- case OracleType.Byte : return (int)JavaSqlTypes.TINYINT;\r
- case OracleType.Char : return (int)JavaSqlTypes.CHAR;\r
- case OracleType.Clob : return (int)JavaSqlTypes.CLOB;\r
- case OracleType.Cursor : return (int)JavaSqlTypes.CURSOR;\r
- case OracleType.DateTime : return (int)JavaSqlTypes.TIMESTAMP;\r
- case OracleType.Double : return (int)JavaSqlTypes.DOUBLE;\r
- case OracleType.Float : return (int)JavaSqlTypes.FLOAT;\r
- case OracleType.Int16 : return (int)JavaSqlTypes.SMALLINT;\r
- case OracleType.Int32 : return (int)JavaSqlTypes.INTEGER;\r
- case OracleType.IntervalDayToSecond : return (int)JavaSqlTypes.INTERVALDS;\r
- case OracleType.IntervalYearToMonth : return (int)JavaSqlTypes.INTERVALYM;\r
- case OracleType.LongRaw : return (int)JavaSqlTypes.LONGVARBINARY;\r
- case OracleType.LongVarChar : return (int)JavaSqlTypes.LONGVARCHAR;\r
- case OracleType.NChar : return (int)JavaSqlTypes.CHAR;\r
- case OracleType.NClob : return (int)JavaSqlTypes.CLOB;\r
- case OracleType.Number : return (int)JavaSqlTypes.NUMERIC;\r
- case OracleType.NVarChar : return (int)JavaSqlTypes.VARCHAR;\r
- case OracleType.Raw : return (int)JavaSqlTypes.BINARY;\r
-\r
- case OracleType.RowId : return (int)JavaSqlTypes.VARCHAR;\r
- case OracleType.SByte : return (int)JavaSqlTypes.TINYINT;\r
- case OracleType.Timestamp : return (int)JavaSqlTypes.TIMESTAMP;\r
- case OracleType.TimestampLocal : return (int)JavaSqlTypes.TIMESTAMP;\r
- case OracleType.TimestampWithTZ : return (int)JavaSqlTypes.TIMESTAMP;\r
- case OracleType.UInt16 : return (int)JavaSqlTypes.SMALLINT;\r
-\r
- case OracleType.UInt32 : return (int)JavaSqlTypes.INTEGER;\r
- case OracleType.VarChar : return (int)JavaSqlTypes.VARCHAR;\r
-// case OracleType.BigInt : return Types.BIGINT;\r
-// case OracleType.Binary : return Types.BINARY;\r
-// case OracleType.Boolean : return Types.BIT;\r
-// case OracleType.BSTR : return Types.VARCHAR;\r
-// case OracleType.Char : return Types.CHAR;\r
-// case OracleType.Currency : return Types.DECIMAL;\r
-// case OracleType.Date : return Types.TIMESTAMP;\r
-// case OracleType.DBDate : return Types.DATE;\r
-// case OracleType.DBTime : return Types.TIME;\r
-// case OracleType.DBTimeStamp : return Types.TIMESTAMP;\r
-// case OracleType.Decimal : return Types.DECIMAL;\r
-// case OracleType.Double : return Types.DOUBLE;\r
-// case OracleType.Empty : return Types.NULL;\r
-// case OracleType.Error : return Types.OTHER;\r
-// case OracleType.Filetime : return Types.TIMESTAMP;\r
-// case OracleType.Guid : return Types.CHAR;\r
-// case OracleType.IDispatch : return Types.OTHER; //throw new ArgumentException("The " + oleDbType + " OracleType value is not supported.");\r
-// case OracleType.Integer : return Types.INTEGER;\r
-// case OracleType.IUnknown : return Types.OTHER; //throw new ArgumentException("The " + oleDbType + " OracleType value is not supported.");\r
-// case OracleType.LongVarBinary : return Types.LONGVARBINARY;\r
-// case OracleType.LongVarChar : return Types.LONGVARCHAR;\r
-// case OracleType.LongVarWChar : return Types.LONGVARCHAR;\r
-// case OracleType.Numeric : return Types.NUMERIC;\r
-// case OracleType.PropVariant : return Types.OTHER;\r
-// case OracleType.Single : return Types.FLOAT;\r
-// case OracleType.SmallInt : return Types.SMALLINT;\r
-// case OracleType.TinyInt : return Types.TINYINT;\r
-// case OracleType.UnsignedBigInt : return Types.BIGINT;\r
-// case OracleType.UnsignedInt : return Types.INTEGER;\r
-// case OracleType.UnsignedSmallInt : return Types.SMALLINT;\r
-// case OracleType.UnsignedTinyInt : return Types.TINYINT;\r
-// case OracleType.VarBinary : return Types.VARBINARY;\r
-// case OracleType.VarChar : return Types.VARCHAR;\r
-// case OracleType.Variant : return Types.VARCHAR;\r
-// case OracleType.VarNumeric : return Types.DECIMAL;\r
-// case OracleType.VarWChar : return Types.VARCHAR;\r
-// case OracleType.WChar : return Types.VARCHAR;\r
- default : throw ExceptionHelper.InvalidOleDbType((int)oleDbType);\r
- }\r
-\r
- #endregion // Methods\r
- }\r
- }\r
-}\r
+++ /dev/null
-//\r
-// System.Data.OracleClient.OracleDataReader\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-//\r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Data.Common;\r
-using System.Data.ProviderBase;\r
-\r
-using java.sql;\r
-\r
-namespace System.Data.OracleClient {\r
- public sealed class OracleDataReader : AbstractDataReader {\r
- #region Fields\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- internal OracleDataReader(OracleCommand command) : base(command) {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- protected sealed override SystemException CreateException(string message, SQLException e) {\r
- return new OracleException(message,e, (OracleConnection)_command.Connection); \r
- }\r
-\r
- protected sealed override SystemException CreateException(java.io.IOException e) {\r
- return new OracleException(e, (OracleConnection)_command.Connection); \r
- }\r
-\r
- public override String GetDataTypeName(int columnIndex) {\r
- try {\r
- string jdbcTypeName = Results.getMetaData().getColumnTypeName(columnIndex + 1);\r
- \r
- return OracleConvert.JdbcTypeNameToDbTypeName(jdbcTypeName);\r
- }\r
- catch (SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
-\r
- protected override int GetProviderType(int jdbcType) {\r
- return (int)OracleConvert.JdbcTypeToOracleType(jdbcType); \r
- }\r
-\r
- protected override IReaderCacheContainer CreateReaderCacheContainer(int jdbcType, int columnIndex) {\r
- switch ((JavaSqlTypes)jdbcType) {\r
- case JavaSqlTypes.BINARY_FLOAT:\r
- jdbcType = (int)JavaSqlTypes.REAL;\r
- break;\r
- case JavaSqlTypes.BINARY_DOUBLE:\r
- jdbcType = (int)JavaSqlTypes.DOUBLE;\r
- break;\r
- case JavaSqlTypes.ROWID:\r
- jdbcType = (int)JavaSqlTypes.VARCHAR;\r
- break;\r
-// case JavaSqlTypes.CURSOR:\r
-// jdbcType = JavaSqlTypes.OTHER;\r
-// break;\r
- case JavaSqlTypes.TIMESTAMPNS:\r
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;\r
- break;\r
- case JavaSqlTypes.TIMESTAMPTZ:\r
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;\r
- break;\r
- case JavaSqlTypes.TIMESTAMPLTZ: \r
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;\r
- break;\r
- case JavaSqlTypes.INTERVALYM:\r
- jdbcType = (int)JavaSqlTypes.INTEGER;\r
- break;\r
- case JavaSqlTypes.INTERVALDS:\r
- jdbcType = (int)JavaSqlTypes.TIMESTAMP;\r
- break;\r
- }\r
- return base.CreateReaderCacheContainer (jdbcType, columnIndex);\r
- }\r
-\r
-\r
- protected override void SetSchemaType(DataRow schemaRow, ResultSetMetaData metaData, int columnIndex) {\r
- JavaSqlTypes columnType = (JavaSqlTypes)metaData.getColumnType(columnIndex);\r
- switch (columnType) {\r
- case JavaSqlTypes.BINARY_FLOAT:\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfFloat;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- case JavaSqlTypes.BINARY_DOUBLE:\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfDouble;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- case JavaSqlTypes.ROWID:\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfString;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- case JavaSqlTypes.CURSOR:\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfDouble;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- case JavaSqlTypes.TIMESTAMPNS:\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- case JavaSqlTypes.TIMESTAMPTZ:\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- case JavaSqlTypes.TIMESTAMPLTZ: \r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- case JavaSqlTypes.INTERVALYM:\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfUInt32;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- case JavaSqlTypes.INTERVALDS:\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = OracleConvert.TypeOfTimespan;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- default:\r
- base.SetSchemaType(schemaRow, metaData, columnIndex);\r
- break;\r
- }\r
- }\r
-\r
- public override decimal GetDecimal(int i) {\r
- if (IsNumeric(i))\r
- return GetDecimalSafe(i);\r
-\r
- return base.GetDecimal(i);\r
- }\r
-\r
- public override double GetDouble(int i) {\r
- if (IsNumeric(i))\r
- return GetDoubleSafe(i);\r
-\r
- return base.GetDouble(i);\r
- }\r
-\r
- public override float GetFloat(int i) {\r
- if (IsNumeric(i))\r
- return GetFloatSafe(i);\r
-\r
- return base.GetFloat(i);\r
- }\r
-//\r
-// OracleClient does not "excuse" for Int16\r
-//\r
-// public override short GetInt16(int i) {\r
-// if (IsNumeric(i))\r
-// return GetInt16Safe(i);\r
-//\r
-// return base.GetInt16(i);\r
-// }\r
-\r
-\r
- public override int GetInt32(int i) {\r
- if (IsNumeric(i))\r
- return GetInt32Safe(i);\r
-\r
- return base.GetInt32(i);\r
- }\r
-\r
- public override long GetInt64(int i) {\r
- if (IsNumeric(i))\r
- return GetInt64Safe(i);\r
-\r
- return base.GetInt64(i);\r
- }\r
-\r
-#if SUPPORT_ORACLE_TYPES\r
- #region GetOracleXXX\r
-\r
- public OracleBFile GetOracleBFile(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public OracleBinary GetOracleBinary(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public OracleDateTime GetOracleDateTime(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public OracleLob GetOracleLob(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public OracleMonthSpan GetOracleMonthSpan(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public OracleNumber GetOracleNumber(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public OracleString GetOracleString(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public OracleTimeSpan GetOracleTimeSpan(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public object GetOracleValue(\r
- int i\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- public int GetOracleValues(\r
- object[] values\r
- ) {\r
- throw new NotImplementedException();\r
- }\r
-\r
- #endregion\r
-#endif\r
-\r
- #endregion // Methods\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.OleDb.OleDbError\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-\r
-namespace System.Data.OracleClient {\r
- using java.sql;\r
- using System.Data.Common;\r
- using System.Data.ProviderBase;\r
-\r
- [Serializable]\r
- internal sealed class OracleError : AbstractDbError {\r
-\r
- internal OracleError(SQLException e, AbstractDBConnection connection) : base(e, connection) {\r
- }\r
- \r
- public String Message {\r
- get {\r
- return DbMessage;\r
- }\r
- }\r
- \r
- public int NativeError {\r
- get {\r
- return DbErrorCode;\r
- }\r
- }\r
- \r
- public String Source {\r
- get {\r
- return DbSource;\r
- }\r
- }\r
- \r
- public String SQLState {\r
- get {\r
- return DbSQLState;\r
- }\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.OleDb.OleDbErrorCollection\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-\r
-namespace System.Data.OracleClient {\r
-\r
-\r
- using System.Collections;\r
- using java.sql;\r
- using System.Data.Common;\r
- using System.Data.ProviderBase;\r
-\r
- [Serializable]\r
- public sealed class OracleErrorCollection : AbstractDbErrorCollection {\r
- internal OracleErrorCollection(SQLException e, AbstractDBConnection connection) : base(e, connection) {\r
- }\r
- /**\r
- * Gets the error at the specified index.\r
- *\r
- * @param index of the error\r
- * @return Error on specified index\r
- */\r
- internal OracleError this[int index] {\r
- get {\r
- return (OracleError)GetDbItem(index);\r
- }\r
- }\r
-\r
- protected override AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection) {\r
- return new OracleError(e, connection);\r
- }\r
-\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.SqlClient.SqlException\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-namespace System.Data.OracleClient {\r
-\r
- using java.sql;\r
-\r
- using System;\r
- using System.Data.ProviderBase;\r
-\r
- /**\r
- * The exception that is thrown when SQL Server returns a warning or error.\r
- * This class cannot be inherited.\r
- */\r
-\r
- /*\r
- * CURRENT LIMITATIONS\r
- * 1. Constructor for serialization SqlException(SerializationInfo info, StreamingContext sc) \r
- * is not supported.\r
- * 2. Method "void GetObjectData(...,...)" is not supported (serialization)\r
- */\r
-\r
- public sealed class OracleException : AbstractDbException {\r
- internal OracleException(Exception cause, OracleConnection connection) : base(cause, connection) {}\r
-\r
- internal OracleException(SQLException cause, OracleConnection connection) : base(cause, connection) {}\r
-\r
- internal OracleException(string message, SQLException cause, OracleConnection connection) : base(message, cause, connection) {}\r
-\r
- protected override AbstractDbErrorCollection DbErrors {\r
- get {\r
- return Errors;\r
- }\r
- }\r
-\r
- \r
-\r
- /**\r
- * Gets the severity level of the error returned from the SQL Server .NET \r
- * Data Provider.\r
- * @return severity level of the first error in the collection.\r
- */\r
-// public byte Class {\r
-// get {\r
-// SqlErrorCollection errors = Errors;\r
-// return errors.Count > 0 ? errors[0].Class : (byte)0;\r
-// }\r
-// }\r
-\r
- /**\r
- * Gets a collection of one or more SqlError objects that give detailed \r
- * information about exceptions generated by the SQL Server .NET Data Provider.\r
- * @return collection of SqlError objects\r
- */\r
- internal OracleErrorCollection Errors {\r
- get {\r
- return new OracleErrorCollection(_cause, _connection);\r
- }\r
- }\r
-\r
- public int Code {\r
- get { return DbErrorCode; }\r
- }\r
-\r
- /**\r
- * Gets the line number within the Transact-SQL command batch or stored \r
- * procedure that generated the error.\r
- * @return line number of the first error in the collection.\r
- */\r
-// public int LineNumber {\r
-// get {\r
-// SqlErrorCollection errors = Errors;\r
-// return errors.Count > 0 ? errors[0].LineNumber : 0;\r
-// }\r
-// }\r
-\r
- /**\r
- * Gets a number that identifies the type of error.\r
- * @return number that identifies the type of first error in the collection\r
- */\r
-// public int Number {\r
-// get {\r
-// SqlErrorCollection errors = Errors;\r
-// return errors.Count > 0 ? errors[0].Number : 0;\r
-// }\r
-// }\r
-\r
- /**\r
- * Gets the name of the stored procedure or remote procedure call (RPC) \r
- * that generated the error.\r
- * @return name of the stored procedure \r
- */\r
-// public String Procedure {\r
-// get {\r
-// SqlErrorCollection errors = Errors;\r
-// return errors.Count > 0 ? errors[0].Procedure : null;\r
-// }\r
-// }\r
-\r
- /**\r
- * Gets the name of the computer running an instance of SQL Server \r
- * that generated the error.\r
- * @return name of the computer where error generated\r
- */\r
-// public String Server {\r
-// get {\r
-// SqlErrorCollection errors = Errors;\r
-// return errors.Count > 0 ? errors[0].Server : null;\r
-// }\r
-// }\r
-\r
-\r
- /**\r
- * Gets a numeric error code from SQL Server that represents an error, \r
- * warning or "no data found" message. \r
- * @return numeric error code from SQL Server\r
- */\r
-// public byte State {\r
-// get {\r
-// SqlErrorCollection errors = Errors;\r
-// return errors.Count > 0 ? errors[0].State : (byte)0;\r
-// }\r
-// }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.OracleClient.OracleParameter\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Text;\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Data.ProviderBase;\r
-using System.Globalization;\r
-\r
-using java.sql;\r
-using java.lang;\r
-\r
-namespace System.Data.OracleClient {\r
- public sealed class OracleParameter : AbstractDbParameter, ICloneable {\r
-\r
- #region Fields\r
-\r
- OracleType _oleDbType = OracleType.VarChar;\r
-\r
- #endregion // Fields\r
- \r
- #region Constructors\r
-\r
- public OracleParameter() {\r
- }\r
- \r
- public OracleParameter(String parameterName, Object value)\r
- : this (parameterName, OracleType.VarChar, 0, ParameterDirection.Input,\r
- false, 0, 0, String.Empty, DataRowVersion.Current, value) {\r
- IsDbTypeSet = false;\r
- }\r
- \r
- public OracleParameter(String parameterName, OracleType dbType)\r
- : this (parameterName, dbType, 0, ParameterDirection.Input,\r
- false, 0, 0, String.Empty, DataRowVersion.Current, null) {\r
- }\r
- \r
- public OracleParameter(String parameterName, OracleType dbType, int size)\r
- : this (parameterName, dbType, size, ParameterDirection.Input,\r
- false, 0, 0, String.Empty, DataRowVersion.Current, null) {\r
- }\r
- \r
- public OracleParameter(String parameterName, OracleType dbType, int size,\r
- String sourceColumn)\r
- : this (parameterName, dbType, size, ParameterDirection.Input,\r
- false, 0, 0, sourceColumn, DataRowVersion.Current, null) {\r
- }\r
- \r
- \r
- public OracleParameter(String parameterName, \r
- OracleType dbType, \r
- int size,\r
- ParameterDirection direction, \r
- bool isNullable,\r
- byte precision, \r
- byte scale, \r
- String sourceColumn,\r
- DataRowVersion sourceVersion, \r
- Object value) {\r
- ParameterName = parameterName;\r
- OracleType = dbType;\r
- Size = size;\r
- Direction = direction;\r
- IsNullable = isNullable;\r
- Precision = precision;\r
- Scale = scale;\r
- SourceColumn = sourceColumn;\r
- SourceVersion = sourceVersion;\r
- Value = value;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public override DbType DbType {\r
- get { return OracleConvert.OracleTypeToDbType(_oleDbType); } \r
- set { OracleType = OracleConvert.DbTypeToOracleType(value); }\r
- } \r
- \r
- public OracleType OracleType {\r
- get { return _oleDbType; } \r
- set {\r
- _oleDbType = value;\r
- IsDbTypeSet = true;\r
- }\r
- } \r
- \r
- public new Object Value {\r
- get { return base.Value; }\r
- set {\r
- if (!IsDbTypeSet && (value != null) && (value != DBNull.Value)) {\r
- _oleDbType = OracleConvert.ValueTypeToOracleType(value.GetType());\r
- }\r
- base.Value = value;\r
- }\r
- }\r
-\r
-#if NET_2_0\r
- public new byte Precision {\r
- get { return base.Precision; }\r
- set { base.Precision = value; }\r
- }\r
-\r
- public new byte Scale {\r
- get { return base.Scale; }\r
- set { base.Scale = value; }\r
- }\r
-#endif\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public override String ToString() {\r
- return ParameterName;\r
- }\r
-\r
- protected override string Placeholder {\r
- get {\r
- if (ParameterName.Length == 0 || ParameterName[0] == ':')\r
- return ParameterName;\r
-\r
- return String.Concat(":", ParameterName);\r
- }\r
- }\r
-\r
- internal string InternalPlaceholder {\r
- get {\r
- return Placeholder;\r
- }\r
- }\r
-\r
- protected sealed override object ConvertValue(object value) {\r
- // can not convert null or DbNull to other types\r
- if (value == null || value == DBNull.Value) {\r
- return value;\r
- }\r
-\r
- // TBD : some other way to do this?\r
-// if (OracleType == OracleType.Binary) {\r
-// return value;\r
-// }\r
- // .NET throws an exception to the user.\r
- object convertedValue = value;\r
-\r
- // note : if we set user parameter jdbc type inside prepare interbal, the db type is not set\r
- if (value is IConvertible && (IsDbTypeSet || IsJdbcTypeSet)) {\r
- OracleType oleDbType = (IsDbTypeSet) ? OracleType : OracleConvert.JdbcTypeToOracleType((int)JdbcType);\r
- Type to = OracleConvert.OracleTypeToValueType(oleDbType);\r
- if (!(value is DateTime && to == OracleConvert.TypeOfTimespan)) //anyway will go by jdbc type\r
- convertedValue = Convert.ChangeType(value,to);\r
- }\r
- return convertedValue;\r
- }\r
-\r
- protected sealed override void SetParameterName(ResultSet res) {\r
- ParameterName = res.getString("COLUMN_NAME");\r
- }\r
-\r
- protected sealed override void SetParameterDbType(ResultSet res) {\r
- int jdbcType = res.getInt("DATA_TYPE"); \r
- // FIXME : is that correct?\r
- if (jdbcType == Types.OTHER) {\r
- string typeName = res.getString("TYPE_NAME");\r
- if (String.Compare("REF CURSOR", typeName, true, CultureInfo.InvariantCulture) == 0) {\r
- jdbcType = (int)JavaSqlTypes.CURSOR;\r
- }\r
- else if (String.Compare("BLOB",typeName,true, CultureInfo.InvariantCulture) == 0) {\r
- jdbcType = (int)JavaSqlTypes.BLOB;\r
- }\r
- else if (String.Compare("CLOB",typeName,true, CultureInfo.InvariantCulture) == 0) {\r
- jdbcType = (int)JavaSqlTypes.CLOB;\r
- }\r
- else if(String.Compare("FLOAT",typeName,true, CultureInfo.InvariantCulture) == 0) {\r
- jdbcType = (int)JavaSqlTypes.FLOAT;\r
- }\r
- else if(String.Compare("NVARCHAR2",typeName,true, CultureInfo.InvariantCulture) == 0) {\r
- jdbcType = (int)JavaSqlTypes.VARCHAR;\r
- }\r
- else if(String.Compare("NCHAR",typeName,true, CultureInfo.InvariantCulture) == 0) {\r
- jdbcType = (int)JavaSqlTypes.VARCHAR;\r
- }\r
- }\r
- OracleType = OracleConvert.JdbcTypeToOracleType(jdbcType);\r
- JdbcType = jdbcType;\r
- }\r
-\r
- protected sealed override void SetSpecialFeatures(ResultSet res) {\r
- // do nothing\r
- }\r
-\r
- protected sealed override int JdbcTypeFromProviderType() {\r
- return OracleConvert.OracleTypeToJdbcType(OracleType);\r
- }\r
-\r
- #endregion // Methods\r
- \r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.Data.OracleClient", "System.Data.OracleClient.vmwcsproj", "{168E2978-1640-405C-99B8-8CD81B27BC92}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.Data", "..\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
- {168E2978-1640-405C-99B8-8CD81B27BC92}.Debug.ActiveCfg = Debug_Java|.NET
- {168E2978-1640-405C-99B8-8CD81B27BC92}.Debug.Build.0 = Debug_Java|.NET
- {168E2978-1640-405C-99B8-8CD81B27BC92}.Debug_Java.ActiveCfg = Debug_Java|.NET
- {168E2978-1640-405C-99B8-8CD81B27BC92}.Debug_Java.Build.0 = Debug_Java|.NET
- {168E2978-1640-405C-99B8-8CD81B27BC92}.Release.ActiveCfg = Release_Java|.NET
- {168E2978-1640-405C-99B8-8CD81B27BC92}.Release.Build.0 = Release_Java|.NET
- {168E2978-1640-405C-99B8-8CD81B27BC92}.Release_Java.ActiveCfg = Release_Java|.NET
- {168E2978-1640-405C-99B8-8CD81B27BC92}.Release_Java.Build.0 = Release_Java|.NET
- {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}.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
return new OracleConnectionStringBuilder ();
}
-#if !TARGET_JVM
public override CodeAccessPermission CreatePermission (PermissionState state) {
return new OraclePermission (state);
}
-#endif
public override DbDataAdapter CreateDataAdapter () {
return new OracleDataAdapter ();
namespace System.Data.OracleClient
{
[TypeConverter (typeof(OracleParameter.OracleParameterConverter))]
- public sealed class OracleParameter :
+ public sealed class OracleParameter :
#if NET_2_0
- DbParameter, IDbDataParameter, ICloneable
+ DbParameter, IDbDataParameter, ICloneable,
#else
- MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
+ MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable,
#endif
+ IDisposable
{
#region Fields
object value = DBNull.Value;
OciLobLocator lobLocator; // only if Blob or Clob
IntPtr bindOutValue = IntPtr.Zero;
+ IntPtr indicator = IntPtr.Zero;
OciDateTimeDescriptor dateTimeDesc;
IntPtr cursor = IntPtr.Zero;
bool useRef;
OciDataType bindType;
- short indicator;
int bindSize;
bool sizeManuallySet;
this.value = value.value;
this.lobLocator = value.lobLocator;
this.oracleTypeSet = value.oracleTypeSet;
+ this.indicator = OciCalls.AllocateClear (sizeof(short));
}
public OracleParameter ()
this.srcVersion = DataRowVersion.Current;
this.value = null;
this.oracleTypeSet = false;
+ this.indicator = OciCalls.AllocateClear (sizeof(short));
}
public OracleParameter (string name, object value)
srcColumn = string.Empty;
SourceVersion = DataRowVersion.Current;
InferOracleType (value);
+ this.indicator = OciCalls.AllocateClear (sizeof(short));
#if NET_2_0
// Find the OciType before inferring for the size
if (value != null && value != DBNull.Value) {
OracleType = oracleType;
SourceColumn = sourceColumn;
SourceVersion = sourceVersion;
+ this.indicator = OciCalls.AllocateClear (sizeof(short));
}
#endif
OracleType = oracleType;
SourceColumn = srcColumn;
SourceVersion = srcVersion;
+ this.indicator = OciCalls.AllocateClear (sizeof(short));
+ }
+
+ ~OracleParameter ()
+ {
+ Dispose(false);
}
#endregion // Constructors
set { container = value; }
}
+ internal short Indicator {
+ get { return (Marshal.ReadInt16(indicator)); }
+ set { Marshal.WriteInt16(indicator, value); }
+ }
+
#if !NET_2_0
[Browsable (false)]
[RefreshProperties (RefreshProperties.All)]
}
if (isnull == true && direction == ParameterDirection.Input) {
- indicator = 0;
bindType = OciDataType.VarChar2;
bindSize = 0;
} else {
case OciDataType.CharZ:
case OciDataType.OciString:
bindType = OciDataType.String;
- indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
dt = DateTime.MinValue;
sDate = "";
if (isnull)
- indicator = -1;
+ Indicator = -1;
else if (v is String) {
sDate = (string) v;
dt = DateTime.Parse (sDate);
case OciDataType.Float:
case OciDataType.Number:
bindType = OciDataType.String;
- indicator = 0;
+ Indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
bindSize = Size + 5; // 4 bytes prepended for length, bytes, 1 byte NUL character
- indicator = 0;
+ Indicator = 0;
svalue = "\0";
// convert value from managed type to type to marshal
if (direction == ParameterDirection.Input ||
case OciDataType.VarRaw:
bindType = OciDataType.VarRaw;
bindSize = Size + 2; // include 2 bytes prepended to hold the length
- indicator = 0;
+ Indicator = 0;
bytes = new byte [bindSize];
if (direction == ParameterDirection.Input ||
direction == ParameterDirection.InputOutput) {
case OciDataType.LongVarRaw:
bindType = OciDataType.LongVarRaw;
bindSize = Size + 4; // include 4 bytes prepended to hold the length
- indicator = 0;
+ Indicator = 0;
bytes = new byte [bindSize];
if (direction == ParameterDirection.Input ||
direction == ParameterDirection.InputOutput) {
ref bindValue,
bindSize,
bindType,
- ref indicator,
+ indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
ref bindValue,
bindSize,
bindType,
- ref indicator,
+ indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
ref cursor,
bindSize,
bindType,
- ref indicator,
+ indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
bytes,
bindSize,
bindType,
- ref indicator,
+ indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
bindValue,
bindSize,
bindType,
- ref indicator,
+ indicator,
IntPtr.Zero,
IntPtr.Zero,
0,
// used to update the parameter value
// for Output, the output of InputOutput, and Return parameters
value = DBNull.Value;
- if (indicator == -1)
+ if (Indicator == -1)
return;
int rsize = 0;
return buffer;
}
+ public void Dispose ()
+ {
+ Dispose (true);
+ }
+
+ void Dispose (bool disposing)
+ {
+ if (disposing) {
+ GC.SuppressFinalize(this);
+ }
+ if (indicator != IntPtr.Zero) {
+ Marshal.FreeHGlobal (indicator);
+ indicator = IntPtr.Zero;
+ }
+ }
+
#endregion // Methods
internal sealed class OracleParameterConverter : ExpandableObjectConverter
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{71F3DF41-7E2F-41FB-B470-110851F2E758}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>System.Data.OracleClient</RootNamespace>
- <AssemblyName>System.Data.OracleClient</AssemblyName>
- <JDKName>1.4.2</JDKName>
- <GHProjectType>1</GHProjectType>
- <GHProjectKind>framework</GHProjectKind>
- <Version>2.0</Version>
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">
- <OutputPath>bin\Release_Java20\</OutputPath>
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>True</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.4.2</JDKName>
- <TargetPlatform>0</TargetPlatform>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\Debug_Java20\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>True</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.4.2</JDKName>
- <TargetPlatform>0</TargetPlatform>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Java\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <NoStdLib>false</NoStdLib>
- <SkipValidation>True</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Java\</OutputPath>
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <NoStdLib>false</NoStdLib>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <ProjectExtensions>
- <VisualStudio>
- <UserProperties REFS-JarPath-system-drawing="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Drawing.jar;..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\jai_imageio.jar;..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\jai_core.jar;..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\jai_codec.jar;..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\clibwrapper_jiio.jar;..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mlibwrapper_jai.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-RefInfo-rt="repository:jre:sun:1.4.2" REFS-JarPath-rt="" />
- </VisualStudio>
- </ProjectExtensions>
- <ItemGroup>
- <Compile Include="..\..\build\common\Locale.cs">
- <Link>Assembly\Locale.cs</Link>
- </Compile>
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">
- <Link>Assembly\MonoTODOAttribute.cs</Link>
- </Compile>
- <Compile Include="Assembly\AssemblyInfo.cs" />
- <Compile Include="Mainsoft.Data.Jdbc.Providers.jvm\OracleProvider.cs" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\..\build\common\Consts.cs.in">
- <Link>Assembly\Consts.cs.in</Link>
- </Compile>
- <Compile Include="System.Data.OracleClient.jvm\ExceptionHelper.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Data.OracleClient.jvm\OracleCommandBuilder.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Data.OracleClient.jvm\OracleConvert.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleError.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleErrorCollection.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleException.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleInfoMessageEventArgs.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameter.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameterCollection.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleTransaction.cs" />
- <Compile Include="System.Data.OracleClient.jvm\Regex.cs" />
- <Compile Include="System.Data.OracleClient\OracleClientFactory.cs" />
- <Compile Include="System.Data.OracleClient\OracleDataAdapter.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Data.OracleClient\OracleInfoMessageEventHandler.cs" />
- <Compile Include="System.Data.OracleClient\OracleRowUpdatedEventArgs.cs" />
- <Compile Include="System.Data.OracleClient\OracleRowUpdatedEventHandler.cs" />
- <Compile Include="System.Data.OracleClient\OracleRowUpdatingEventArgs.cs" />
- <Compile Include="System.Data.OracleClient\OracleRowUpdatingEventHandler.cs" />
- <Compile Include="System.Data.OracleClient\OracleType.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\System.Data\System.Data20.csproj">
- <Project>{BD83C476-AEC7-4535-8158-977B04887AF0}</Project>
- <Name>System.Data</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />
- <Reference Include="System" />
- <Reference Include="System.Drawing" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Properties\" />
- </ItemGroup>
-</Project>
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.OracleClient20", "System.Data.OracleClient20.csproj", "{71F3DF41-7E2F-41FB-B470-110851F2E758}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data20", "..\System.Data\System.Data20.csproj", "{BD83C476-AEC7-4535-8158-977B04887AF0}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug_Java|Any CPU = Debug_Java|Any CPU
- Debug_Java20|Any CPU = Debug_Java20|Any CPU
- Release_Java|Any CPU = Release_Java|Any CPU
- Release_Java20|Any CPU = Release_Java20|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {71F3DF41-7E2F-41FB-B470-110851F2E758}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
- {71F3DF41-7E2F-41FB-B470-110851F2E758}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
- {71F3DF41-7E2F-41FB-B470-110851F2E758}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
- {71F3DF41-7E2F-41FB-B470-110851F2E758}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
- {71F3DF41-7E2F-41FB-B470-110851F2E758}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
- {71F3DF41-7E2F-41FB-B470-110851F2E758}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
- {71F3DF41-7E2F-41FB-B470-110851F2E758}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU
- {71F3DF41-7E2F-41FB-B470-110851F2E758}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU
- {BD83C476-AEC7-4535-8158-977B04887AF0}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <appSettings>
- <add key="ConnectionString" value="hostname=powergh;port=1521;User ID=ghtdb;Password=ghtdb;ServiceName=powergh;Data Source=powergh" />
- <!--
- <add key="ConnectionString" value="Provider=SQLOLEDB.1;Data Source=xp050;Initial Catalog=GHTDB;User Id=sa;Password=" />
- <add key="ConnectionString" value="Provider=MSDAORA.1;hostname=xp050;port=1521;User ID=ghtdb;Password=ghtdb;ServiceName=xp050;Data Source=xp050" />
- <add key="ConnectionString" value="Provider=IBMDADB2;Password=db2admin;User ID=db2admin;Data Source=GHTDB;HostName=xp050;Port=50000;Location=xp050:50000" />
- <add key="ConnectionString" value="Provider=Sybase ASE OLE DB Provider;hostname=KONGO;port=5000;User ID=sa;Password=;ServiceName=KONGO;Data Source=sybaseoledb;JdbcDriverClassName=com.sybase.jdbc2.jdbc.SybDriver;JdbcURL=jdbc:sybase:Tds:KONGO:5000/GHTDB;user=sa;DatabaseName=GHTDB" />
- <add key="ConnectionString" value="Provider=Mainsoft.JDBC.OLEDB.1;Persist Security Info=False;User ID=super;Data Source=PostgreSQL_XP050;Extended Properties="DSN=PostgreSQL_XP050;DATABASE=GHTDB;SERVER=xp050;PORT=5432;UID=super;ReadOnly=0;Protocol=6.4;FakeOidIndex=0;ShowOidColumn=0;RowVersioning=0;ShowSystemTables=0;ConnSettings=;Fetch=100;Socket=8192;UnknownSizes=0;MaxVarcharSize=254;MaxLongVarcharSize=8190;Debug=0;CommLog=0;Optimizer=1;Ksqo=1;UseDeclareFetch=0;TextAsLongVarchar=1;UnknownsAsLongVarchar=0;BoolsAsChar=0;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;;LFConversion=1;UpdatableCursors=0;DisallowPremature=0;TrueIsMinus1=0;BI=0;ByteaAsLongVarBinary=0;UseServerSidePrepare=0";Initial Catalog=GHTDB;JdbcDriverClassName=org.postgresql.Driver;JdbcURL=jdbc:postgresql://xp050/GHTDB;User=super;Password=super" />
- -->
- </appSettings>
-</configuration>
\ No newline at end of file
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.Data.OracleClient.Tests.J2EE", "System.Data.OracleClient.Tests.J2EE.vmwcsproj", "{8A846229-F249-415F-B69D-738374543437}"
- ProjectSection(ProjectDependencies) = postProject
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1} = {39CC8FF7-EF1A-41A1-B727-42684211ECD1}
- EndProjectSection
-EndProject
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "nunit.framework.dll.J2EE", "..\..\..\nunit20\framework\nunit.framework.dll.J2EE.vmwcsproj", "{39CC8FF7-EF1A-41A1-B727-42684211ECD1}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Debug_Java = Debug_Java
- Release_Java = Release_Java
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {8A846229-F249-415F-B69D-738374543437}.Debug.ActiveCfg = Debug|.NET
- {8A846229-F249-415F-B69D-738374543437}.Debug.Build.0 = Debug|.NET
- {8A846229-F249-415F-B69D-738374543437}.Debug_Java.ActiveCfg = Debug_Java|.NET
- {8A846229-F249-415F-B69D-738374543437}.Debug_Java.Build.0 = Debug_Java|.NET
- {8A846229-F249-415F-B69D-738374543437}.Release_Java.ActiveCfg = Release_Java|.NET
- {8A846229-F249-415F-B69D-738374543437}.Release_Java.Build.0 = Release_Java|.NET
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug.ActiveCfg = Debug|.NET
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug_Java.ActiveCfg = Debug_Java|.NET
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release_Java.ActiveCfg = Release_Java|.NET
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release_Java.Build.0 = Release_Java|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">
- <OutputPath>bin\Release_Java20\</OutputPath>
- <DefineConstants>TRACE;TARGET_JVM;JAVA</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.5.0_05</JDKName>
- <TargetPlatform>0</TargetPlatform>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\Debug_Java20\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;JAVA</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>True</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.5.0_05</JDKName>
- <TargetPlatform>0</TargetPlatform>
- </PropertyGroup>
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>System.Data.OracleClient.Tests20.J2EE</RootNamespace>
- <AssemblyName>System.Data.OracleClient.Tests20.J2EE</AssemblyName>
- <JDKName>1.5.0_05</JDKName>
- <GHProjectType>1</GHProjectType>
- <Version>2.0</Version>
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Java\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;JAVA</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Java\</OutputPath>
- <DefineConstants>TRACE;TARGET_JVM;JAVA</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="System.Data.OracleClient.jvm\MonoTests.System.Data.Utils\ADONetTesterClass.cs" />
- <Compile Include="System.Data.OracleClient.jvm\MonoTests.System.Data.Utils\ConnectedDataProvider.cs" />
- <Compile Include="System.Data.OracleClient.jvm\MonoTests.System.Data.Utils\DbTypeParameter.cs" />
- <Compile Include="System.Data.OracleClient.jvm\MonoTests.System.Data.Utils\DbTypeParametersCollection.cs" />
- <Compile Include="System.Data.OracleClient.jvm\MonoTests.System.Data.Utils\GHTBase.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommandBuilder\OracleCommandBuilder_DeriveParameters_O.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_CommandText.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_CommandTimeout.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_CommandType.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_Connection.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_Dispose.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_ExecuteNonQuery.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_ExecuteReader.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_ExecuteScalar.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_New.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_Parameters.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_Prepare.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleCommand\OracleCommand_Transaction.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\IDBConnection_For_Oracle.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_BeginTransaction.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_ChangeDatabase.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_Close.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_ConnectionString.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_ConnectionTimeout.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_CreateCommand.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_Database.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_DataSource.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_Equals.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_InfoMessage.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_New.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_Open.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_State.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleConnection\OracleConnection_StateChange.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_AcceptChangesDuringFill.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_ContinueUpdateOnError.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_ctor.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_ctor_O.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_ctor_SO.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_ctor_SS.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_DeleteCommand.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Dispose.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_FillError.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_FillSchema_DS.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_FillSchema_DSS.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_FillSchema_DsSt.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_FillSchema_DtSch.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Fill_1.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Fill_2.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Fill_3.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Fill_Ds.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Fill_DsStr.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Fill_Ds_Int_Int_Str.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Fill_Dt.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_GetFillParameters.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_InsertCommand.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_MissingMappingAction.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_MissingSchemaAction.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_RowUpdated.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_RowUpdating.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_SelectCommand.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_TableMappings.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_ToString.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_UpdateCommand.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Update_Dr.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Update_Ds.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Update_DsStr.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataAdapter\OracleDataAdapter_Update_Dt.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_Close.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_ctor.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_Depth.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetBoolean.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetBytes_IIBII.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetByte_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetChars.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetDataTypeName.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetDateTime.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetDecimal_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetDouble_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetFieldType.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetFloat_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetGuiid_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetInt16.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetInt32_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetInt64.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetName_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetOrdinal.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetSchemaTable.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetString_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetTimeSpan_I.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetValue.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_GetValues.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_HasRows.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_IsDBNull.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_Item.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_NextResult.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_Read.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleDataReader\OracleDataReader_RecordsAffected.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameterCollection\OracleParameterCollection_Add.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameterCollection\OracleParameterCollection_Contains.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameterCollection\OracleParameterCollection_Count.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameter\OracleParameter_ctor.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameter\OracleParameter_ctor_SO.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameter\OracleParameter_ctor_SOIPBBBSDO.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameter\OracleParameter_ctor_SOtype.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameter\OracleParameter_ctor_SOtypeI.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleParameter\OracleParameter_ctor_SOtype_IS.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleTransaction\OracleTransaction_Begin.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleTransaction\OracleTransaction_Commit.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleTransaction\OracleTransaction_Connection.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleTransaction\OracleTransaction_ctor.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleTransaction\OracleTransaction_IsolationLevel.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleTransaction\OracleTransaction_Rollback.cs" />
- <Compile Include="System.Data.OracleClient.jvm\OracleType\OracleType_Date.cs" />
- </ItemGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.framework.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="rt, Version=0.0.0.0, Culture=neutral">
- <Private>False</Private>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Data.OracleClient">
- <Private>False</Private>
- </Reference>
- <Reference Include="System.Xml" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <ProjectExtensions>
- <VisualStudio>
- <UserProperties REFS-JarPath-rt="..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-system-data="..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Data.jar" REFS-JarPath-system="..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-system-data-oracleclient="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Data.OracleClient.jar" REFS-JarPath-nunit-framework="..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.framework.jar" />
- </VisualStudio>
- </ProjectExtensions>
-</Project>
\ No newline at end of file
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.OracleClient.Tests20.J2EE", "System.Data.OracleClient.Tests20.J2EE.csproj", "{DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug_Java|Any CPU = Debug_Java|Any CPU
- Debug_Java20|Any CPU = Debug_Java20|Any CPU
- Release_Java|Any CPU = Release_Java|Any CPU
- Release_Java20|Any CPU = Release_Java20|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}.Debug_Java|Any CPU.ActiveCfg = Release_Java20|Any CPU
- {DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}.Debug_Java|Any CPU.Build.0 = Release_Java20|Any CPU
- {DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
- {DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
- {DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
- {DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
- {DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU
- {DC2FDC0D-C2C3-4B2B-84F0-6655BD3D1E61}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
// The .NET Framework provides support for Oracle LOBs in the OracleClient namespace, but not in the Oracle namespace.
// Since Visual MainWin does not support the OracleClient namespace, a partial support for this important feature is provided in the Oracle namespace.
// See ms-help://MS.VSCC.2003/VMW.GH.1033/ghdoc/vmwdoc_ADONET_data_access_limitations_51.htm
-#if TARGET_JVM
-
- row.Add("BLOB", new byte[] {0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- }, 4000);
- row.Add("CLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
- row.Add("NCLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
-#endif
break;
#endregion
/// <returns>The number of deleted rows.</returns>
public static int ExecuteDelete(string a_sTableName, string a_sUniqueId)
{
-#if !TARGET_JVM
return 0;
-#endif
int l_iRecordsDeleted;
OracleCommand l_cmdDelete = new OracleCommand();
l_cmdDelete.Connection = new OracleConnection(ConnectedDataProvider.ConnectionString);
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
OracleCommand cmd = new OracleCommand();
//Test case for bug #4708
[Test(Description="Test case for bug #4708")]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestLongSqlExpression()
{
BeginCase("Long SQL string cause java.lang.StackOverflowError (Test case for bug #4708)");
DoTestTypes3(con);
}
-#if TARGET_JVM
- DoTestTypes4(con);
-#endif
// DoTestTypes5(con); //Table direct --> multipe tables
DoTestTypes6(con);
//BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void run()
{
Exception exp = null;
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_Ds : ADONetTesterClass
{
public static void Main()
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_DsStr : ADONetTesterClass
{
public static void Main()
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleDataAdapter_Update_Dt : ADONetTesterClass
{
public static void Main()
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
Exception exp = null;
}
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestMultipleResultSetsWithSQLText()
{
}
[Test]
-#if !TARGET_JVM
[Ignore ("JVM test")]
-#endif
public void TestMultipleResultSetsWithSP()
{
#if !JAVA
}
[Test]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void run()
{
Exception exp = null;
}
[Test]
-//#if !TARGET_JVM
-// [Category("NotWorking")]
-//#endif
public void SimpleTypesWithDBNull()
{
OracleConnection con=null;
}
}
}
-}
\ No newline at end of file
+}
namespace MonoTests.System.Data.OracleClient
{
[TestFixture]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public class OracleTransaction_Rollback : ADONetTesterClass
{
public static void Main()
+++ /dev/null
-System.Data.OracleClient.Oci/OciAttributeType.cs
-System.Data.OracleClient.Oci/OciBindHandle.cs
-System.Data.OracleClient.Oci/OciCalls.cs
-System.Data.OracleClient.Oci/OciColumnInfo.cs
-System.Data.OracleClient.Oci/OciCredentialType.cs
-System.Data.OracleClient.Oci/OciDataType.cs
-System.Data.OracleClient.Oci/OciDateTimeDescriptor.cs
-System.Data.OracleClient.Oci/OciDefineHandle.cs
-System.Data.OracleClient.Oci/OciDescriptorHandle.cs
-System.Data.OracleClient.Oci/OciEnvironmentHandle.cs
-System.Data.OracleClient.Oci/OciEnvironmentMode.cs
-System.Data.OracleClient.Oci/OciErrorHandle.cs
-System.Data.OracleClient.Oci/OciErrorInfo.cs
-System.Data.OracleClient.Oci/OciExecuteMode.cs
-System.Data.OracleClient.Oci/OciHandle.cs
-System.Data.OracleClient.Oci/OciHandleType.cs
-System.Data.OracleClient.Oci/OciLobLocator.cs
-System.Data.OracleClient.Oci/OciLobType.cs
-System.Data.OracleClient.Oci/OciNlsServiceType.cs
-System.Data.OracleClient.Oci/OciParameterDescriptor.cs
-System.Data.OracleClient.Oci/OciPointerType.cs
-System.Data.OracleClient.Oci/OciRowIdDescriptor.cs
-System.Data.OracleClient.Oci/OciServerHandle.cs
-System.Data.OracleClient.Oci/OciServiceHandle.cs
-System.Data.OracleClient.Oci/OciSessionHandle.cs
-System.Data.OracleClient.Oci/OciSessionMode.cs
-System.Data.OracleClient.Oci/OciStatementHandle.cs
-System.Data.OracleClient.Oci/OciStatementLanguage.cs
-System.Data.OracleClient.Oci/OciStatementMode.cs
-System.Data.OracleClient.Oci/OciStatementType.cs
-System.Data.OracleClient.Oci/OciTransactionFlags.cs
-System.Data.OracleClient.Oci/OciTransactionHandle.cs
-System.Data.OracleClient/OciGlue.cs
-System.Data.OracleClient/OracleBFile.cs
-System.Data.OracleClient/OracleBinary.cs
-System.Data.OracleClient/OracleCommand.cs
-System.Data.OracleClient/OracleCommandBuilder.cs
-System.Data.OracleClient/OracleConnection.cs
-System.Data.OracleClient/OracleConnectionPool.cs
-System.Data.OracleClient/OracleConnectionPoolManager.cs
-System.Data.OracleClient/OracleDataReader.cs
-System.Data.OracleClient/OracleException.cs
-System.Data.OracleClient/OracleInfoMessageEventArgs.cs
-System.Data.OracleClient/OracleLob.cs
-System.Data.OracleClient/OracleParameterCollection.cs
-System.Data.OracleClient/OracleParameter.cs
-System.Data.OracleClient/OracleTransaction.cs
+++ /dev/null
-#include System.Data.OracleClient.dll.sources
-Mainsoft.Data.Jdbc.Providers.jvm/OracleProvider.cs
-System.Data.OracleClient.jvm/ExceptionHelper.cs
-System.Data.OracleClient.jvm/OracleBFile.cs
-System.Data.OracleClient.jvm/OracleBinary.cs
-System.Data.OracleClient.jvm/OracleCommand.cs
-System.Data.OracleClient.jvm/OracleCommandBuilder.cs
-System.Data.OracleClient.jvm/OracleConnection.cs
-System.Data.OracleClient.jvm/OracleConvert.cs
-System.Data.OracleClient.jvm/OracleDataReader.cs
-System.Data.OracleClient.jvm/OracleError.cs
-System.Data.OracleClient.jvm/OracleErrorCollection.cs
-System.Data.OracleClient.jvm/OracleException.cs
-System.Data.OracleClient.jvm/OracleInfoMessageEventArgs.cs
-System.Data.OracleClient.jvm/OracleLob.cs
-System.Data.OracleClient.jvm/OracleParameter.cs
-System.Data.OracleClient.jvm/OracleParameterCollection.cs
-System.Data.OracleClient.jvm/OracleTransaction.cs
-System.Data.OracleClient.jvm/Regex.cs
-#include System.Data.Services.Client.dll.sources
-./Client/AssemblyAttributes.cs
+#include net_4_5_System.Data.Services.Client.dll.sources
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{A586EC7C-F793-42C1-8C14-D8C4DF147D1A}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Data.Services</RootNamespace>\r
- <AssemblyName>System.Data.Services</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.Core">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.ServiceModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.ServiceModel.Web">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Xml.Linq">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data.DataSetExtensions">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="ChangeInterceptorAttribute.cs" />\r
- <Compile Include="DataService.cs" />\r
- <Compile Include="DataServiceException.cs" />\r
- <Compile Include="DataServiceHost.cs" />\r
- <Compile Include="DataServiceHostFactory.cs" />\r
- <Compile Include="EntitySetRights.cs" />\r
- <Compile Include="ETagAttribute.cs" />\r
- <Compile Include="ExpandSegment.cs" />\r
- <Compile Include="ExpandSegmentCollection.cs" />\r
- <Compile Include="HandleExceptionArgs.cs" />\r
- <Compile Include="IDataServiceConfiguration.cs" />\r
- <Compile Include="IDataServiceHost.cs" />\r
- <Compile Include="IExpandedResult.cs" />\r
- <Compile Include="IExpandProvider.cs" />\r
- <Compile Include="IgnorePropertiesAttribute.cs" />\r
- <Compile Include="IRequestHandler.cs" />\r
- <Compile Include="IUpdatable.cs" />\r
- <Compile Include="MimeTypeAttribute.cs" />\r
- <Compile Include="ProcessRequestArgs.cs" />\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="QueryInterceptorAttribute.cs" />\r
- <Compile Include="ServiceOperationRights.cs" />\r
- <Compile Include="SingleResultAttribute.cs" />\r
- <Compile Include="UpdateOperations.cs" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Services", "System.Data.Services.csproj", "{A586EC7C-F793-42C1-8C14-D8C4DF147D1A}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Services.Tests", "Tests\System.Data.Services.Tests.csproj", "{2491EDE6-791F-4CA2-B99C-70791EE81E75}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {2491EDE6-791F-4CA2-B99C-70791EE81E75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {2491EDE6-791F-4CA2-B99C-70791EE81E75}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {2491EDE6-791F-4CA2-B99C-70791EE81E75}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {2491EDE6-791F-4CA2-B99C-70791EE81E75}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {A586EC7C-F793-42C1-8C14-D8C4DF147D1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {A586EC7C-F793-42C1-8C14-D8C4DF147D1A}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {A586EC7C-F793-42C1-8C14-D8C4DF147D1A}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {A586EC7C-F793-42C1-8C14-D8C4DF147D1A}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(MonoDevelopProperties) = preSolution\r
- StartupItem = System.Data.Services.csproj\r
- EndGlobalSection\r
-EndGlobal\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System;\r
+using System.Data.Services;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class ChangeInterceptorAttributeTests {\r
[Test]\r
Assert.AreEqual ("setName", ci.EntitySetName);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System;\r
+using System.Data.Services;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class DataServiceExceptionTests {\r
[Test]\r
Assert.AreEqual (inner, ex.InnerException);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System;\r
+using System.Data.Services;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class DataServiceTests {\r
[Test]\r
this.OnStartProcessingRequest (args);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System;\r
+using System.Data.Services;\r
using System.Linq;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class ETagAttributeTests {\r
[Test]\r
Assert.AreEqual ("bar", e.PropertyNames[1]);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System.Data.Services;\r
using System.Linq.Expressions;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class ExpandSegmentCollectionTests {\r
[Test]\r
Assert.IsFalse (esc.HasFilter);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System;\r
+using System.Data.Services;\r
using System.Linq.Expressions;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class ExpandSegmentTests {\r
[Test]\r
{ new ExpandSegment ("first", null), new ExpandSegment ("second", null), new ExpandSegment ("third", null) }));\r
}\r
}\r
-}
\ No newline at end of file
+}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System;\r
+using System.Data.Services;\r
using System.Linq;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class IgnorePropertiesAttributeTests {\r
[Test]\r
Assert.AreEqual ("bar", e.PropertyNames[1]);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System.Data.Services;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class MimeTypeAttributeTests {\r
[Test]\r
Assert.AreEqual ("type", mt.MimeType);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
+using System;\r
+using System.Data.Services;\r
using NUnit.Framework;\r
\r
-namespace System.Data.Services.Tests {\r
+namespace MonoTests.System.Data.Services {\r
[TestFixture]\r
public class QueryInterceptorAttributeTests {\r
[Test]\r
new QueryInterceptorAttribute (null);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{2491EDE6-791F-4CA2-B99C-70791EE81E75}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Data.Services.Tests</RootNamespace>\r
- <AssemblyName>System.Data.Services.Tests</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.Core">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.ServiceModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Xml.Linq">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="ChangeInterceptorAttributeTests.cs" />\r
- <Compile Include="DataServiceExceptionTests.cs" />\r
- <Compile Include="DataServiceTests.cs" />\r
- <Compile Include="ETagAttributeTests.cs" />\r
- <Compile Include="ExpandSegmentCollectionTests.cs" />\r
- <Compile Include="ExpandSegmentTests.cs" />\r
- <Compile Include="IgnorePropertiesAttributeTests.cs" />\r
- <Compile Include="MimeTypeAttributeTests.cs" />\r
- <Compile Include="QueryInterceptorAttributeTests.cs" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ItemGroup>\r
- <ProjectReference Include="..\System.Data.Services.csproj">\r
- <Project>{A586EC7C-F793-42C1-8C14-D8C4DF147D1A}</Project>\r
- <Name>System.Data.Services</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
-</Project>\r
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
-#endif
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: AssemblyDelaySign (true)]
-#if !TARGET_JVM
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
+++ /dev/null
-//
-// System.Data.OleDb.OleDbConnection
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Data.Common;
-using System.Data.Configuration;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Reflection;
-using System.Text.RegularExpressions;
-using Mainsoft.Data.Configuration;
-
-using System.Globalization;
-
-using java.sql;
-using javax.sql;
-using javax.naming;
-
-namespace Mainsoft.Data.Jdbc.Providers
-{
- public class GenericProvider : IConnectionProvider
- {
- #region JdbcUrlConnector
-
- sealed class JdbcUrlConnector {
- #region Consts
-
- private static readonly Regex JdbcUrlPatternRegex= new Regex (@"\$\{(?<VALUE>[^$\{\}]*)\}", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);
-
- #endregion // Consts
-
- #region Fields
-
- readonly IConnectionStringDictionary _keyMapper;
- readonly GenericProvider _provider;
- readonly ArrayList _excludedKeys = new ArrayList();
-
- #endregion // Fields
-
- #region Constructors
-
- internal JdbcUrlConnector (GenericProvider provider, IConnectionStringDictionary keyMapper) {
- _provider = provider;
- _keyMapper = keyMapper;
- }
-
- #endregion // Constructors
-
-
- #region Methods
-
- internal java.sql.Connection Connection {
- get {
- java.util.Properties properties = new java.util.Properties ();
-
- string url = (string)_keyMapper["JdbcURL"];
- if (url == null) {
- string jdbcUrlPattern = (string)_provider.ProviderInfo [ConfigurationConsts.JdbcUrlPattern];
- if (jdbcUrlPattern == null || jdbcUrlPattern.Length == 0) {
- //throw ExceptionHelper.JdbcUrlPatternNotFound ((string)_provider.ProviderInfo [ConfigurationConsts.Name]);
- object [] args = new object [] {_provider.ProviderInfo [ConfigurationConsts.Name]};
- throw new ArgumentException (String.Format("Provider '{0}' is not configured with valid JDBC URL pattern.",args));
- }
- MatchEvaluator evaluator = new MatchEvaluator (ReplaceEvaluator);
- url = JdbcUrlPatternRegex.Replace (jdbcUrlPattern, evaluator);
- }
- else {
- // hack for backward comatibility:
- // if the connection string contains 'Provider',
- // the following mapping will hold:
- // 'User', 'User Id' --> 'user'
- // 'Password' --> 'password'
- if (_keyMapper["Provider"] != null) {
-
- const string USER = "User";
- const string USERID = "User Id";
- const string PASSWORD = "Password";
-
- string user = (string)_keyMapper[USER];
- if (user != null) {
- properties.put("user", user);
- _excludedKeys.Add(USER);
- }
- else {
- user = (string)_keyMapper[USERID];
- if (user != null) {
- properties.put("user", user);
- _excludedKeys.Add(USERID);
- }
- }
-
- string password = (string)_keyMapper[PASSWORD];
- if (password != null) {
- properties.put("password", password);
- _excludedKeys.Add(PASSWORD);
- }
- }
- }
-
- if (_provider._excludedKeys != null)
- _excludedKeys.AddRange(_provider._excludedKeys);
-
- foreach(string key in _provider.KeyMapping.Keys) {
- object value = _keyMapper [key];
- if (value == null)
- continue;
- bool contains = false;
- for (int i = 0; i < _excludedKeys.Count; i++) {
- if (String.Compare((string)_excludedKeys[i], key,
- true, CultureInfo.InvariantCulture) == 0) {
- contains = true;
- break;
- }
- }
- if (!contains) {
- properties.put (key, value);
- _excludedKeys.Add(key);
- }
- }
-
- for (int i = 0; i < _excludedKeys.Count; i++) {
- string value = _keyMapper.GetConnectionStringKey((string)_excludedKeys[i]);
- if (value != null)
- _excludedKeys[i] = value;
- }
-
- foreach(string key in _keyMapper.Keys) {
- object value = _keyMapper [key];
- if (value == null)
- continue;
- bool contains = false;
- for (int i = 0; i < _excludedKeys.Count; i++) {
- if (String.Compare((string)_excludedKeys[i], key,
- true, CultureInfo.InvariantCulture) == 0) {
- contains = true;
- break;
- }
- }
- if (!contains) {
- if (_provider._unsupportedKeys != null)
- for (int i = 0; i < _provider._unsupportedKeys.Length; i++)
- if (String.Compare ((string) _provider._unsupportedKeys [i], key,
- true, CultureInfo.InvariantCulture) == 0)
- throw new NotSupportedException (
- String.Format ("The parameter '{0}' is not supported.", key));
-
- properties.put (key, value);
- }
- }
-
- Driver d = ActivateJdbcDriver ();
- // TBD : add DriverManager.setLoginTimeout
- if (d != null)
- return d.connect (url, properties);
-
- return DriverManager.getConnection (url, properties);
- }
- }
-
- private string ReplaceEvaluator (Match m) {
- Group g = m.Groups["VALUE"];
-
- if (!g.Success)
- return String.Empty;
-
- string usedKey = g.Value.Trim();
-
- string value = (string)_keyMapper [usedKey];
- if (value == null)
- throw new ArgumentException(
- String.Format("Missing parameter {0}", g.Value),
- "ConnectionString");
-
- _excludedKeys.Add(usedKey);
- return value;
- }
-
- private Driver ActivateJdbcDriver () {
- string driver = (string) _keyMapper["JdbcDriverClassName"];
- if (driver == null)
- driver = (string) _provider.ProviderInfo [ConfigurationConsts.JdbcDriverClassName];
-
- if (driver != null && driver.Length != 0) {
- try {
- java.lang.ClassLoader contextLoader = (java.lang.ClassLoader) AppDomain.CurrentDomain.GetData ("GH_ContextClassLoader");
- if (contextLoader != null)
- return (Driver) contextLoader.loadClass (driver).newInstance ();
- return (Driver) java.lang.Class.forName (driver).newInstance ();
- }
- catch (java.lang.ClassNotFoundException e) {
- throw new TypeLoadException (e.Message, e);
- }
- catch (java.lang.InstantiationException e) {
- throw new MemberAccessException (e.Message, e);
- }
- catch (java.lang.IllegalAccessException e) {
- throw new MissingMethodException (e.Message, e);
- }
- }
-
- return null;
- }
-
- #endregion // Methods
- }
-
- #endregion // JdbcUrlBuilder
-
- #region DataSourceCache
-
- private sealed class DataSourceCache : AbstractDbMetaDataCache {
- internal DataSource GetDataSource(string dataSourceName,string namingProviderUrl,string namingFactoryInitial) {
- Hashtable cache = Cache;
-
- DataSource ds = cache[dataSourceName] as DataSource;
-
- if (ds != null) {
- return ds;
- }
-
- Context ctx = null;
-
- java.util.Properties properties = new java.util.Properties();
-
- if ((namingProviderUrl != null) && (namingProviderUrl.Length > 0)) {
- properties.put("java.naming.provider.url",namingProviderUrl);
- }
-
- if ((namingFactoryInitial != null) && (namingFactoryInitial.Length > 0)) {
- properties.put("java.naming.factory.initial",namingFactoryInitial);
- }
-
- ctx = new InitialContext(properties);
-
- try {
- ds = (DataSource)ctx.lookup(dataSourceName);
- }
- catch(javax.naming.NameNotFoundException e) {
- // possible that is a Tomcat bug,
- // so try to lookup for jndi datasource with "java:comp/env/" appended
- ds = (DataSource)ctx.lookup("java:comp/env/" + dataSourceName);
- }
-
- cache[dataSourceName] = ds;
- return ds;
- }
- }
-
- #endregion // DatasourceCache
-
- #region Fields
-
- private static DataSourceCache _dataSourceCache = new DataSourceCache();
-
- private readonly IDictionary _providerInfo;
- private NameValueCollection _keyMapping;
- private string[] _excludedKeys;
- private string[] _unsupportedKeys;
-
- #endregion // Fields
-
- #region Constructors
-
- public GenericProvider(IDictionary providerInfo)
- {
- _providerInfo = providerInfo;
- _keyMapping = null;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- protected IDictionary ProviderInfo
- {
- get { return _providerInfo; }
- }
-
- private NameValueCollection KeyMapping
- {
- get
- {
- if (_keyMapping == null)
- InitKeyMapping ();
-
- return _keyMapping;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public virtual java.sql.Connection GetConnection (IConnectionStringDictionary conectionStringBuilder)
- {
- string dataSourceJndi = (string) conectionStringBuilder.GetValue ("jndi-datasource-name");
-
- if (dataSourceJndi != null && dataSourceJndi.Length > 0) {
-
- string namingProviderUrl = (string) conectionStringBuilder.GetValue ("naming-provider-url");
- string namingFactoryInitial = (string) conectionStringBuilder.GetValue ("naming-factory-initial");
- DataSource ds = _dataSourceCache.GetDataSource(dataSourceJndi,namingProviderUrl,namingFactoryInitial);
- return ds.getConnection();
- }
-
- JdbcUrlConnector connector = new JdbcUrlConnector (this, conectionStringBuilder);
- return connector.Connection;
- }
-
- public virtual IConnectionStringDictionary GetConnectionStringBuilder (string connectionString)
- {
- return new ConnectionStringDictionary(connectionString, KeyMapping);
- }
-
- private void InitKeyMapping ()
- {
- lock (this) {
- if (_keyMapping != null)
- return;
-
- _keyMapping = new NameValueCollection (StringComparer.OrdinalIgnoreCase);
-
- // create key mappings collection
- string keyMappingsStr = (string) _providerInfo [ConfigurationConsts.KeyMapping];
- if (keyMappingsStr != null) {
- string [] keyMappings = keyMappingsStr.Split (ConfigurationConsts.SemicolonArr);
- foreach (string keyMapping in keyMappings) {
- if (keyMapping.Length == 0)
- continue;
- int equalsIndex = keyMapping.IndexOf ('=');
- string key = keyMapping.Substring (0, equalsIndex).Trim ();
- string [] mappings = keyMapping.Substring (equalsIndex + 1).Trim ().Split (ConfigurationConsts.CommaArr);
- foreach (string mapping in mappings)
- _keyMapping.Add (key, mapping.Trim ());
- }
- }
-
- string keyMappingExcludesStr = (string) _providerInfo [ConfigurationConsts.KeyMappingExcludes];
- if (keyMappingExcludesStr != null) {
- _excludedKeys = keyMappingExcludesStr.Split (ConfigurationConsts.CommaArr);
- for (int i = 0; i < _excludedKeys.Length; i++)
- _excludedKeys [i] = _excludedKeys [i].Trim ();
- }
-
- string keyMappingUnsupportedStr = (string) _providerInfo [ConfigurationConsts.KeyMappingUnsupported];
- if (keyMappingUnsupportedStr != null) {
- _unsupportedKeys = keyMappingUnsupportedStr.Split (ConfigurationConsts.CommaArr);
- for (int i = 0; i < _unsupportedKeys.Length; i++)
- _unsupportedKeys [i] = _unsupportedKeys [i].Trim ();
- }
- }
- }
-
- #endregion // Methods
- }
-}
+++ /dev/null
-//
-// System.Data.OleDb.OleDbConnection
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using Mainsoft.Data.Configuration;
-
-using java.sql;
-
-namespace Mainsoft.Data.Jdbc.Providers
-{
- sealed class ConfigurationConsts {
- #region Constructors
-
- ConfigurationConsts() {
- }
-
- #endregion // Constructors
-
- #region Consts
-
- public const string Name = "id";
- public const string KeyMapping = "keyMapping";
- public const string KeyMappingExcludes = "keyExclude";
- public const string KeyMappingUnsupported = "keyUnsupported";
- public const string JdbcUrlPattern = "url";
- public const string JdbcDriverClassName = "driverClassName";
- public const string ProviderType = "type";
-
- public static readonly char [] SemicolonArr = new char [] { ';' };
- public static readonly char [] CommaArr = new char [] { ',' };
-
- #endregion // Consts
-
- }
-
- public interface IConnectionProvider
- {
- java.sql.Connection GetConnection (IConnectionStringDictionary connectionStringBuilder);
- IConnectionStringDictionary GetConnectionStringBuilder (string connectionString);
- }
-
- public interface IPreparedStatement : java.sql.PreparedStatement {
- void setBit(int parameterIndex, int value);
- void setChar(int parameterIndex, string value);
- void setNumeric(int parameterIndex, java.math.BigDecimal value);
- void setReal(int parameterIndex, double value);
- }
-}
+++ /dev/null
-//
-// System.Data.OleDb.OleDbConnection
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data.Common;
-using System.Data.Configuration;
-using System.Data.ProviderBase;
-using Mainsoft.Data.Configuration;
-
-using java.net;
-using System.Globalization;
-
-namespace Mainsoft.Data.Jdbc.Providers
-{
- #region OleDbSqlServerProvider2000
-
- public class OleDbSqlServerProvider2000 : GenericProvider
- {
- #region Consts
-
- private const string Port = "Port";
- private const string DefaultInstanceName = "MSSQLSERVER";
- private const int DefaultTimeout = 15;
-
- #endregion //Consts
-
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- public OleDbSqlServerProvider2000 (IDictionary providerInfo) : base (providerInfo)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- #endregion // Properties
-
- #region Methods
-
- public override IConnectionStringDictionary GetConnectionStringBuilder (string connectionString)
- {
- //TBD: should wrap the IConnectionStringDictionary
- IConnectionStringDictionary conectionStringBuilder = base.GetConnectionStringBuilder (connectionString);
- OleDbSqlHelper.InitConnectionStringBuilder (conectionStringBuilder);
-
- string port = (string) conectionStringBuilder [Port];
- if (port == null || port.Length == 0) {
- port = GetMSSqlPort (OleDbSqlHelper.GetInstanceName (conectionStringBuilder, DefaultInstanceName), OleDbSqlHelper.GetDataSource (conectionStringBuilder), OleDbSqlHelper.GetTimeout (conectionStringBuilder, DefaultTimeout));
- conectionStringBuilder.Add (Port, port);
- }
-
- return conectionStringBuilder;
- }
-
- static string GetMSSqlPort(string instanceName, string dataSource, int timeout) {
- string port = String.Empty;
- try {
- DatagramSocket socket = new DatagramSocket();
-
- // send request
- sbyte[] buf = new sbyte[] {2};
- InetAddress address = InetAddress.getByName(dataSource);
- DatagramPacket packet = new DatagramPacket(buf, buf.Length, address, 1434);
- socket.send(packet);
- sbyte[] recbuf = new sbyte[1024];
- packet = new DatagramPacket(recbuf, recbuf.Length, packet.getAddress(), packet.getPort());
-
- // try to receive from socket while increasing timeouts in geometric progression
- int iterationTimeout = 1;
- int totalTimeout = 0;
- for(;;) {
- socket.setSoTimeout(iterationTimeout);
- try {
- socket.receive(packet);
- break;
- }
- catch (SocketTimeoutException e) {
- totalTimeout += iterationTimeout;
- iterationTimeout *= 2;
- if (totalTimeout >= timeout*1000) {
- throw new java.sql.SQLException(
- String.Format ("Unable to retrieve the port number for {0} using UDP on port 1434. Please see your network administrator to solve this problem or add the port number of your SQL server instance to your connection string (i.e. port=1433).", dataSource)
- );
- }
- }
- }
- sbyte[] rcvdSbytes = packet.getData();
- char[] rcvdChars = new char[rcvdSbytes.Length];
- for(int i=0; i < rcvdSbytes.Length; i++) {
- rcvdChars[i] = (char)rcvdSbytes[i];
- }
- String received = new String(rcvdChars);
-
- java.util.StringTokenizer st = new java.util.StringTokenizer(received, ";");
- String prev = "";
- bool instanceReached = instanceName == null || instanceName.Length == 0;
- while (st.hasMoreTokens()) {
- if (!instanceReached) {
- if (prev.Trim().Equals("InstanceName")) {
- if (String.Compare(instanceName,st.nextToken().Trim(),true, CultureInfo.InvariantCulture) == 0) {
- instanceReached = true;
- }
- }
- }
- else {
- if (prev.Trim().Equals("tcp")) {
- port = st.nextToken().Trim();
- //ensure we got a valid int
- java.lang.Integer.parseInt(port);
- break;
- }
- }
- prev = st.nextToken();
- }
- socket.close();
-
- if (!instanceReached)
- throw new java.sql.SQLException(
- String.Format ("Specified SQL Server '{0}\\{1}' not found.", dataSource, instanceName)
- );
- return port;
-
- }
- catch (java.sql.SQLException) {
- throw;
- }
- catch (Exception e) {
- throw new java.sql.SQLException(e.Message);
- }
- }
-
- #endregion // Methods
- }
-
- #endregion // OleDbSqlServerProvider2000
-
- #region OleDbSqlServerProvider2005
-
- public class OleDbSqlServerProvider2005 : GenericProvider
- {
- #region Consts
-
- #endregion //Consts
-
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- public OleDbSqlServerProvider2005 (IDictionary providerInfo) : base (providerInfo)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- #endregion // Properties
-
- #region Methods
-
- public override IConnectionStringDictionary GetConnectionStringBuilder (string connectionString)
- {
- //TBD: should wrap the IConnectionStringDictionary
- IConnectionStringDictionary conectionStringBuilder = base.GetConnectionStringBuilder (connectionString);
- OleDbSqlHelper.InitConnectionStringBuilder (conectionStringBuilder);
- return conectionStringBuilder;
- }
-
- public override java.sql.Connection GetConnection(IConnectionStringDictionary conectionStringBuilder)
- {
- return new SqlServer2005Connection (base.GetConnection (conectionStringBuilder));
- }
-
- #endregion // Methods
-
- #region SqlServer2005Connection
-
- sealed class SqlServer2005Connection : Connection
- {
- #region Constructors
-
- public SqlServer2005Connection(java.sql.Connection connection) : base (connection)
- {
- }
-
- #endregion
-
- #region Methods
-
- public override java.sql.DatabaseMetaData getMetaData()
- {
- return new SqlServer2005DatabaseMetaData (base.getMetaData ());
- }
-
- #endregion
- }
-
- #endregion
-
- #region SqlServer2005DatabaseMetaData
-
- sealed class SqlServer2005DatabaseMetaData : DatabaseMetaData
- {
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlServer2005DatabaseMetaData (java.sql.DatabaseMetaData databaseMetaData) : base (databaseMetaData)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- #endregion // Properties
-
- #region Methods
-
- public override java.sql.ResultSet getProcedureColumns(string arg_0, string arg_1, string arg_2, string arg_3)
- {
- return new SqlServer2005DatbaseMetaDataResultSet (Wrapped.getProcedureColumns (arg_0, arg_1, arg_2, arg_3));
- }
-
- #endregion // Methods
- }
-
- #endregion
-
- #region SqlServer2005DatbaseMetaDataResultSet
-
- sealed class SqlServer2005DatbaseMetaDataResultSet : ResultSet
- {
- #region Consts
-
- private const string DataType = "DATA_TYPE";
-
- #endregion
-
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlServer2005DatbaseMetaDataResultSet (java.sql.ResultSet resultSet) : base (resultSet)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- #endregion // Properties
-
- #region Methods
-
- public override int getInt(int arg_0)
- {
- int res = base.getInt (arg_0);
- if (res == -9) // sql server 2005 jdbc driver value for NVARCHAR
- if (String.CompareOrdinal (getMetaData ().getColumnName (arg_0), DataType) == 0)
- return java.sql.Types.VARCHAR;
- if (res == -8) // sql server 2005 jdbc driver value for NVARCHAR
- if (String.CompareOrdinal (getMetaData ().getColumnName (arg_0), DataType) == 0)
- return java.sql.Types.CHAR;
- return res;
- }
-
- public override int getInt(string arg_0)
- {
- int res = base.getInt (arg_0);
-
- if (res == -9) // sql server 2005 jdbc driver value for NVARCHAR
- if (String.CompareOrdinal (arg_0, DataType) == 0)
- return java.sql.Types.VARCHAR;
-
- if (res == -8) // sql server 2005 jdbc driver value for NVARCHAR
- if (String.CompareOrdinal (arg_0, DataType) == 0)
- return java.sql.Types.CHAR;
- return res;
- }
-
- #endregion // Methods
- }
-
- #endregion
- }
-
- #endregion // OleDbSqlServerProvider2005
-
- #region OleDbSqlHelper
-
- class OleDbSqlHelper
- {
- private const string Database = "Database";
- private const string ServerName = "ServerName";
- private const string Timeout = "Timeout";
-
- internal static void InitConnectionStringBuilder (IConnectionStringDictionary conectionStringBuilder)
- {
- if (!conectionStringBuilder.Contains("jndi-datasource-name")) {
-
- string database = (string) conectionStringBuilder [Database];
- if (database == null)
- conectionStringBuilder.Add (Database, String.Empty);
-
- string dataSource = GetDataSource (conectionStringBuilder);
- string instanceName = GetInstanceName (conectionStringBuilder, null);
-
- if (instanceName != null)
- conectionStringBuilder [ServerName] = dataSource + "\\" + instanceName;
- else
- conectionStringBuilder [ServerName] = dataSource;
- }
- }
-
- // TBD : refactor GetInstanceName and GetDataSource to single method
- internal static string GetInstanceName (IDictionary keyMapper, string defaultInstanceName)
- {
- string dataSource = (string) keyMapper [ServerName];
- string instanceName = String.Empty;
- int instanceIdx;
- if (dataSource == null || (instanceIdx = dataSource.IndexOf ("\\")) == -1)
- // no named instance specified - use a default name
- return defaultInstanceName;
- else
- // get named instance name
- return dataSource.Substring (instanceIdx + 1);
- }
-
- internal static string GetDataSource (IDictionary keyMapper)
- {
- string dataSource = (string) keyMapper [ServerName];
- int instanceIdx;
- if (dataSource != null && (instanceIdx = dataSource.IndexOf ("\\")) != -1)
- // throw out named instance name
- dataSource = dataSource.Substring (0,instanceIdx);
-
- if (dataSource != null && dataSource.StartsWith ("(") && dataSource.EndsWith (")"))
- dataSource = dataSource.Substring (1,dataSource.Length - 2);
-
- if (String.Empty.Equals (dataSource) || (String.Compare ("local", dataSource, true, CultureInfo.InvariantCulture) == 0) || (String.CompareOrdinal (".", dataSource) == 0))
- dataSource = "localhost";
-
- return dataSource;
- }
-
- internal static int GetTimeout (IDictionary keyMapper, int defaultTimeout)
- {
- string timeoutStr = (string) keyMapper [Timeout];
- if ((timeoutStr != null) && (timeoutStr.Length != 0)) {
- try {
- return Convert.ToInt32(timeoutStr);
- }
- catch(FormatException e) {
- throw ExceptionHelper.InvalidValueForKey("connect timeout");
- }
- catch (OverflowException e) {
- throw ExceptionHelper.InvalidValueForKey("connect timeout");
- }
- }
- return defaultTimeout;
- }
- }
-
- #endregion // OleDbSqlHelper
-
-}
-r:System.Xml.dll \
-ifeq (net_1_1_java, $(PROFILE))
-OTHER_RES = $(RESOURCE_FILES)
-LIB_MCS_FLAGS += \
- -r:rt.dll \
- -r:J2SE.Helpers.dll \
- $(OTHER_LIB_MCS_FLAGS)
-else
MOBILE := $(filter monotouch monodroid xammac mobile mobile_static, $(PROFILE))
ifdef MOBILE
LIB_MCS_FLAGS += \
-r:Mono.Data.Tds.dll \
$(OTHER_LIB_MCS_FLAGS)
endif
-endif
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -r:Mono.Data.Sqlite.dll -nowarn:618,169,612,219,168
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public enum CatalogLocation
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.ComponentModel;
using System.Data;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.ComponentModel;
using System.Data;
using System.ComponentModel;
using System.Data;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using System.Transactions;
#endif
protected abstract DbCommand CreateDbCommand ();
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
public virtual void EnlistTransaction (Transaction transaction)
{
throw new NotSupportedException ();
}
RowUpdatingEventArgs argsUpdating = CreateRowUpdatingEvent (row, command, statementType, tableMapping);
- row.RowError = null;
+ row.RowError = String.Empty;
OnRowUpdating (argsUpdating);
switch (argsUpdating.Status) {
case UpdateStatus.Continue :
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public abstract class DbDataSourceEnumerator
+++ /dev/null
-/*\r
- * Copyright (c) 2002-2004 Mainsoft Corporation.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in\r
- * all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
- * DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-using System;\r
-using System.Collections;\r
-\r
-using java.sql;\r
-\r
-namespace System.Data.Common\r
-{\r
- #region AbstractDbMetaDataCache\r
-\r
- internal abstract class AbstractDbMetaDataCache\r
- {\r
- Hashtable _cache;\r
- const int MINUTES_TIMEOUT = 10;\r
- private long _timestamp;\r
-\r
- protected AbstractDbMetaDataCache()\r
- {\r
- _cache = Hashtable.Synchronized(new Hashtable());\r
- }\r
-\r
- protected Hashtable Cache \r
- {\r
- get\r
- {\r
- long now = DateTime.Now.Ticks;\r
- if (now - _timestamp > MINUTES_TIMEOUT * TimeSpan.TicksPerMinute)\r
- {\r
- _timestamp = now;\r
- _cache.Clear();\r
- }\r
-\r
- return _cache;\r
- }\r
- }\r
- }\r
-\r
- #endregion\r
-}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.ComponentModel;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.ComponentModel;
public static DbProviderFactory GetFactory (DataRow providerRow)
{
string assemblyType = (string) providerRow ["AssemblyQualifiedName"];
-#if TARGET_JVM // case insensitive GetType is not supported
- Type type = Type.GetType (assemblyType, false);
-#else
Type type = Type.GetType (assemblyType, false, true);
-#endif
if (type != null && type.IsSubclassOf (typeof (DbProviderFactory))) {
// Provider factories are singletons with Instance field having
// the sole instance
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.Security;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public enum DbProviderSupportedClasses
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if TARGET_JVM
-
-using System.ComponentModel;
-
-namespace System.Data.Common {
- public abstract class DbTable : DataTable
- {
- #region Constructors
-
- [MonoTODO]
- protected DbTable (DbProviderFactory providerFactory)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- [MonoTODO]
- public ConflictOption ConflictOption {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbConnection Connection {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand DeleteCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand InsertCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbProviderFactory ProviderFactory {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public bool ReturnProviderSpecificTypes {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand SelectCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override ISite Site {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DataTableMapping TableMapping {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public int UpdateBatchSize {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DbCommand UpdateCommand {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public DataRelation AddChildTable (string relationName, DbTable childTable, string parentColumnName, string childColumnName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRelation AddChildTable (string relationName, DbTable childTable, string[] parentColumnNames, string[] childColumnNames)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void BeginInit ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual DbCommandBuilder CreateCommandBuilder (DbConnection connection)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override void Dispose (bool disposing)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void EndInit ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (FillOptions options, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Fill (FillOptions options, DbTransaction transaction, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, FillOptions options, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int FillPage (int startRecord, int maxRecords, FillOptions options, DbTransaction transaction, object[] parameterValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual string GenerateQuery (DbCommandBuilder cmdBuilder)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual string GenerateQueryForHierarchy (DbCommandBuilder builder, DataTable[] tableList)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (UpdateOptions updateOptions)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (UpdateOptions updateOptions, DbTransaction transaction)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows, UpdateOptions updateOptions)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int UpdateRows (DataRow[] dataRows, UpdateOptions updateOptions, DbTransaction transaction)
- {
- throw new NotImplementedException ();
- }
-
-
- #endregion // Methods
- }
-}
-
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data.Common {
public enum SchemaLocation
using System.EnterpriseServices;
using System.Runtime.InteropServices;
using System.Text;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using System.Transactions;
#endif
+++ /dev/null
-//\r
-// System.Data.OleDb.OleDbCommand\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Text;\r
-using System.Text.RegularExpressions;\r
-using System.Data;\r
-using System.Data.Common;\r
-using System.Data.ProviderBase;\r
-\r
-using java.sql;\r
-// Cannot use this because it makes ArrayList ambiguous reference\r
-//using java.util;\r
-\r
-namespace System.Data.OleDb\r
-{\r
- public sealed class OleDbCommand : AbstractDbCommand\r
- {\r
-\r
- #region Fields\r
-\r
- internal static readonly int oracleTypeRefCursor = java.sql.Types.OTHER;\r
- private static readonly int _oracleRefCursor = -10; // oracle.jdbc.OracleTypes.CURSOR\r
- private int _currentParameterIndex = 0;\r
- private ResultSet _currentRefCursor;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- static OleDbCommand()\r
- {\r
- try {\r
- java.lang.Class OracleTypesClass = java.lang.Class.forName("oracle.jdbc.OracleTypes");\r
- _oracleRefCursor = OracleTypesClass.getField("CURSOR").getInt(null);\r
- }\r
- catch(java.lang.ClassNotFoundException e) {\r
- // oracle driver is not in classpath - just continue\r
- }\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the OleDbCommand class.\r
- * The base constructor initializes all fields to their default values.\r
- * The following table shows initial property values for an instance of SqlCommand.\r
- */\r
- public OleDbCommand() : this(null, null, null)\r
- {\r
- }\r
-\r
- public OleDbCommand(OleDbConnection connection) : this(null, connection, null)\r
- {\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the OleDbCommand class with the text of the query.\r
- * @param cmdText The text of the query.\r
- */\r
- public OleDbCommand(String cmdText) : this(cmdText, null, null)\r
- {\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the OleDbCommand class with the text of the query and a SqlConnection.\r
- * @param cmdText The text of the query.\r
- * @param connection A SqlConnection that represents the connection to an instance of SQL Server.\r
- */\r
- public OleDbCommand(String cmdText, OleDbConnection connection) : this(cmdText, connection, null)\r
- {\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the OleDbCommand class with the text of the query, a SqlConnection, and the Transaction.\r
- * @param cmdText The text of the query.\r
- * @param connection A SqlConnection that represents the connection to an instance of SQL Server.\r
- * @param transaction The SqlTransaction in which the OleDbCommand executes.\r
- */\r
- public OleDbCommand(\r
- String cmdText,\r
- OleDbConnection connection,\r
- OleDbTransaction transaction)\r
- : base(cmdText, connection, transaction)\r
- {\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public new OleDbConnection Connection\r
- {\r
- get { return (OleDbConnection)base.Connection; }\r
- set { base.Connection = (AbstractDBConnection)value; }\r
- }\r
-\r
- public new OleDbParameterCollection Parameters\r
- {\r
- get { \r
- return (OleDbParameterCollection)base.Parameters; \r
- }\r
- }\r
-\r
- public new OleDbTransaction Transaction\r
- {\r
- get { return (OleDbTransaction)base.Transaction; }\r
- set { base.Transaction = (DbTransaction)value; }\r
- }\r
-\r
- protected internal sealed override ResultSet CurrentResultSet\r
- {\r
- get { \r
- try {\r
- ResultSet resultSet = base.CurrentResultSet;\r
- \r
- if (resultSet != null) {\r
- return resultSet; \r
- }\r
- return CurrentRefCursor;\r
- }\r
- catch(SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
- }\r
-\r
- private ResultSet CurrentRefCursor\r
- {\r
- get {\r
- if (_currentParameterIndex < 0) {\r
- NextRefCursor();\r
- }\r
- if (_currentRefCursor == null && _currentParameterIndex < InternalParameters.Count) {\r
- _currentRefCursor = (ResultSet)((CallableStatement)Statement).getObject(_currentParameterIndex + 1);\r
- }\r
- return _currentRefCursor;\r
- }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- public new OleDbDataReader ExecuteReader()\r
- {\r
- return (OleDbDataReader)ExecuteReader(CommandBehavior.Default);\r
- }\r
-\r
- public new OleDbDataReader ExecuteReader(CommandBehavior behavior)\r
- {\r
- return (OleDbDataReader)base.ExecuteReader(behavior);\r
- }\r
-\r
- public new OleDbParameter CreateParameter()\r
- {\r
- return (OleDbParameter)CreateParameterInternal();\r
- } \r
-\r
- protected sealed override void CheckParameters()\r
- {\r
- for(int i = 0; i < Parameters.Count; i++) {\r
- OleDbParameter parameter = (OleDbParameter)Parameters[i];\r
- if ((parameter.OleDbType == OleDbType.Empty) || (parameter.OleDbType == OleDbType.Error)) {\r
- throw ExceptionHelper.ParametersNotInitialized(i,parameter.ParameterName,parameter.OleDbType.ToString());\r
- }\r
-\r
- if (((parameter.OleDbType == OleDbType.Char) || (parameter.OleDbType == OleDbType.Binary) ||\r
- (parameter.OleDbType == OleDbType.VarWChar) || (parameter.OleDbType == OleDbType.VarBinary) ||\r
- (parameter.OleDbType == OleDbType.VarNumeric)) && (parameter.Size == 0)) {\r
- throw ExceptionHelper.WrongParameterSize("OleDb");\r
- }\r
- }\r
- }\r
-\r
- protected sealed override DbParameter CreateParameterInternal()\r
- {\r
- return new OleDbParameter();\r
- }\r
-\r
- protected sealed override DbParameterCollection CreateParameterCollection(AbstractDbCommand parent)\r
- {\r
- return new OleDbParameterCollection((OleDbCommand)parent);\r
- }\r
-\r
- public override object Clone() {\r
- OleDbCommand clone = (OleDbCommand)base.Clone();\r
- clone._currentParameterIndex = 0;\r
- clone._currentRefCursor = null;\r
- return clone;\r
- }\r
-\r
- protected override void PrepareInternalParameters()\r
- {\r
- InternalParameters.Clear();\r
- _currentParameterIndex = -1;\r
- }\r
-\r
- protected override void BindOutputParameter(AbstractDbParameter parameter, int parameterIndex)\r
- {\r
- CallableStatement callableStatement = ((CallableStatement)Statement);\r
- if (((OleDbParameter)parameter).IsOracleRefCursor) {\r
- callableStatement.registerOutParameter(++parameterIndex, _oracleRefCursor);\r
- }\r
- else {\r
- base.BindOutputParameter(parameter, parameterIndex);\r
- }\r
- }\r
-\r
- protected override bool SkipParameter(DbParameter parameter)\r
- {\r
- return ((OleDbParameter)parameter).IsOracleRefCursor;\r
- }\r
-\r
- protected internal override bool NextResultSet()\r
- {\r
- try { \r
- bool hasMoreResults = base.NextResultSet();\r
-\r
- if (hasMoreResults) {\r
- return true;\r
- }\r
- else {\r
- return NextRefCursor();\r
- }\r
- }\r
- catch (SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
-\r
- private bool NextRefCursor()\r
- {\r
- _currentRefCursor = null;\r
- // FIXME : should we count all parameters or only out ones?\r
- for (_currentParameterIndex++;InternalParameters.Count > _currentParameterIndex;_currentParameterIndex++) {\r
- if (((OleDbParameter)InternalParameters[_currentParameterIndex]).IsOracleRefCursor) {\r
- return true; \r
- }\r
- }\r
- return false;\r
- }\r
-\r
- protected sealed override DbDataReader CreateReader()\r
- {\r
- return new OleDbDataReader(this);\r
- }\r
-\r
- protected internal sealed override SystemException CreateException(SQLException e)\r
- {\r
- return new OleDbException(e,Connection); \r
- }\r
-\r
- #endregion // Methods\r
- \r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//
-// System.Data.OleDb.OleDbConnection
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Data;
-using System.Data.Common;
-using System.Collections;
-using System.Data.ProviderBase;
-using System.Globalization;
-
-using java.sql;
-
-using System.Configuration;
-using Mainsoft.Data.Configuration;
-using Mainsoft.Data.Jdbc.Providers;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbConnection : AbstractDBConnection {
-
- #region Events
-
- public event OleDbInfoMessageEventHandler InfoMessage;
-
- #endregion // Events
-
- #region Constructors
-
- public OleDbConnection() : this(null) {
- }
-
- public OleDbConnection(String connectionString) : base(connectionString) {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public String Provider {
- get {
- IDictionary conDict = ConnectionStringBuilder;
- string provider = (string)conDict["Provider"];
- if (provider == null || provider.Length == 0)
- throw ExceptionHelper.OleDbNoProviderSpecified();
-
- return provider;
- }
- }
-
- protected override IConnectionProvider GetConnectionProvider() {
- IDictionary conProviderDict = ConnectionStringDictionary.Parse(ConnectionString);
- string jdbcUrl = (string)conProviderDict["JdbcUrl"];
- if (jdbcUrl == null) {
- string provider = (string)conProviderDict["Provider"];
- if (provider != null)
- return GetConnectionProvider("Mainsoft.Data.Configuration/OleDbProviders", provider);
- }
-
- return new GenericProvider (conProviderDict);
- }
-
- #endregion // Properties
-
- #region Methods
-
- public new OleDbTransaction BeginTransaction(IsolationLevel level)
- {
- return new OleDbTransaction(level, this);
- }
-
- public new OleDbTransaction BeginTransaction()
- {
- return BeginTransaction(IsolationLevel.ReadCommitted);
- }
-
- public new OleDbCommand CreateCommand()
- {
- return new OleDbCommand(this);
- }
-
- protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) {
- return BeginTransaction();
- }
-
- protected override DbCommand CreateDbCommand() {
- return CreateCommand();
- }
-
- protected sealed override SystemException CreateException(SQLException e)
- {
- return new OleDbException(e,this);
- }
-
- protected sealed override SystemException CreateException(string message)
- {
- return new OleDbException(message, null, this);
- }
-
- [MonoTODO]
- public DataTable GetOleDbSchemaTable (Guid schema, object[] restrictions)
- {
- if (State != ConnectionState.Open)
- throw ExceptionHelper.ConnectionNotOpened("GetOleDbSchemaTable", State.ToString());
-
- try {
-
- string[] fixedRestrictions = new string[4];
- if (restrictions != null) {
- if (restrictions.Length > 4)
- throw new OleDbException("The parameter is incorrect", null, this);
-
- for (int i = 0, count = restrictions.Length; i < count; i ++) {
- if (restrictions[i] != null) {
- if (!(restrictions[i] is string))
- throw new OleDbException("The parameter is incorrect", null, this);
-
- fixedRestrictions[i] = (string)restrictions[i];
- }
- }
- }
-
- DataTable schemaTable = new DataTable("Tables");
- schemaTable.Columns.Add("TABLE_CATALOG");
- schemaTable.Columns.Add("TABLE_SCHEMA");
- schemaTable.Columns.Add("TABLE_NAME");
- schemaTable.Columns.Add("TABLE_TYPE");
- schemaTable.Columns.Add("TABLE_GUID");
- schemaTable.Columns.Add("DESCRIPTION");
- schemaTable.Columns.Add("TABLE_PROPID");
- schemaTable.Columns.Add("DATE_CREATED");
- schemaTable.Columns.Add("DATE_MODIFIED");
-
- java.sql.ResultSet tableRes = JdbcConnection.getMetaData().getTables(
- fixedRestrictions[0],
- fixedRestrictions[1],
- fixedRestrictions[2],
- new string[]{fixedRestrictions[3]});
-
- try {
- while(tableRes.next()) {
- DataRow row = schemaTable.NewRow();
- row["TABLE_CATALOG"] = tableRes.getString("TABLE_CAT");
- row["TABLE_SCHEMA"] = tableRes.getString("TABLE_SCHEM");
- row["TABLE_NAME"] = tableRes.getString("TABLE_NAME");
- row["TABLE_TYPE"] = tableRes.getString("TABLE_TYPE");
- row["DESCRIPTION"] = tableRes.getString("REMARKS");
-
- schemaTable.Rows.Add(row);
- }
- }
- finally {
- tableRes.close();
- }
-
- return schemaTable;
- }
- catch (SQLException e) {
- throw CreateException(e);
- }
- }
-
- public static void ReleaseObjectPool()
- {
- // since we're using connection pool from app servet, this is by design
- //throw new NotImplementedException();
- }
-
-#if NET_2_0
- [MonoLimitation ("Empty implementation since State relies on java.sql.Connection.State always returning the correct state")]
- public void ResetState ()
- {
- }
-
-#endif
-
- protected internal sealed override void OnSqlWarning(SQLWarning warning)
- {
- OleDbErrorCollection col = new OleDbErrorCollection(warning, this);
- OnOleDbInfoMessage(new OleDbInfoMessageEventArgs(col));
- }
-
- private void OnOleDbInfoMessage (OleDbInfoMessageEventArgs value)
- {
- if (InfoMessage != null) {
- InfoMessage (this, value);
- }
- }
-
- #endregion // Methods
-
- }
-}
+++ /dev/null
-//\r
-// System.Data.OleDb.OleDbConvert\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Data.Common;\r
-using System.Data.ProviderBase;\r
-\r
-using java.sql;\r
-\r
-namespace System.Data.OleDb\r
-{\r
- internal sealed class OleDbConvert : DbConvert\r
- {\r
- #region Fields\r
-\r
- private static Hashtable _typeNamesMap;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- static OleDbConvert()\r
- {\r
- _typeNamesMap = new Hashtable(30,CaseInsensitiveHashCodeProvider.DefaultInvariant, CaseInsensitiveComparer.DefaultInvariant);\r
- \r
- // SqlServer types mapping\r
-// _typeNamesMap.Add("numeric(3, 0)1","DBTYPE_I1");\r
- _typeNamesMap.Add("smallint","DBTYPE_I2");\r
- _typeNamesMap.Add("Int","DBTYPE_I4");\r
- _typeNamesMap.Add("bigint","DBTYPE_I8");\r
- _typeNamesMap.Add("tinyint","DBTYPE_UI1");\r
-// _typeNamesMap.Add("numeric(5,0)","DBTYPE_UI2");\r
-// _typeNamesMap.Add("numeric(10,0)","DBTYPE_UI4");\r
-// _typeNamesMap.Add("numeric(20,0)","DBTYPE_UI8");\r
- _typeNamesMap.Add("Float","DBTYPE_R8");\r
- _typeNamesMap.Add("Real","DBTYPE_R4");\r
- _typeNamesMap.Add("numeric","DBTYPE_NUMERIC");\r
- _typeNamesMap.Add("decimal","DBTYPE_NUMERIC");\r
- _typeNamesMap.Add("money","DBTYPE_CY");\r
- _typeNamesMap.Add("smallmoney","DBTYPE_CY");\r
- _typeNamesMap.Add("ntext","DBTYPE_WLONGVARCHAR");\r
- _typeNamesMap.Add("nchar","DBTYPE_WCHAR");\r
- _typeNamesMap.Add("nvarchar","DBTYPE_WVARCHAR");\r
- _typeNamesMap.Add("Bit","DBTYPE_BOOL");\r
-// _typeNamesMap.Add("nvarchar(4000)","DBTYPE_VARIANT");\r
- _typeNamesMap.Add("sql_variant","DBTYPE_VARIANT");\r
- _typeNamesMap.Add("uniqueidentifier","DBTYPE_GUID");\r
- _typeNamesMap.Add("image","DBTYPE_LONGVARBINARY");\r
- _typeNamesMap.Add("timestamp","DBTYPE_BINARY");\r
- _typeNamesMap.Add("binary","DBTYPE_BINARY");\r
- _typeNamesMap.Add("varbinary","DBTYPE_VARBINARY");\r
- _typeNamesMap.Add("char","DBTYPE_CHAR");\r
- _typeNamesMap.Add("varchar","DBTYPE_VARCHAR");\r
- _typeNamesMap.Add("text","DBTYPE_LONGVARCHAR");\r
-// _typeNamesMap.Add("nchar","DBTYPE_WSTR");\r
-// _typeNamesMap.Add("nvarchar","DBTYPE_WSTR");\r
-// _typeNamesMap.Add("ntext","DBTYPE_WSTR");\r
-// _typeNamesMap.Add("datetime","DBTYPE_DATE");\r
- _typeNamesMap.Add("datetime","DBTYPE_DBTIMESTAMP");\r
- _typeNamesMap.Add("smalldatetime","DBTYPE_DBTIMESTAMP");\r
- _typeNamesMap.Add("Ignored","DBTYPE_BYREF");\r
- }\r
-\r
- #endregion //Constructors\r
-\r
- #region Methods\r
-\r
- internal static String JdbcTypeNameToDbTypeName(string jdbcTypeName)\r
- {\r
- jdbcTypeName = jdbcTypeName.Trim();\r
- string dbTypeName = (string)_typeNamesMap[jdbcTypeName];\r
-\r
- return (dbTypeName != null) ? dbTypeName : jdbcTypeName;\r
- }\r
-\r
- internal static OleDbType JdbcTypeToOleDbType(int jdbcType)\r
- {\r
- switch ((JavaSqlTypes)jdbcType) {\r
- case JavaSqlTypes.ARRAY: return OleDbType.Binary;\r
- case JavaSqlTypes.BIGINT: return OleDbType.BigInt;\r
- case JavaSqlTypes.BINARY: return OleDbType.Binary;\r
- case JavaSqlTypes.BIT: return OleDbType.Boolean;\r
- case JavaSqlTypes.BLOB: return OleDbType.Binary;\r
- case JavaSqlTypes.BOOLEAN: return OleDbType.Boolean;\r
- case JavaSqlTypes.CHAR: return OleDbType.Char;\r
- case JavaSqlTypes.CLOB: return OleDbType.LongVarWChar;\r
- case JavaSqlTypes.DATALINK: return OleDbType.IUnknown;\r
- case JavaSqlTypes.DATE: return OleDbType.DBDate;\r
- case JavaSqlTypes.DECIMAL: return OleDbType.Decimal;\r
- case JavaSqlTypes.DISTINCT: return OleDbType.IUnknown; \r
- case JavaSqlTypes.DOUBLE: return OleDbType.Double;\r
- case JavaSqlTypes.FLOAT: return OleDbType.Double;\r
- case JavaSqlTypes.INTEGER: return OleDbType.Integer;\r
- case JavaSqlTypes.JAVA_OBJECT: return OleDbType.IUnknown;\r
- case JavaSqlTypes.LONGVARBINARY: return OleDbType.LongVarBinary;\r
- case JavaSqlTypes.LONGVARCHAR: return OleDbType.LongVarWChar;\r
- case JavaSqlTypes.NULL: return OleDbType.Empty;\r
- case JavaSqlTypes.NUMERIC: return OleDbType.Numeric;\r
- default:\r
- case JavaSqlTypes.OTHER: return OleDbType.IUnknown;\r
- case JavaSqlTypes.REAL: return OleDbType.Single;\r
- case JavaSqlTypes.REF: return OleDbType.IUnknown;\r
- case JavaSqlTypes.SMALLINT: return OleDbType.SmallInt;\r
- case JavaSqlTypes.STRUCT: return OleDbType.IUnknown;\r
- case JavaSqlTypes.TIME: return OleDbType.DBTime;\r
- case JavaSqlTypes.TIMESTAMP: return OleDbType.DBTimeStamp;\r
- case JavaSqlTypes.TINYINT: return OleDbType.TinyInt;\r
- case JavaSqlTypes.VARBINARY: return OleDbType.VarBinary;\r
- case JavaSqlTypes.VARCHAR: return OleDbType.VarChar;\r
- }\r
- }\r
-\r
- internal static OleDbType ValueTypeToOleDbType(Type type)\r
- {\r
- switch (Type.GetTypeCode(type)) {\r
- case TypeCode.Boolean: return OleDbType.Boolean;\r
- case TypeCode.Byte: return OleDbType.UnsignedTinyInt;\r
- case TypeCode.Char: return OleDbType.Char;\r
- case TypeCode.DateTime: return OleDbType.Date;\r
- case TypeCode.DBNull: return OleDbType.Empty;\r
- case TypeCode.Decimal: return OleDbType.Decimal;\r
- case TypeCode.Double: return OleDbType.Double;\r
- case TypeCode.Empty: return OleDbType.Empty;\r
- case TypeCode.Int16: return OleDbType.SmallInt;\r
- case TypeCode.Int32: return OleDbType.Integer;\r
- case TypeCode.Int64: return OleDbType.BigInt;\r
- default:\r
- case TypeCode.Object: {\r
- if (type.Equals(DbTypes.TypeOfByteArray)) return OleDbType.Binary;\r
- if (type.Equals(DbTypes.TypeOfTimespan)) return OleDbType.DBTime;\r
- if (type.Equals(DbTypes.TypeOfGuid)) return OleDbType.Guid;\r
-\r
- if (type.IsEnum)\r
- return ValueTypeToOleDbType (Enum.GetUnderlyingType (type));\r
-\r
- return OleDbType.IUnknown;\r
- }\r
- case TypeCode.SByte: return OleDbType.TinyInt;\r
- case TypeCode.Single: return OleDbType.Single;\r
- case TypeCode.String: return OleDbType.VarWChar;\r
- case TypeCode.UInt16: return OleDbType.UnsignedSmallInt;\r
- case TypeCode.UInt32: return OleDbType.UnsignedInt;\r
- case TypeCode.UInt64: return OleDbType.UnsignedBigInt;\r
- }\r
- }\r
-\r
- internal static Type OleDbTypeToValueType(OleDbType oleDbType)\r
- {\r
- switch (oleDbType) {\r
- case OleDbType.BigInt : return DbTypes.TypeOfInt64;// typeof(long);\r
- case OleDbType.Binary : return DbTypes.TypeOfByteArray;\r
- case OleDbType.Boolean : return DbTypes.TypeOfBoolean;\r
- case OleDbType.BSTR : return DbTypes.TypeOfString;\r
- case OleDbType.Char : return DbTypes.TypeOfString;\r
- case OleDbType.Currency : return DbTypes.TypeOfDecimal;\r
- case OleDbType.Date : return DbTypes.TypeOfDateTime;\r
- case OleDbType.DBDate : return DbTypes.TypeOfDateTime;\r
- case OleDbType.DBTime : return DbTypes.TypeOfTimespan;\r
- case OleDbType.DBTimeStamp : return DbTypes.TypeOfDateTime;\r
- case OleDbType.Decimal : return DbTypes.TypeOfDecimal;\r
- case OleDbType.Double : return DbTypes.TypeOfDouble;\r
- case OleDbType.Empty : return null; //typeof(DBNull);\r
- case OleDbType.Error : return typeof(Exception);\r
- case OleDbType.Filetime : return DbTypes.TypeOfDateTime;\r
- case OleDbType.Guid : return DbTypes.TypeOfGuid;\r
- case OleDbType.IDispatch : return DbTypes.TypeOfObject;\r
- case OleDbType.Integer : return DbTypes.TypeOfInt32;\r
- case OleDbType.IUnknown : return DbTypes.TypeOfObject;\r
- case OleDbType.LongVarBinary : return DbTypes.TypeOfByteArray;\r
- case OleDbType.LongVarChar : return DbTypes.TypeOfString;\r
- case OleDbType.LongVarWChar : return DbTypes.TypeOfString;\r
- case OleDbType.Numeric : return DbTypes.TypeOfDecimal;\r
- case OleDbType.PropVariant : return DbTypes.TypeOfObject;\r
- case OleDbType.Single : return DbTypes.TypeOfFloat;\r
- case OleDbType.SmallInt : return DbTypes.TypeOfInt16;\r
- case OleDbType.TinyInt : return DbTypes.TypeOfSByte;\r
- case OleDbType.UnsignedBigInt : return DbTypes.TypeOfUInt64;\r
- case OleDbType.UnsignedInt : return DbTypes.TypeOfUInt32;\r
- case OleDbType.UnsignedSmallInt : return DbTypes.TypeOfUInt16;\r
- case OleDbType.UnsignedTinyInt : return DbTypes.TypeOfByte;\r
- case OleDbType.VarBinary : return DbTypes.TypeOfByteArray;\r
- case OleDbType.VarChar : return DbTypes.TypeOfString;\r
- case OleDbType.Variant : return DbTypes.TypeOfObject;\r
- case OleDbType.VarNumeric : return DbTypes.TypeOfDecimal;\r
- case OleDbType.VarWChar : return DbTypes.TypeOfString;\r
- case OleDbType.WChar : return DbTypes.TypeOfString;\r
- default : return DbTypes.TypeOfObject;\r
- }\r
- }\r
-\r
- internal static OleDbType DbTypeToOleDbType(DbType dbType)\r
- {\r
- switch (dbType) {\r
- case DbType.AnsiString : return OleDbType.VarChar;\r
- case DbType.Binary : return OleDbType.VarBinary;\r
- case DbType.Byte : return OleDbType.UnsignedTinyInt;\r
- case DbType.Boolean : return OleDbType.Boolean;\r
- case DbType.Currency : return OleDbType.Currency;\r
- case DbType.Date : return OleDbType.DBDate;\r
- case DbType.DateTime : return OleDbType.DBTimeStamp;\r
- case DbType.Decimal : return OleDbType.Decimal;\r
- case DbType.Double : return OleDbType.Double;\r
- case DbType.Guid : return OleDbType.Guid;\r
- case DbType.Int16 : return OleDbType.SmallInt;\r
- case DbType.Int32 : return OleDbType.Integer;\r
- case DbType.Int64 : return OleDbType.BigInt;\r
- case DbType.Object : return OleDbType.Variant;\r
- case DbType.SByte : return OleDbType.TinyInt;\r
- case DbType.Single : return OleDbType.Single;\r
- case DbType.String : return OleDbType.VarWChar;\r
- case DbType.Time : return OleDbType.DBTime;\r
- case DbType.UInt16 : return OleDbType.UnsignedSmallInt;\r
- case DbType.UInt32 : return OleDbType.UnsignedInt;\r
- case DbType.UInt64 : return OleDbType.UnsignedBigInt;\r
- case DbType.VarNumeric : return OleDbType.VarNumeric;\r
- case DbType.AnsiStringFixedLength : return OleDbType.Char;\r
- case DbType.StringFixedLength : return OleDbType.WChar;\r
- default : throw ExceptionHelper.InvalidDbType((int)dbType);\r
- }\r
- }\r
-\r
- internal static DbType OleDbTypeToDbType(OleDbType oleDbType)\r
- {\r
- switch (oleDbType) {\r
- case OleDbType.Empty : return DbType.Object;\r
- case OleDbType.SmallInt : return DbType.Int16;\r
- case OleDbType.Integer : return DbType.Int32;\r
- case OleDbType.Single : return DbType.Single;\r
- case OleDbType.Double : return DbType.Double;\r
- case OleDbType.Currency : return DbType.Currency;\r
- case OleDbType.Date : return DbType.DateTime;\r
- case OleDbType.BSTR : return DbType.String;\r
- case OleDbType.IDispatch : return DbType.Object;\r
- case OleDbType.Error : return DbType.Object;\r
- case OleDbType.Boolean : return DbType.Boolean;\r
- case OleDbType.Variant : return DbType.Object;\r
- case OleDbType.IUnknown : return DbType.Object;\r
- case OleDbType.Decimal : return DbType.Decimal;\r
- case OleDbType.TinyInt : return DbType.SByte;\r
- case OleDbType.UnsignedTinyInt : return DbType.Byte;\r
- case OleDbType.UnsignedSmallInt : return DbType.UInt16;\r
- case OleDbType.UnsignedInt : return DbType.UInt32;\r
- case OleDbType.BigInt : return DbType.Int64;\r
- case OleDbType.UnsignedBigInt : return DbType.UInt64;\r
- case OleDbType.Filetime : return DbType.DateTime;\r
- case OleDbType.Guid : return DbType.Guid;\r
- case OleDbType.Binary : return DbType.Binary;\r
- case OleDbType.Char : return DbType.AnsiStringFixedLength;\r
- case OleDbType.WChar : return DbType.StringFixedLength;\r
- case OleDbType.Numeric : return DbType.Decimal;\r
- case OleDbType.DBDate : return DbType.Date;\r
- case OleDbType.DBTime : return DbType.Time;\r
- case OleDbType.DBTimeStamp : return DbType.DateTime;\r
- case OleDbType.PropVariant : return DbType.Object;\r
- case OleDbType.VarNumeric : return DbType.VarNumeric;\r
- case OleDbType.VarChar : return DbType.AnsiString;\r
- case OleDbType.LongVarChar : return DbType.AnsiString;\r
- case OleDbType.VarWChar : return DbType.String;\r
- case OleDbType.LongVarWChar : return DbType.String;\r
- case OleDbType.VarBinary : return DbType.Binary;\r
- case OleDbType.LongVarBinary : return DbType.Binary;\r
- default : throw ExceptionHelper.InvalidOleDbType((int)oleDbType);\r
- }\r
- }\r
-\r
- internal static int OleDbTypeToJdbcType(OleDbType oleDbType)\r
- {\r
- switch(oleDbType) {\r
- case OleDbType.BigInt : return Types.BIGINT;\r
- case OleDbType.Binary : return Types.BINARY;\r
- case OleDbType.Boolean : return Types.BIT;\r
- case OleDbType.BSTR : return Types.VARCHAR;\r
- case OleDbType.Char : return Types.CHAR;\r
- case OleDbType.Currency : return Types.DECIMAL;\r
- case OleDbType.Date : return Types.TIMESTAMP;\r
- case OleDbType.DBDate : return Types.DATE;\r
- case OleDbType.DBTime : return Types.TIME;\r
- case OleDbType.DBTimeStamp : return Types.TIMESTAMP;\r
- case OleDbType.Decimal : return Types.DECIMAL;\r
- case OleDbType.Double : return Types.DOUBLE;\r
- case OleDbType.Empty : return Types.NULL;\r
- case OleDbType.Error : return Types.OTHER;\r
- case OleDbType.Filetime : return Types.TIMESTAMP;\r
- case OleDbType.Guid : return Types.CHAR;\r
- case OleDbType.IDispatch : return Types.OTHER; //throw new ArgumentException("The " + oleDbType + " OleDbType value is not supported.");\r
- case OleDbType.Integer : return Types.INTEGER;\r
- case OleDbType.IUnknown : return Types.OTHER; //throw new ArgumentException("The " + oleDbType + " OleDbType value is not supported.");\r
- case OleDbType.LongVarBinary : return Types.LONGVARBINARY;\r
- case OleDbType.LongVarChar : return Types.LONGVARCHAR;\r
- case OleDbType.LongVarWChar : return Types.LONGVARCHAR;\r
- case OleDbType.Numeric : return Types.NUMERIC;\r
- case OleDbType.PropVariant : return Types.OTHER;\r
- case OleDbType.Single : return Types.FLOAT;\r
- case OleDbType.SmallInt : return Types.SMALLINT;\r
- case OleDbType.TinyInt : return Types.TINYINT;\r
- case OleDbType.UnsignedBigInt : return Types.BIGINT;\r
- case OleDbType.UnsignedInt : return Types.INTEGER;\r
- case OleDbType.UnsignedSmallInt : return Types.SMALLINT;\r
- case OleDbType.UnsignedTinyInt : return Types.TINYINT;\r
- case OleDbType.VarBinary : return Types.VARBINARY;\r
- case OleDbType.VarChar : return Types.VARCHAR;\r
- case OleDbType.Variant : return Types.VARCHAR;\r
- case OleDbType.VarNumeric : return Types.DECIMAL;\r
- case OleDbType.VarWChar : return Types.VARCHAR;\r
- case OleDbType.WChar : return Types.VARCHAR;\r
- default : throw ExceptionHelper.InvalidOleDbType((int)oleDbType);\r
- }\r
-\r
- #endregion // Methods\r
- }\r
- }\r
-}\r
+++ /dev/null
-//
-// System.Data.OleDb.OleDbDataReader
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Data.Common;
-using System.Data.ProviderBase;
-
-using java.sql;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbDataReader : AbstractDataReader
- {
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- internal OleDbDataReader(OleDbCommand command) : base(command)
- {
- }
-
- #endregion // Constructors
-
- #region Methods
-
- protected sealed override SystemException CreateException(string message, SQLException e)
- {
- return new OleDbException(message,e, (OleDbConnection)_command.Connection);
- }
-
- protected sealed override SystemException CreateException(java.io.IOException e)
- {
- return new OleDbException(e, (OleDbConnection)_command.Connection);
- }
-
- public override String GetDataTypeName(int columnIndex)
- {
- try {
- string jdbcTypeName = Results.getMetaData().getColumnTypeName(columnIndex + 1);
-
- return OleDbConvert.JdbcTypeNameToDbTypeName(jdbcTypeName);
- }
- catch (SQLException e) {
- throw CreateException(e);
- }
- }
-
- protected override int GetProviderType(int jdbcType)
- {
- return (int)OleDbConvert.JdbcTypeToOleDbType(jdbcType);
- }
-
- [MonoNotSupported("")]
- public OleDbDataReader GetData (int ordinal)
- {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// System.Data.OleDb.OleDbError
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Data.OleDb
-{
- using java.sql;
- using System.Data.Common;
- using System.Data.ProviderBase;
-
- [Serializable]
- public sealed class OleDbError : AbstractDbError
- {
-
- internal OleDbError(SQLException e, AbstractDBConnection connection) : base(e, connection) {
- }
-
- public String Message
- {
- get
- {
- return DbMessage;
- }
- }
-
- public int NativeError
- {
- get
- {
- return DbErrorCode;
- }
- }
-
- public String Source
- {
- get
- {
- return DbSource;
- }
- }
-
- public String SQLState
- {
- get
- {
- return DbSQLState;
- }
- }
-
- public override string ToString ()
- {
- string toStr;
-
- toStr = String.Format("OleDbError: {0}. {1}", Message, _e.StackTrace);
- return toStr;
-
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// System.Data.OleDb.OleDbErrorCollection
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Data.OleDb
-{
-
-
- using System.Collections;
- using java.sql;
- using System.Data.Common;
- using System.Data.ProviderBase;
-
- [Serializable]
- public sealed class OleDbErrorCollection : AbstractDbErrorCollection
- {
- internal OleDbErrorCollection(SQLException e, AbstractDBConnection connection) : base(e, connection) {
- }
- /**
- * Gets the error at the specified index.
- *
- * @param index of the error
- * @return Error on specified index
- */
- public OleDbError this[int index]
- {
- get
- {
- return (OleDbError)GetDbItem(index);
- }
- }
-
-#if NET_2_0
- public void CopyTo (OleDbError [] array, int index)
- {
- base.CopyTo (array, index);
- }
-
-#endif
-
- protected override AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection) {
- return new OleDbError(e, connection);
- }
-
- }
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.OleDb.OleDbException\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-\r
-namespace System.Data.OleDb\r
-{\r
-\r
- using java.sql;\r
- using System.Text;\r
- using System.Data.Common;\r
- using System.Data.ProviderBase;\r
-\r
- /*\r
- * CURRENT LIMITATIONS\r
- * 1. Constructor for serialization SqlException(SerializationInfo info, StreamingContext sc) \r
- * is not supported.\r
- * 2. Method "void GetObjectData(...,...)" is not supported (serialization)\r
- */\r
-#if NET_2_0\r
- public sealed class OleDbException : AbstractDbException\r
- {\r
- internal OleDbException (Exception cause, OleDbConnection connection) : base (cause, connection) { }\r
-\r
- internal OleDbException (SQLException cause, OleDbConnection connection) : base (cause, connection) { }\r
-\r
- internal OleDbException (string message, SQLException cause, OleDbConnection connection) : base (message, cause, connection) { }\r
-\r
- protected override AbstractDbErrorCollection DbErrors {\r
- get {\r
- return Errors;\r
- }\r
- }\r
-\r
- public OleDbErrorCollection Errors {\r
- get {\r
- return new OleDbErrorCollection (_cause, _connection);\r
- }\r
- }\r
-\r
- public override int ErrorCode {\r
- get {\r
- return DbErrorCode;\r
- }\r
- }\r
- }\r
-#else\r
- public sealed class OleDbException : System.Runtime.InteropServices.ExternalException\r
- {\r
- private class OleDbExceptionImpl : AbstractDbException {\r
- internal OleDbExceptionImpl(Exception cause, OleDbConnection connection) : base(cause, connection) {}\r
-\r
- internal OleDbExceptionImpl(SQLException cause, OleDbConnection connection) : base(cause, connection) {}\r
-\r
- internal OleDbExceptionImpl(string message, SQLException cause, OleDbConnection connection) : base(message, cause, connection) {}\r
-\r
- protected override AbstractDbErrorCollection DbErrors {\r
- get {\r
- return Errors;\r
- }\r
- }\r
-\r
- public OleDbErrorCollection Errors {\r
- get {\r
- return new OleDbErrorCollection(_cause, _connection);\r
- }\r
- }\r
-\r
- public int ErrorCode {\r
- get {\r
- return DbErrorCode;\r
- }\r
- }\r
- }\r
- \r
- OleDbExceptionImpl _impl;\r
-\r
- internal OleDbException(Exception cause, OleDbConnection connection) : base(null, cause) {\r
- _impl = new OleDbExceptionImpl(cause, connection);\r
- }\r
-\r
- internal OleDbException(SQLException cause, OleDbConnection connection) : base(null, cause) {\r
- _impl = new OleDbExceptionImpl(cause, connection);\r
- }\r
-\r
- internal OleDbException(string message, SQLException cause, OleDbConnection connection) : base(null, cause) {\r
- _impl = new OleDbExceptionImpl(message, cause, connection);\r
- }\r
- /**\r
- * Gets a collection of one or more SqlError objects that give detailed \r
- * information about exceptions generated by the SQL Server .NET Data Provider.\r
- * @return collection of SqlError objects\r
- */\r
- public OleDbErrorCollection Errors\r
- {\r
- get\r
- {\r
- return (OleDbErrorCollection)_impl.Errors;\r
- }\r
- }\r
-\r
- /**\r
- * Gets the error code of the error.\r
- * @return The error code of the error.\r
- */\r
- public override int ErrorCode\r
- {\r
- get\r
- {\r
- return base.HResult;\r
- }\r
- }\r
-\r
- \r
- /**\r
- * Gets the name of the OLE DB provider that generated the error.\r
- * @return the name of the OLE DB provider that generated the error. \r
- */\r
- public override String Source\r
- {\r
- get\r
- {\r
- return _impl.Source;\r
- }\r
- }\r
-\r
- public override string Message {\r
- get {\r
- return _impl.Message;\r
- }\r
- }\r
-\r
- }\r
-#endif\r
-}
\ No newline at end of file
+++ /dev/null
-//
-// System.Data.OleDb.OleDbParameter
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Text;
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-
-using java.sql;
-using java.lang;
-using System.Globalization;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbParameter : AbstractDbParameter
- {
-
- #region Fields
-
- private OleDbType _oleDbType = OleDbType.VarWChar;
- private bool _isOracleRefCursor = false;
-
- #endregion // Fields
-
- #region Constructors
-
- public OleDbParameter()
- {
- }
-
- public OleDbParameter(String parameterName, Object value)
- : this (parameterName, OleDbType.VarWChar, 0, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, value)
- {
- IsDbTypeSet = false;
- }
-
- public OleDbParameter(String parameterName, OleDbType dbType)
- : this (parameterName, dbType, 0, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, null)
- {
- }
-
- public OleDbParameter(String parameterName, OleDbType dbType, int size)
- : this (parameterName, dbType, size, ParameterDirection.Input,
- false, 0, 0, String.Empty, DataRowVersion.Current, null)
- {
- }
-
- public OleDbParameter(String parameterName, OleDbType dbType, int size,
- String sourceColumn)
- : this (parameterName, dbType, size, ParameterDirection.Input,
- false, 0, 0, sourceColumn, DataRowVersion.Current, null)
- {
- }
-
-
- public OleDbParameter(String parameterName,
- OleDbType dbType,
- int size,
- ParameterDirection direction,
- bool isNullable,
- byte precision,
- byte scale,
- String sourceColumn,
- DataRowVersion sourceVersion,
- Object value)
- {
- ParameterName = parameterName;
- OleDbType = dbType;
- Size = size;
- Direction = direction;
- IsNullable = isNullable;
- Precision = precision;
- Scale = scale;
- SourceColumn = sourceColumn;
- SourceVersion = sourceVersion;
- Value = value;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public override DbType DbType
- {
- get { return OleDbConvert.OleDbTypeToDbType(_oleDbType); }
- set { OleDbType = OleDbConvert.DbTypeToOleDbType(value); }
- }
-
- public OleDbType OleDbType
- {
- get { return _oleDbType; }
- set {
- _oleDbType = value;
- IsDbTypeSet = true;
- }
- }
-
-#if NET_2_0
- public new byte Precision
- {
- get { return base.Precision; }
- set { base.Precision = value; }
- }
-
- public new byte Scale
- {
- get { return base.Scale; }
- set { base.Scale = value; }
- }
-#endif
-
- public new Object Value
- {
- get { return base.Value; }
- set {
- if (!IsDbTypeSet && (value != null) && (value != DBNull.Value)) {
- _oleDbType = OleDbConvert.ValueTypeToOleDbType(value.GetType());
- }
- base.Value = value;
- }
- }
-
- protected internal sealed override bool IsSpecial {
- get {
- return (Direction == ParameterDirection.Output) && IsOracleRefCursor;
- }
- }
-
-
- internal bool IsOracleRefCursor
- {
- get { return _isOracleRefCursor; }
- set { _isOracleRefCursor = value; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected internal sealed override object ConvertValue(object value)
- {
- // can not convert null or DbNull to other types
- if (value == null || value == DBNull.Value) {
- return value;
- }
-
- // FIXME : some other way to do this?
- if (OleDbType == OleDbType.Binary) {
- return value;
- }
- // .NET throws an exception to the user.
- object convertedValue = value;
-
- // note : if we set user parameter jdbc type inside prepare interbal, the db type is not set
- if (value is IConvertible && (IsDbTypeSet || IsJdbcTypeSet)) {
- OleDbType oleDbType = (IsDbTypeSet) ? OleDbType : OleDbConvert.JdbcTypeToOleDbType((int)JdbcType);
- Type to = OleDbConvert.OleDbTypeToValueType(oleDbType);
- if (!(value is DateTime && to == DbTypes.TypeOfTimespan)) //anyway will go by jdbc type
- convertedValue = Convert.ChangeType(value,to);
- }
- return convertedValue;
- }
-
- protected internal sealed override void SetParameterName(ResultSet res)
- {
- ParameterName = res.getString("COLUMN_NAME");
-
- if (ParameterName.StartsWith("@")) {
- ParameterName = ParameterName.Remove(0,1);
- }
- }
-
- protected internal sealed override void SetParameterDbType(ResultSet res)
- {
- int jdbcType = res.getInt("DATA_TYPE");
- // FIXME : is that correct?
- if (jdbcType == Types.OTHER) {
- string typeName = res.getString("TYPE_NAME");
- if (String.Compare ("BLOB", typeName, true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = Types.BLOB;
- }
- else if (String.Compare ("CLOB", typeName, true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = Types.CLOB;
- }
- else if (String.Compare ("FLOAT", typeName, true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = Types.FLOAT;
- }
- else if (String.Compare ("NVARCHAR2", typeName, true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = Types.VARCHAR;
- }
- else if (String.Compare ("NCHAR", typeName, true, CultureInfo.InvariantCulture) == 0) {
- jdbcType = Types.VARCHAR;
- }
- }
- OleDbType = OleDbConvert.JdbcTypeToOleDbType(jdbcType);
- JdbcType = jdbcType;
- }
-
-#if NET_2_0
- public void ResetOleDbType ()
- {
- IsDbTypeSet = false;
- }
-
- public override void ResetDbType ()
- {
- ResetOleDbType ();
- }
-#endif
-
- protected internal sealed override void SetSpecialFeatures(ResultSet res)
- {
- IsOracleRefCursor = (res.getString("TYPE_NAME") == "REF CURSOR");
- }
-
- protected internal sealed override int JdbcTypeFromProviderType()
- {
- return OleDbConvert.OleDbTypeToJdbcType(OleDbType);
- }
-
- #endregion // Methods
-
- }
-}
+++ /dev/null
-//\r
-// System.Data.ProviderBase.AbstractDbCommand\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Text;\r
-using System.Text.RegularExpressions;\r
-using System.Collections;\r
-using System.Data;\r
-using System.Data.Common;\r
-\r
-using java.sql;\r
-using java.io;\r
-\r
-#if !USE_DOTNET_REGEXP\r
-using java.util.regex;\r
-#endif\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
- public abstract class AbstractDbCommand : DbCommand, ICloneable\r
- {\r
- #region ProcedureColumnCache\r
-\r
- internal sealed class ProcedureColumnCache : AbstractDbMetaDataCache\r
- {\r
- internal ArrayList GetProcedureColumns(AbstractDBConnection connection, String commandText,AbstractDbCommand command) \r
- {\r
- string connectionCatalog = connection.JdbcConnection.getCatalog();\r
- string key = String.Concat(connection.ConnectionString, connectionCatalog, commandText);\r
- System.Collections.Hashtable cache = Cache;\r
-\r
- ArrayList col = cache[key] as ArrayList;\r
-\r
- if (null != col) {\r
- return col;\r
- }\r
- \r
- col = connection.GetProcedureColumns(commandText,command);\r
- if (col != null)\r
- cache[key] = col;\r
- return col; \r
- }\r
- }\r
-\r
- #endregion\r
-\r
- #region SqlStatementsHelper\r
-\r
- internal sealed class SqlStatementsHelper\r
- {\r
- #region Fields\r
-#if USE_DOTNET_REGEXP \r
- internal static readonly Regex NamedParameterStoredProcedureRegExp = new Regex(@"^\s*{?\s*((?<RETVAL>@\w+)\s*=\s*)?call\s+(?<PROCNAME>(((\[[^\]]*\])|([^\.\(])*)\s*\.\s*){0,2}(\[[^\]]*\]|((\s*[^\.\(\)\{\}\s])+)))\s*(\(\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)?\s*(,\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)\s*)*\))?\s*}?\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- internal static readonly Regex SimpleParameterStoredProcedureRegExp = new Regex(@"^\s*{?\s*((?<RETVAL>\?)\s*=\s*)?call\s+(?<PROCNAME>(((\[[^\]]*\])|([^\.\(])*)\s*\.\s*){0,2}(\[[^\]]*\]|((\s*[^\.\(\)\{\}\s])+)))\s*(\(\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)?\s*(,\s*(?<USERPARAM>((""([^""]|(""""))*"")|('([^']|(''))*')|[^,])*)\s*)*\))?\s*}?\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- internal static readonly Regex ForBrowseStatementReqExp = new Regex(@"\s+FOR\s+BROWSE\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
-#else\r
- internal static readonly Pattern NamedParameterStoredProcedureRegExp = Pattern.compile(@"^\s*\{?\s*(?:(@\w+)\s*=\s*)?call\s+((?:(?:(?:\[[^\]]*\])|(?:[^\.\(\)\{\}\[\]])*)\s*\.\s*){0,2}(?:\[[^\]]*\]|(?:(?:\s*[^\.\(\)\{\}\[\]])+)))\s*(?:\((.*)\))?\s*\}?\s*$", Pattern.CASE_INSENSITIVE);\r
- internal static readonly Pattern SimpleParameterStoredProcedureRegExp = Pattern.compile(@"^\s*\{?\s*(?:(\?)\s*=\s*)?call\s+((?:(?:(?:\[[^\]]*\])|(?:[^\.\(\)\{\}\[\]])*)\s*\.\s*){0,2}(?:\[[^\]]*\]|(?:(?:\s*[^\.\(\)\{\}\[\]])+)))\s*(?:\((.*)\))?\s*\}?\s*$", Pattern.CASE_INSENSITIVE);\r
- internal static readonly Pattern ForBrowseStatementReqExp = Pattern.compile(@"\s+FOR\s+BROWSE\s*$", Pattern.CASE_INSENSITIVE);\r
-#endif\r
-\r
- internal static readonly SimpleRegex NamedParameterRegExp = new SqlParamsRegex();\r
- internal static readonly SimpleRegex SimpleParameterRegExp = new OleDbParamsRegex();\r
-\r
- internal static readonly SimpleRegex CompoundStatementSplitterReqExp = new CharacterSplitterRegex(';');\r
- internal static readonly SimpleRegex ProcedureParameterSplitterReqExp = new CharacterSplitterRegex(',');\r
-\r
- #endregion // Fields\r
- }\r
-\r
- #endregion // SqlStatementsHelper\r
-\r
- #region Fields\r
-\r
- string _commandText;\r
- int _commandTimeout;\r
- CommandType _commandType;\r
- bool _designTimeVisible;\r
- UpdateRowSource _updatedRowSource;\r
-\r
- private DbParameterCollection _parameters;\r
- private java.sql.Statement _statement;\r
- private AbstractDBConnection _connection;\r
- private AbstractTransaction _transaction;\r
- private bool _isCommandPrepared;\r
- private CommandBehavior _behavior;\r
- private ArrayList _internalParameters;\r
- string _javaCommandText;\r
- private int _recordsAffected;\r
- private ResultSet _currentResultSet;\r
- private DbDataReader _currentReader;\r
- private bool _nullParametersInPrepare;\r
- private bool _hasResultSet;\r
- private bool _explicitPrepare;\r
-\r
- static ProcedureColumnCache _procedureColumnCache = new ProcedureColumnCache();\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public AbstractDbCommand(\r
- String cmdText,\r
- AbstractDBConnection connection,\r
- AbstractTransaction transaction)\r
- {\r
- _connection = connection;\r
- _commandText = cmdText;\r
- _transaction = transaction;\r
-\r
- _commandTimeout = 30;\r
- _commandType = CommandType.Text;\r
- _designTimeVisible = true;\r
- _updatedRowSource = UpdateRowSource.Both;\r
-\r
- _isCommandPrepared = false;\r
- _explicitPrepare = false;\r
- _recordsAffected = -1;\r
- if (connection != null) {\r
- connection.AddReference(this);\r
- }\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public override int CommandTimeout {\r
- get { return _commandTimeout; }\r
- set { _commandTimeout = value; }\r
- }\r
-\r
- public override CommandType CommandType {\r
- get { return _commandType; }\r
- set { _commandType = value; }\r
- }\r
-\r
- public override bool DesignTimeVisible {\r
- get { return _designTimeVisible; }\r
- set { _designTimeVisible = value; }\r
- } \r
-\r
- public override UpdateRowSource UpdatedRowSource {\r
- get { return _updatedRowSource; }\r
- set { _updatedRowSource = value; }\r
- }\r
-\r
- protected override DbParameterCollection DbParameterCollection\r
- {\r
- get {\r
- if (_parameters == null) {\r
- _parameters = CreateParameterCollection(this);\r
- }\r
- return _parameters; \r
- }\r
- }\r
-\r
- protected override DbConnection DbConnection\r
- {\r
- get { return (DbConnection)_connection; }\r
- set {\r
- if (value == _connection) {\r
- return;\r
- }\r
-\r
- if (_currentReader != null && !_currentReader.IsClosed) {\r
- throw ExceptionHelper.ConnectionIsBusy(this.GetType().Name,((AbstractDBConnection)_connection).InternalState);\r
- }\r
- if (_connection != null) {\r
- _connection.RemoveReference(this);\r
- }\r
- _connection = (AbstractDBConnection) value;\r
- if (_connection != null) {\r
- _connection.AddReference(this);\r
- }\r
- }\r
- }\r
-\r
- protected override DbTransaction DbTransaction\r
- {\r
- get { return _transaction != null ? _transaction.ActiveTransaction : null; }\r
- set { _transaction = (AbstractTransaction)value; }\r
- }\r
-\r
- public override string CommandText\r
- {\r
- get { return _commandText; }\r
- set { \r
- if (CommandText == null || String.Compare(CommandText, value, true) != 0) {\r
- _commandText = value;\r
- _isCommandPrepared = false;\r
- _explicitPrepare = false;\r
- }\r
- }\r
- }\r
-\r
- protected virtual string InternalCommandText {\r
- get { return CommandText; }\r
- //set { CommandText = value; }\r
- }\r
-\r
- internal CommandBehavior Behavior\r
- {\r
- get { return _behavior; }\r
- set { _behavior = value; }\r
- }\r
-\r
- bool IsCommandPrepared\r
- {\r
- get { return _isCommandPrepared; }\r
- set { _isCommandPrepared = value; }\r
- }\r
-\r
- bool NullParametersInPrepare\r
- {\r
- get { return _nullParametersInPrepare; }\r
- set { _nullParametersInPrepare = value; }\r
- }\r
-\r
- protected ArrayList InternalParameters\r
- {\r
- get {\r
- if (_internalParameters == null) {\r
- _internalParameters = new ArrayList();\r
- }\r
- return _internalParameters;\r
- }\r
- }\r
-\r
- // Number of records affected by execution of batch statement\r
- // -1 for SELECT statements.\r
- internal int RecordsAffected\r
- {\r
- get {\r
- return _recordsAffected;\r
- }\r
- }\r
-\r
- // AbstractDbCommand acts as IEnumerator over JDBC statement\r
- // AbstractDbCommand.CurrentResultSet corresponds to IEnumerator.Current\r
- protected internal virtual ResultSet CurrentResultSet\r
- {\r
- get { \r
- try {\r
- if (_currentResultSet == null && _hasResultSet) {\r
- _currentResultSet = _statement.getResultSet(); \r
- }\r
- return _currentResultSet;\r
- }\r
- catch(SQLException e) {\r
- throw new Exception(e.Message, e);\r
- }\r
- }\r
- }\r
-\r
- protected internal java.sql.Statement Statement\r
- {\r
- get { return _statement; }\r
- }\r
-#if USE_DOTNET_REGEX\r
- protected virtual Regex StoredProcedureRegExp\r
-#else\r
- protected virtual Pattern StoredProcedureRegExp\r
-#endif\r
- {\r
- get { return SqlStatementsHelper.SimpleParameterStoredProcedureRegExp; }\r
- }\r
-\r
- protected virtual SimpleRegex ParameterRegExp\r
- {\r
- get { return SqlStatementsHelper.SimpleParameterRegExp; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- protected abstract DbParameter CreateParameterInternal();\r
-\r
- protected abstract void CheckParameters();\r
-\r
- protected abstract DbDataReader CreateReader();\r
-\r
- protected abstract DbParameterCollection CreateParameterCollection(AbstractDbCommand parent);\r
-\r
- protected internal abstract SystemException CreateException(SQLException e);\r
-\r
- public override int ExecuteNonQuery ()\r
- {\r
- IDataReader reader = null;\r
- try {\r
- reader = ExecuteReader ();\r
- }\r
- finally {\r
- if (reader != null)\r
- reader.Close (); \r
- }\r
- return reader.RecordsAffected;\r
- }\r
-\r
- public override object ExecuteScalar ()\r
- {\r
- IDataReader reader = ExecuteReader(CommandBehavior.SequentialAccess);\r
- \r
- try {\r
- do {\r
- if (reader.FieldCount > 0 && reader.Read ())\r
- return reader.GetValue (0); \r
- }\r
- while (reader.NextResult ());\r
- return null;\r
- } finally {\r
- reader.Close();\r
- }\r
- }\r
-\r
- public virtual void ResetCommandTimeout ()\r
- {\r
- _commandTimeout = 30;\r
- }\r
-\r
- public override void Cancel()\r
- {\r
- try {\r
- if (_statement != null)\r
- _statement.cancel();\r
- }\r
- catch {\r
- // MSDN says : "If there is nothing to cancel, nothing happens. \r
- // However, if there is a command in process, and the attempt to cancel fails, \r
- // no exception is generated."\r
- }\r
- }\r
- \r
- protected virtual bool SkipParameter(DbParameter parameter)\r
- {\r
- return false;\r
- }\r
-\r
- protected sealed override DbParameter CreateDbParameter()\r
- {\r
- return CreateParameterInternal();\r
- }\r
-\r
- internal ArrayList DeriveParameters(string procedureName, bool throwIfNotExist)\r
- {\r
- try {\r
- ArrayList col = _procedureColumnCache.GetProcedureColumns((AbstractDBConnection)Connection, procedureName, this);\r
- if (col == null) {\r
- if (throwIfNotExist)\r
- throw ExceptionHelper.NoStoredProcedureExists(procedureName);\r
- col = new ArrayList();\r
- }\r
-\r
- return col;\r
- }\r
- catch(SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
-\r
- string CreateTableDirectCommandText(string tableNames) {\r
- string forBrowse = String.Empty;\r
- if ((Behavior & CommandBehavior.KeyInfo) != 0) {\r
- AbstractDBConnection connection = (AbstractDBConnection)Connection;\r
- if (connection != null) {\r
- string dbname = connection.JdbcConnection.getMetaData().getDatabaseProductName();\r
- if (dbname == "Microsoft SQL Server") //must add "FOR BROWSE" for selects\r
- forBrowse = " FOR BROWSE";\r
- }\r
- }\r
-\r
- string[] names = tableNames.Split(',');\r
- StringBuilder sb = new StringBuilder();\r
-\r
- for(int i = 0; i < names.Length; i++) {\r
- sb.Append("SELECT * FROM ");\r
- sb.Append(names[i]);\r
- sb.Append(forBrowse);\r
- sb.Append(';');\r
- }\r
- \r
- if(names.Length <= 1) {\r
- sb.Remove(sb.Length - 1,1);\r
- }\r
- return sb.ToString();\r
- }\r
-\r
- private string PrepareCommandTextAndParameters()\r
- {\r
- NullParametersInPrepare = false;\r
- switch (CommandType) {\r
- case CommandType.TableDirect :\r
- return CreateTableDirectCommandText(CommandText);\r
- case CommandType.StoredProcedure :\r
- return CreateStoredProcedureCommandTextSimple (InternalCommandText, Parameters, DeriveParameters (InternalCommandText, false));\r
- case CommandType.Text :\r
-\r
- int userParametersPosition = 0;\r
- int charsConsumed = 0;\r
- StringBuilder sb = new StringBuilder(CommandText.Length);\r
-\r
- for (SimpleMatch match = SqlStatementsHelper.CompoundStatementSplitterReqExp.Match(CommandText);\r
- match.Success;\r
- match = match.NextMatch()) {\r
-\r
- int length = match.Length;\r
-\r
- if (length == 0)\r
- continue;\r
-\r
- int start = match.Index;\r
- string value = match.Value;\r
-\r
- sb.Append(CommandText, charsConsumed, start-charsConsumed);\r
- charsConsumed = start + length;\r
-\r
-#if USE_DOTNET_REGEX\r
- Match storedProcMatch = StoredProcedureRegExp.Match(value);\r
- // count parameters for all kinds of simple statements \r
- userParametersPosition +=\r
- (storedProcMatch.Success) ?\r
- // statement is stored procedure call\r
- CreateStoredProcedureCommandText(sb, value, storedProcMatch, Parameters, userParametersPosition) :\r
- // statement is a simple SQL query \r
- PrepareSimpleQuery(sb, value, Parameters, userParametersPosition); \r
-#else\r
- Matcher storedProcMatch = StoredProcedureRegExp.matcher((java.lang.CharSequence)(object)value);\r
- userParametersPosition +=\r
- (storedProcMatch.find()) ?\r
- // statement is stored procedure call\r
- CreateStoredProcedureCommandText(sb, value, storedProcMatch, Parameters, userParametersPosition) :\r
- // statement is a simple SQL query \r
- PrepareSimpleQuery(sb, value, Parameters, userParametersPosition);\r
-#endif\r
- }\r
-\r
- sb.Append(CommandText, charsConsumed, CommandText.Length-charsConsumed);\r
-\r
- return sb.ToString();\r
- }\r
- return null;\r
- }\r
-\r
- string CreateStoredProcedureCommandTextSimple(string procedureName, IDataParameterCollection userParams, IList derivedParams) {\r
- StringBuilder sb = new StringBuilder();\r
-\r
- int curUserPos = 0;\r
- int curDerivedPos = 0;\r
- bool addParas = true;\r
- string trimedProcedureName = (procedureName != null) ? procedureName.TrimEnd() : String.Empty;\r
- if (trimedProcedureName.Length > 0 && trimedProcedureName[trimedProcedureName.Length-1] == ')')\r
- addParas = false;\r
- \r
- AbstractDbParameter derivedParam = (derivedParams.Count > 0) ? (AbstractDbParameter)derivedParams[curDerivedPos] : null;\r
- if (derivedParam != null) {\r
- if (derivedParam.Direction == ParameterDirection.ReturnValue)\r
- curDerivedPos++;\r
- else\r
- derivedParam = null; //play as if there is no retval parameter\r
- }\r
- AbstractDbParameter returnValueParameter = GetReturnParameter (userParams);\r
- if (returnValueParameter != null) {\r
- curUserPos++;\r
- InternalParameters.Add(returnValueParameter);\r
- sb.Append("{? = call ");\r
-\r
- if (derivedParam != null && !returnValueParameter.IsDbTypeSet) {\r
- returnValueParameter.JdbcType = derivedParam.JdbcType;\r
- }\r
- }\r
- else {\r
- sb.Append("{call ");\r
- }\r
-\r
- sb.Append(procedureName);\r
- if (addParas)\r
- sb.Append('(');\r
-\r
- bool needComma = false;\r
- for (int i = curDerivedPos; i < derivedParams.Count; i++) {\r
- AbstractDbParameter derivedParameter = (AbstractDbParameter)derivedParams[curDerivedPos++];\r
- \r
- bool addParam = false;\r
-\r
- if (derivedParameter.IsSpecial) {\r
- // derived parameter is special - never appears in user parameters or user values\r
- InternalParameters.Add((AbstractDbParameter)derivedParameter.Clone());\r
- addParam = true;\r
- }\r
- else {\r
- AbstractDbParameter userParameter = GetUserParameter(derivedParameter.Placeholder, userParams, curUserPos);\r
- if (userParameter != null) {\r
- curUserPos++;\r
- InternalParameters.Add(userParameter);\r
- addParam = true;\r
-\r
- if (derivedParameter != null && !userParameter.IsDbTypeSet) {\r
- userParameter.JdbcType = derivedParameter.JdbcType;\r
- }\r
- }\r
- }\r
-\r
- if (addParam) {\r
- if (needComma)\r
- sb.Append(',');\r
- else\r
- needComma = true;\r
-\r
- sb.Append('?');\r
- }\r
- }\r
-\r
- for (int i = curUserPos; i < userParams.Count; i++) {\r
- if (needComma)\r
- sb.Append(',');\r
- else\r
- needComma = true;\r
-\r
- AbstractDbParameter userParameter = (AbstractDbParameter)userParams[curUserPos++];\r
- InternalParameters.Add(userParameter);\r
-\r
- sb.Append('?');\r
- }\r
-\r
- if (addParas)\r
- sb.Append(')');\r
- sb.Append('}');\r
- return sb.ToString();\r
- }\r
-\r
- /// <summary>\r
- /// We suppose that user parameters are in the same order as devived parameters except the special cases\r
- /// (return value, oracle ref cursors etc.)\r
- /// </summary>\r
- //protected virtual string CreateStoredProcedureCommandText(string procedureName, IList userParametersList, int userParametersListStart/*, int userParametersListCount*/, string[] userValuesList, ArrayList derivedParametersList)\r
-#if USE_DOTNET_REGEX\r
- int CreateStoredProcedureCommandText(StringBuilder sb, string sql, Match match, IDataParameterCollection userParams, int userParamsStartPosition)\r
-#else\r
- int CreateStoredProcedureCommandText(StringBuilder sb, string sql, Matcher match, IDataParameterCollection userParams, int userParamsStartPosition)\r
-#endif\r
- {\r
- int curUserPos = userParamsStartPosition;\r
-#if USE_DOTNET_REGEX\r
- Group procNameGroup = null;\r
-\r
- for (Match procNameMatch = match; procNameMatch.Success; procNameMatch = procNameMatch.NextMatch()){\r
- procNameGroup = match.Groups["PROCNAME"];\r
- if (!procNameGroup.Success) {\r
- continue;\r
- }\r
- }\r
-\r
- if (procNameGroup == null || !procNameGroup.Success)\r
- throw new ArgumentException("Not a stored procedure call: '{0}'", sql);\r
-\r
- ArrayList derivedParameters = DeriveParameters(procNameGroup.Value, false);\r
-#else\r
- ArrayList derivedParameters = DeriveParameters(match.group(2).Trim(), false);\r
-#endif\r
- int curDerivedPos = 0;\r
-\r
- AbstractDbParameter retValderivedParameter = curDerivedPos < derivedParameters.Count ?\r
- (AbstractDbParameter)derivedParameters[curDerivedPos] : null;\r
- if (retValderivedParameter != null && retValderivedParameter.Direction == ParameterDirection.ReturnValue)\r
- curDerivedPos++;\r
-\r
- int queryCurrentPosition = 0;\r
- \r
-#if USE_DOTNET_REGEX\r
- for (Match retValMatch = match; retValMatch.Success; retValMatch = retValMatch.NextMatch()){\r
- Group retval = retValMatch.Groups["RETVAL"];\r
- if (!retval.Success) {\r
- continue;\r
- }\r
-\r
- int retvalIndex = retval.Index;\r
- string retvalValue = retval.Value;\r
- int retvalLength = retval.Length;\r
-#else\r
- int retvalIndex = match.start(1);\r
- for (;retvalIndex >= 0;) {\r
- string retvalValue = match.group(1);\r
- int retvalLength = retvalValue.Length;\r
-#endif\r
-\r
- sb.Append(sql, queryCurrentPosition, retvalIndex);\r
- AbstractDbParameter userParameter = GetUserParameter(retvalValue, userParams, curUserPos);\r
- if (userParameter != null) {\r
- sb.Append('?');\r
- InternalParameters.Add(userParameter);\r
-\r
- if (retValderivedParameter != null && !userParameter.IsDbTypeSet) {\r
- userParameter.JdbcType = retValderivedParameter.JdbcType;\r
- }\r
-\r
- curUserPos++;\r
- }\r
- else {\r
- sb.Append(retvalValue);\r
- }\r
-\r
- queryCurrentPosition = (retvalIndex + retvalLength);\r
-\r
- break;\r
- }\r
-\r
-#if USE_DOTNET_REGEX\r
- sb.Append(sql, queryCurrentPosition, procNameGroup.Index + procNameGroup.Length - queryCurrentPosition);\r
- queryCurrentPosition = procNameGroup.Index + procNameGroup.Length;\r
-#else\r
- sb.Append(sql, queryCurrentPosition, match.end(2) - queryCurrentPosition);\r
- queryCurrentPosition = match.end(2);\r
-#endif\r
-\r
- bool hasUserParams = false;\r
-\r
-#if USE_DOTNET_REGEX\r
- must rewrite the regex to not parse params to have single code with java regex\r
-#else\r
- int paramsStart = match.start(3);\r
- if (paramsStart >= 0) {\r
-#endif\r
-\r
- hasUserParams = true;\r
- sb.Append(sql,queryCurrentPosition,paramsStart - queryCurrentPosition);\r
- queryCurrentPosition = paramsStart;\r
-\r
- for (SimpleMatch m = SqlStatementsHelper.ProcedureParameterSplitterReqExp.Match(match.group(3));\r
- m.Success;m = m.NextMatch()) {\r
-\r
- SimpleCapture parameterCapture = m;\r
- sb.Append(sql,queryCurrentPosition,paramsStart + parameterCapture.Index - queryCurrentPosition);\r
-\r
- // advance in query\r
- queryCurrentPosition = paramsStart + parameterCapture.Index + parameterCapture.Length;\r
-\r
- AbstractDbParameter derivedParameter = curDerivedPos < derivedParameters.Count ?\r
- (AbstractDbParameter)derivedParameters[curDerivedPos++] : null;\r
- \r
- //check for special params\r
- while (derivedParameter != null && derivedParameter.IsSpecial) {\r
- // derived parameter is special - never appears in user parameters or user values\r
- InternalParameters.Add((AbstractDbParameter)derivedParameter.Clone());\r
- sb.Append('?');\r
- sb.Append(',');\r
-\r
- derivedParameter = curDerivedPos < derivedParameters.Count ?\r
- (AbstractDbParameter)derivedParameters[curDerivedPos++] : null;\r
- }\r
-\r
- AbstractDbParameter userParameter = GetUserParameter(parameterCapture.Value.Trim(), userParams, curUserPos);\r
-\r
- if (userParameter != null) {\r
- sb.Append('?');\r
- InternalParameters.Add(userParameter);\r
- if (derivedParameter != null && !userParameter.IsDbTypeSet) {\r
- userParameter.JdbcType = derivedParameter.JdbcType;\r
- }\r
- // advance in user parameters\r
- curUserPos++; \r
- }\r
- else {\r
- sb.Append(parameterCapture.Value);\r
- } \r
- } \r
- }\r
-\r
- bool addedSpecialParams = false;\r
-\r
- for (int i = curDerivedPos; i < derivedParameters.Count;) {\r
- AbstractDbParameter derivedParameter = (AbstractDbParameter)derivedParameters[i++];\r
- if (derivedParameter.IsSpecial) {\r
- // derived parameter is special - never appears in user parameters or user values\r
- if (!hasUserParams && !addedSpecialParams) {\r
- addedSpecialParams = true;\r
- curDerivedPos++;\r
- sb.Append('(');\r
- }\r
-\r
- for (;curDerivedPos < i;curDerivedPos++)\r
- sb.Append(',');\r
-\r
- InternalParameters.Add((AbstractDbParameter)derivedParameter.Clone());\r
- sb.Append('?');\r
- }\r
- }\r
-\r
- if (!hasUserParams && addedSpecialParams)\r
- sb.Append(')');\r
-\r
- sb.Append(sql,queryCurrentPosition,sql.Length - queryCurrentPosition);\r
- return curUserPos - userParamsStartPosition;\r
- }\r
-\r
- protected virtual AbstractDbParameter GetUserParameter(string parameterName, IList userParametersList, int userParametersListPosition)\r
- {\r
- if (userParametersListPosition < userParametersList.Count) {\r
- AbstractDbParameter param = (AbstractDbParameter)userParametersList[userParametersListPosition];\r
- if (param.Placeholder == parameterName)\r
- return param;\r
- }\r
- return null;\r
- }\r
-\r
- protected virtual AbstractDbParameter GetReturnParameter (IList userParametersList)\r
- {\r
- AbstractDbParameter param = GetUserParameter ("?", userParametersList, 0); \r
-\r
- if (param != null && param.Direction == ParameterDirection.ReturnValue)\r
- return param;\r
-\r
- return null;\r
- }\r
-\r
- int PrepareSimpleQuery(StringBuilder sb, string query, IList userParametersList, int userParametersListStart)\r
- {\r
- int queryCurrentPosition = 0;\r
- int userParametersListPosition = userParametersListStart;\r
-\r
- if (userParametersList.Count > 0) {\r
- for (SimpleMatch m = ParameterRegExp.Match(query);\r
- m.Success;m = m.NextMatch()) {\r
-\r
- SimpleCapture parameterCapture = m;\r
- sb.Append(query,queryCurrentPosition,parameterCapture.Index - queryCurrentPosition);\r
-\r
- // advance in query\r
- queryCurrentPosition = parameterCapture.Index + parameterCapture.Length; \r
-\r
- AbstractDbParameter userParameter = GetUserParameter(parameterCapture.Value, userParametersList, userParametersListPosition);\r
-\r
- if (userParameter != null) {\r
- if (IsNullParameter(userParameter)) {\r
- sb.Append("null");\r
- NullParametersInPrepare = true;\r
- }\r
- else {\r
- sb.Append('?');\r
- InternalParameters.Add(userParameter); \r
- } \r
- // advance in user parameters\r
- userParametersListPosition++; \r
- }\r
- else {\r
- sb.Append(parameterCapture.Value);\r
- }\r
- }\r
- }\r
-\r
- sb.Append(query,queryCurrentPosition,query.Length - queryCurrentPosition);\r
- int userParamsConsumed = userParametersListPosition - userParametersListStart;\r
-\r
- if ((Behavior & CommandBehavior.KeyInfo) == 0)\r
- return userParamsConsumed;\r
-\r
- AbstractDBConnection connection = (AbstractDBConnection)Connection;\r
- if (connection == null)\r
- return userParamsConsumed;\r
-\r
- string dbname = connection.JdbcConnection.getMetaData().getDatabaseProductName();\r
- if (dbname == "Microsoft SQL Server") { //must add "FOR BROWSE" for selects\r
-#if USE_DOTNET_REGEX\r
- if (!SqlStatementsHelper.ForBrowseStatementReqExp.IsMatch(query))\r
- sb.Append(" FOR BROWSE");\r
-#else\r
- if (!SqlStatementsHelper.ForBrowseStatementReqExp.matcher ((java.lang.CharSequence)(object)query).find ())\r
- sb.Append (" FOR BROWSE");\r
-#endif\r
- }\r
-\r
- return userParamsConsumed;\r
- }\r
-\r
- protected virtual bool IsNullParameter(AbstractDbParameter parameter)\r
- {\r
- return ((parameter.Value == null || parameter.Value == DBNull.Value) && !parameter.IsDbTypeSet);\r
- }\r
-\r
- protected virtual void PrepareInternalParameters()\r
- {\r
- InternalParameters.Clear();\r
- }\r
- \r
- protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior)\r
- {\r
- AbstractDBConnection connection = (AbstractDBConnection)Connection;\r
- if (connection == null) {\r
- throw ExceptionHelper.ConnectionNotInitialized("ExecuteReader");\r
- }\r
-\r
- connection.IsExecuting = true;\r
-\r
- try {\r
- IDbTransaction transaction = Transaction;\r
- if ((transaction != null && transaction.Connection != connection) ||\r
- (transaction == null && !connection.JdbcConnection.getAutoCommit ())) {\r
- throw ExceptionHelper.TransactionNotInitialized ();\r
- }\r
-\r
- Behavior = behavior;\r
-\r
- PrepareInternalParameters(); \r
- PrepareInternal();\r
-\r
- // For SchemaOnly there is no need for statement execution\r
- if (Behavior != CommandBehavior.SchemaOnly) {\r
- _recordsAffected = -1;\r
-\r
- // FIXME: this causes SP in MS Sql Server to create no mor than one row.\r
- if ((Behavior & CommandBehavior.SingleRow) != 0) {\r
- _statement.setMaxRows (1);\r
- }\r
- \r
- if(_statement is PreparedStatement) {\r
- BindParameters(InternalParameters);\r
- _hasResultSet = ((PreparedStatement)_statement).execute();\r
- }\r
- else {\r
- _hasResultSet =_statement.execute(_javaCommandText); \r
- }\r
- \r
- if (!_hasResultSet) {\r
- int updateCount = _statement.getUpdateCount();\r
- if (updateCount >= 0) {\r
- AccumulateRecordsAffected(updateCount);\r
- _hasResultSet = true; //play as if we have resultset\r
- NextResultSet();\r
- }\r
- } \r
- }\r
- connection.IsFetching = true;\r
- try {\r
- _currentReader = CreateReader();\r
- }\r
- catch(Exception e) {\r
- connection.IsFetching = false;\r
- throw e;\r
- }\r
- return _currentReader;\r
- }\r
- catch(SQLException e) { \r
- throw CreateException(e);\r
- }\r
- finally {\r
- connection.IsExecuting = false;\r
- NullParametersInPrepare = false;\r
- }\r
- }\r
-\r
- public override void Prepare()\r
- {\r
- ((AbstractDBConnection)Connection).IsExecuting = true;\r
- try {\r
- CheckParameters();\r
- _explicitPrepare = true;\r
- }\r
- finally {\r
- ((AbstractDBConnection)Connection).IsExecuting = false;\r
- }\r
- }\r
-\r
- private void PrepareInternal()\r
- {\r
- if ((Connection == null) || (Connection.State != ConnectionState.Open)) {\r
- throw ExceptionHelper.ConnectionNotOpened("Prepare",(Connection != null) ? Connection.State.ToString() : "");\r
- }\r
-\r
- if (IsCommandPrepared) {\r
- // maybe we have to prepare the command again\r
- bool hasNullParameters = false;\r
- for(int i = 0; (i < Parameters.Count) && !hasNullParameters; i++) {\r
- AbstractDbParameter parameter = (AbstractDbParameter)Parameters[i];\r
- if (IsNullParameter(parameter)) {\r
- // if we still have null parameters - have to prepare agail\r
- IsCommandPrepared = false;\r
- hasNullParameters = true;\r
- }\r
- }\r
-\r
- if (!NullParametersInPrepare && hasNullParameters) {\r
- // if we prepeared using null parameters and now there is no null parameters - need to prepare again\r
- IsCommandPrepared = false;\r
- }\r
- }\r
-\r
- if (!IsCommandPrepared) {\r
-\r
- _javaCommandText = PrepareCommandTextAndParameters();\r
-\r
- java.sql.Connection jdbcCon = _connection.JdbcConnection;\r
-\r
- // For SchemaOnly we just prepare statement (for future use in GetSchemaTable)\r
- if (Behavior == CommandBehavior.SchemaOnly) {\r
- if (CommandType == CommandType.StoredProcedure)\r
- _statement = jdbcCon.prepareCall(_javaCommandText);\r
- else\r
- _statement = jdbcCon.prepareStatement(_javaCommandText); \r
- return;\r
- }\r
-\r
- if (CommandType == CommandType.StoredProcedure)\r
- _statement = jdbcCon.prepareCall(_javaCommandText);\r
- else {\r
- int internalParametersCount = InternalParameters.Count;\r
- if ( internalParametersCount > 0) {\r
- bool hasOnlyInputParameters = true;\r
- for(int i=0; i < internalParametersCount; i++) {\r
- AbstractDbParameter internalParameter = (AbstractDbParameter)InternalParameters[i];\r
- if (IsNullParameter(internalParameter)) {\r
- NullParametersInPrepare = true;\r
- }\r
-\r
- if ((internalParameter.Direction & ParameterDirection.Output) != 0){\r
- hasOnlyInputParameters = false;\r
- }\r
- }\r
-\r
- if (hasOnlyInputParameters) {\r
- _statement = jdbcCon.prepareStatement(_javaCommandText); \r
- }\r
- else { \r
- _statement = jdbcCon.prepareCall(_javaCommandText);\r
- }\r
- }\r
- else {\r
- if (_explicitPrepare) {\r
- _statement = jdbcCon.prepareStatement(_javaCommandText); \r
- }\r
- else {\r
- _statement = jdbcCon.createStatement(); \r
- }\r
- }\r
- }\r
- IsCommandPrepared = true;\r
- }\r
- }\r
-\r
- protected void BindParameters(ArrayList parameters)\r
- {\r
- for(int parameterIndex = 0; parameterIndex < parameters.Count; parameterIndex++) {\r
- AbstractDbParameter parameter = (AbstractDbParameter)parameters[parameterIndex];\r
- switch (parameter.Direction) {\r
- case ParameterDirection.Input :\r
- BindInputParameter(parameter,parameterIndex);\r
- break;\r
- case ParameterDirection.InputOutput:\r
- BindInputParameter(parameter,parameterIndex);\r
- BindOutputParameter(parameter,parameterIndex);\r
- break;\r
- case ParameterDirection.Output :\r
- BindOutputParameter(parameter,parameterIndex);\r
- break;\r
- case ParameterDirection.ReturnValue :\r
- BindOutputParameter(parameter,parameterIndex);\r
- break;\r
- }\r
- }\r
- }\r
- \r
- protected virtual void BindInputParameter(AbstractDbParameter parameter, int parameterIndex)\r
- {\r
- object value = parameter.ConvertedValue; \r
- // java parameters are 1 based, while .net are 0 based\r
- parameterIndex++; \r
- PreparedStatement preparedStatement = ((PreparedStatement)_statement);\r
-\r
- switch ((DbConvert.JavaSqlTypes)parameter.JdbcType) {\r
- case DbConvert.JavaSqlTypes.DATALINK:\r
- case DbConvert.JavaSqlTypes.DISTINCT:\r
- case DbConvert.JavaSqlTypes.JAVA_OBJECT:\r
- case DbConvert.JavaSqlTypes.OTHER:\r
- case DbConvert.JavaSqlTypes.REF:\r
- case DbConvert.JavaSqlTypes.STRUCT: {\r
- preparedStatement.setObject(parameterIndex, value, (int)parameter.JdbcType);\r
- return;\r
- }\r
- }\r
-\r
- if ((value is DBNull) || (value == null)) {\r
- preparedStatement.setNull(parameterIndex, (int)((AbstractDbParameter)parameter).JdbcType);\r
- }\r
- else if (value is long) {\r
- preparedStatement.setLong(parameterIndex, (long)value);\r
- }\r
- else if (value is byte[]) {\r
- if (((byte[])value).Length <= 4000) {\r
- preparedStatement.setBytes(parameterIndex, vmw.common.TypeUtils.ToSByteArray((byte[]) value));\r
- }\r
- else {\r
- InputStream iStream=new ByteArrayInputStream(vmw.common.TypeUtils.ToSByteArray((byte[]) value));\r
- preparedStatement.setBinaryStream(parameterIndex,iStream,((byte[])value).Length);\r
- }\r
- }\r
- else if (value is byte) {\r
- preparedStatement.setByte(parameterIndex, (sbyte)(byte)value);\r
- }\r
- else if (value is char[]) {\r
- Reader reader = new CharArrayReader((char[])value);\r
- preparedStatement.setCharacterStream(parameterIndex,reader,((char[])value).Length);\r
- }\r
- else if (value is bool) {\r
- preparedStatement.setBoolean(parameterIndex, (bool) value);\r
- }\r
- else if (value is char) {\r
- preparedStatement.setString(parameterIndex, ((char)value).ToString());\r
- }\r
- else if (value is DateTime) {\r
- switch ((DbConvert.JavaSqlTypes)parameter.JdbcType) {\r
- default:\r
- case DbConvert.JavaSqlTypes.TIMESTAMP:\r
- preparedStatement.setTimestamp(parameterIndex,DbConvert.ClrTicksToJavaTimestamp(((DateTime)value).Ticks));\r
- break;\r
- case DbConvert.JavaSqlTypes.TIME:\r
- preparedStatement.setTime(parameterIndex,DbConvert.ClrTicksToJavaTime(((DateTime)value).Ticks));\r
- break;\r
- case DbConvert.JavaSqlTypes.DATE:\r
- preparedStatement.setDate(parameterIndex,DbConvert.ClrTicksToJavaDate(((DateTime)value).Ticks));\r
- break;\r
- }\r
- }\r
- else if (value is TimeSpan) {\r
- if (parameter.JdbcType == (int)DbConvert.JavaSqlTypes.TIMESTAMP)\r
- preparedStatement.setTimestamp(parameterIndex,DbConvert.ClrTicksToJavaTimestamp(((TimeSpan)value).Ticks));\r
- else\r
- preparedStatement.setTime(parameterIndex,DbConvert.ClrTicksToJavaTime(((TimeSpan)value).Ticks));\r
- }\r
- else if (value is Decimal) {\r
- preparedStatement.setBigDecimal(parameterIndex, vmw.common.PrimitiveTypeUtils.DecimalToBigDecimal((Decimal) value));\r
- }\r
- else if (value is double) {\r
- preparedStatement.setDouble(parameterIndex, (double)value);\r
- }\r
- else if (value is float) {\r
- preparedStatement.setFloat(parameterIndex, (float)value);\r
- }\r
- else if (value is int) {\r
- preparedStatement.setInt(parameterIndex, (int)value);\r
- }\r
- else if (value is string) {\r
- //can not be done for inout params, due to Oracle problem with FIXED_CHAR out param fetching\r
- if (parameter.Direction == ParameterDirection.Input && \r
- preparedStatement is Mainsoft.Data.Jdbc.Providers.IPreparedStatement &&\r
- (DbConvert.JavaSqlTypes)parameter.JdbcType == DbConvert.JavaSqlTypes.CHAR) {\r
- ((Mainsoft.Data.Jdbc.Providers.IPreparedStatement)preparedStatement)\r
- .setChar(parameterIndex, (string)value);\r
- }\r
- else\r
- preparedStatement.setString(parameterIndex, (string)value);\r
- }\r
- else if (value is Guid) {\r
- preparedStatement.setString(parameterIndex, value.ToString());\r
- }\r
- else if (value is short) {\r
- preparedStatement.setShort(parameterIndex, (short)value);\r
- }\r
- else if (value is sbyte) {\r
- preparedStatement.setByte(parameterIndex, (sbyte)value);\r
- }\r
- else {\r
- preparedStatement.setObject(parameterIndex, value);\r
- }\r
- }\r
-\r
- protected virtual void BindOutputParameter(AbstractDbParameter parameter, int parameterIndex)\r
- {\r
- parameter.Validate();\r
- int jdbcType = (int)parameter.JdbcType; \r
- // java parameters are 1 based, while .net are 0 based\r
- parameterIndex++;\r
-\r
- CallableStatement callableStatement = ((CallableStatement)_statement);\r
-\r
- // the scale has a meening only in DECIMAL and NUMERIC parameters\r
- if (jdbcType == Types.DECIMAL || jdbcType == Types.NUMERIC) {\r
- if(parameter.DbType == DbType.Currency) {\r
- callableStatement.registerOutParameter(parameterIndex, jdbcType, 4);\r
- }\r
- else {\r
- callableStatement.registerOutParameter(parameterIndex, jdbcType, parameter.Scale);\r
- }\r
- }\r
- else {\r
- callableStatement.registerOutParameter(parameterIndex, jdbcType);\r
- }\r
- }\r
-\r
- private void FillOutputParameters()\r
- { \r
- if (!(_statement is CallableStatement)) {\r
- return;\r
- }\r
- for(int i = 0; i < InternalParameters.Count; i++) {\r
- AbstractDbParameter parameter = (AbstractDbParameter)InternalParameters[i];\r
- ParameterDirection direction = parameter.Direction;\r
- if (((direction & ParameterDirection.Output) != 0) && !SkipParameter(parameter)) { \r
- FillOutputParameter(parameter, i);\r
- }\r
- // drop jdbc type of out parameter, since it possibly was updated in ExecuteReader\r
- parameter.IsJdbcTypeSet = false;\r
- }\r
- }\r
-\r
- protected virtual void FillOutputParameter(DbParameter parameter, int index)\r
- { \r
- CallableStatement callableStatement = (CallableStatement)_statement;\r
- ParameterMetadataWrapper parameterMetadataWrapper = null; \r
- // FIXME wait for other drivers to implement\r
-// try {\r
-// parameterMetadataWrapper = new ParameterMetadataWrapper(callableStatement.getParameterMetaData());\r
-// }\r
-// catch {\r
-// // suppress error : ms driver for sql server does not implement getParameterMetaData\r
-// // suppress exception : ms driver for sql server does not implement getParameterMetaData\r
-// }\r
- DbConvert.JavaSqlTypes javaSqlType = (DbConvert.JavaSqlTypes)((AbstractDbParameter)parameter).JdbcType;\r
- try {\r
- parameter.Value = DbConvert.JavaResultSetToClrWrapper(callableStatement,index,javaSqlType,parameter.Size,parameterMetadataWrapper);\r
- }\r
- catch(java.sql.SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
-\r
- // AbstractDbCommand acts as IEnumerator over JDBC statement\r
- // AbstractDbCommand.NextResultSet corresponds to IEnumerator.MoveNext\r
- protected internal virtual bool NextResultSet()\r
- {\r
- if (!_hasResultSet)\r
- return false;\r
-\r
- try {\r
- for(;;) {\r
- _hasResultSet = _statement.getMoreResults();\r
- if (_hasResultSet)\r
- return true;\r
- int updateCount = _statement.getUpdateCount();\r
- if (updateCount < 0)\r
- return false;\r
-\r
- AccumulateRecordsAffected(updateCount); \r
- }\r
- }\r
- catch (SQLException e) {\r
- throw CreateException(e);\r
- }\r
- finally {\r
- _currentResultSet = null;\r
- }\r
- }\r
-\r
- private void AccumulateRecordsAffected(int updateCount)\r
- { \r
- if (_recordsAffected < 0) {\r
- _recordsAffected = updateCount;\r
- }\r
- else {\r
- _recordsAffected += updateCount;\r
- }\r
- }\r
-\r
- internal void OnReaderClosed(object reader)\r
- {\r
- CloseInternal();\r
- if (Connection != null) {\r
- ((AbstractDBConnection)Connection).RemoveReference(reader);\r
- ((AbstractDBConnection)Connection).IsFetching = false;\r
- if ((Behavior & CommandBehavior.CloseConnection) != 0) {\r
- Connection.Close();\r
- }\r
- } \r
- }\r
-\r
- internal void CloseInternal()\r
- {\r
- if (Behavior != CommandBehavior.SchemaOnly) {\r
- if (_statement != null) {\r
- while (NextResultSet()) {\r
- } \r
- FillOutputParameters(); \r
- }\r
- }\r
- _currentReader = null;\r
- CleanUp();\r
- }\r
-\r
- protected override void Dispose(bool disposing)\r
- {\r
- if (disposing) {\r
- CleanUp();\r
- }\r
- base.Dispose(disposing);\r
- }\r
-\r
- private void CleanUp()\r
- {\r
- if (_currentReader != null) {\r
- // we must preserve statement object until we have an associated reader object that might access it.\r
- return;\r
- }\r
- if (Connection != null) {\r
- ((AbstractDBConnection)Connection).RemoveReference(this);\r
- }\r
- if (_statement != null) {\r
- _statement.close();\r
- _statement = null;\r
- } \r
- IsCommandPrepared = false;\r
- _internalParameters = null;\r
- _currentResultSet = null;\r
- }\r
-\r
- internal void OnSchemaChanging()\r
- {\r
- }\r
-\r
- #endregion // Methods\r
-\r
- #region ICloneable Members\r
-\r
- public virtual object Clone() {\r
- AbstractDbCommand target = (AbstractDbCommand)MemberwiseClone();\r
- target._statement = null;\r
- target._isCommandPrepared = false;\r
- target._internalParameters = null;\r
- target._javaCommandText = null;\r
- target._recordsAffected = -1;\r
- target._currentResultSet = null;\r
- target._currentReader = null;\r
- target._nullParametersInPrepare = false;\r
- target._hasResultSet = false;\r
- target._explicitPrepare = false;\r
- if (Parameters != null && Parameters.Count > 0) {\r
- target._parameters = CreateParameterCollection(target);\r
- for(int i=0 ; i < Parameters.Count; i++) {\r
- target.Parameters.Add(((AbstractDbParameter)Parameters[i]).Clone());\r
- }\r
- }\r
- return target;\r
- }\r
-\r
- #endregion\r
- }\r
-}\r
+++ /dev/null
-//\r
-// System.Data.Common.AbstractDBConnection\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Globalization;\r
-using System.Data;\r
-using System.Data.ProviderBase;\r
-using System.Data.Configuration;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Collections.Specialized;\r
-using System.Text;\r
-using System.Text.RegularExpressions;\r
-using Mainsoft.Data.Jdbc.Providers;\r
-using System.Data.Common;\r
-\r
-using java.sql;\r
-using javax.sql;\r
-using javax.naming;\r
-\r
-using Mainsoft.Data.Configuration;\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
- public abstract class AbstractDBConnection : DbConnection, ICloneable\r
- {\r
- #region ObjectNamesHelper\r
-\r
- private sealed class ObjectNamesHelper\r
- {\r
- //static readonly Regex NameOrder = new Regex(@"^\s*((\[(?<NAME>(\s*[^\[\]\s])+)\s*\])|(?<NAME>(\w|!|\#|\$)+(\s*(\w|!|\#|\$)+)*))\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- static readonly Regex NameOrder = new Regex(@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
-\r
- //static readonly Regex SchemaNameOrder = new Regex(@"^\s*((\[(?<SCHEMA>(\s*[^\[\]\s])+)\s*\])|(?<SCHEMA>(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*((\[(?<NAME>(\s*[^\[\]\s])+)\s*\])|(?<NAME>(\w|!|\#|\$)+(\s*(\w|!|\#|\$)+)*))\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- static readonly Regex SchemaNameOrder = new Regex(@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- //static readonly Regex CatalogSchemaNameOrder = new Regex(@"^\s*((\[\s*(?<CATALOG>(\s*[^\[\]\s])+)\s*\])|(?<CATALOG>(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*((\[(?<SCHEMA>(\s*[^\[\]\s])+)\s*\])|(?<SCHEMA>(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*((\[(?<NAME>(\s*[^\[\]\s])+)\s*\])|(?<NAME>(\w|!|\#|\$)+(\s*(\w|!|\#|\$)+)*))\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- //static readonly Regex CatalogSchemaNameOrder = new Regex(@"^\s*((\[\s*(?<CATALOG>(\s*[^\]\s])+)\s*\])|(?<CATALOG>([^\.\s])*(\s*([^\.\s])+)*))\s*\.\s*((\[(?<SCHEMA>(\s*[^\]\s])+)\s*\])|(?<SCHEMA>([^\.\s])*(\s*([^\.\s])+)*))\s*\.\s*((\[(?<NAME>(\s*[^\]\s])+)\s*\])|(?<NAME>([^\.\s])+(\s*([^\.\s])+)*))\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- static readonly Regex CatalogSchemaNameOrder = new Regex(@"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
-\r
- //static readonly Regex CatalogNameOrder = new Regex(@"^\s*((\[(?<CATALOG>(\s*[^\[\]\s])+)\s*\])|(?<CATALOG>(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*((\[(?<NAME>(\s*[^\[\]\s])+)\s*\])|(?<NAME>(\w|!|\#|\$)+(\s*(\w|!|\#|\$)+)*))\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- //static readonly Regex CatalogNameOrder = new Regex(@"^\s*((\[(?<CATALOG>(\s*[^\]\s])+)\s*\])|(?<CATALOG>([^\.\s])*(\s*([^\.\s])+)*))\s*\.\s*((\[(?<NAME>(\s*[^\]\s])+)\s*\])|(?<NAME>([^\.\s])+(\s*([^\.\s])+)*))\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- static readonly Regex CatalogNameOrder = new Regex(@"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- //static readonly Regex SchemaCatalogNameOrder = new Regex(@"^\s*((\[\s*(?<SCHEMA>(\s*[^\[\]\s])+)\s*\])|(?<SCHEMA>(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*((\[(?<CATALOG>(\s*[^\[\]\s])+)\s*\])|(?<CATALOG>(\w|!|\#|\$)*(\s*(\w|!|\#|\$)+)*))\s*\.\s*((\[(?<NAME>(\s*[^\[\]\s])+)\s*\])|(?<NAME>(\w|!|\#|\$)+(\s*(\w|!|\#|\$)+)*))\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- //static readonly Regex SchemaCatalogNameOrder = new Regex(@"^\s*((\[\s*(?<SCHEMA>(\s*[^\]\s])+)\s*\])|(?<SCHEMA>([^\.\s])*(\s*([^\.\s])+)*))\s*\.\s*((\[(?<CATALOG>(\s*[^\]\s])+)\s*\])|(?<CATALOG>([^\.\s])*(\s*([^\.\s])+)*))\s*\.\s*((\[(?<NAME>(\s*[^\]\s])+)\s*\])|(?<NAME>([^\.\s])+(\s*([^\.\s])+)*))\s*$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
- static readonly Regex SchemaCatalogNameOrder = new Regex(@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);\r
-\r
- internal static ObjectNameResolver[] GetSyntaxPatterns(AbstractDBConnection connection)\r
- {\r
- ArrayList collection = new ArrayList();\r
- collection.Add(new ObjectNameResolver(NameOrder));\r
-\r
- ObjectNameResolversCollection basic = (ObjectNameResolversCollection) ConfigurationSettings.GetConfig ("Mainsoft.Data.Configuration/objectnameresolution");\r
- \r
- java.sql.DatabaseMetaData metaData = connection.JdbcConnection.getMetaData();\r
- string productName = metaData.getDatabaseProductName();\r
-\r
- foreach(ObjectNameResolver nameResolver in basic) {\r
- if (productName.IndexOf(nameResolver.DbName) != -1) {\r
- collection.Add(nameResolver);\r
- }\r
- }\r
-\r
- //defaults\r
- if (metaData.isCatalogAtStart()) {\r
- collection.Add(new ObjectNameResolver(SchemaNameOrder));\r
- collection.Add(new ObjectNameResolver(CatalogNameOrder));\r
- collection.Add(new ObjectNameResolver(CatalogSchemaNameOrder));\r
- collection.Add(new ObjectNameResolver(SchemaCatalogNameOrder));\r
- }\r
- else {\r
- collection.Add(new ObjectNameResolver(CatalogNameOrder));\r
- collection.Add(new ObjectNameResolver(SchemaNameOrder));\r
- collection.Add(new ObjectNameResolver(SchemaCatalogNameOrder));\r
- collection.Add(new ObjectNameResolver(CatalogSchemaNameOrder));\r
- }\r
-\r
- return (ObjectNameResolver[])collection.ToArray(typeof(ObjectNameResolver)); \r
- }\r
- }\r
-\r
- #endregion // ObjectNamesHelper\r
- \r
- #region Fields\r
-\r
- private const int DEFAULT_TIMEOUT = 15;\r
-\r
- private java.sql.Connection _jdbcConnnection;\r
- private ConnectionState _internalState;\r
- private object _internalStateSync = new object();\r
-\r
- private string _connectionString = String.Empty;\r
- IConnectionStringDictionary _connectionStringBuilder;\r
- IConnectionProvider _connectionProvider;\r
-\r
- private ArrayList _referencedObjects = new ArrayList(); \r
- private ObjectNameResolver[] _syntaxPatterns;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public AbstractDBConnection(string connectionString)\r
- {\r
- _connectionString = connectionString;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public override String ConnectionString\r
- {\r
- get { return _connectionString; }\r
- set {\r
- if (IsOpened) {\r
- throw ExceptionHelper.NotAllowedWhileConnectionOpen("ConnectionString",_internalState);\r
- } \r
- _connectionString = value;\r
- _connectionProvider = null;\r
- _connectionStringBuilder = null;\r
- }\r
- }\r
-\r
- public override int ConnectionTimeout\r
- {\r
- get {\r
- string timeoutStr = (string)ConnectionStringBuilder["loginTimeout"];\r
- if (timeoutStr != null && timeoutStr.Length > 0) {\r
- try {\r
- return Convert.ToInt32(timeoutStr);\r
- }\r
- catch(FormatException) {\r
- throw ExceptionHelper.InvalidValueForKey("connect timeout");\r
- }\r
- catch (OverflowException) {\r
- throw ExceptionHelper.InvalidValueForKey("connect timeout");\r
- }\r
- }\r
- return DEFAULT_TIMEOUT;\r
- }\r
- }\r
-\r
- public override String Database\r
- {\r
- get { \r
- if ((State & ConnectionState.Open) != 0)\r
- return JdbcConnection.getCatalog();\r
-\r
- return (string)ConnectionStringBuilder["DATABASE"];\r
- }\r
- }\r
-\r
- public override ConnectionState State\r
- {\r
- get {\r
- try {\r
- if ((JdbcConnection == null) || JdbcConnection.isClosed()) {\r
- // jdbc connection not initialized or closed\r
- if (_internalState == ConnectionState.Closed ) {\r
- return ConnectionState.Closed;\r
- }\r
- }\r
- else {\r
- // jdbc connection is opened\r
- if ((_internalState & ConnectionState.Open) != 0) {\r
- return ConnectionState.Open;\r
- }\r
- }\r
- return ConnectionState.Broken; \r
- } \r
- catch (SQLException) {\r
- return ConnectionState.Broken;\r
- } \r
- }\r
- }\r
-\r
- internal bool IsExecuting\r
- {\r
- get { \r
- return ((_internalState & ConnectionState.Executing) != 0);\r
- }\r
-\r
- set {\r
- lock(_internalStateSync) {\r
- // to switch to executing, the connection must be in opened\r
- if (value) {\r
- if (_internalState != ConnectionState.Open) {\r
- if (IsFetching) {\r
- throw ExceptionHelper.OpenedReaderExists();\r
- }\r
- throw ExceptionHelper.OpenConnectionRequired("",_internalState);\r
- }\r
- _internalState |= ConnectionState.Executing;\r
- }\r
- else { \r
- if (!IsExecuting) {\r
- throw new InvalidOperationException("Connection : Impossible to tear down from state " + ConnectionState.Executing.ToString() + " while in state " + _internalState.ToString());\r
- }\r
- _internalState &= ~ConnectionState.Executing;\r
- }\r
- }\r
- }\r
- }\r
-\r
- internal bool IsFetching\r
- {\r
- get {\r
- return ((_internalState & ConnectionState.Fetching) != 0);\r
- }\r
-\r
- set {\r
- lock(_internalStateSync) {\r
- if (value) {\r
- // to switch to fetching connection must be in opened, executing\r
- if (((_internalState & ConnectionState.Open) == 0) || ((_internalState & ConnectionState.Executing) == 0)) {\r
- throw ExceptionHelper.OpenConnectionRequired("",_internalState);\r
- }\r
- _internalState |= ConnectionState.Fetching;\r
- }\r
- else {\r
- if (!IsFetching) {\r
- throw new InvalidOperationException("Connection : Impossible to tear down from state " + ConnectionState.Fetching.ToString() + " while in state " + _internalState.ToString());\r
- }\r
- _internalState &= ~ConnectionState.Fetching;\r
- }\r
- }\r
- }\r
- }\r
-\r
- internal bool IsOpened\r
- {\r
- get {\r
- return ((_internalState & ConnectionState.Open) != 0);\r
- }\r
-\r
- set {\r
- lock(_internalStateSync) { \r
- if (value) {\r
- // only connecting connection can be opened\r
- if ((_internalState != ConnectionState.Connecting)) {\r
- throw ExceptionHelper.ConnectionAlreadyOpen(_internalState);\r
- }\r
- _internalState |= ConnectionState.Open;\r
- }\r
- else {\r
- if (!IsOpened) {\r
- throw new InvalidOperationException("Connection : Impossible to tear down from state " + ConnectionState.Open.ToString() + " while in state " + _internalState.ToString());\r
- }\r
- _internalState &= ~ConnectionState.Open;\r
- }\r
- }\r
- }\r
- }\r
-\r
- internal bool IsConnecting\r
- {\r
- get {\r
- return ((_internalState & ConnectionState.Connecting) != 0);\r
- }\r
-\r
- set {\r
- lock(_internalStateSync) { \r
- if (value) {\r
- // to switch to connecting conection must be in closed or in opened\r
- if ((_internalState != ConnectionState.Closed) && (_internalState != ConnectionState.Open)) {\r
- throw ExceptionHelper.ConnectionAlreadyOpen(_internalState);\r
- }\r
- _internalState |= ConnectionState.Connecting;\r
- }\r
- else {\r
- if (!IsConnecting) {\r
- throw new InvalidOperationException("Connection : Impossible to tear down from state " + ConnectionState.Connecting.ToString() + " while in state " + _internalState.ToString());\r
- }\r
- _internalState &= ~ConnectionState.Connecting;\r
- }\r
- }\r
- }\r
- }\r
-\r
- public override string DataSource\r
- {\r
- get {\r
- return (string)ConnectionStringBuilder["SERVERNAME"];\r
- }\r
- }\r
-\r
- internal ConnectionState InternalState\r
- {\r
- get { return _internalState; }\r
- }\r
-\r
-\r
- protected internal java.sql.Connection JdbcConnection\r
- {\r
- get { return _jdbcConnnection; }\r
- set { _jdbcConnnection = value; }\r
- }\r
-\r
- internal ObjectNameResolver[] SyntaxPatterns\r
- {\r
- get {\r
- if (_syntaxPatterns == null) {\r
- _syntaxPatterns = ObjectNamesHelper.GetSyntaxPatterns(this);\r
- }\r
- return _syntaxPatterns;\r
- }\r
- }\r
-\r
- protected internal IConnectionProvider ConnectionProvider { \r
- get {\r
- try {\r
- if (_connectionProvider == null)\r
- _connectionProvider = GetConnectionProvider();\r
-\r
- return _connectionProvider;\r
- }\r
- catch(SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
- }\r
- }\r
- protected internal IConnectionStringDictionary ConnectionStringBuilder {\r
- get {\r
- try {\r
- if (_connectionStringBuilder == null)\r
- _connectionStringBuilder = ConnectionProvider.GetConnectionStringBuilder(ConnectionString);\r
-\r
- return _connectionStringBuilder;\r
- }\r
- catch(SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
- }\r
- }\r
- protected abstract IConnectionProvider GetConnectionProvider();\r
-\r
- static protected IConnectionProvider GetConnectionProvider(string sectionMame, string provider) {\r
- if (provider == null)\r
- throw new ArgumentNullException("provider");\r
-\r
- IList providers = (IList) ConfigurationSettings.GetConfig(sectionMame);\r
- if (providers.Count == 0)\r
- throw new ArgumentException("Configuration section is empty.", "sectionName");\r
-\r
- for (int i = 0; i < providers.Count; i++) {\r
- IDictionary providerInfo = (IDictionary) providers[i];\r
- \r
- string curProvider = (string)providerInfo[ConfigurationConsts.Name];\r
- if (String.Compare(provider, 0, curProvider, 0, provider.Length, StringComparison.OrdinalIgnoreCase) == 0) {\r
- string providerType = (string) providerInfo [ConfigurationConsts.ProviderType];\r
- if (providerType == null || providerType.Length == 0)\r
- return new GenericProvider (providerInfo); \r
- else {\r
- Type t = Type.GetType (providerType);\r
- return (IConnectionProvider) Activator.CreateInstance (t , new object[] {providerInfo});\r
- }\r
- }\r
- }\r
-\r
- throw new ArgumentException(\r
- String.Format("Unknown provider name '{0}'", provider), "ConnectionString");\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
- // since WS also does not permits dynamically change of login timeout and tomcat does no implements - do not do it at all\r
- //ds.setLoginTimeout(ConnectionTimeout);\r
-\r
- protected internal abstract void OnSqlWarning(SQLWarning warning);\r
-\r
- protected abstract SystemException CreateException(SQLException e);\r
-\r
- protected abstract SystemException CreateException(string message);\r
-\r
- public override void Close()\r
- {\r
- ConnectionState orig = State;\r
- try {\r
- ClearReferences();\r
- if (JdbcConnection != null && !JdbcConnection.isClosed()) {\r
- if (!JdbcConnection.getAutoCommit())\r
- JdbcConnection.rollback();\r
- JdbcConnection.close();\r
- }\r
- }\r
- catch (Exception e) {\r
- // suppress exception\r
-#if DEBUG\r
- Console.WriteLine("Exception catched at Conection.Close() : {0}\n{1}\n{2}",e.GetType().FullName,e.Message,e.StackTrace);\r
-#endif\r
- }\r
- finally {\r
- JdbcConnection = null;\r
- lock(_internalStateSync) {\r
- _internalState = ConnectionState.Closed;\r
- }\r
- }\r
-\r
- ConnectionState current = State;\r
- if (current != orig)\r
- OnStateChange (new StateChangeEventArgs (orig, current));\r
- }\r
-\r
- internal protected virtual void OnSqlException(SQLException exp)\r
- {\r
- throw CreateException(exp);\r
- }\r
-\r
- internal void AddReference(object referencedObject)\r
- { lock(_referencedObjects.SyncRoot) {\r
- _referencedObjects.Add(new WeakReference(referencedObject));\r
- }\r
- }\r
-\r
- internal void RemoveReference(object referencedObject)\r
- {\r
- lock(_referencedObjects.SyncRoot) {\r
- for(int i = 0; i < _referencedObjects.Count; i++) {\r
- WeakReference wr = (WeakReference) _referencedObjects[i];\r
- if (wr.IsAlive && (wr.Target == referencedObject)) {\r
- _referencedObjects.RemoveAt(i);\r
- }\r
- }\r
- }\r
- }\r
-\r
- private void ClearReferences()\r
- {\r
- ArrayList oldList = _referencedObjects;\r
- _referencedObjects = new ArrayList();\r
-\r
- for(int i = 0; i < oldList.Count; i++) {\r
- WeakReference wr = (WeakReference) oldList[i];\r
- if (wr.IsAlive) {\r
- ClearReference(wr.Target);\r
- }\r
- }\r
- }\r
-\r
- private void ClearReference(object referencedObject)\r
- {\r
- try {\r
- if (referencedObject is AbstractDbCommand) {\r
- ((AbstractDbCommand)referencedObject).CloseInternal();\r
- }\r
- else if (referencedObject is AbstractDataReader) {\r
- ((AbstractDataReader)referencedObject).CloseInternal();\r
- }\r
- }\r
- catch (SQLException) {\r
- // suppress exception since it's possible that command or reader are in inconsistent state\r
- }\r
- }\r
-\r
- public override void Open()\r
- {\r
- if (_connectionString == null || _connectionString.Length == 0) {\r
- throw ExceptionHelper.ConnectionStringNotInitialized();\r
- }\r
-\r
- IsConnecting = true;\r
- try { \r
- if (JdbcConnection != null && !JdbcConnection.isClosed()) {\r
- throw ExceptionHelper.ConnectionAlreadyOpen(_internalState);\r
- }\r
-\r
- JdbcConnection = ConnectionProvider.GetConnection (ConnectionStringBuilder);\r
-\r
- IsOpened = true;\r
-\r
- OnStateChange (new StateChangeEventArgs (ConnectionState.Closed, ConnectionState.Open));\r
- }\r
- catch (SQLWarning warning) {\r
- OnSqlWarning(warning);\r
- }\r
- catch (SQLException exp) {\r
- OnSqlException(exp);\r
- }\r
- finally {\r
- IsConnecting = false;\r
- }\r
- }\r
-\r
- public override void ChangeDatabase(String database)\r
- {\r
- IsConnecting = true;\r
- try {\r
- ClearReferences();\r
- java.sql.Connection con = JdbcConnection; \r
- con.setCatalog(database);\r
-// ConnectionStringHelper.UpdateValue(UserParameters,StringManager.GetStringArray("CON_DATABASE"),database);\r
- }\r
- catch (SQLWarning warning) {\r
- OnSqlWarning(warning);\r
- }\r
- catch (SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
- finally {\r
- IsConnecting = false;\r
- }\r
- }\r
-\r
- public override string ServerVersion {\r
- get {\r
- // only if the driver support this methods\r
- try {\r
- if (JdbcConnection == null)\r
- return String.Empty;\r
-\r
- java.sql.DatabaseMetaData metaData = JdbcConnection.getMetaData();\r
- return metaData.getDatabaseProductVersion();\r
- }\r
- catch (SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
- }\r
- }\r
-\r
- internal string JdbcProvider {\r
- get {\r
- // only if the driver support this methods\r
- try {\r
- if (JdbcConnection == null)\r
- return String.Empty;\r
-\r
- java.sql.DatabaseMetaData metaData = JdbcConnection.getMetaData();\r
- return metaData.getDriverName() + " " + metaData.getDriverVersion();\r
- }\r
- catch (SQLException exp) {\r
- return String.Empty; //suppress\r
- }\r
- }\r
- }\r
-\r
- protected override void Dispose(bool disposing)\r
- {\r
- if (disposing) {\r
- try {\r
- if (JdbcConnection != null && !JdbcConnection.isClosed()) {\r
- JdbcConnection.close();\r
- } \r
- JdbcConnection = null;\r
- }\r
- catch (java.sql.SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
- }\r
- base.Dispose(disposing);\r
- }\r
-\r
- internal void ValidateBeginTransaction()\r
- {\r
- if (State != ConnectionState.Open) {\r
- throw new InvalidOperationException(String.Format("{0} requires an open and available Connection. The connection's current state is {1}.", new object[] {"BeginTransaction", State}));\r
- }\r
-\r
- if (!JdbcConnection.getAutoCommit()) {\r
- throw new System.InvalidOperationException("Parallel transactions are not supported.");\r
- }\r
- }\r
-\r
- internal ArrayList GetProcedureColumns(String procedureString, AbstractDbCommand command)\r
- {\r
- ArrayList col = new ArrayList();\r
- try {\r
- ObjectNameResolver[] nameResolvers = SyntaxPatterns;\r
- java.sql.ResultSet res = null;\r
- string catalog = null;\r
- string schema = null;\r
- string spname = null;\r
- \r
- java.sql.DatabaseMetaData metadata = JdbcConnection.getMetaData(); \r
- bool storesUpperCaseIdentifiers = false;\r
- bool storesLowerCaseIdentifiers = false;\r
- try {\r
- storesUpperCaseIdentifiers = metadata.storesUpperCaseIdentifiers();\r
- storesLowerCaseIdentifiers = metadata.storesLowerCaseIdentifiers();\r
- }\r
- catch (SQLException e) {\r
- // suppress\r
- }\r
-\r
- for(int i=0; i < nameResolvers.Length; i++) {\r
- ObjectNameResolver nameResolver = nameResolvers[i];\r
- Match match = nameResolver.Match(procedureString);\r
-\r
- if (match.Success) {\r
- spname = ObjectNameResolver.GetName(match); \r
- schema = ObjectNameResolver.GetSchema(match); \r
- catalog = ObjectNameResolver.GetCatalog(match); \r
-\r
- // make all identifiers uppercase or lowercase according to database metadata\r
- if (storesUpperCaseIdentifiers) {\r
- spname = (spname.Length > 0) ? spname.ToUpper() : null;\r
- schema = (schema.Length > 0) ? schema.ToUpper() : null;\r
- catalog = (catalog.Length > 0) ? catalog.ToUpper() : null;\r
- }\r
- else if (storesLowerCaseIdentifiers) {\r
- spname = (spname.Length > 0) ? spname.ToLower() : null;\r
- schema = (schema.Length > 0) ? schema.ToLower() : null;\r
- catalog = (catalog.Length > 0) ? catalog.ToLower() : null;\r
- }\r
- else {\r
- spname = (spname.Length > 0) ? spname : null;\r
- schema = (schema.Length > 0) ? schema : null;\r
- catalog = (catalog.Length > 0) ? catalog : null;\r
- }\r
-\r
- // catalog from db is always in correct caps\r
- if (catalog == null) {\r
- catalog = JdbcConnection.getCatalog();\r
- }\r
-\r
- try {\r
- // always get the first procedure that db returns\r
- res = metadata.getProcedures(catalog, schema, spname); \r
- if (res.next()) {\r
- catalog = res.getString(1);\r
- schema = res.getString(2);\r
- spname = res.getString(3);\r
- break;\r
- }\r
-\r
- spname = null;\r
- }\r
- catch { // suppress exception\r
- return null;\r
- }\r
- finally {\r
- if (res != null) {\r
- res.close();\r
- }\r
- }\r
- }\r
- } \r
- \r
- if (spname == null || spname.Length == 0) {\r
- return null;\r
- }\r
- \r
- try {\r
- // get procedure columns based o procedure metadata\r
- res = metadata.getProcedureColumns(catalog, schema, spname, null); \r
- while (res.next()) {\r
- // since there is still a possibility that some of the parameters to getProcedureColumn were nulls, \r
- // we need to filter the results with strict matching\r
- if ((res.getString(1) != catalog ) || (res.getString(2) != schema) || (res.getString(3) != spname)) {\r
- continue;\r
- }\r
-\r
- AbstractDbParameter parameter = (AbstractDbParameter)command.CreateParameter();\r
- \r
- parameter.SetParameterName(res);\r
- parameter.SetParameterDbType(res);\r
- parameter.SetSpecialFeatures(res);\r
-\r
- //get parameter direction\r
- short direction = res.getShort("COLUMN_TYPE");\r
- if(direction == 1) //DatabaseMetaData.procedureColumnIn\r
- parameter.Direction = ParameterDirection.Input;\r
- else if(direction == 2) //DatabaseMetaData.procedureColumnInOut\r
- parameter.Direction = ParameterDirection.InputOutput;\r
- else if(direction == 4) //DatabaseMetaData.procedureColumnOut\r
- parameter.Direction = ParameterDirection.Output;\r
- else if(direction == 5) //DatabaseMetaData.procedureColumnReturn\r
- parameter.Direction = ParameterDirection.ReturnValue;\r
- \r
- //get parameter precision and scale\r
- parameter.SetParameterPrecisionAndScale(res);\r
-\r
- parameter.SetParameterSize(res);\r
- parameter.SetParameterIsNullable(res);\r
-\r
- col.Add(parameter);\r
- }\r
- }\r
- finally {\r
- if (res != null) {\r
- res.close();\r
- }\r
- } \r
- }\r
- catch(Exception e) {\r
- //supress\r
-#if DEBUG\r
- Console.WriteLine("Exception catched at AbstractDBConnection.GetProcedureColumns() : {0}\n{1}\n{2}",e.GetType().FullName,e.Message,e.StackTrace);\r
-#endif\r
- }\r
- return col;\r
- }\r
-\r
- #endregion // Methods \r
-\r
- #region ICloneable Members\r
-\r
- public virtual object Clone() {\r
- AbstractDBConnection con = (AbstractDBConnection)MemberwiseClone();\r
- con._internalState = ConnectionState.Closed;\r
- con._internalStateSync = new object();\r
- con._jdbcConnnection = null;\r
- con._referencedObjects = new ArrayList();\r
- con._syntaxPatterns = null;\r
- return con;\r
- }\r
-\r
- #endregion\r
- }\r
-}\r
+++ /dev/null
-//
-// System.Data.ProviderBase.AbstractDbParameter
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-using java.sql;
-
-namespace System.Data.ProviderBase
-{
- public abstract class AbstractDbParameter : DbParameter, IDbDataParameter, ICloneable
- {
- #region Fields
-
- byte _precision;
- byte _scale;
- protected DataRowVersion _sourceVersion;
- private int _jdbcType;
- bool _isDbTypeSet;
- bool _isJdbcTypeSet;
- object _convertedValue;
-
- string _parameterName;
- ParameterDirection _direction = ParameterDirection.Input;
- int _size;
- object _value;
- bool _isNullable;
- int _offset;
- string _sourceColumn;
- DbParameterCollection _parent = null;
-
- #endregion // Fields
-
- #region Constructors
-
- [MonoTODO]
- protected AbstractDbParameter ()
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public override ParameterDirection Direction {
- get { return _direction; }
- set {
- if (_direction != value) {
- switch (value) {
- case ParameterDirection.Input:
- case ParameterDirection.Output:
- case ParameterDirection.InputOutput:
- case ParameterDirection.ReturnValue:
- {
- _direction = value;
- return;
- }
- }
- throw ExceptionHelper.InvalidParameterDirection (value);
- }
- }
- }
-
- public override bool IsNullable {
- get { return _isNullable; }
- set { _isNullable = value; }
- }
-
-
- public virtual int Offset {
- get { return _offset; }
- set { _offset = value; }
- }
-
- public override string ParameterName {
- get {
- if (_parameterName == null)
- return String.Empty;
-
- return _parameterName;
- }
- set {
- if (_parameterName != value) {
- _parameterName = value;
- }
- }
- }
-
- public override int Size {
- get { return _size; }
-
- set {
- if (_size != value) {
- if (value < -1)
- throw ExceptionHelper.InvalidSizeValue (value);
-
- _size = value;
- }
- }
- }
-
-
- public override string SourceColumn {
- get {
- if (_sourceColumn == null)
- return String.Empty;
-
- return _sourceColumn;
- }
-
- set { _sourceColumn = value; }
- }
-
- internal DbParameterCollection Parent
- {
- get { return _parent; }
- set { _parent = value; }
- }
-
- public byte Precision
- {
- get { return _precision; }
- set { _precision = value; }
- }
-
- public byte Scale
- {
- get { return _scale; }
- set { _scale = value; }
- }
-
- public override DataRowVersion SourceVersion
- {
- get { return _sourceVersion; }
- set { _sourceVersion = value; }
- }
-
- protected internal int JdbcType
- {
- get {
- if (!IsJdbcTypeSet) {
- return JdbcTypeFromProviderType();
- }
- return _jdbcType;
- }
- set {
- _jdbcType = value;
- IsJdbcTypeSet = true;
- }
- }
-
- protected internal bool IsJdbcTypeSet
- {
- get {
- return _isJdbcTypeSet;
- }
-
- set {
- _isJdbcTypeSet = value;
- }
- }
-
- protected internal bool IsDbTypeSet
- {
- get { return _isDbTypeSet; }
- set { _isDbTypeSet = value; }
- }
-
- protected internal virtual bool IsSpecial {
- get {
- return false;
- }
- }
-
- private bool IsFixedLength
- {
- get {
- return ((DbType != DbType.AnsiString) && (DbType != DbType.Binary) &&
- (DbType != DbType.String) && (DbType != DbType.VarNumeric));
- }
- }
-
- protected internal virtual string Placeholder {
- get {
- return "?";
- }
- }
-
- internal object ConvertedValue
- {
- get {
- if (_convertedValue == null) {
- object value = Value;
- _convertedValue = ((value != null) && (value != DBNull.Value)) ? ConvertValue(value) : value;
- }
- return _convertedValue;
- }
- }
-
- public override object Value {
- get { return _value; }
- set {
- _convertedValue = null;
- _value = value;
- }
- }
-
- //DbParameter overrides
-
- public override bool SourceColumnNullMapping {
- get {
- throw new NotImplementedException();
- }
- set {
- throw new NotImplementedException();
- }
- }
-
-
- #endregion // Properties
-
- #region Methods
-
- public override String ToString()
- {
- return ParameterName;
- }
-
- protected internal abstract void SetParameterName(ResultSet res);
-
- protected internal abstract void SetParameterDbType(ResultSet res);
-
- protected internal abstract void SetSpecialFeatures(ResultSet res);
-
- public virtual object Clone()
- {
- AbstractDbParameter other = (AbstractDbParameter) MemberwiseClone ();
- other._parent = null;
- return other;
- }
-
- protected internal abstract int JdbcTypeFromProviderType();
-
- protected internal abstract object ConvertValue(object value);
-
- internal void SetParameterPrecisionAndScale(ResultSet res)
- {
- int jdbcType = res.getInt("DATA_TYPE");
- if(jdbcType == java.sql.Types.DECIMAL || jdbcType == java.sql.Types.NUMERIC) {
- Precision = (byte)res.getInt("PRECISION");
- Scale = (byte)res.getInt("SCALE");
- }
- }
-
- internal void SetParameterSize(ResultSet res)
- {
- Size = res.getInt("LENGTH");
- }
-
- internal void SetParameterIsNullable(ResultSet res)
- {
- IsNullable = (res.getInt("NULLABLE") == 1);
- }
-
- internal void Validate()
- {
- if (!IsFixedLength && ((Direction & ParameterDirection.Output) != 0) && (Size == 0)) {
- throw ExceptionHelper.ParameterSizeNotInitialized(Offset,ParameterName,DbType.ToString(),Size);
- }
- }
-
- //DbParameter overrides
-
- public override void ResetDbType() {
- throw new NotImplementedException();
- }
-
- #endregion // Methods
- }
-}
-
+++ /dev/null
-//\r
-// System.Data.Common.AbstractDataReader\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-using System;\r
-using System.Data;\r
-using System.Collections;\r
-using System.Data.Common;\r
-\r
-using java.io;\r
-using java.sql;\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
- public abstract class AbstractDataReader : DbDataReader, ISafeDataRecord {\r
-\r
- #region Fields\r
-\r
- private ResultSetMetaData _resultsMetaData;\r
- protected AbstractDbCommand _command;\r
- private DataTable _schemaTable;\r
- private ReaderState _readerState = ReaderState.Uninitialized;\r
-\r
- private IReaderCacheContainer[] _readerCache;\r
- private int _currentCacheFilledPosition; \r
- private Stack _resultSetStack = new Stack();\r
- private bool _isClosed = false;\r
-\r
- [Flags]\r
- private enum ReaderState { Uninitialized = 0, Empty = 1, HasRows = 2, FirstRed = 4, Eof = 8, Fetching = 16 };\r
-\r
- protected internal enum SCHEMA_TABLE { ColumnName,\r
- ColumnOrdinal,\r
- ColumnSize,\r
- NumericPrecision,\r
- NumericScale,\r
- IsUnique,\r
- IsKey,\r
- BaseServerName,\r
- BaseCatalogName,\r
- BaseColumnName,\r
- BaseSchemaName,\r
- BaseTableName,\r
- DataType,\r
- AllowDBNull,\r
- ProviderType,\r
- IsAliased,\r
- IsExpression,\r
- IsIdentity,\r
- IsAutoIncrement,\r
- IsRowVersion,\r
- IsHidden,\r
- IsLong,\r
- IsReadOnly};\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
- \r
- protected AbstractDataReader(AbstractDbCommand command) {\r
- _command = command;\r
- if (_command.Connection != null) {\r
- ((AbstractDBConnection)_command.Connection).AddReference(this);\r
- }\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- public override int Depth {\r
- get { return 0; }\r
- }\r
-\r
- public override bool HasRows {\r
- get {\r
- if (IsClosed) {\r
- throw new InvalidOperationException("Invalid attempt to HasRows when reader is closed.");\r
- }\r
-\r
- try {\r
- if(null == Results)\r
- return false;\r
- }\r
- catch(SystemException) {\r
- //suppress\r
- return false;\r
- }\r
-\r
- return (_readerState & ReaderState.HasRows) != 0;\r
- }\r
- }\r
-\r
- public override int RecordsAffected\r
- {\r
- // MSDN : The RecordsAffected property is not set \r
- // until all rows are read and you close the reader.\r
- get { \r
- return _command.RecordsAffected; \r
- }\r
- }\r
-\r
- public override int FieldCount\r
- {\r
- get {\r
- if (ResultsMetaData == null)\r
- return 0;\r
-\r
- try {\r
- return ResultsMetaData.getColumnCount();\r
- }\r
- catch (SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
-\r
- }\r
- }\r
-\r
- protected internal CommandBehavior Behavior\r
- {\r
- get {\r
- return _command.Behavior;\r
- }\r
- }\r
-\r
- public override Object this[String columnName]\r
- {\r
- get {\r
- try {\r
- int columnIndex = Results.findColumn(columnName) - 1;\r
- return this[columnIndex];\r
- }\r
- catch (SQLException exp) {\r
- throw new IndexOutOfRangeException(exp.Message, exp);\r
- } \r
- }\r
- }\r
-\r
- public override Object this[int columnIndex]\r
- {\r
- get { return GetValue(columnIndex); }\r
- }\r
-\r
- protected ResultSet Results\r
- {\r
- get {\r
- if (_readerState == ReaderState.Uninitialized) {\r
-\r
- if (_resultSetStack.Count == 0) {\r
- ResultSet resultSet = _command.CurrentResultSet;\r
- if (resultSet == null)\r
- return null;\r
-\r
- _resultSetStack.Push(resultSet);\r
- }\r
-\r
- _readerState = ReaderState.Fetching;\r
- for (;;) {\r
- try {\r
- Configuration.BooleanSetting prefetchSchema = Configuration.Switches.PrefetchSchema;\r
-\r
- if (prefetchSchema == Configuration.BooleanSetting.NotSet) {\r
- AbstractDBConnection conn = (AbstractDBConnection)((ICloneable)_command.Connection);\r
- string driverName = conn.JdbcConnection.getMetaData().getDriverName();\r
- if (driverName.IndexOf("DB2", StringComparison.Ordinal) >= 0)\r
- prefetchSchema = Configuration.BooleanSetting.True;\r
- }\r
-\r
- if (prefetchSchema == Configuration.BooleanSetting.True)\r
- GetSchemaTable();\r
-\r
- ResultSet resultSet = (ResultSet)_resultSetStack.Peek();\r
- if (resultSet.next()) {\r
- _readerState = (ReaderState.HasRows | ReaderState.FirstRed);\r
- ResultSetMetaData rsMetaData = ResultsMetaData;\r
- DbConvert.JavaSqlTypes javaSqlType = (DbConvert.JavaSqlTypes)rsMetaData.getColumnType(1);\r
- if (javaSqlType == DbConvert.JavaSqlTypes.OTHER) {\r
- object value = GetValue(0);\r
- if (value != null && value is ResultSet) {\r
- _resultsMetaData = null;\r
- _readerCache = null;\r
- SchemaTable = null;\r
- _readerState = ReaderState.Fetching;\r
- _resultSetStack.Push(value);\r
- continue;\r
- }\r
- }\r
- }\r
- else\r
- _readerState = ReaderState.Empty;\r
-\r
- break;\r
- }\r
- catch(SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
- }\r
-\r
- return (_resultSetStack.Count > 0) ? (ResultSet)_resultSetStack.Peek() : null;\r
- }\r
- }\r
-\r
- protected ResultSetMetaData ResultsMetaData\r
- {\r
- get {\r
- ResultSet results = Results;\r
- if (results == null) {\r
- return null;\r
- }\r
- if(_resultsMetaData == null) {\r
- _resultsMetaData = results.getMetaData();\r
- }\r
- return _resultsMetaData;\r
- } \r
- }\r
-\r
- protected DataTable SchemaTable\r
- {\r
- get {\r
- if (_schemaTable == null) {\r
- _schemaTable = ConstructSchemaTable();\r
- }\r
- return _schemaTable;\r
- }\r
-\r
- set {_schemaTable = value; }\r
- }\r
-\r
- internal protected IReaderCacheContainer[] ReaderCache\r
- {\r
- get {\r
- if (_readerCache == null) {\r
- _readerCache = CreateReaderCache();\r
- _currentCacheFilledPosition = -1;\r
- }\r
- return _readerCache;\r
- }\r
- }\r
-\r
- public override bool IsClosed {\r
- get { return _isClosed; }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- protected abstract int GetProviderType(int jdbcType);\r
-\r
- protected abstract SystemException CreateException(string message, SQLException e);\r
-\r
- protected abstract SystemException CreateException(IOException e);\r
-\r
- protected SystemException CreateException(SQLException e)\r
- {\r
- return CreateException(e.Message,e); \r
- }\r
-\r
- private bool CloseCurrentResultSet() {\r
- if (_resultSetStack.Count > 0) {\r
- try{\r
- _resultsMetaData = null;\r
- _readerCache = null;\r
- _readerState = ReaderState.Uninitialized;\r
- ResultSet rs = (ResultSet)_resultSetStack.Pop();\r
- rs.close();\r
- return true;\r
- }\r
- catch (SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
- }\r
-\r
- return false;\r
- }\r
-\r
- // FIXME : add Close(bool readAllRecords) and pass this bool to skip looping over NextResult(), override AbstractDbCommand.ExecuteScalar\r
- public override void Close()\r
- {\r
- if (IsClosed)\r
- return;\r
-\r
- try {\r
- CloseCurrentResultSet();\r
- _command.OnReaderClosed(this);\r
- }\r
- finally {\r
- CloseInternal();\r
- }\r
- }\r
-\r
- internal void CloseInternal()\r
- {\r
- _resultsMetaData = null;\r
- _readerCache = null;\r
- _isClosed = true;\r
- }\r
-\r
- public override IEnumerator GetEnumerator ()\r
- {\r
- bool closeReader = (Behavior & CommandBehavior.CloseConnection) != 0;\r
- return new DbEnumerator (this , closeReader);\r
- }\r
-\r
- public override bool NextResult()\r
- {\r
- CloseCurrentResultSet();\r
-\r
- if ((_command.Behavior & CommandBehavior.SingleResult) != 0) {\r
- while (CloseCurrentResultSet());\r
- while (_command.NextResultSet());\r
- return false;\r
- }\r
-\r
- try {\r
- while (_resultSetStack.Count > 0) {\r
- ResultSet rs = (ResultSet)_resultSetStack.Peek();\r
-\r
- if(!rs.next()) {\r
- CloseCurrentResultSet();\r
- continue;\r
- }\r
-\r
- // must be a ResultSet\r
- object childRs = rs.getObject(1);\r
- if (childRs != null) {\r
- SchemaTable = null;\r
- _resultSetStack.Push(childRs);\r
- return true;\r
- }\r
- }\r
- }\r
- catch (SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
- \r
- if (_command.NextResultSet()) {\r
- SchemaTable = null; \r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public override bool Read()\r
- {\r
- if(null == Results ||\r
- (_readerState & (ReaderState.HasRows | ReaderState.Eof)) != ReaderState.HasRows)\r
- return false;\r
-\r
- bool firstRead = false;\r
-\r
- try {\r
- if ((_readerState & ReaderState.FirstRed) != 0) {\r
- firstRead = true;\r
- _readerState &= ~ReaderState.FirstRed;\r
- return true;\r
- }\r
- else {\r
- bool next = Results.next();\r
-\r
- if (!next)\r
- _readerState |= ReaderState.Eof;\r
-\r
- return next;\r
- }\r
- } \r
- catch (SQLException exp) {\r
- // suppress exception as .Net does\r
- return false;\r
- }\r
- finally {\r
- // in case of first read we could sampled the first value\r
- // to see whether there is a resultset, so _currentCacheFilledPosition\r
- // might be already inited\r
- if (!firstRead)\r
- _currentCacheFilledPosition = -1;\r
- }\r
- }\r
-\r
- public override bool GetBoolean(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((BooleanReaderCacheContainer)ReaderCache[columnIndex]).GetBoolean();\r
- }\r
-\r
- public bool GetBooleanSafe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is BooleanReaderCacheContainer) {\r
- return GetBoolean(columnIndex);\r
- }\r
- else {\r
- return Convert.ToBoolean(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override byte GetByte(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((ByteReaderCacheContainer)ReaderCache[columnIndex]).GetByte();\r
- }\r
-\r
- public byte GetByteSafe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is ByteReaderCacheContainer) {\r
- return GetByte(columnIndex);\r
- }\r
- else {\r
- return Convert.ToByte(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override long GetBytes(\r
- int columnIndex,\r
- long dataIndex,\r
- byte[] buffer,\r
- int bufferIndex,\r
- int length)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((BytesReaderCacheContainer)ReaderCache[columnIndex])\r
- .GetBytes(dataIndex, buffer, bufferIndex, length);\r
- }\r
-\r
- public virtual byte[] GetBytes(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((BytesReaderCacheContainer)ReaderCache[columnIndex]).GetBytes();\r
- }\r
-\r
- public override char GetChar(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- string s = ((StringReaderCacheContainer)ReaderCache[columnIndex]).GetString();\r
- if(s == null) {\r
- return '\0';\r
- }\r
- return s[0];\r
- }\r
-\r
- public char GetCharSafe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is StringReaderCacheContainer) {\r
- return GetChar(columnIndex);\r
- }\r
- else {\r
- return Convert.ToChar(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override long GetChars(\r
- int columnIndex,\r
- long dataIndex,\r
- char[] buffer,\r
- int bufferIndex,\r
- int length)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((CharsReaderCacheContainer)ReaderCache[columnIndex])\r
- .GetChars(dataIndex, buffer, bufferIndex, length);\r
- }\r
-\r
- public override string GetDataTypeName(int columnIndex)\r
- {\r
- try {\r
- if (ResultsMetaData == null) {\r
- return String.Empty;\r
- }\r
- return ResultsMetaData.getColumnTypeName(columnIndex + 1);\r
- }\r
- catch (SQLException exp) {\r
- throw CreateException(exp);\r
- }\r
- }\r
-\r
- public override DateTime GetDateTime(int columnIndex)\r
- {\r
- return GetDateTimeUnsafe(columnIndex);\r
- }\r
-\r
- DateTime GetDateTimeUnsafe(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((DateTimeReaderCacheContainer)ReaderCache[columnIndex]).GetDateTime();\r
- }\r
-\r
- public DateTime GetDateTimeSafe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is DateTimeReaderCacheContainer) {\r
- return GetDateTimeUnsafe(columnIndex);\r
- }\r
- else {\r
- return Convert.ToDateTime(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public virtual TimeSpan GetTimeSpan(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((TimeSpanReaderCacheContainer)ReaderCache[columnIndex]).GetTimeSpan();\r
- }\r
-\r
- public override Guid GetGuid(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((GuidReaderCacheContainer)ReaderCache[columnIndex]).GetGuid();\r
- }\r
-\r
- public override decimal GetDecimal(int columnIndex)\r
- {\r
- return GetDecimalUnsafe(columnIndex);\r
- }\r
-\r
- decimal GetDecimalUnsafe(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((DecimalReaderCacheContainer)ReaderCache[columnIndex]).GetDecimal();\r
- }\r
-\r
- public decimal GetDecimalSafe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is DecimalReaderCacheContainer) {\r
- return GetDecimalUnsafe(columnIndex);\r
- }\r
- else {\r
- return Convert.ToDecimal(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override double GetDouble(int columnIndex)\r
- {\r
- return GetDoubleUnsafe(columnIndex);\r
- }\r
-\r
- double GetDoubleUnsafe(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((DoubleReaderCacheContainer)ReaderCache[columnIndex]).GetDouble();\r
- }\r
-\r
- public double GetDoubleSafe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is DoubleReaderCacheContainer) {\r
- return GetDoubleUnsafe(columnIndex);\r
- }\r
- else {\r
- return Convert.ToDouble(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override float GetFloat(int columnIndex)\r
- {\r
- return GetFloatUnsafe(columnIndex);\r
- }\r
-\r
- float GetFloatUnsafe(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((FloatReaderCacheContainer)ReaderCache[columnIndex]).GetFloat();\r
- }\r
-\r
- public float GetFloatSafe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is FloatReaderCacheContainer) {\r
- return GetFloatUnsafe(columnIndex);\r
- }\r
- else {\r
- return Convert.ToSingle(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override short GetInt16(int columnIndex)\r
- {\r
- return GetInt16Unsafe(columnIndex);\r
- }\r
-\r
- short GetInt16Unsafe(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((Int16ReaderCacheContainer)ReaderCache[columnIndex]).GetInt16();\r
- }\r
-\r
- public short GetInt16Safe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is Int16ReaderCacheContainer) {\r
- return GetInt16Unsafe(columnIndex);\r
- }\r
- else {\r
- return Convert.ToInt16(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override int GetInt32(int columnIndex)\r
- {\r
- return GetInt32Unsafe(columnIndex);\r
- }\r
-\r
- int GetInt32Unsafe(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((Int32ReaderCacheContainer)ReaderCache[columnIndex]).GetInt32();\r
- }\r
-\r
- public int GetInt32Safe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is Int32ReaderCacheContainer) {\r
- return GetInt32Unsafe(columnIndex);\r
- }\r
- else {\r
- return Convert.ToInt32(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override long GetInt64(int columnIndex)\r
- {\r
- return GetInt64Unsafe(columnIndex);\r
- }\r
-\r
- long GetInt64Unsafe(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((Int64ReaderCacheContainer)ReaderCache[columnIndex]).GetInt64();\r
- }\r
-\r
- public long GetInt64Safe(int columnIndex)\r
- {\r
- if (ReaderCache[columnIndex] is Int64ReaderCacheContainer) {\r
- return GetInt64Unsafe(columnIndex);\r
- }\r
- else {\r
- return Convert.ToInt64(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override string GetName(int columnIndex)\r
- {\r
- try {\r
- if (ResultsMetaData == null) {\r
- return String.Empty;\r
- }\r
- return ResultsMetaData.getColumnName(columnIndex + 1);\r
- }\r
- catch (SQLException exp) {\r
- throw new IndexOutOfRangeException(exp.Message, exp);\r
- }\r
- }\r
-\r
- public override int GetOrdinal(String columnName)\r
- {\r
- try {\r
- int retVal = Results.findColumn(columnName);\r
- if(retVal != -1) {\r
- retVal -= 1;\r
- }\r
- return retVal;\r
- }\r
- catch (SQLException exp) {\r
- throw new IndexOutOfRangeException(exp.Message, exp);\r
- }\r
- }\r
-\r
- public override string GetString(int columnIndex)\r
- {\r
- return GetStringUnsafe(columnIndex);\r
- }\r
-\r
- string GetStringUnsafe(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ((StringReaderCacheContainer)ReaderCache[columnIndex]).GetString();\r
- }\r
-\r
- public string GetStringSafe(int columnIndex) {\r
- if (ReaderCache[columnIndex] is StringReaderCacheContainer) {\r
- return GetStringUnsafe(columnIndex);\r
- }\r
- else {\r
- return Convert.ToString(GetValue(columnIndex));\r
- }\r
- }\r
-\r
- public override object GetValue(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- if (ReaderCache[columnIndex].IsNull()) {\r
- return DBNull.Value;\r
- }\r
- return ReaderCache[columnIndex].GetValue();\r
- }\r
-\r
- public override int GetValues(Object[] values)\r
- { \r
- int columnCount = FieldCount;\r
- int i = 0;\r
- for (; i < values.Length && i < columnCount; i++) {\r
- values[i] = GetValue(i);\r
- }\r
- return i;\r
- }\r
-\r
- private void FillReaderCache(int columnIndex)\r
- {\r
- try {\r
- IReaderCacheContainer[] readerCache = ReaderCache;\r
- if ((Behavior & CommandBehavior.SequentialAccess) == 0) { \r
- while (_currentCacheFilledPosition < columnIndex) {\r
- _currentCacheFilledPosition++;\r
- readerCache[_currentCacheFilledPosition].Fetch(Results,_currentCacheFilledPosition, false);\r
- } \r
- }\r
- else {\r
- readerCache[columnIndex].Fetch(Results,columnIndex, true);\r
- }\r
- }\r
- catch(SQLException e) {\r
- _currentCacheFilledPosition = -1;\r
- throw CreateException(e);\r
- }\r
- catch (IOException e) {\r
- _currentCacheFilledPosition = -1;\r
- throw CreateException(e);\r
- }\r
- }\r
-\r
- protected virtual IReaderCacheContainer CreateReaderCacheContainer(int jdbcType, int columnIndex) {\r
- switch ((DbConvert.JavaSqlTypes)jdbcType) {\r
- case DbConvert.JavaSqlTypes.ARRAY :\r
- return new ArrayReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.BIGINT :\r
- return new Int64ReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.BINARY :\r
- case DbConvert.JavaSqlTypes.VARBINARY :\r
- case DbConvert.JavaSqlTypes.LONGVARBINARY :\r
- return new BytesReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.BIT :\r
- return new BooleanReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.BLOB :\r
- return new BlobReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.VARCHAR:\r
- case DbConvert.JavaSqlTypes.CHAR : \r
- if (String.CompareOrdinal("uniqueidentifier", ResultsMetaData.getColumnTypeName(columnIndex)) == 0) {\r
- return new GuidReaderCacheContainer();\r
- }\r
- else {\r
- return new StringReaderCacheContainer();\r
- }\r
- case DbConvert.JavaSqlTypes.CLOB :\r
- return new ClobReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.TIME :\r
- return new TimeSpanReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.DATE :\r
- AbstractDBConnection conn = (AbstractDBConnection)((ICloneable)_command.Connection);\r
- string driverName = conn.JdbcConnection.getMetaData().getDriverName();\r
-\r
- if (driverName.StartsWith("PostgreSQL")) {\r
- return new DateTimeReaderCacheContainer();\r
- }\r
- else\r
- goto case DbConvert.JavaSqlTypes.TIMESTAMP;\r
- case DbConvert.JavaSqlTypes.TIMESTAMP : \r
- return new TimestampReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.DECIMAL :\r
- case DbConvert.JavaSqlTypes.NUMERIC :\r
- // jdbc driver for oracle identitfies both FLOAT and NUMBEr columns as \r
- // java.sql.Types.NUMERIC (2), columnTypeName NUMBER, columnClassName java.math.BigDecimal \r
- // therefore we relay on scale\r
- int scale = ResultsMetaData.getScale(columnIndex);\r
- if (scale == -127) {\r
- // Oracle db type FLOAT\r
- return new DoubleReaderCacheContainer();\r
- }\r
- else {\r
- return new DecimalReaderCacheContainer();\r
- }\r
- case DbConvert.JavaSqlTypes.DOUBLE :\r
- case DbConvert.JavaSqlTypes.FLOAT :\r
- return new DoubleReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.INTEGER :\r
- return new Int32ReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.LONGVARCHAR :\r
- return new StringReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.NULL :\r
- return new NullReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.REAL :\r
- return new FloatReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.REF :\r
- return new RefReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.SMALLINT :\r
- return new Int16ReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.TINYINT :\r
- return new ByteReaderCacheContainer();\r
- case DbConvert.JavaSqlTypes.DISTINCT :\r
- case DbConvert.JavaSqlTypes.JAVA_OBJECT :\r
- case DbConvert.JavaSqlTypes.OTHER :\r
- case DbConvert.JavaSqlTypes.STRUCT :\r
- default :\r
- return new ObjectReaderCacheContainer();\r
- }\r
- }\r
-\r
- private IReaderCacheContainer[] CreateReaderCache()\r
- {\r
- try {\r
- IReaderCacheContainer[] readerCache = new IReaderCacheContainer[FieldCount];\r
- for(int i=1; i <= readerCache.Length; i++)\r
- readerCache[i-1] = CreateReaderCacheContainer(ResultsMetaData.getColumnType(i), i);\r
-\r
- return readerCache;\r
- }\r
- catch(SQLException e) {\r
- throw CreateException(e);\r
- }\r
- }\r
-\r
- protected bool IsNumeric(int columnIndex)\r
- {\r
- return ReaderCache[columnIndex].IsNumeric();\r
- }\r
-\r
- public override bool IsDBNull(int columnIndex)\r
- {\r
- FillReaderCache(columnIndex);\r
- return ReaderCache[columnIndex].IsNull();\r
- }\r
-\r
- public override Type GetFieldType(int i)\r
- {\r
- try {\r
- int javaSqlType = ResultsMetaData.getColumnType(i + 1);\r
- return DbConvert.JavaSqlTypeToClrType(javaSqlType);\r
- }\r
- catch (SQLException exp) {\r
- throw new IndexOutOfRangeException(exp.Message, exp);\r
- }\r
- }\r
-\r
- public IDataReader GetData(int i)\r
- {\r
- throw new NotSupportedException();\r
- }\r
-\r
- protected virtual void SetSchemaType(DataRow schemaRow, ResultSetMetaData metaData, int columnIndex) {\r
- DbConvert.JavaSqlTypes columnType = (DbConvert.JavaSqlTypes)metaData.getColumnType(columnIndex);\r
-\r
- switch (columnType) {\r
- case DbConvert.JavaSqlTypes.ARRAY: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = typeof (java.sql.Array);\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.BIGINT: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfInt64;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.BINARY: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfByteArray;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = true;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.BIT: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfBoolean;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.BLOB: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfByteArray;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = true;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.VARCHAR:\r
- case DbConvert.JavaSqlTypes.CHAR: {\r
- // FIXME : specific for Microsoft SQl Server driver\r
- if (String.CompareOrdinal(metaData.getColumnTypeName(columnIndex), "uniqueidentifier") == 0) {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = DbType.Guid;\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfGuid;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- }\r
- else\r
- if (String.CompareOrdinal(metaData.getColumnTypeName(columnIndex), "sql_variant") == 0) {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = DbType.Object;\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfObject;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- }\r
- else {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfString;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- }\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.CLOB: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfString; // instead og .java.sql.Clob\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = true;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.DATE: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfDateTime;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- // else if(DbConvert.JavaSqlTypes.DISTINCT)\r
- // {\r
- // schemaRow ["ProviderType = (int)GetProviderType((int)columnType);\r
- // schemaRow ["DataType = typeof (?);\r
- // schemaRow ["IsLong = false;\r
- // }\r
- case DbConvert.JavaSqlTypes.DOUBLE: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfDouble; // was typeof(float)\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.FLOAT: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfDouble;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.REAL: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfFloat;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.INTEGER: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfInt32;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.JAVA_OBJECT: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfObject;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.LONGVARBINARY: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfByteArray;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = true;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.LONGVARCHAR: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfString;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = true;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.DECIMAL:\r
- case DbConvert.JavaSqlTypes.NUMERIC: {\r
- int scale = ResultsMetaData.getScale(columnIndex);\r
- if (scale == -127) {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfDouble;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- }\r
- else {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfDecimal;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- }\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.REF: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = typeof (java.sql.Ref);\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = true;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.SMALLINT: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfInt16;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.STRUCT: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = typeof (java.sql.Struct);\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.TIME: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfTimespan;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.TIMESTAMP: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfDateTime;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.TINYINT: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfByte;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = false;\r
- break;\r
- }\r
- case DbConvert.JavaSqlTypes.VARBINARY: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = GetProviderType((int)columnType);\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfByteArray;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = true;\r
- break;\r
- }\r
- default: {\r
- schemaRow [(int)SCHEMA_TABLE.ProviderType] = DbType.Object;\r
- schemaRow [(int)SCHEMA_TABLE.DataType] = DbTypes.TypeOfObject;\r
- schemaRow [(int)SCHEMA_TABLE.IsLong] = true;\r
- break;\r
- }\r
- }\r
- }\r
-\r
- public override DataTable GetSchemaTable()\r
- {\r
- if (SchemaTable.Rows != null && SchemaTable.Rows.Count > 0) {\r
- return SchemaTable;\r
- }\r
- \r
- ResultSetMetaData metaData; \r
- if (Behavior == CommandBehavior.SchemaOnly) {\r
- try {\r
- metaData = ((PreparedStatement)_command.Statement).getMetaData();\r
- }\r
- catch(SQLException e) {\r
- throw CreateException("CommandBehaviour.SchemaOnly is not supported by the JDBC driver.",e);\r
- }\r
- }\r
- else {\r
- metaData = ResultsMetaData;\r
- }\r
-\r
- if (metaData == null) {\r
- return SchemaTable;\r
- }\r
-\r
- DatabaseMetaData dbMetaData = null;\r
- AbstractDBConnection clonedConnection = null;\r
- if ((_command.Behavior & CommandBehavior.KeyInfo) != 0) {\r
- clonedConnection = (AbstractDBConnection)((ICloneable)_command.Connection).Clone();\r
-\r
- try {\r
- clonedConnection.Open();\r
- dbMetaData = clonedConnection.JdbcConnection.getMetaData();\r
- }\r
- catch {\r
- //suppress\r
- if (clonedConnection != null) {\r
- clonedConnection.Close();\r
- }\r
- } \r
- }\r
- \r
- try {\r
- int tmp; \r
- for(int i = 1; i <= metaData.getColumnCount(); i++) {\r
- DataRow row = SchemaTable.NewRow ();\r
- string columnName = metaData.getColumnLabel(i);\r
- string baseColumnName = metaData.getColumnName(i);\r
- \r
- row [(int)SCHEMA_TABLE.ColumnName] = columnName; // maybe we should use metaData.getColumnLabel(i);\r
- row [(int)SCHEMA_TABLE.ColumnSize] = metaData.getColumnDisplaySize(i);\r
- row [(int)SCHEMA_TABLE.ColumnOrdinal] = i - 1;\r
- try {\r
- // FIXME : workaround for Oracle JDBC driver bug\r
- // getPrecision on BLOB, CLOB, NCLOB throws NumberFormatException\r
- tmp = metaData.getPrecision(i);\r
- }\r
- catch(java.lang.NumberFormatException e) {\r
- // supress exception\r
- tmp = 255;\r
- }\r
- row [(int)SCHEMA_TABLE.NumericPrecision] = Convert.ToInt16(tmp > 255 ? 255 : tmp);\r
- tmp = metaData.getScale(i);\r
- row [(int)SCHEMA_TABLE.NumericScale] = Convert.ToInt16(tmp > 255 ? 255 : tmp);\r
-\r
- row [(int)SCHEMA_TABLE.BaseServerName] = DBNull.Value;\r
- \r
- string catalog = null;\r
- try {\r
- catalog = metaData.getCatalogName(i);\r
- }\r
- catch (Exception e) {\r
- // supress exception\r
- }\r
- if (catalog != null && catalog.Length == 0)\r
- catalog = ((AbstractDBConnection)_command.Connection).JdbcConnection.getCatalog();\r
- row [(int)SCHEMA_TABLE.BaseCatalogName] = catalog;\r
- row [(int)SCHEMA_TABLE.BaseColumnName] = baseColumnName;\r
-\r
- string schemaName;\r
- string tableName;\r
-\r
- try {\r
- tableName = metaData.getTableName(i);\r
- }\r
- catch {\r
- tableName = null;\r
- }\r
-\r
- try {\r
- schemaName = metaData.getSchemaName(i);\r
- }\r
- catch {\r
- schemaName = null;\r
- }\r
-\r
- if (tableName != null && tableName.Length == 0)\r
- tableName = null;\r
- if (schemaName != null && schemaName.Length == 0)\r
- schemaName = null;\r
-\r
- row [(int)SCHEMA_TABLE.BaseSchemaName] = schemaName;\r
- row [(int)SCHEMA_TABLE.BaseTableName] = tableName;\r
-\r
-\r
- row [(int)SCHEMA_TABLE.AllowDBNull] = Convert.ToBoolean(metaData.isNullable(i));\r
- \r
- InitKeyInfo(row, dbMetaData, catalog, schemaName, tableName);\r
- \r
- row [(int)SCHEMA_TABLE.IsAliased] = columnName != baseColumnName;\r
- row [(int)SCHEMA_TABLE.IsExpression] = false;\r
-\r
- row [(int)SCHEMA_TABLE.IsAutoIncrement] = metaData.isAutoIncrement(i);\r
-\r
- row [(int)SCHEMA_TABLE.IsHidden] = false;\r
- row [(int)SCHEMA_TABLE.IsReadOnly] = metaData.isReadOnly(i);\r
-\r
- SetSchemaType(row, metaData, i);\r
-\r
- SchemaTable.Rows.Add (row);\r
- }\r
- }\r
- catch (SQLException e) { \r
- throw CreateException(e);\r
- }\r
- finally {\r
- if (clonedConnection != null) {\r
- clonedConnection.Close();\r
- }\r
- } \r
- return SchemaTable;\r
- }\r
-\r
- private void InitKeyInfo(DataRow row, DatabaseMetaData dbMetaData, String catalog, String schema, String table) {\r
- string column = (string)row [(int)SCHEMA_TABLE.BaseColumnName];\r
-\r
- row [(int)SCHEMA_TABLE.IsUnique] = false;\r
- row [(int)SCHEMA_TABLE.IsKey] = false;\r
- row [(int)SCHEMA_TABLE.IsIdentity] = false;\r
- row [(int)SCHEMA_TABLE.IsRowVersion] = false;\r
-\r
- if ((_command.Behavior & CommandBehavior.KeyInfo) == 0)\r
- return;\r
-\r
- if(table == null || column == null || dbMetaData == null)\r
- return;\r
-\r
- ResultSet versionCol = dbMetaData.getVersionColumns(catalog, schema, table);\r
- try {\r
- while(versionCol.next()) {\r
- if(versionCol.getString("COLUMN_NAME") == column) {\r
- if (DatabaseMetaData__Finals.versionColumnPseudo == versionCol.getShort("PSEUDO_COLUMN")) {\r
- row [(int)SCHEMA_TABLE.IsIdentity] = true;\r
- row [(int)SCHEMA_TABLE.IsRowVersion] = true;\r
- }\r
- }\r
- }\r
- }\r
- finally {\r
- versionCol.close();\r
- }\r
-\r
- ResultSet primaryKeys = dbMetaData.getPrimaryKeys(catalog,schema,table);\r
- bool primaryKeyExists = false;\r
- int columnCount = 0;\r
- try {\r
- while(primaryKeys.next()) {\r
- columnCount++;\r
- if(primaryKeys.getString("COLUMN_NAME") == column) {\r
- row [(int)SCHEMA_TABLE.IsKey] = true;\r
- primaryKeyExists = true;\r
- }\r
- }\r
- // column constitutes a key by itself, so it should be marked as unique \r
- if ((columnCount == 1) && (((bool)row [(int)SCHEMA_TABLE.IsKey]) == true)) {\r
- row [(int)SCHEMA_TABLE.IsUnique] = true;\r
- }\r
- }\r
- finally {\r
- primaryKeys.close();\r
- }\r
-\r
- ResultSet indexInfoRes = dbMetaData.getIndexInfo(catalog,schema,table,true,false);\r
- string currentIndexName = null;\r
- columnCount = 0;\r
- bool belongsToCurrentIndex = false;\r
- bool atFirstIndex = true;\r
- bool uniqueKeyExists = false;\r
- try {\r
- while(indexInfoRes.next()) {\r
- if (indexInfoRes.getShort("TYPE") == DatabaseMetaData__Finals.tableIndexStatistic) {\r
- // index of type tableIndexStatistic identifies table statistics - ignore it\r
- continue;\r
- }\r
- \r
- uniqueKeyExists = true;\r
- string iname = indexInfoRes.getString("INDEX_NAME");\r
- if (currentIndexName == iname) {\r
- // we're within the rows of the same index \r
- columnCount++;\r
- }\r
- else {\r
- // we jump to row of new index \r
- if (belongsToCurrentIndex && columnCount == 1) {\r
- // there is a constraint of type UNIQUE that applies only to this column\r
- row [(int)SCHEMA_TABLE.IsUnique] = true;\r
- }\r
-\r
- if (currentIndexName != null) {\r
- atFirstIndex = false;\r
- }\r
- currentIndexName = iname;\r
- columnCount = 1;\r
- belongsToCurrentIndex = false;\r
- }\r
-\r
- if(indexInfoRes.getString("COLUMN_NAME") == column) {\r
- // FIXME : this will cause "spare" columns marked as IsKey. Needs future investigation.\r
- // only the first index we met should be marked as a key\r
- //if (atFirstIndex) {\r
- row [(int)SCHEMA_TABLE.IsKey] = true;\r
- //}\r
- belongsToCurrentIndex = true; \r
- }\r
- }\r
- // the column appears in the last index, which is single-column\r
- if (belongsToCurrentIndex && columnCount == 1) {\r
- // there is a constraint of type UNIQUE that applies only to this column\r
- row [(int)SCHEMA_TABLE.IsUnique] = true;\r
- }\r
- }\r
- finally {\r
- indexInfoRes.close();\r
- } \r
-\r
- if(!primaryKeyExists && !uniqueKeyExists) {\r
- ResultSet bestRowId = dbMetaData.getBestRowIdentifier(catalog, schema, table, DatabaseMetaData__Finals.bestRowTemporary, false);\r
- try {\r
- while(bestRowId.next()) {\r
- if(bestRowId.getString("COLUMN_NAME") == column)\r
- row [(int)SCHEMA_TABLE.IsKey] = true;\r
- }\r
- }\r
- finally {\r
- bestRowId.close();\r
- }\r
- }\r
- }\r
-\r
- protected static DataTable ConstructSchemaTable ()\r
- {\r
- Type booleanType = DbTypes.TypeOfBoolean;\r
- Type stringType = DbTypes.TypeOfString;\r
- Type intType = DbTypes.TypeOfInt32;\r
- Type typeType = DbTypes.TypeOfType;\r
- Type shortType = DbTypes.TypeOfInt16;\r
-\r
- DataTable schemaTable = new DataTable ("SchemaTable");\r
- schemaTable.Columns.Add ("ColumnName", stringType);\r
- schemaTable.Columns.Add ("ColumnOrdinal", intType);\r
- schemaTable.Columns.Add ("ColumnSize", intType);\r
- schemaTable.Columns.Add ("NumericPrecision", shortType);\r
- schemaTable.Columns.Add ("NumericScale", shortType);\r
- schemaTable.Columns.Add ("IsUnique", booleanType);\r
- schemaTable.Columns.Add ("IsKey", booleanType);\r
- schemaTable.Columns.Add ("BaseServerName", stringType);\r
- schemaTable.Columns.Add ("BaseCatalogName", stringType);\r
- schemaTable.Columns.Add ("BaseColumnName", stringType);\r
- schemaTable.Columns.Add ("BaseSchemaName", stringType);\r
- schemaTable.Columns.Add ("BaseTableName", stringType);\r
- schemaTable.Columns.Add ("DataType", typeType);\r
- schemaTable.Columns.Add ("AllowDBNull", booleanType);\r
- schemaTable.Columns.Add ("ProviderType", intType);\r
- schemaTable.Columns.Add ("IsAliased", booleanType);\r
- schemaTable.Columns.Add ("IsExpression", booleanType);\r
- schemaTable.Columns.Add ("IsIdentity", booleanType);\r
- schemaTable.Columns.Add ("IsAutoIncrement", booleanType);\r
- schemaTable.Columns.Add ("IsRowVersion", booleanType);\r
- schemaTable.Columns.Add ("IsHidden", booleanType);\r
- schemaTable.Columns.Add ("IsLong", booleanType);\r
- schemaTable.Columns.Add ("IsReadOnly", booleanType);\r
- return schemaTable;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ProviderBase.AbstractDbError\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-\r
-namespace System.Data.ProviderBase {\r
- using java.sql;\r
- using System.Data.Common;\r
-\r
- [Serializable]\r
- public abstract class AbstractDbError {\r
- protected SQLException _e;\r
- string _jdbcProvider;\r
-\r
- protected AbstractDbError(SQLException e, AbstractDBConnection connection) {\r
- _e = e;\r
- if (connection != null)\r
- _jdbcProvider = connection.JdbcProvider;\r
- }\r
- \r
- protected internal String DbMessage {\r
- get {\r
- return _e.Message;\r
- }\r
- }\r
- \r
- protected int DbErrorCode {\r
- get {\r
- return _e.getErrorCode();\r
- }\r
- }\r
- \r
- protected String DbSource {\r
- get {\r
- return _jdbcProvider;\r
- }\r
- }\r
- \r
- protected String DbSQLState {\r
- get {\r
- return _e.getSQLState();\r
- }\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ProviderBase.AbstractDbErrorCollection\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-\r
-namespace System.Data.ProviderBase {\r
-\r
-\r
- using System.Collections;\r
- using java.sql;\r
- using System.Data.Common;\r
-\r
- [Serializable]\r
- public abstract class AbstractDbErrorCollection : ICollection, IEnumerable {\r
- private ArrayList _list;\r
-\r
- protected AbstractDbErrorCollection(SQLException e, AbstractDBConnection connection) {\r
- _list = new ArrayList();\r
-\r
- while(e != null) {\r
- _list.Add(CreateDbError(e, connection));\r
- e = e.getNextException();\r
- }\r
- }\r
-\r
- protected abstract AbstractDbError CreateDbError(SQLException e, AbstractDBConnection connection);\r
- /**\r
- * Gets the error at the specified index.\r
- *\r
- * @param index of the error\r
- * @return Error on specified index\r
- */\r
- protected AbstractDbError GetDbItem(int index) {\r
- return (AbstractDbError)_list[index];\r
- }\r
-\r
- /**\r
- * Adds new Error to the collection\r
- *\r
- * @param value new OleDbError\r
- */\r
- public void Add(object value) {\r
- _list.Add(value);\r
- }\r
- \r
- public int Count {\r
- get {\r
- return _list.Count;\r
- }\r
- }\r
-\r
- public IEnumerator GetEnumerator() {\r
- return _list.GetEnumerator();\r
- }\r
- \r
- public void CopyTo(System.Array arr, int index) {\r
- _list.CopyTo(arr, index);\r
- }\r
-\r
- bool ICollection.IsSynchronized {\r
- get {\r
- return _list.IsSynchronized;\r
- }\r
- }\r
-\r
- Object ICollection.SyncRoot {\r
- get {\r
- return _list.SyncRoot;\r
- }\r
- }\r
- \r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ProviderBase.AbstractDbException\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-\r
-namespace System.Data.ProviderBase {\r
-\r
- using java.sql;\r
- using System.Text;\r
- using System.Data.Common;\r
-\r
- /*\r
- * CURRENT LIMITATIONS\r
- * 1. Constructor for serialization SqlException(SerializationInfo info, StreamingContext sc) \r
- * is not supported.\r
- * 2. Method "void GetObjectData(...,...)" is not supported (serialization)\r
- */\r
-\r
- public abstract class AbstractDbException :\r
-#if NET_2_0\r
- DbException\r
-#else\r
- System.SystemException\r
-#endif\r
- {\r
- protected SQLException _cause;\r
- protected AbstractDBConnection _connection;\r
-\r
- protected AbstractDbException(Exception cause, AbstractDBConnection connection) : base(cause.Message, cause) {\r
- _connection = connection;\r
- }\r
-\r
- protected AbstractDbException(SQLException cause, AbstractDBConnection connection) : this(String.Empty, cause, connection) {}\r
-\r
- protected AbstractDbException(string message, SQLException cause, AbstractDBConnection connection) : base(message, cause) {\r
- _connection = connection;\r
- _cause = cause;\r
- }\r
-\r
- abstract protected AbstractDbErrorCollection DbErrors { get; }\r
-\r
- /**\r
- * Gets the error code of the error.\r
- * @return The error code of the error.\r
- */\r
- protected int DbErrorCode {\r
- get {\r
- return _cause != null ? _cause.getErrorCode() : 0;\r
- }\r
- }\r
-\r
- \r
- /**\r
- * Gets the name of the OLE DB provider that generated the error.\r
- * @return the name of the OLE DB provider that generated the error. \r
- */\r
- public override String Source {\r
- get {\r
- return _connection != null ? _connection.JdbcProvider : null;\r
- }\r
- }\r
-\r
- public override string Message {\r
- get {\r
- StringBuilder sb = new StringBuilder();\r
- string message = base.Message;\r
- bool addNewLine = false;\r
- if (message != null && message.Length > 0) {\r
- sb.Append(message);\r
- addNewLine = true;\r
- }\r
-\r
- foreach (AbstractDbError err in DbErrors) {\r
- if (addNewLine)\r
- sb.Append(Environment.NewLine);\r
-\r
- addNewLine = true;\r
- sb.Append(err.DbMessage);\r
- }\r
- return sb.ToString();\r
- }\r
- }\r
-\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.ProviderBase.AbstractTransaction\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System.Data.Common;\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
-\r
- using java.sql;\r
-\r
- using System.Data;\r
-\r
- public abstract class AbstractTransaction : DbTransaction\r
- {\r
-\r
- protected String _transactionName;\r
- protected AbstractDBConnection _connection;\r
-\r
- protected IsolationLevel _isolationLevel;\r
-\r
- public AbstractTransaction(\r
- IsolationLevel isolationLevel,\r
- AbstractDBConnection connection,\r
- String transactionName)\r
- {\r
- connection.ValidateBeginTransaction();\r
- _transactionName = transactionName;\r
- _connection = connection;\r
- _isolationLevel = isolationLevel;\r
- try\r
- {\r
- _connection.JdbcConnection.setAutoCommit(false);\r
- _connection.JdbcConnection.setTransactionIsolation(\r
- convertIsolationLevel(isolationLevel));\r
- }\r
- catch (SQLException exp)\r
- {\r
- throw new System.InvalidOperationException(exp.Message, exp);\r
- }\r
- }\r
-\r
- \r
- /**\r
- * @see System.Data.IDbTransaction#Connection\r
- */\r
- protected override DbConnection DbConnection\r
- {\r
- get\r
- {\r
- return _connection;\r
- }\r
- }\r
-\r
- /**\r
- * @see System.Data.IDbTransaction#IsolationLevel\r
- */\r
- public override IsolationLevel IsolationLevel\r
- {\r
- get\r
- {\r
- return _isolationLevel;\r
- }\r
- }\r
-\r
- /**\r
- * @see System.Data.IDbTransaction#Commit()\r
- */\r
- public override void Commit()\r
- {\r
- if (_connection == null)\r
- return;\r
-\r
- try\r
- {\r
- _connection.JdbcConnection.commit();\r
- _connection.JdbcConnection.setAutoCommit(true);\r
- _connection = null;\r
- }\r
- catch (SQLException exp)\r
- {\r
- throw new SystemException(exp.Message, exp);\r
- }\r
- }\r
-\r
- /**\r
- * @see System.Data.IDbTransaction#Rollback()\r
- */\r
- public override void Rollback()\r
- {\r
- if (_connection == null)\r
- return;\r
-\r
- try\r
- {\r
- _connection.JdbcConnection.rollback();\r
- _connection.JdbcConnection.setAutoCommit(true);\r
- _connection = null;\r
- }\r
- catch (SQLException exp)\r
- {\r
- throw new SystemException(exp.Message, exp);\r
- }\r
- }\r
-\r
- internal AbstractTransaction ActiveTransaction {\r
- get {\r
- // recoursively return parent transaction when nesting will\r
- // be implemented\r
- return _connection != null ? this : null;\r
- }\r
- }\r
-\r
- private int convertIsolationLevel(IsolationLevel isolationLevel)\r
- {\r
- if (isolationLevel == IsolationLevel.Unspecified)\r
- return vmw.@internal.sql.ConnectionUtils__Finals.TRANSACTION_NONE;\r
- if (isolationLevel == IsolationLevel.ReadCommitted)\r
- return vmw.@internal.sql.ConnectionUtils__Finals.TRANSACTION_READ_COMMITTED;\r
- if (isolationLevel == IsolationLevel.ReadUncommitted)\r
- return vmw.@internal.sql.ConnectionUtils__Finals.TRANSACTION_READ_UNCOMMITTED;\r
- if (isolationLevel == IsolationLevel.RepeatableRead)\r
- return vmw.@internal.sql.ConnectionUtils__Finals.TRANSACTION_REPEATABLE_READ;\r
- if (isolationLevel == IsolationLevel.Serializable)\r
- return vmw.@internal.sql.ConnectionUtils__Finals.TRANSACTION_SERIALIZABLE;\r
-\r
- throw new NotSupportedException("The Isolation level '" + isolationLevel + "' is not supported");\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.Common.DbConvert\r
-//\r
-// Author:\r
-// Boris Kirzner (borisk@mainsoft.com)\r
-//\r
-\r
-using System;\r
-using System.Data.Common;\r
-\r
-using java.io;\r
-using java.sql;\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
- public abstract class DbConvert\r
- {\r
- #region Fields\r
-\r
- const long JAVA_MIN_MILLIS_UTC = -62135769600000L; // java.sql.Timestamp.valueOf("0001-01-01 00:00:00.000000000").getTime() at Greenwich time zone.\r
- static readonly long TIMEZONE_RAW_OFFSET;\r
- // .NET milliseconds value of DateTime(1582,1,1,0,0,0,0).Ticks/TimeSpan.TicksPerMillisecond \r
- const long CLR_MILLIS_1582 = 49891507200000L;\r
- const long MILLIS_PER_TWO_DAYS = 2 * TimeSpan.TicksPerDay / TimeSpan.TicksPerMillisecond; // 172800000L;\r
- internal static readonly java.util.TimeZone DEFAULT_TIME_ZONE;\r
-\r
- #endregion // Fields\r
-\r
- #region java.sql.Types constants\r
-\r
- internal enum JavaSqlTypes {\r
- ARRAY = 2003 ,\r
- BIGINT = -5, \r
- BINARY = -2 ,\r
- BIT = -7 ,\r
- BLOB = 2004, \r
- BOOLEAN = 16, \r
- CHAR = 1, \r
- CLOB = 2005, \r
- DATALINK = 70, \r
- DATE = 91, \r
- DECIMAL = 3, \r
- DISTINCT = 2001, \r
- DOUBLE = 8, \r
- FLOAT = 6, \r
- INTEGER = 4, \r
- JAVA_OBJECT = 2000, \r
- LONGVARBINARY = -4,\r
- LONGVARCHAR = -1, \r
- NULL = 0, \r
- NUMERIC = 2 ,\r
- OTHER = 1111 ,\r
- REAL = 7 ,\r
- REF = 2006 ,\r
- SMALLINT = 5,\r
- STRUCT = 2002, \r
- TIME = 92, \r
- TIMESTAMP = 93, \r
- TINYINT = -6, \r
- VARBINARY = -3, \r
- VARCHAR = 12,\r
- // NOTSET = int.MinValue\r
- }\r
-\r
-\r
- #endregion // java.sql.Types constants\r
-\r
- #region Methods\r
-\r
- static DbConvert()\r
- {\r
- DEFAULT_TIME_ZONE = java.util.SimpleTimeZone.getDefault(); \r
- TIMEZONE_RAW_OFFSET = (long)DEFAULT_TIME_ZONE.getRawOffset(); \r
- }\r
-\r
- // The diff between .Net and Java goes as the following:\r
- // * at 1582: java has 10 days less than .net\r
- // * below 1500 (exept 1200,800,400) : each 100'th year java adds 1 day over .net. \r
- // Current implementation compatible with .net in 1-99 and since 1582. In 100-1582 we're not compatible with .Ner nor with Java\r
-\r
- internal static long JavaMillisToClrMillis(long javaMillis)\r
- {\r
- return JavaMillisToClrMillisUTC(javaMillis) + TIMEZONE_RAW_OFFSET;\r
- }\r
-\r
- internal static long JavaMillisToClrMillisUTC(long javaMillis) {\r
- long clrMillis = javaMillis - JAVA_MIN_MILLIS_UTC;\r
- if (clrMillis > CLR_MILLIS_1582) {\r
- clrMillis -= MILLIS_PER_TWO_DAYS;\r
- }\r
- return clrMillis;\r
- }\r
-\r
- internal static long ClrMillisToJavaMillis(long clrMillis)\r
- {\r
- return ClrMillisToJavaMillisUTC(clrMillis) - TIMEZONE_RAW_OFFSET;\r
- }\r
-\r
- internal static long ClrMillisToJavaMillisUTC(long clrMillis) {\r
- long javaMillis = clrMillis + JAVA_MIN_MILLIS_UTC;\r
- if (clrMillis > CLR_MILLIS_1582) {\r
- javaMillis += MILLIS_PER_TWO_DAYS;\r
- }\r
- return javaMillis;\r
- }\r
-\r
- internal static java.sql.Time ClrTicksToJavaTime(long ticks) {\r
- return new Time((ticks / TimeSpan.TicksPerMillisecond)\r
- - DEFAULT_TIME_ZONE.getRawOffset());\r
- }\r
-\r
- internal static java.sql.Date ClrTicksToJavaDate(long ticks) {\r
- java.sql.Date d = new java.sql.Date(0);\r
- ClrTicksToJavaDate(d, ticks);\r
- return d;\r
- }\r
-\r
- internal static java.sql.Timestamp ClrTicksToJavaTimestamp(long ticks)\r
- {\r
- java.sql.Timestamp ts = new java.sql.Timestamp(0);\r
- ClrTicksToJavaDate(ts, ticks);\r
-\r
-// int nanos = (int)(ticks % TimeSpan.TicksPerMillisecond) * 100;\r
-// ts.setNanos(javaTimestamp.getNanos() + nanos);\r
-\r
- return ts;\r
- }\r
-\r
- internal static void ClrTicksToJavaDate(java.util.Date d, long ticks) {\r
- long millis = ClrMillisToJavaMillis(ticks / TimeSpan.TicksPerMillisecond);\r
-\r
- d.setTime(millis);\r
- if (DEFAULT_TIME_ZONE.inDaylightTime(d)) {\r
- millis -= DEFAULT_TIME_ZONE.getDSTSavings();\r
- d.setTime(millis);\r
- }\r
- }\r
- \r
- internal static long JavaTimestampToClrTicks(java.sql.Timestamp ts)\r
- {\r
- long ticks = JavaDateToClrTicks(ts);\r
- // Extra ticks, for dbs that can save them. \r
- // We do not use it, since .net does not saves ticks for fractial milliseconds\r
- // long ticksLessThanMilliseconds = (ts.getNanos()*100) % TimeSpan.TicksPerMillisecond;\r
- // ticks += ticksLessThanMilliseconds;\r
- \r
- return ticks;\r
- }\r
-\r
- internal static long JavaDateToClrTicks(java.util.Date d) {\r
- long millis = JavaMillisToClrMillis(d.getTime());\r
- if (DEFAULT_TIME_ZONE.inDaylightTime(d)) {\r
- millis += DEFAULT_TIME_ZONE.getDSTSavings();\r
- }\r
- return millis * TimeSpan.TicksPerMillisecond;\r
- }\r
-\r
- internal static long JavaTimeToClrTicks(java.sql.Time t) {\r
- return (t.getTime() + DEFAULT_TIME_ZONE.getRawOffset())\r
- * TimeSpan.TicksPerMillisecond;\r
- }\r
-\r
- internal static Type JavaSqlTypeToClrType(int sqlTypeValue)\r
- {\r
- JavaSqlTypes sqlType = (JavaSqlTypes)sqlTypeValue;\r
-\r
- switch (sqlType) {\r
- case JavaSqlTypes.ARRAY : return typeof (java.sql.Array);\r
- case JavaSqlTypes.BIGINT : return DbTypes.TypeOfInt64;\r
- case JavaSqlTypes.BINARY : return DbTypes.TypeOfByteArray;\r
- case JavaSqlTypes.BIT : return DbTypes.TypeOfBoolean;\r
- case JavaSqlTypes.BLOB : return DbTypes.TypeOfByteArray;\r
- case JavaSqlTypes.BOOLEAN : return DbTypes.TypeOfBoolean;\r
- case JavaSqlTypes.CHAR : return DbTypes.TypeOfString;\r
- case JavaSqlTypes.CLOB : return DbTypes.TypeOfString;\r
-// case JavaSqlTypes.DATALINK :\r
- case JavaSqlTypes.DATE : return DbTypes.TypeOfDateTime;\r
- case JavaSqlTypes.DECIMAL : return DbTypes.TypeOfDecimal;\r
-// case JavaSqlTypes.DISTINCT :\r
- case JavaSqlTypes.DOUBLE : return DbTypes.TypeOfDouble;\r
- case JavaSqlTypes.FLOAT : return DbTypes.TypeOfDouble;\r
- case JavaSqlTypes.INTEGER : return DbTypes.TypeOfInt32;\r
-// case JavaSqlTypes.JAVA_OBJECT :\r
- case JavaSqlTypes.LONGVARBINARY : return DbTypes.TypeOfByteArray;\r
- case JavaSqlTypes.LONGVARCHAR : return DbTypes.TypeOfString;\r
- case JavaSqlTypes.NULL : return null;\r
- case JavaSqlTypes.NUMERIC : return DbTypes.TypeOfDecimal;\r
-// case JavaSqlTypes.OTHER :\r
- case JavaSqlTypes.REAL : return DbTypes.TypeOfSingle;\r
- case JavaSqlTypes.REF : return typeof (java.sql.Ref);\r
- case JavaSqlTypes.SMALLINT : return DbTypes.TypeOfInt16;\r
- case JavaSqlTypes.STRUCT : return typeof (java.sql.Struct);\r
- case JavaSqlTypes.TIME : return DbTypes.TypeOfTimespan;\r
- case JavaSqlTypes.TIMESTAMP : return DbTypes.TypeOfDateTime;\r
- case JavaSqlTypes.TINYINT : return DbTypes.TypeOfByte;\r
- case JavaSqlTypes.VARBINARY : return DbTypes.TypeOfByteArray;\r
- case JavaSqlTypes.VARCHAR : return DbTypes.TypeOfString;\r
- default : return DbTypes.TypeOfObject;\r
- }\r
-\r
- }\r
-\r
-\r
- internal static object JavaResultSetToClrWrapper(CallableStatement results,int columnIndex,JavaSqlTypes javaSqlType,int maxLength ,ResultSetMetaData resultsMetaData)\r
- {\r
- object returnValue = null; \r
- sbyte[] sbyteArray;\r
- long milliseconds;\r
- long ticks;\r
- string s;\r
- columnIndex++; //jdbc style\r
- switch (javaSqlType) {\r
- case JavaSqlTypes.ARRAY :\r
- returnValue = results.getArray(columnIndex);\r
- break;\r
- case JavaSqlTypes.BIGINT :\r
- returnValue = results.getLong(columnIndex);\r
- break;\r
- case JavaSqlTypes.BINARY :\r
- case JavaSqlTypes.VARBINARY :\r
- case JavaSqlTypes.LONGVARBINARY :\r
- // FIXME : comsider using maxLength\r
- sbyteArray = results.getBytes(columnIndex);\r
- if (sbyteArray != null) {\r
- returnValue = vmw.common.TypeUtils.ToByteArray(sbyteArray);\r
- }\r
- break;\r
- case JavaSqlTypes.BIT :\r
- returnValue = results.getBoolean(columnIndex);\r
- break;\r
- case JavaSqlTypes.BLOB :\r
- // FIXME : comsider using maxLength\r
- java.sql.Blob blob = results.getBlob(columnIndex);\r
- if (blob != null) {\r
- InputStream input = blob.getBinaryStream(); \r
- if (input == null) {\r
- returnValue = new byte[0];\r
- }\r
- else {\r
- long length = blob.length();\r
- byte[] byteValue = new byte[length];\r
- sbyte[] sbyteValue = vmw.common.TypeUtils.ToSByteArray(byteValue);\r
- input.read(sbyteValue);\r
- returnValue = byteValue;\r
- }\r
- }\r
- break; \r
- case JavaSqlTypes.CHAR : \r
- if (resultsMetaData != null && "uniqueidentifier".Equals(resultsMetaData.getColumnTypeName(columnIndex))) {\r
- returnValue = new Guid(results.getString(columnIndex));\r
- }\r
- else {\r
- // Oracle Jdbc driver returns extra trailing 0 chars for NCHAR columns, so we threat this at parameter.Size level\r
- s = results.getString(columnIndex);\r
- if ((s != null) && (maxLength < s.Length)) {\r
- s = s.Substring(0,maxLength);\r
- }\r
- returnValue = s;\r
- }\r
- break;\r
- case JavaSqlTypes.CLOB :\r
- // FIXME : comsider using maxLength\r
- java.sql.Clob clob = results.getClob(columnIndex);\r
- if (clob != null) {\r
- java.io.Reader reader = clob.getCharacterStream(); \r
- if (reader == null) {\r
- returnValue = String.Empty;\r
- }\r
- else {\r
- long length = clob.length();\r
- char[] charValue = new char[length];\r
- reader.read(charValue);\r
- returnValue = new string(charValue);\r
- }\r
- }\r
- break; \r
- case JavaSqlTypes.TIME :\r
- Time t = results.getTime(columnIndex);\r
- if (t != null) {\r
- returnValue = new TimeSpan(JavaTimeToClrTicks(t));\r
- }\r
- break; \r
- case JavaSqlTypes.DATE :\r
- Date d = results.getDate(columnIndex);\r
- if (d != null) {\r
- returnValue = new DateTime(JavaDateToClrTicks(d));\r
- }\r
- break;\r
- case JavaSqlTypes.TIMESTAMP : \r
- Timestamp ts = results.getTimestamp(columnIndex);\r
- if (ts != null) {\r
- returnValue = new DateTime(JavaTimestampToClrTicks(ts));\r
- }\r
- break; \r
- case JavaSqlTypes.DECIMAL :\r
- case JavaSqlTypes.NUMERIC :\r
- // java.sql.Types.NUMERIC (2), columnTypeName NUMBER, columnClassName java.math.BigDecimal \r
- // therefore we rely on scale\r
- if (resultsMetaData != null && resultsMetaData.getScale(columnIndex) == -127) {\r
- // Oracle db type FLOAT\r
- returnValue = results.getDouble(columnIndex);\r
- }\r
- else {\r
- java.math.BigDecimal bigDecimal = results.getBigDecimal(columnIndex);\r
- if (bigDecimal != null) {\r
- returnValue = vmw.common.PrimitiveTypeUtils.BigDecimalToDecimal(bigDecimal);\r
- }\r
- }\r
- break; \r
- case JavaSqlTypes.DISTINCT :\r
- returnValue = results.getObject(columnIndex);\r
- break;\r
- case JavaSqlTypes.DOUBLE :\r
- returnValue = results.getDouble(columnIndex);\r
- break;\r
- case JavaSqlTypes.FLOAT :\r
- //float f = results.getFloat(columnIndex);\r
- returnValue = results.getDouble(columnIndex);\r
- break;\r
- case JavaSqlTypes.INTEGER :\r
- returnValue = results.getInt(columnIndex);\r
- break;\r
- case JavaSqlTypes.JAVA_OBJECT :\r
- returnValue = results.getObject(columnIndex);\r
- break;\r
- case JavaSqlTypes.LONGVARCHAR :\r
- returnValue = results.getString(columnIndex);\r
- break;\r
- case JavaSqlTypes.NULL :\r
- returnValue = DBNull.Value;\r
- break;\r
- case JavaSqlTypes.OTHER :\r
- returnValue = results.getObject(columnIndex);\r
- break;\r
- case JavaSqlTypes.REAL :\r
- returnValue = results.getFloat(columnIndex);\r
- break;\r
- case JavaSqlTypes.REF :\r
- returnValue = results.getRef(columnIndex);\r
- break;\r
- case JavaSqlTypes.SMALLINT :\r
- returnValue = results.getShort(columnIndex);\r
- break;\r
- case JavaSqlTypes.STRUCT :\r
- returnValue = results.getObject(columnIndex);\r
- break;\r
- case JavaSqlTypes.TINYINT :\r
- returnValue = Convert.ToByte(results.getByte(columnIndex));\r
- break;\r
- case JavaSqlTypes.VARCHAR :\r
- s = results.getString(columnIndex);\r
- if ((s != null) && (maxLength < s.Length)) {\r
- s = s.Substring(0,maxLength);\r
- }\r
- returnValue = s;\r
- break;\r
- default :\r
- returnValue = results.getObject(columnIndex);\r
- break;\r
- }\r
- \r
- if (results.wasNull() || results == null) {\r
- return DBNull.Value;\r
- } \r
- return returnValue;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-//\r
-// System.Data.ProviderBase.ParameterMetaDataWrapper\r
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.
-//\r
-\r
-using System;\r
-\r
-using java.sql;\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
- public class ParameterMetadataWrapper : java.sql.ResultSetMetaData\r
- {\r
- #region Fields \r
-\r
- ParameterMetaData _parameterMetaData;\r
-\r
- #endregion // Fields\r
-\r
- #region Constructors\r
-\r
- public ParameterMetadataWrapper(ParameterMetaData parameterMetaData)\r
- {\r
- _parameterMetaData = parameterMetaData;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- public int getColumnCount() { throw new NotImplementedException(); }\r
-\r
- public int getColumnDisplaySize(int i) { throw new NotImplementedException(); }\r
-\r
- public int getColumnType(int i) { throw new NotImplementedException(); }\r
-\r
- public int getPrecision(int i) { throw new NotImplementedException(); }\r
-\r
- public int getScale(int i) { throw new NotImplementedException(); }\r
-\r
- public int isNullable(int i) { throw new NotImplementedException(); }\r
-\r
- public bool isAutoIncrement(int i) { throw new NotImplementedException(); }\r
-\r
- public bool isCaseSensitive(int i) { throw new NotImplementedException(); }\r
-\r
- public bool isCurrency(int i) { throw new NotImplementedException(); }\r
-\r
- public bool isDefinitelyWritable(int i) { throw new NotImplementedException(); }\r
-\r
- public bool isReadOnly(int i) { throw new NotImplementedException(); }\r
-\r
- public bool isSearchable(int i) { throw new NotImplementedException(); }\r
-\r
- public bool isSigned(int i) { throw new NotImplementedException(); }\r
-\r
- public bool isWritable(int i) { throw new NotImplementedException(); }\r
-\r
- public String getCatalogName(int i) { throw new NotImplementedException(); }\r
-\r
- public String getColumnClassName(int i) { throw new NotImplementedException(); }\r
-\r
- public String getColumnLabel(int i) { throw new NotImplementedException(); }\r
-\r
- public String getColumnName(int i) { throw new NotImplementedException(); }\r
-\r
- public String getColumnTypeName(int i) { return _parameterMetaData.getParameterTypeName(i); }\r
-\r
- public String getSchemaName(int i) { throw new NotImplementedException(); }\r
-\r
- public String getTableName(int i) { throw new NotImplementedException(); }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-//\r
-// System.Data.ProviderBase.ReaderCache.cs\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using java.sql;\r
-\r
-namespace System.Data.ProviderBase\r
-{\r
- public interface IReaderCacheContainer\r
- {\r
- void Fetch(ResultSet rs, int columnIndex, bool isSequential);\r
- bool IsNull();\r
- bool IsNumeric();\r
- object GetValue();\r
- }\r
-\r
- public abstract class ReaderCacheContainerBase : IReaderCacheContainer\r
- {\r
- #region Fields\r
-\r
- bool _isNull;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected abstract void FetchInternal(ResultSet rs, int columnIndex);\r
- protected virtual void FetchInternal(ResultSet rs, int columnIndex, bool isSequential) {\r
- FetchInternal(rs, columnIndex);\r
- }\r
-\r
- public virtual bool IsNumeric() {\r
- return false;\r
- }\r
-\r
- public abstract object GetValue(); \r
-\r
- public void Fetch(ResultSet rs, int columnIndex, bool isSequential)\r
- {\r
- FetchInternal(rs, columnIndex + 1, isSequential);\r
- _isNull = rs.wasNull();\r
- }\r
-\r
- public bool IsNull()\r
- {\r
- return _isNull;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class ArrayReaderCacheContainer : ReaderCacheContainerBase // Types.ARRAY\r
- {\r
- #region Fields\r
-\r
- object _a;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _a = rs.getArray(columnIndex).getArray();\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _a;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class Int64ReaderCacheContainer : ReaderCacheContainerBase // Types.BIGINT\r
- {\r
- #region Fields\r
- \r
- long _l;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _l = rs.getLong(columnIndex);\r
- }\r
-\r
- public override bool IsNumeric() {\r
- return true;\r
- }\r
-\r
-\r
- public override object GetValue()\r
- {\r
- return _l;\r
- }\r
-\r
- internal long GetInt64()\r
- {\r
- return _l;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal class BytesReaderCacheContainer : ReaderCacheContainerBase // Types.BINARY, Types.VARBINARY, Types.LONGVARBINARY\r
- {\r
- #region Fields\r
-\r
- protected byte[] _b;\r
- \r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- sbyte[] sbyteArray = rs.getBytes(columnIndex);\r
- if (sbyteArray != null) {\r
- _b = (byte[])vmw.common.TypeUtils.ToByteArray(sbyteArray);\r
- }\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _b;\r
- }\r
-\r
- internal byte[] GetBytes()\r
- {\r
- return (byte[])GetValue();\r
- }\r
-\r
- internal virtual long GetBytes(\r
- long dataIndex,\r
- byte[] buffer,\r
- int bufferIndex,\r
- int length) {\r
- if (_b == null)\r
- return 0;\r
- if (buffer == null)\r
- return _b.LongLength;\r
- long actualLength = ((dataIndex + length) >= _b.LongLength) ? (_b.LongLength - dataIndex) : length;\r
- Array.Copy(_b,dataIndex,buffer,bufferIndex,actualLength);\r
- return actualLength;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class BooleanReaderCacheContainer : ReaderCacheContainerBase // Types.BIT\r
- {\r
- #region Fields\r
- \r
- bool _b;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _b = rs.getBoolean(columnIndex);\r
- }\r
-\r
- public override bool IsNumeric() {\r
- return true;\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _b;\r
- }\r
-\r
- internal bool GetBoolean()\r
- {\r
- return _b;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class BlobReaderCacheContainer : BytesReaderCacheContainer // Types.BLOB\r
- {\r
- #region Fields\r
-\r
- static readonly byte[] _emptyByteArr = new byte[0];\r
- java.sql.Blob _blob;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex) {\r
- throw new NotImplementedException("Should not be called");\r
- }\r
-\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex, bool isSequential)\r
- {\r
- _blob = rs.getBlob(columnIndex);\r
- if (!isSequential)\r
- ReadAll();\r
- \r
- }\r
-\r
- void ReadAll() {\r
- if (_blob != null) {\r
- long length = _blob.length(); \r
- if (length == 0) {\r
- _b = _emptyByteArr;\r
- }\r
- else { \r
- java.io.InputStream input = _blob.getBinaryStream(); \r
- byte[] byteValue = new byte[length];\r
- sbyte[] sbyteValue = vmw.common.TypeUtils.ToSByteArray(byteValue);\r
- input.read(sbyteValue);\r
- _b = byteValue;\r
- }\r
- }\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- if (_b == null)\r
- ReadAll();\r
- return base.GetValue();\r
- }\r
-\r
- internal override long GetBytes(long dataIndex, byte[] buffer, int bufferIndex, int length) {\r
- if (_b != null)\r
- return base.GetBytes (dataIndex, buffer, bufferIndex, length);\r
-\r
- if (_blob == null)\r
- return 0;\r
-\r
- if (buffer == null)\r
- return _blob.length();\r
-\r
- java.io.InputStream input = _blob.getBinaryStream();\r
- input.skip(dataIndex);\r
- return input.read(vmw.common.TypeUtils.ToSByteArray(buffer), bufferIndex, length);\r
- }\r
-\r
-\r
- #endregion // Methods\r
- }\r
- \r
-\r
- internal abstract class CharsReaderCacheContainer : ReaderCacheContainerBase // \r
- {\r
- #region Fields\r
- \r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- internal abstract long GetChars(\r
- long dataIndex,\r
- char[] buffer,\r
- int bufferIndex,\r
- int length);\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class GuidReaderCacheContainer : ReaderCacheContainerBase // Types.CHAR\r
- {\r
- #region Fields\r
- \r
- Guid _g;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- string s = rs.getString(columnIndex);\r
- if (s != null)\r
- _g = new Guid(s);\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _g;\r
- }\r
-\r
- internal Guid GetGuid()\r
- {\r
- return _g;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class ClobReaderCacheContainer : StringReaderCacheContainer // Types.CLOB\r
- {\r
- #region Fields\r
- \r
- java.sql.Clob _clob;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex, bool isSequential)\r
- {\r
- _clob = rs.getClob(columnIndex);\r
- if (!isSequential)\r
- ReadAll();\r
- \r
- }\r
-\r
- void ReadAll() {\r
- if (_clob != null) {\r
- long length = _clob.length(); \r
- if (length == 0) {\r
- _s = String.Empty;\r
- }\r
- else { \r
- java.io.Reader reader = _clob.getCharacterStream(); \r
- char[] charValue = new char[length];\r
- reader.read(charValue);\r
- if (charValue != null)\r
- _s = new String(charValue);\r
- }\r
- }\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- if (_s == null)\r
- ReadAll();\r
- return base.GetValue();\r
- }\r
-\r
- internal override long GetChars(long dataIndex, char[] buffer, int bufferIndex, int length) {\r
- if (_s != null)\r
- return base.GetChars (dataIndex, buffer, bufferIndex, length);\r
-\r
- if (_clob == null)\r
- return 0;\r
-\r
- if (buffer == null)\r
- return _clob.length();\r
-\r
- java.io.Reader reader = _clob.getCharacterStream();\r
- reader.skip(dataIndex);\r
- return reader.read(buffer, bufferIndex, length);\r
- }\r
-\r
-\r
- #endregion // Methods\r
- }\r
- \r
-\r
- internal sealed class TimeSpanReaderCacheContainer : ReaderCacheContainerBase // Types.TIME\r
- {\r
- #region Fields\r
- \r
- TimeSpan _t;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- Time t = rs.getTime(columnIndex);\r
- if (t != null) { \r
- _t = new TimeSpan(DbConvert.JavaTimeToClrTicks(t));\r
- }\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _t;\r
- }\r
-\r
- internal TimeSpan GetTimeSpan()\r
- {\r
- return _t;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal class DateTimeReaderCacheContainer : ReaderCacheContainerBase // Types.TIMESTAMP\r
- {\r
- #region Fields\r
- \r
- protected DateTime _d;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- Date d = rs.getDate(columnIndex);\r
- if (d != null) {\r
- _d = new DateTime(DbConvert.JavaDateToClrTicks(d));\r
- }\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _d;\r
- }\r
-\r
- internal DateTime GetDateTime()\r
- {\r
- return _d;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
- internal sealed class TimestampReaderCacheContainer : DateTimeReaderCacheContainer // Types.DATE\r
- {\r
- protected override void FetchInternal(ResultSet rs, int columnIndex) {\r
- Timestamp ts = rs.getTimestamp(columnIndex);\r
- if (ts != null) {\r
- _d = new DateTime(DbConvert.JavaTimestampToClrTicks(ts));\r
- }\r
- }\r
- }\r
-\r
-\r
- internal sealed class DecimalReaderCacheContainer : ReaderCacheContainerBase // Types.DECIMAL, Types.NUMERIC\r
- {\r
- #region Fields\r
- \r
- decimal _d;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- java.math.BigDecimal bigDecimal = rs.getBigDecimal(columnIndex);\r
- if (bigDecimal != null) {\r
- _d = (decimal)vmw.common.PrimitiveTypeUtils.BigDecimalToDecimal(bigDecimal);\r
- }\r
- }\r
-\r
- public override bool IsNumeric() {\r
- return true;\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _d;\r
- }\r
-\r
- internal decimal GetDecimal()\r
- {\r
- return _d;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class DoubleReaderCacheContainer : ReaderCacheContainerBase // Types.DOUBLE, Types.Float, Types.NUMERIC for Oracle with scale = -127\r
- {\r
- #region Fields\r
- \r
- double _d;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _d = rs.getDouble(columnIndex);\r
- }\r
-\r
- public override bool IsNumeric() {\r
- return true;\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _d;\r
- }\r
-\r
- internal double GetDouble()\r
- {\r
- return _d;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class Int32ReaderCacheContainer : ReaderCacheContainerBase // Types.INTEGER\r
- {\r
- #region Fields\r
- \r
- int _i;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _i = rs.getInt(columnIndex);\r
- }\r
-\r
- public override bool IsNumeric() {\r
- return true;\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _i;\r
- }\r
-\r
- internal int GetInt32()\r
- {\r
- return _i;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal class StringReaderCacheContainer : CharsReaderCacheContainer // Types.LONGVARCHAR, Types.VARCHAR, Types.CHAR\r
- {\r
- #region Fields\r
- \r
- protected string _s;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _s = rs.getString(columnIndex);\r
- // Oracle Jdbc driver returns extra trailing 0 chars for NCHAR columns\r
-// if ((_s != null) && (_jdbcType == 1)) { \r
-// Console.WriteLine(_jdbcType);\r
-// int zeroIndex = ((string)_s).IndexOf((char)0);\r
-// if (zeroIndex > 0) {\r
-// Console.WriteLine("zero-padded");\r
-// _s = ((string)_s).Substring(0,zeroIndex);\r
-// }\r
-// else {\r
-// // Oracle sometimes pads with blanks (32)\r
-// int blankIndex = ((string)_s).IndexOf((char)32);\r
-// if (blankIndex > 0) {\r
-// Console.WriteLine("blank-padded");\r
-// _s = ((string)_s).Substring(0,blankIndex);\r
-// }\r
-// }\r
-// }\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _s;\r
- }\r
-\r
- internal string GetString()\r
- {\r
- return _s;\r
- }\r
- \r
- internal override long GetChars(long dataIndex, char[] buffer, int bufferIndex, int length) {\r
- if (_s == null)\r
- return 0;\r
- if (buffer == null)\r
- return _s.Length;\r
- int actualLength = ((dataIndex + length) >= _s.Length) ? (_s.Length - (int)dataIndex) : length;\r
- _s.CopyTo((int)dataIndex, buffer, bufferIndex, actualLength);\r
- return actualLength;\r
- }\r
-\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class NullReaderCacheContainer : ReaderCacheContainerBase // Types.NULL\r
- {\r
- #region Fields\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return DBNull.Value;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class FloatReaderCacheContainer : ReaderCacheContainerBase // Types.REAL\r
- {\r
- #region Fields\r
- \r
- float _f;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _f = rs.getFloat(columnIndex);\r
- }\r
-\r
- public override bool IsNumeric() {\r
- return true;\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _f;\r
- }\r
-\r
- internal float GetFloat()\r
- {\r
- return _f;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class RefReaderCacheContainer : ReaderCacheContainerBase // Types.REF\r
- {\r
- #region Fields\r
- \r
- java.sql.Ref _r;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _r = rs.getRef(columnIndex);\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _r;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class Int16ReaderCacheContainer : ReaderCacheContainerBase // Types.SMALLINT\r
- {\r
- #region Fields\r
- \r
- short _s;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _s = rs.getShort(columnIndex);\r
- }\r
-\r
- public override bool IsNumeric() {\r
- return true;\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _s;\r
- }\r
-\r
- internal short GetInt16()\r
- {\r
- return _s;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class ByteReaderCacheContainer : ReaderCacheContainerBase // Types.TINYINT\r
- {\r
- #region Fields\r
- \r
- byte _b;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- _b = (byte)rs.getByte(columnIndex);\r
- }\r
-\r
- public override bool IsNumeric() {\r
- return true;\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return _b;\r
- }\r
-\r
- internal byte GetByte()\r
- {\r
- return _b;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-\r
- internal sealed class ObjectReaderCacheContainer : ReaderCacheContainerBase // Types.Distinct, Types.JAVA_OBJECT, Types.OTHER, Types.STRUCT\r
- {\r
- #region Fields\r
- \r
- object o;\r
-\r
- #endregion // Fields\r
-\r
- #region Methods\r
-\r
- protected override void FetchInternal(ResultSet rs, int columnIndex)\r
- {\r
- o = rs.getObject(columnIndex);\r
- }\r
-\r
- public override object GetValue()\r
- {\r
- return o;\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-\r
-}\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Data.Common;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.Data.Common;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Data.Common;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
using System.Collections;
using System.Data.Common;
+++ /dev/null
-//
-// System.Data.SqlClient.SqlCommand
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Data;
-using System.Data.Common;
-using System.Data.ProviderBase;
-using System.Xml;
-
-using java.sql;
-
-namespace System.Data.SqlClient
-{
- public sealed class SqlCommand : AbstractDbCommand
- {
- #region Fields
-
- #endregion // Fields
-
- #region Constructors
-
- // Initializes a new instance of the SqlCommand class.
- // The base constructor initializes all fields to their default values.
- // The following table shows initial property values for an instance of SqlCommand.
- public SqlCommand() : this(null, null, null)
- {
- }
-
- public SqlCommand(SqlConnection connection) : this(null, connection, null)
- {
- }
-
- // Initializes a new instance of the SqlCommand class with the text of the query.
- public SqlCommand(String cmdText) : this(cmdText, null, null)
- {
- }
-
- // Initializes a new instance of the SqlCommand class with the text of the query and a SqlConnection.
- public SqlCommand(String cmdText, SqlConnection connection) : this(cmdText, connection, null)
- {
- }
-
- // Initializes a new instance of the SqlCommand class with the text of the query, a SqlConnection, and the Transaction.
- public SqlCommand(
- String cmdText,
- SqlConnection connection,
- SqlTransaction transaction)
- : base(cmdText, connection, transaction)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- protected override string InternalCommandText {
- get {
- string commandText = CommandText;
- if (CommandType != CommandType.StoredProcedure ||
- string.IsNullOrEmpty (commandText) ||
- commandText [0] == '[' ||
- commandText.IndexOf ('.') >= 0)
- return commandText;
-
- string trimmedCommandText = commandText.TrimEnd ();
- if (trimmedCommandText.Length > 0 && trimmedCommandText [trimmedCommandText.Length - 1] != ')')
- commandText = String.Concat ("[", commandText, "]");
-
- return commandText;
- }
- }
-
- public new SqlConnection Connection
- {
- get { return (SqlConnection)base.Connection; }
- set { base.Connection = value; }
- }
-
- public new SqlParameterCollection Parameters
- {
- get {
- return (SqlParameterCollection)base.Parameters;
- }
- }
-
- public new SqlTransaction Transaction
- {
- get { return (SqlTransaction)base.Transaction; }
- set { base.Transaction = value; }
- }
-
-#if USE_DOTNET_REGEX
- protected override Regex StoredProcedureRegExp
-#else
- protected override java.util.regex.Pattern StoredProcedureRegExp {
-#endif
- get { return SqlStatementsHelper.NamedParameterStoredProcedureRegExp; }
- }
-
- protected override SimpleRegex ParameterRegExp
- {
- get { return SqlStatementsHelper.NamedParameterRegExp; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public XmlReader ExecuteXmlReader() {
- return SqlXmlTextReader.Create(ExecuteReader(CommandBehavior.SequentialAccess));
- }
-
- public new SqlDataReader ExecuteReader()
- {
- return (SqlDataReader)ExecuteReader(CommandBehavior.Default);
- }
-
- public new SqlDataReader ExecuteReader(CommandBehavior behavior)
- {
- return (SqlDataReader)base.ExecuteReader(behavior);
- }
-
- public new SqlParameter CreateParameter()
- {
- return (SqlParameter)CreateParameterInternal();
- }
-
- protected sealed override void CheckParameters()
- {
- // do nothing
- }
-
- protected override AbstractDbParameter GetUserParameter(string parameterName, IList userParametersList, int userParametersListPosition/*,int userParametersListStart,int userParameterListCount*/)
- {
-// Match match = SqlStatementsHelper.NamedParameterRegExp.Match(parameterName);
-// parameterName = match.Result("${USERPARAM}");
-// if (parameterName.Length == 0)
-// return null;
-
- for(int i=0; i < userParametersList.Count; i++) {
- AbstractDbParameter userParameter = (AbstractDbParameter)userParametersList[i];
- if (String.Compare(parameterName, userParameter.Placeholder.Trim(), true, System.Globalization.CultureInfo.InvariantCulture) == 0) {
- return userParameter;
- }
- }
-
- return null;
- }
-
- protected override AbstractDbParameter GetReturnParameter (IList userParametersList)
- {
- for(int i=0; i < userParametersList.Count; i++) {
- AbstractDbParameter userParameter = (AbstractDbParameter)userParametersList[i];
- if (userParameter.Direction == ParameterDirection.ReturnValue) {
- return userParameter;
- }
- }
-
- return null;
- }
-
- protected sealed override DbParameter CreateParameterInternal()
- {
- return new SqlParameter();
- }
-
- protected sealed override DbDataReader CreateReader()
- {
- return new SqlDataReader(this);
- }
-
- protected sealed override DbParameterCollection CreateParameterCollection(AbstractDbCommand parent)
- {
- return new SqlParameterCollection((SqlCommand)parent);
- }
-
- protected internal sealed override SystemException CreateException(SQLException e)
- {
- return new SqlException(e, Connection);
- }
-
- #region Asynchronous behavior
-#if NET_2_0
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public IAsyncResult BeginExecuteReader ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public IAsyncResult BeginExecuteReader (CommandBehavior behavior)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public IAsyncResult BeginExecuteReader (AsyncCallback callback, Object stateObject)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public IAsyncResult BeginExecuteReader (AsyncCallback callback, Object stateObject, CommandBehavior behavior)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public SqlDataReader EndExecuteReader (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public IAsyncResult BeginExecuteXmlReader ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public IAsyncResult BeginExecuteXmlReader (AsyncCallback callback, Object stateObject)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public XmlReader EndExecuteXmlReader (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public IAsyncResult BeginExecuteNonQuery ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public IAsyncResult BeginExecuteNonQuery (AsyncCallback callback, Object stateObject)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Asynchronous behavior not implemented")]
- public int EndExecuteNonQuery (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
-#endif
- #endregion
- #endregion // Methods
- }
-}
+++ /dev/null
-//
-// System.Data.SqlClient.SqlConnection
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Data;
-using System.Data.Common;
-using System.Collections;
-using System.Data.ProviderBase;
-
-using java.sql;
-
-using System.Configuration;
-using Mainsoft.Data.Configuration;
-using Mainsoft.Data.Jdbc.Providers;
-
-namespace System.Data.SqlClient
-{
- public class SqlConnection : AbstractDBConnection
- {
- #region Fields
-
- private const int DEFAULT_PACKET_SIZE = 8192;
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlConnection() : this(null)
- {
- }
-
- public SqlConnection(String connectionString) : base(connectionString)
- {
- }
-
- #endregion // Constructors
-
- #region Events
-
- [DataCategory ("InfoMessage")]
- [DataSysDescription ("Event triggered when messages arrive from the DataSource.")]
- public event SqlInfoMessageEventHandler InfoMessage;
-
- #endregion // Events
-
- #region Properties
-
- public string WorkstationId
- {
- get { return (string)ConnectionStringBuilder["workstation id"]; }
- }
-
- public int PacketSize
- {
- get {
- string packetSize = (string)ConnectionStringBuilder["Packet Size"];
- if (packetSize == null || packetSize.Length == 0) {
- return DEFAULT_PACKET_SIZE;
- }
- try {
- return Convert.ToInt32(packetSize);
- }
- catch(FormatException e) {
- throw ExceptionHelper.InvalidValueForKey("packet size");
- }
- catch (OverflowException e) {
- throw ExceptionHelper.InvalidValueForKey("packet size");
- }
- }
- }
-
- protected override IConnectionProvider GetConnectionProvider() {
- IDictionary conProviderDict = ConnectionStringDictionary.Parse(ConnectionString);
- string provider = (string)conProviderDict["Provider"];
- if (provider == null)
- provider = "SQLCLIENT";
-
- return GetConnectionProvider("Mainsoft.Data.Configuration/SqlClientProviders", provider);
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) {
- return BeginTransaction(isolationLevel);
- }
-
- public SqlTransaction BeginTransaction(String transactionName)
- {
- return BeginTransaction(IsolationLevel.ReadCommitted,transactionName);
- }
-
- public new SqlTransaction BeginTransaction(IsolationLevel isolationLevel)
- {
- return BeginTransaction(isolationLevel,"Transaction");
- }
-
- public new SqlTransaction BeginTransaction()
- {
- return BeginTransaction(IsolationLevel.ReadCommitted);
- }
-
- public SqlTransaction BeginTransaction(IsolationLevel isolationLevel, string transactionName)
- {
- return new SqlTransaction(isolationLevel, this, transactionName);
- }
-
- public new SqlCommand CreateCommand()
- {
- return new SqlCommand(this);
- }
-
- protected override DbCommand CreateDbCommand() {
- return CreateCommand();
- }
-
- protected internal sealed override void OnSqlWarning(SQLWarning warning)
- {
- SqlErrorCollection col = new SqlErrorCollection(warning, this);
- OnSqlInfoMessage(new SqlInfoMessageEventArgs(col));
- }
-
- protected sealed override SystemException CreateException(SQLException e)
- {
- return new SqlException(e, this);
- }
-
- protected sealed override SystemException CreateException(string message)
- {
- return new SqlException(message, null, this);
- }
-
- private void OnSqlInfoMessage (SqlInfoMessageEventArgs value)
- {
- if (InfoMessage != null) {
- InfoMessage (this, value);
- }
- }
-
-#if NET_2_0
-
- [MonoNotSupported("")]
- public static void ChangePassword (string connectionString, string newPassword)
- {
- throw new NotImplementedException ();
-
- // FIXME: refactored from Mono implementation. Not finished!!!
- if (connectionString == null || newPassword == null || newPassword == String.Empty)
- throw new ArgumentNullException ();
- if (newPassword.Length > 128)
- throw new ArgumentException ("The value of newPassword exceeds its permittable length which is 128");
-
- SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder (connectionString);
- if (builder.IntegratedSecurity) {
- throw new ArgumentException ("Can't use integrated security when changing password");
- }
-
- using (SqlConnection conn = new SqlConnection (connectionString)) {
- conn.Open ();
- SqlCommand cmd = conn.CreateCommand ();
- cmd.CommandText = "sp_password";
- cmd.CommandType = CommandType.StoredProcedure;
- // FIXME: Need to extract old password and user from our structures
- // of the connectionString.
- cmd.Parameters.Add (builder.Password); // Is this good???
- cmd.Parameters.Add (newPassword);
- cmd.Parameters.Add (builder.UserID); // Is this good???
- cmd.ExecuteNonQuery();
- }
- }
-
- #region Pooling
-
- [MonoNotSupported("Pooling not supported")]
- public static void ClearPool (SqlConnection connection)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Pooling not supported")]
- public static void ClearAllPools ()
- {
- throw new NotImplementedException ();
- }
-
- #endregion
- #region Statistics
-
- [MonoNotSupported ("Statistics not supported")]
- public IDictionary RetrieveStatistics ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("Statistics not supported")]
- public void ResetStatistics ()
- {
- throw new NotImplementedException ();
- }
-
- #endregion
-#endif
- #endregion // Methods
-
- }
-}
+++ /dev/null
-//\r
-// System.Data.SqlClient.SqlConvert\r
-//\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-using System.Data.Common;\r
-using System.Data.ProviderBase;\r
-\r
-using java.sql;\r
-\r
-namespace System.Data.SqlClient\r
-{\r
- internal sealed class SqlConvert : DbConvert\r
- {\r
- #region Methods\r
-\r
- internal static String JdbcTypeNameToDbTypeName(string jdbcTypeName)\r
- {\r
- return jdbcTypeName.Trim();\r
- }\r
-\r
- internal static SqlDbType JdbcTypeToSqlDbType(int jdbcType)\r
- {\r
- // FIXME : other java.sql.Type\r
- // Types.ARRAY\r
- if(Types.BIGINT == jdbcType) return SqlDbType.BigInt;\r
- if(Types.BINARY == jdbcType) return SqlDbType.Binary;\r
- if(Types.BIT == jdbcType) return SqlDbType.Bit;\r
- if(Types.BLOB == jdbcType) return SqlDbType.Binary;\r
- // Types.BOOLEAN\r
- if(Types.CHAR == jdbcType) return SqlDbType.Char;\r
- if(Types.CLOB == jdbcType) return SqlDbType.Binary;\r
- if(Types.DATE == jdbcType) return SqlDbType.DateTime;\r
- if(Types.DECIMAL == jdbcType) return SqlDbType.Decimal;\r
- // Types.DISTINCT\r
- if(Types.DOUBLE == jdbcType) return SqlDbType.Float;\r
- if(Types.FLOAT == jdbcType) return SqlDbType.Float;\r
- if(Types.INTEGER == jdbcType) return SqlDbType.Int;\r
- // Types.JAVA_OBJECT\r
- if(Types.LONGVARBINARY == jdbcType) return SqlDbType.Image;\r
- if(Types.LONGVARCHAR == jdbcType) return SqlDbType.Text;\r
- // Types.NULL\r
- if(Types.NUMERIC == jdbcType) return SqlDbType.Decimal;\r
- if(Types.REAL == jdbcType) return SqlDbType.Real;\r
- // Types.REF\r
- if(Types.SMALLINT == jdbcType) return SqlDbType.SmallInt;\r
- // Types.STRUCT\r
- if(Types.TIME == jdbcType) return SqlDbType.DateTime;\r
- if(Types.TIMESTAMP == jdbcType) return SqlDbType.DateTime;\r
- if(Types.TINYINT == jdbcType) return SqlDbType.TinyInt;\r
- if(Types.VARBINARY == jdbcType) return SqlDbType.VarBinary;\r
- if(Types.VARCHAR == jdbcType) return SqlDbType.NVarChar;\r
- return SqlDbType.Variant;\r
- }\r
-\r
- internal static SqlDbType ValueTypeToSqlDbType(Type type)\r
- {\r
- switch (Type.GetTypeCode(type)) {\r
- case TypeCode.Boolean: return SqlDbType.Bit;\r
- case TypeCode.Byte: return SqlDbType.TinyInt;\r
- case TypeCode.Char: return SqlDbType.Char;\r
- case TypeCode.DateTime: return SqlDbType.DateTime;\r
- case TypeCode.DBNull: return SqlDbType.Variant;\r
- case TypeCode.Decimal: return SqlDbType.Decimal;\r
- case TypeCode.Double: return SqlDbType.Float;\r
- case TypeCode.Empty: return SqlDbType.Variant;\r
- case TypeCode.Int16: return SqlDbType.SmallInt;\r
- case TypeCode.Int32: return SqlDbType.Int;\r
- case TypeCode.Int64: return SqlDbType.BigInt;\r
- default:\r
- case TypeCode.Object: {\r
- if (type.Equals(DbTypes.TypeOfByteArray)) return SqlDbType.VarBinary;\r
- //if (type.Equals(DbTypes.TypeOfTimespan)) return OleDbType.DBTime;\r
- if (type.Equals(DbTypes.TypeOfGuid)) return SqlDbType.UniqueIdentifier;\r
-\r
- if (type.IsEnum)\r
- return ValueTypeToSqlDbType (Enum.GetUnderlyingType (type));\r
-\r
- return SqlDbType.Variant;\r
- }\r
- case TypeCode.SByte: return SqlDbType.TinyInt;\r
- case TypeCode.Single: return SqlDbType.Float;\r
- case TypeCode.String: return SqlDbType.NVarChar;\r
- case TypeCode.UInt16: return SqlDbType.SmallInt;\r
- case TypeCode.UInt32: return SqlDbType.Int;\r
- case TypeCode.UInt64: return SqlDbType.BigInt;\r
- }\r
- }\r
-\r
- internal static Type SqlDbTypeToValueType(SqlDbType sqlDbType)\r
- {\r
- switch (sqlDbType) {\r
- case SqlDbType.BigInt : return typeof(long);\r
- case SqlDbType.Binary : return typeof(byte[]);\r
- case SqlDbType.Bit : return typeof(bool);\r
- case SqlDbType.Char : return typeof(string);\r
- case SqlDbType.DateTime : return typeof(DateTime);\r
- case SqlDbType.Decimal : return typeof(decimal);\r
- case SqlDbType.Float : return typeof(double);\r
- case SqlDbType.Image : return typeof(byte[]);\r
- case SqlDbType.Int : return typeof(int);\r
- case SqlDbType.Money : return typeof(decimal);\r
- case SqlDbType.NChar : return typeof(string);\r
- case SqlDbType.NText : return typeof(string);\r
- case SqlDbType.NVarChar : return typeof(string);\r
- case SqlDbType.Real : return typeof(Single);\r
- case SqlDbType.UniqueIdentifier : return typeof(Guid);\r
- case SqlDbType.SmallDateTime : return typeof(DateTime);\r
- case SqlDbType.SmallInt : return typeof(Int16);\r
- case SqlDbType.SmallMoney : return typeof(decimal);\r
- case SqlDbType.Text : return typeof(string);\r
- case SqlDbType.Timestamp : return typeof(byte[]);\r
- case SqlDbType.TinyInt : return typeof(byte);\r
- case SqlDbType.VarBinary : return typeof(byte[]);\r
- case SqlDbType.VarChar : return typeof(string);\r
- case SqlDbType.Variant : return typeof(object);\r
- default : throw ExceptionHelper.InvalidSqlDbType((int)sqlDbType);\r
- }\r
- }\r
-\r
- internal static SqlDbType DbTypeToSqlDbType(DbType dbType)\r
- {\r
- switch (dbType) {\r
- case DbType.AnsiString : return SqlDbType.VarChar;\r
- case DbType.Binary : return SqlDbType.VarBinary;\r
- case DbType.Byte : return SqlDbType.TinyInt;\r
- case DbType.Boolean : return SqlDbType.Bit;\r
- case DbType.Currency : return SqlDbType.Money;\r
- case DbType.Date : return SqlDbType.DateTime;\r
- case DbType.DateTime : return SqlDbType.DateTime;\r
- case DbType.Decimal : return SqlDbType.Decimal;\r
- case DbType.Double : return SqlDbType.Float;\r
- case DbType.Guid : return SqlDbType.UniqueIdentifier;\r
- case DbType.Int16 : return SqlDbType.SmallInt;\r
- case DbType.Int32 : return SqlDbType.Int;\r
- case DbType.Int64 : return SqlDbType.BigInt;\r
- case DbType.Object : return SqlDbType.Variant;\r
- case DbType.SByte : throw ExceptionHelper.UnknownDataType(dbType.ToString(),"SqlDbType");\r
- case DbType.Single : return SqlDbType.Real;\r
- case DbType.String : return SqlDbType.NVarChar;\r
- case DbType.UInt16 : throw ExceptionHelper.UnknownDataType(dbType.ToString(),"SqlDbType");\r
- case DbType.UInt32 : throw ExceptionHelper.UnknownDataType(dbType.ToString(),"SqlDbType");\r
- case DbType.UInt64 : throw ExceptionHelper.UnknownDataType(dbType.ToString(),"SqlDbType");\r
- case DbType.VarNumeric : throw ExceptionHelper.UnknownDataType(dbType.ToString(),"SqlDbType");\r
- case DbType.AnsiStringFixedLength : return SqlDbType.Char;\r
- case DbType.StringFixedLength : return SqlDbType.NChar;\r
- default : throw ExceptionHelper.InvalidDbType((int)dbType);\r
- }\r
- }\r
-\r
- internal static DbType SqlDbTypeToDbType(SqlDbType sqlDbType)\r
- {\r
- switch (sqlDbType) {\r
- case SqlDbType.BigInt : return DbType.Int64;\r
- case SqlDbType.Binary : return DbType.Binary;\r
- case SqlDbType.Bit : return DbType.Boolean;\r
- case SqlDbType.Char : return DbType.AnsiStringFixedLength;\r
- case SqlDbType.DateTime : return DbType.DateTime;\r
- case SqlDbType.Decimal : return DbType.Decimal;\r
- case SqlDbType.Float : return DbType.Double;\r
- case SqlDbType.Image : return DbType.Binary;\r
- case SqlDbType.Int : return DbType.Int32;\r
- case SqlDbType.Money : return DbType.Currency;\r
- case SqlDbType.NChar : return DbType.StringFixedLength;\r
- case SqlDbType.NText : return DbType.String;\r
- case SqlDbType.NVarChar : return DbType.String;\r
- case SqlDbType.Real : return DbType.Single;\r
- case SqlDbType.UniqueIdentifier : return DbType.Guid;\r
- case SqlDbType.SmallDateTime : return DbType.DateTime;\r
- case SqlDbType.SmallInt : return DbType.Int16;\r
- case SqlDbType.SmallMoney : return DbType.Currency;\r
- case SqlDbType.Text : return DbType.AnsiString;\r
- case SqlDbType.Timestamp : return DbType.Binary;\r
- case SqlDbType.TinyInt : return DbType.Byte;\r
- case SqlDbType.VarBinary : return DbType.Binary;\r
- case SqlDbType.VarChar : return DbType.AnsiString;\r
- case SqlDbType.Variant : return DbType.Object;\r
- default : throw ExceptionHelper.InvalidSqlDbType((int)sqlDbType);\r
- }\r
- }\r
-\r
- internal static int SqlDbTypeToJdbcType(SqlDbType sqlDbType)\r
- {\r
- switch(sqlDbType) {\r
- case SqlDbType.BigInt : return Types.BIGINT;\r
- case SqlDbType.Binary : return Types.BINARY;\r
- case SqlDbType.Bit : return Types.BIT;\r
- case SqlDbType.Char : return Types.CHAR;\r
- case SqlDbType.DateTime : return Types.TIMESTAMP;\r
- case SqlDbType.Decimal : return Types.DECIMAL;\r
- case SqlDbType.Float : return Types.FLOAT;\r
- case SqlDbType.Image : return Types.LONGVARBINARY;\r
- case SqlDbType.Int : return Types.INTEGER;\r
- case SqlDbType.Money : return Types.DECIMAL;\r
- case SqlDbType.NChar : return Types.CHAR;\r
- case SqlDbType.NText : return Types.LONGVARCHAR;\r
- case SqlDbType.NVarChar : return Types.VARCHAR;\r
- case SqlDbType.Real : return Types.REAL;\r
- case SqlDbType.UniqueIdentifier : return Types.CHAR;\r
- case SqlDbType.SmallDateTime : return Types.DATE;\r
- case SqlDbType.SmallInt : return Types.SMALLINT;\r
- case SqlDbType.SmallMoney : return Types.DECIMAL;\r
- case SqlDbType.Text : return Types.LONGVARCHAR;\r
- case SqlDbType.Timestamp : return Types.TIMESTAMP;\r
- case SqlDbType.TinyInt : return Types.TINYINT;\r
- case SqlDbType.VarBinary : return Types.VARBINARY;\r
- case SqlDbType.VarChar : return Types.VARCHAR;\r
- case SqlDbType.Variant : return Types.VARCHAR; // note : ms jdbc driver recognize this sqlserver as varchar\r
- default : throw ExceptionHelper.InvalidSqlDbType((int)sqlDbType);\r
- }\r
- }\r
-\r
- #endregion // Methods\r
- }\r
-}\r
+++ /dev/null
-//
-// System.Data.SqlClient.SqlDataReader
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Data.SqlTypes;
-using System.Data.ProviderBase;
-
-using java.sql;
-
-namespace System.Data.SqlClient
-{
- public class SqlDataReader : AbstractDataReader
- {
-
- #region Constructors
-
- internal SqlDataReader(SqlCommand command) : base(command)
- {
- }
-
- #endregion // Constructors
-
- #region Properties
-
- #endregion // Properties
-
- #region Methods
-
- protected sealed override SystemException CreateException(string message, SQLException e)
- {
- return new SqlException(message, e, (SqlConnection)_command.Connection);
- }
-
- protected sealed override SystemException CreateException(java.io.IOException e)
- {
- return new SqlException(e, (SqlConnection)_command.Connection);
- }
-
- public override String GetDataTypeName(int columnIndex)
- {
- try {
- string jdbcTypeName = Results.getMetaData().getColumnTypeName(columnIndex + 1);
-
- return SqlConvert.JdbcTypeNameToDbTypeName(jdbcTypeName);
- }
- catch (SQLException e) {
- throw CreateException(e);
- }
- }
-
- protected override int GetProviderType(int jdbcType)
- {
- return (int)SqlConvert.JdbcTypeToSqlDbType(jdbcType);
- }
-
- // Gets the value of the specified column as a SqlBinary.
- public SqlBinary GetSqlBinary(int columnIndex)
- {
- byte[] bytes = GetBytes(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlBinary.Null;
- }
- else {
- return new SqlBinary(bytes);
- }
- }
-
- // Gets the value of the specified column as a SqlBoolean.
- public SqlBoolean GetSqlBoolean(int columnIndex)
- {
- bool boolean = GetBoolean(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlBoolean.Null;
- }
- else {
- return new SqlBoolean(boolean);
- }
- }
-
- // Gets the value of the specified column as a SqlByte.
- public SqlByte GetSqlByte(int columnIndex)
- {
- byte byt = GetByte(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlByte.Null;
- }
- else {
- return new SqlByte(byt);
- }
- }
-
-#if NET_2_0
-
- public virtual SqlBytes GetSqlBytes (int columnIndex)
- {
- byte [] bytes = GetBytes (columnIndex);
- if (IsDBNull (columnIndex)) {
- return SqlBytes.Null;
- }
- else {
- return new SqlBytes (bytes);
- }
- }
-
- public virtual SqlChars GetSqlChars (int columnIndex)
- {
- SqlString sqlStr = GetSqlString (columnIndex);
- if (sqlStr.IsNull) {
- return SqlChars.Null;
- }
- else {
- return new SqlChars (sqlStr);
- }
- }
-
- [MonoNotSupported("SqlXml is not fully implemented")]
- public virtual SqlXml GetSqlXml (int columnIndex)
- {
- throw new NotImplementedException ();
- }
-
-#endif
-
- // Gets the value of the specified column as a SqlDecimal.
- public SqlDecimal GetSqlDecimal(int columnIndex)
- {
- decimal dec = GetDecimal(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlDecimal.Null;
- }
- else {
- return new SqlDecimal(dec);
- }
- }
-
- // Gets the value of the specified column as a SqlDateTime.
- public SqlDateTime GetSqlDateTime(int columnIndex)
- {
- DateTime dateTime = GetDateTime(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlDateTime.Null;
- }
- else {
- return new SqlDateTime(dateTime);
- }
- }
-
- // Gets the value of the specified column as a SqlDouble.
- public SqlDouble GetSqlDouble(int columnIndex)
- {
- double doubl = GetDouble(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlDouble.Null;
- }
- else {
- return new SqlDouble(doubl);
- }
- }
-
- // Gets the value of the specified column as a SqlInt16.
- public SqlInt16 GetSqlInt16(int columnIndex)
- {
- short s = GetInt16(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlInt16.Null;
- }
- else {
- return new SqlInt16(s);
- }
- }
-
- // Gets the value of the specified column as a SqlInt32.
- public SqlInt32 GetSqlInt32(int columnIndex)
- {
- int i = GetInt32(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlInt32.Null;
- }
- else {
- return new SqlInt32(i);
- }
- }
-
- // Gets the value of the specified column as a SqlInt64.
- public SqlInt64 GetSqlInt64(int columnIndex)
- {
- long l = GetInt64(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlInt64.Null;
- }
- else {
- return new SqlInt64(l);
- }
- }
-
- // Gets the value of the specified column as a SqlMoney.
- public SqlMoney GetSqlMoney(int columnIndex)
- {
- decimal dec = GetDecimal(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlMoney.Null;
- }
- else {
- return new SqlMoney(dec);
- }
- }
-
- // Gets the value of the specified column as a SqlSingle.
- public SqlSingle GetSqlSingle(int columnIndex)
- {
- float f = GetFloat(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlSingle.Null;
- }
- else {
- return new SqlSingle(f);
- }
- }
-
- // Gets the value of the specified column as a SqlString.
- public SqlString GetSqlString(int columnIndex)
- {
- string str = GetString(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlString.Null;
- }
- else {
- return new SqlString(str);
- }
- }
-
- // Gets the value of the specified column as a SqlGuid.
- public SqlGuid GetSqlGuid(int columnIndex)
- {
- object obj = GetValue(columnIndex);
- if(IsDBNull(columnIndex)) {
- return SqlGuid.Null;
- }
- else {
- if (obj is byte[]) {
- return new SqlGuid((byte[])obj);
- }
- else {
- return new SqlGuid((string)obj);
- }
- }
- }
-
- // Gets all the attribute columns in the current row.
- public int GetSqlValues(Object[] values)
- {
- int columnCount = FieldCount;
- int i = 0;
- for (; i < values.Length && i < columnCount; i++) {
- values[i] = GetSqlValue(i);
- }
- return i;
- }
-
- // Gets an Object that is a representation of the underlying SqlDbType Variant.
- public Object GetSqlValue(int columnIndex)
- {
- try {
- int jdbcType = ResultsMetaData.getColumnType(columnIndex + 1);
- SqlDbType sqlDbType = SqlConvert.JdbcTypeToSqlDbType(jdbcType);
-
- switch (sqlDbType) {
- case SqlDbType.BigInt : return GetSqlInt64(columnIndex);
- case SqlDbType.Binary : return GetSqlBinary(columnIndex);
- case SqlDbType.Bit : return GetSqlBoolean(columnIndex);
- case SqlDbType.Char : return GetSqlString(columnIndex);
- case SqlDbType.DateTime : return GetSqlDateTime(columnIndex);
- case SqlDbType.Decimal : return GetSqlDecimal(columnIndex);
- case SqlDbType.Float : return GetSqlDouble(columnIndex);
- case SqlDbType.Image : return GetSqlBinary(columnIndex);
- case SqlDbType.Int : return GetSqlInt32(columnIndex);
- case SqlDbType.Money : return GetSqlDecimal(columnIndex);
- case SqlDbType.NChar : return GetSqlString(columnIndex);
- case SqlDbType.NText : return GetSqlString(columnIndex);
- case SqlDbType.NVarChar : return GetSqlString(columnIndex);
- case SqlDbType.Real : return GetSqlSingle(columnIndex);
- case SqlDbType.UniqueIdentifier : return GetSqlGuid(columnIndex);
- case SqlDbType.SmallDateTime : return GetSqlDateTime(columnIndex);
- case SqlDbType.SmallInt : return GetSqlInt16(columnIndex);
- case SqlDbType.SmallMoney : return GetSqlDecimal(columnIndex);
- case SqlDbType.Text : return GetSqlString(columnIndex);
- case SqlDbType.Timestamp : return GetSqlDateTime(columnIndex);
- case SqlDbType.TinyInt : return GetSqlByte(columnIndex);
- case SqlDbType.VarBinary : return GetSqlBinary(columnIndex);
- case SqlDbType.VarChar : return GetSqlString(columnIndex);
- case SqlDbType.Variant : return GetValue(columnIndex);
- default : return GetValue(columnIndex);
- }
- }
- catch (SQLException exp) {
- throw new Exception(exp.Message);
- }
- }
-
-#if NET_2_0
- protected bool IsCommandBehavior (CommandBehavior condition)
- {
- return (_command.Behavior & condition) == condition;
- }
-#endif
- #endregion // Methods
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// System.Data.SqlClient.SqlError
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Data.SqlClient
-{
- using System.Data.ProviderBase;
- using java.sql;
- using System.Data.Common;
-
- /**
- * Collects information relevant to a warning or error returned by SQL Server.
- */
-
- [Serializable]
- public class SqlError : AbstractDbError
- {
- string _serverVersion;
- /**
- * Initialize SqlError object
- * */
- internal SqlError(SQLException e, AbstractDBConnection connection) : base(e, connection)
- {
- if (connection != null)
- _serverVersion = connection.ServerVersion;
- }
-
- /**
- * Overridden. Gets the complete text of the error message.
- *
- * @return A string representation of the current object.
- */
- public override String ToString()
- {
- return String.Concat("SqlError:", Message, _e.StackTrace);
- }
-
- /**
- * Gets the name of the provider that generated the error.
- *
- * @return The name of the provider
- */
- public String Source
- {
- get
- {
- return DbSource;
- }
- }
-
- /**
- * Gets a number that identifies the type of error.
- *
- * @return Number of the error
- */
- public int Number
- {
- get
- {
- return DbErrorCode;
- }
- }
-
- /**
- * Gets a numeric error code from SQL Server that represents an error,
- * warning or "no data found" message. For more information on how to
- * decode these values, see SQL Server Books Online.
- *
- * @return Error Code
- */
- public byte State
- {
- get
- {
- return 0; // & BitConstants.ALL_BYTE;
- }
- }
-
- /**
- * Gets the severity level of the error returned from SQL Server.
- *
- * @return Severity level of the error
- */
- public byte Class
- {
- get
- {
- return 0; // & BitConstants.ALL_BYTE;
- }
- }
-
- /**
- * Gets the name of the instance of SQL Server that generated the error.
- *
- * @return The name of the server
- */
- public String Server
- {
- get
- {
- return _serverVersion;
- }
- }
-
- /**
- * Gets the text describing the error.
- *
- * @return The text describing the error
- */
- public String Message
- {
- get
- {
- return DbMessage;
- }
- }
-
- /**
- * Gets the name of the stored procedure or remote procedure call (RPC)
- * that generated the error.
- *
- * @return The name of stored procedure that generated the error.
- */
- public String Procedure
- {
- get
- {
- return null;
- }
- }
-
- /**
- * Bets the line number within the Transact-SQL command batch or stored
- * procedure that contains the error.
- *
- * @return Line number of error in stored procedure
- */
- public int LineNumber
- {
- get
- {
- return 0;
- }
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// System.Data.SqlClient.SqlErrorCollection
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Data.SqlClient
-{
-
- /**
- * Collects all errors generated by the SQL .NET Data Provider.
- */
-
- using System.Collections;
- using System.Data.Common;
- using System.Data.ProviderBase;
- using java.sql;
-
-
- [Serializable]
- public class SqlErrorCollection : AbstractDbErrorCollection
- {
- internal SqlErrorCollection(SQLException e, AbstractDBConnection connection) : base(e, connection) {}
- /**
- * Gets the error at the specified index.
- *
- * @param index of the error
- * @return Error on specified index
- */
- public SqlError this[int index]
- {
- get
- {
- return (SqlError)GetDbItem(index);
- }
- }
-
-#if NET_2_0
- public void CopyTo (SqlError [] array, int index)
- {
- base.CopyTo (array, index);
- }
-
-#endif
-
- protected override AbstractDbError CreateDbError(java.sql.SQLException e, AbstractDBConnection connection) {
- return new SqlError(e, connection);
- }
-
-
- }
-}
\ No newline at end of file
+++ /dev/null
-//\r
-// System.Data.SqlClient.SqlException\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-namespace System.Data.SqlClient\r
-{\r
-\r
- using java.sql;\r
-\r
- using System;\r
- using System.Data.ProviderBase;\r
-\r
- /**\r
- * The exception that is thrown when SQL Server returns a warning or error.\r
- * This class cannot be inherited.\r
- */\r
-\r
- /*\r
- * CURRENT LIMITATIONS\r
- * 1. Constructor for serialization SqlException(SerializationInfo info, StreamingContext sc) \r
- * is not supported.\r
- * 2. Method "void GetObjectData(...,...)" is not supported (serialization)\r
- */\r
-\r
- public sealed class SqlException : AbstractDbException\r
- {\r
- internal SqlException(Exception cause, SqlConnection connection) : base(cause, connection) {}\r
-\r
- internal SqlException(SQLException cause, SqlConnection connection) : base(cause, connection) {}\r
-\r
- internal SqlException(string message, SQLException cause, SqlConnection connection) : base(message, cause, connection) {}\r
-\r
- protected override AbstractDbErrorCollection DbErrors {\r
- get {\r
- return Errors;\r
- }\r
- }\r
-\r
- \r
-\r
- /**\r
- * Gets the severity level of the error returned from the SQL Server .NET \r
- * Data Provider.\r
- * @return severity level of the first error in the collection.\r
- */\r
- public byte Class\r
- {\r
- get\r
- {\r
- SqlErrorCollection errors = Errors;\r
- return errors.Count > 0 ? errors[0].Class : (byte)0;\r
- }\r
- }\r
-\r
- /**\r
- * Gets a collection of one or more SqlError objects that give detailed \r
- * information about exceptions generated by the SQL Server .NET Data Provider.\r
- * @return collection of SqlError objects\r
- */\r
- public SqlErrorCollection Errors\r
- {\r
- get\r
- {\r
- return new SqlErrorCollection(_cause, _connection);\r
- }\r
- }\r
-\r
- /**\r
- * Gets the line number within the Transact-SQL command batch or stored \r
- * procedure that generated the error.\r
- * @return line number of the first error in the collection.\r
- */\r
- public int LineNumber\r
- {\r
- get\r
- {\r
- SqlErrorCollection errors = Errors;\r
- return errors.Count > 0 ? errors[0].LineNumber : 0;\r
- }\r
- }\r
-\r
- /**\r
- * Gets a number that identifies the type of error.\r
- * @return number that identifies the type of first error in the collection\r
- */\r
- public int Number\r
- {\r
- get\r
- {\r
- SqlErrorCollection errors = Errors;\r
- return errors.Count > 0 ? errors[0].Number : 0;\r
- }\r
- }\r
-\r
- /**\r
- * Gets the name of the stored procedure or remote procedure call (RPC) \r
- * that generated the error.\r
- * @return name of the stored procedure \r
- */\r
- public String Procedure\r
- {\r
- get\r
- {\r
- SqlErrorCollection errors = Errors;\r
- return errors.Count > 0 ? errors[0].Procedure : null;\r
- }\r
- }\r
-\r
- /**\r
- * Gets the name of the computer running an instance of SQL Server \r
- * that generated the error.\r
- * @return name of the computer where error generated\r
- */\r
- public String Server\r
- {\r
- get\r
- {\r
- SqlErrorCollection errors = Errors;\r
- return errors.Count > 0 ? errors[0].Server : null;\r
- }\r
- }\r
-\r
-\r
- /**\r
- * Gets a numeric error code from SQL Server that represents an error, \r
- * warning or "no data found" message. \r
- * @return numeric error code from SQL Server\r
- */\r
- public byte State\r
- {\r
- get\r
- {\r
- SqlErrorCollection errors = Errors;\r
- return errors.Count > 0 ? errors[0].State : (byte)0;\r
- }\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//
-// System.Data.SqlClient.SqlParameter
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-// Boris Kirzner <borisk@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.ProviderBase;
-using System.Data.Common;
-
-using java.sql;
-
-namespace System.Data.SqlClient
-{
- public sealed class SqlParameter : AbstractDbParameter
- {
- #region Fields
-
- private SqlDbType _sqlDbType;
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlParameter()
- {
- }
-
- public SqlParameter(String parameterName, Object value)
- : this(parameterName, SqlDbType.NVarChar, 0, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, value,false)
- {
- }
-
- public SqlParameter(String parameterName, SqlDbType dbType)
- : this(parameterName, dbType, 0, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, null, true)
- {
- }
-
-
- public SqlParameter(String parameterName, SqlDbType dbType, int size)
- : this(parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, null, true)
- {
- }
-
-
- public SqlParameter(String parameterName, SqlDbType dbType, int size, String sourceColumn)
- : this(parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, sourceColumn, DataRowVersion.Current, null, true)
- {
- }
-
-
- public SqlParameter(
- String parameterName,
- SqlDbType dbType,
- int size,
- ParameterDirection direction,
- bool isNullable,
- byte precision,
- byte scale,
- String sourceColumn,
- DataRowVersion sourceVersion,
- Object value) : this(parameterName,dbType,size,direction,isNullable,precision,scale,sourceColumn,sourceVersion,value,true)
- {
- }
-
-#if NET_2_0
- public SqlParameter (
- string parameterName,
- SqlDbType dbType,
- int size,
- ParameterDirection direction,
- byte precision,
- byte scale,
- string sourceColumn,
- DataRowVersion sourceVersion,
- bool sourceColumnNullMapping,
- Object value,
- string xmlSchemaCollectionDatabase,
- string xmlSchemaCollectionOwningSchema,
- string xmlSchemaCollectionName
- ) : this (parameterName, dbType, size, direction, sourceColumnNullMapping, precision, scale, sourceColumn, sourceVersion, value, true)
- {
- }
-#endif
-
- SqlParameter(
- String parameterName,
- SqlDbType dbType,
- int size,
- ParameterDirection direction,
- bool isNullable,
- byte precision,
- byte scale,
- String sourceColumn,
- DataRowVersion sourceVersion,
- Object value,
- bool dbTypeExplicit)
- {
- ParameterName = parameterName;
- SqlDbType = dbType;
- Size = size;
- Direction = direction;
- IsNullable = isNullable;
- Precision = precision;
- Scale = scale;
- SourceColumn = sourceColumn;
- SourceVersion = sourceVersion;
- if (!dbTypeExplicit) {
- IsDbTypeSet = false;
- }
- Value = value;
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public override DbType DbType
- {
- get { return SqlConvert.SqlDbTypeToDbType(_sqlDbType); }
- set { SqlDbType = SqlConvert.DbTypeToSqlDbType(value); }
- }
-
- public SqlDbType SqlDbType
- {
- get { return _sqlDbType; }
- set {
- _sqlDbType = value;
- IsDbTypeSet = true;
- }
- }
-
- public override int Size
- {
- get {
- int retVal = base.Size;
- return retVal;
- }
- set {
- if (value < 0) {
- throw ExceptionHelper.InvalidSizeValue(value);
- }
-
- if (value != 0) {
- base.Size = value;
- }
- else {
- base.Size = -1;
- }
- }
- }
-
-#if NET_2_0
- public new byte Precision
- {
- get { return base.Precision; }
- set { base.Precision = value; }
- }
-
- public new byte Scale
- {
- get { return base.Scale; }
- set { base.Scale = value; }
- }
-#endif
-
- protected internal override string Placeholder {
- get {
- if (ParameterName.Length == 0 || ParameterName[0] == '@')
- return ParameterName;
-
- return String.Concat("@", ParameterName);
- }
- }
-
-
- public override Object Value
- {
- get { return base.Value; }
- set {
- if (!IsDbTypeSet && (value != null) && (value != DBNull.Value)) {
- _sqlDbType = SqlConvert.ValueTypeToSqlDbType(value.GetType());
- }
- base.Value = value;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected internal sealed override object ConvertValue(object value)
- {
- // can not convert null or DbNull to other types
- if (value == null || value == DBNull.Value) {
- return value;
- }
- // .NET throws an exception to the user.
- object convertedValue = value is IConvertible ? Convert.ChangeType(value,SqlConvert.SqlDbTypeToValueType(SqlDbType)) : value;
- return convertedValue;
- }
-
- protected internal sealed override void SetParameterName(ResultSet res)
- {
- string name = res.getString("COLUMN_NAME");
- if (name != null && name.Length > 0 && name[0] != '@')
- name = String.Concat("@", name);
- ParameterName = name;
- }
-
- protected internal sealed override void SetParameterDbType(ResultSet res)
- {
- int dataType = res.getInt("DATA_TYPE");
- SqlDbType = SqlConvert.JdbcTypeToSqlDbType(dataType);
- JdbcType = dataType;
- }
-
-#if NET_2_0
- public void ResetSqlDbType ()
- {
- IsDbTypeSet = false;
- }
-
- public override void ResetDbType ()
- {
- ResetSqlDbType ();
- }
-#endif
-
- protected internal sealed override void SetSpecialFeatures (ResultSet res)
- {
- // do nothing
- }
-
- protected internal sealed override int JdbcTypeFromProviderType()
- {
- return SqlConvert.SqlDbTypeToJdbcType(SqlDbType);
- }
-
- #endregion // Methods
-
- }
-}
#if NET_2_0
using System.Collections.Generic;
#endif
+using System.Security;
namespace System.Data.SqlClient
{
// The connection string that identifies this connection
string connectionString;
+ // The connection credentials
+ SqlCredential credentials;
+
// The transaction object for the current transaction
SqlTransaction transaction;
ConnectionString = connectionString;
}
+ public SqlConnection (string connectionString, SqlCredential cred)
+ {
+ ConnectionString = connectionString;
+ Credentials = cred;
+ }
+
#endregion // Constructors
#region Properties
}
}
+ public SqlCredential Credentials {
+ get {
+ return credentials;
+ }
+ set {
+ credentials = value;
+ }
+ }
+
#if !NET_2_0
[DataSysDescription ("Current connection timeout value, 'Connect Timeout=X' in the ConnectionString.")]
#endif
if (!tds.IsConnected) {
try {
+ if (Credentials != null) {
+ if (parms.User != String.Empty)
+ throw new ArgumentException("UserID already specified");
+ if (parms.PasswordSet)
+ throw new ArgumentException("Password already specified");
+ if (parms.DomainLogin != false)
+ throw new ArgumentException("Cannot use credentials with DomainLogin");
+ parms.User = Credentials.UserId;
+ parms.Password = Credentials.Password;
+ }
tds.Connect (parms);
} catch {
if (pooling)
break;
case "password" :
case "pwd" :
- parms.Password = value;
+ parms.Password = new SecureString();
+ foreach (char c in value)
+ parms.Password.AppendChar(c);
+ parms.PasswordSet = true;
break;
case "persistsecurityinfo" :
case "persist security info" :
--- /dev/null
+//
+// System.Data.SqlClient.SqlCredential.cs
+//
+// Author:
+// Neale Ferguson (neale@sinenomine.net)
+//
+// Copyright (C) Neale Ferguson, 2014
+//
+
+//
+// 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.Data;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace System.Data.SqlClient {
+ /// <summary>
+ /// Describes an error from a SQL database.
+ /// </summary>
+ [Serializable]
+ public sealed class SqlCredential
+ {
+ #region Fields
+
+ string uid = "";
+ SecureString pwd = null;
+
+ #endregion // Fields
+
+ #region Constructors
+
+ public SqlCredential (string user, SecureString password)
+ {
+ if (user == null)
+ throw new ArgumentNullException("UserID");
+ if (password == null)
+ throw new ArgumentNullException("Password");
+ this.uid = user;
+ this.pwd = password;
+ }
+
+ #endregion // Constructors
+
+ #region Properties
+
+ public string UserId {
+ get { return uid; }
+ }
+
+ public SecureString Password {
+ get { return pwd; }
+ }
+
+ #endregion
+ }
+}
+++ /dev/null
-// System.Data.SqlTypes.SqlDecimal\r
-//\r
-// Authors:\r
-// Konstantin Triger <kostat@mainsoft.com>\r
-// Boris Kirzner <borisk@mainsoft.com>\r
-// \r
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)\r
-//\r
-\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-namespace System.Data.SqlTypes\r
-{\r
-\r
- /**\r
- * <p>Title: </p>\r
- * <p>Description: </p>\r
- * <p>Copyright: Copyright (c) 2002</p>\r
- * <p>Company: MainSoft</p>\r
- * @author Pavel Sandler\r
- * @version 1.0\r
- */\r
-\r
- using System;\r
-\r
- using java.math;\r
-\r
- /*\r
- * CURRENT LIMITATIONS:\r
- * 1. public byte[] Data not implemented.\r
- * 2. public byte[] BinData not implemented.\r
- * 3. Precision value is ignored.\r
- * 4. public SqlDecimal AdjustScale(SqlDecimal n, int position) not implemented.\r
- * 5. public SqlDecimal ConvertToPrecScale(SqlDecimal n, int precision, int scale) not implemented.\r
- */\r
-\r
-\r
- public struct SqlDecimal : INullable\r
- {\r
-\r
- private Decimal _value;\r
- private bool _isNull;\r
-\r
- public static readonly SqlDecimal MaxValue = new SqlDecimal(Decimal.MaxValue);\r
- public static readonly SqlDecimal MinValue = new SqlDecimal(Decimal.MinValue);\r
- public static readonly int MaxPrecision = 38;\r
- public static readonly int MaxScale = MaxPrecision;\r
- public static readonly SqlDecimal Null = new SqlDecimal(true);\r
-\r
- private int _precision;\r
- private int _scale;\r
- \r
-\r
- private SqlDecimal(bool isNull)\r
- {\r
- _value = Decimal.Zero;\r
- _isNull = isNull;\r
- _precision = 38;\r
- _scale = 0;\r
- }\r
- /**\r
- * Initializes a new instance of the SqlDecimal instance using the supplied Decimal value.\r
- * @param value The Decimal value to be stored as a SqlDecimal instance.\r
- */\r
- public SqlDecimal(Decimal value) \r
- {\r
- _value = value;\r
- _isNull = false;\r
- int[] bits = Decimal.GetBits(value);\r
- int i = bits[3] & 0xff0000;\r
- _scale = i >> 16;\r
- _precision = 38;\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the SqlDecimal instance using the supplied double value.\r
- * @param value The double value to be stored as a SqlDecimal instance.\r
- */\r
- public SqlDecimal(double value) \r
- { \r
- _value = new Decimal(value);\r
- _isNull = false; \r
- int[] bits = Decimal.GetBits(_value);\r
- int i = bits[3] & 0xff0000;\r
- _scale = i >> 16;\r
- _precision = 38;\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the SqlDecimal instance using the supplied int value.\r
- * @param value The int value to be stored as a SqlDecimal instance.\r
- */\r
- public SqlDecimal(int value) \r
- {\r
- _value = new Decimal(value);\r
- _isNull = false;\r
- int[] bits = Decimal.GetBits(_value);\r
- int i = bits[3] & 0xff0000;\r
- _scale = i >> 16;\r
- _precision = 38;\r
- }\r
-\r
- /**\r
- * Initializes a new instance of the SqlDecimal instance using the supplied long value.\r
- * @param value The long value to be stored as a SqlDecimal instance.\r
- */\r
- public SqlDecimal(long value) \r
- {\r
- _value = new Decimal(value);\r
- _isNull = false;\r
- int[] bits = Decimal.GetBits(_value);\r
- int i = bits[3] & 0xff0000;\r
- _scale = i >> 16;\r
- _precision = 38;\r
- }\r
-\r
- \r
- /**\r
- * Indicates whether or not Value is null.\r
- * @return true if Value is null, otherwise false.\r
- */\r
- public bool IsNull\r
- {\r
- get\r
- {\r
- return _isNull;\r
- }\r
- }\r
-\r
- /**\r
- * Gets the value of the SqlDecimal instance.\r
- * @return the value of this instance\r
- */\r
- public Decimal Value\r
- {\r
- get\r
- {\r
- if(IsNull)\r
- throw new SqlNullValueException();\r
- return _value;\r
- }\r
- }\r
-\r
- public byte[] BinData\r
- {\r
- get\r
- {\r
- /** @todo implement this method */\r
- throw new NotImplementedException();\r
- }\r
- }\r
-\r
- public byte[] Data\r
- {\r
- get\r
- {\r
- /** @todo implement this method */\r
- throw new NotImplementedException();\r
- }\r
- }\r
-\r
- /**\r
- * Indicates whether or not the Value of this SqlDecimal instance is greater than zero.\r
- * @return true if the Value is assigned to null, otherwise false.\r
- */\r
- public bool IsPositive\r
- {\r
- get\r
- {\r
- if (!IsNull)\r
- {\r
- if (_value >= 0)\r
- return true;\r
-\r
- return false;\r
- }\r
- \r
- throw new SqlNullValueException("The value of this instance is null");\r
- }\r
- }\r
-\r
- /**\r
- * Gets the maximum number of digits used to represent the Value property.\r
- * @return The maximum number of digits used to represent the Value of this SqlDecimal instance.\r
- */\r
- public int Precision\r
- {\r
- get\r
- {\r
- return _precision;\r
- }\r
- }\r
-\r
- /**\r
- * Gets the number of decimal places to which Value is resolved.\r
- * @return The number of decimal places to which the Value property is resolved.\r
- */\r
- public int Scale\r
- {\r
- get\r
- {\r
- return _precision;\r
- }\r
- }\r
-\r
- /**\r
- * The Abs member function gets the absolute value of the SqlDecimal parameter.\r
- * @param n A SqlDecimal instance.\r
- * @return A SqlDecimal instance whose Value property contains the unsigned number representing the absolute value of the SqlDecimal parameter.\r
- */\r
- public static SqlDecimal Abs(SqlDecimal n)\r
- {\r
- if (n.IsNull)\r
- return new SqlDecimal();\r
-\r
- Decimal val;\r
-\r
- if (n.IsPositive)\r
- val = n.Value;\r
- else\r
- val = Decimal.Negate(n._value);\r
-\r
- return new SqlDecimal(val);\r
-\r
- }\r
-\r
- /**\r
- * Calcuates the sum of the two SqlDecimal operators.\r
- * @param x A SqlDecimal instance.\r
- * @param y A SqlDecimal instance.\r
- * @return A new SqlDecimal instance whose Value property contains the sum.\r
- * If one of the parameters or their value is null return SqlDecimal.Null.\r
- */\r
- public static SqlDecimal Add(SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull)\r
- return SqlDecimal.Null;\r
-\r
- Decimal res = Decimal.Add(x._value, y._value);\r
-\r
- return new SqlDecimal(res);\r
- }\r
-\r
- public static SqlDecimal AdjustScale(SqlDecimal n, int digits, bool fround)\r
- {\r
- /** @todo find out what the logic */\r
- throw new NotImplementedException();\r
- }\r
-\r
- /**\r
- * Returns the smallest whole number greater than or equal to the specified SqlDecimal instance.\r
- * @param n The SqlDecimal instance for which the ceiling value is to be calculated.\r
- * @return A SqlDecimal representing the smallest whole number greater than or equal to the specified SqlDecimal instance.\r
- */\r
- public static SqlDecimal Ceiling(SqlDecimal n)\r
- {\r
- if (n.IsNull)\r
- return SqlDecimal.Null;\r
-\r
- double d = Math.Ceiling((double)n._value);\r
- return new SqlDecimal(d);\r
- }\r
-\r
- /**\r
- * Compares this instance to the supplied object and returns an indication of their relative values.\r
- * @param obj The object to compare.\r
- * @return A signed number indicating the relative values of the instance and the object.\r
- * Less than zero This instance is less than object.\r
- * Zero This instance is the same as object.\r
- * Greater than zero This instance is greater than object -or-\r
- * object is a null reference.\r
- */\r
- public int CompareTo(Object obj)\r
- {\r
- if (obj == null)\r
- return 1;\r
-\r
- if (obj is SqlDecimal)\r
- {\r
- SqlDecimal value = (SqlDecimal)obj;\r
- \r
- if (IsNull)\r
- return -1;\r
-\r
- if (value.IsNull)\r
- return 1;\r
-\r
- if (_value == value._value)\r
- return 0;\r
-\r
- return Decimal.Compare(_value, value._value);\r
- }\r
-\r
- throw new ArgumentException("parameter obj is not SqlDecimal : " + obj.GetType().Name);\r
-\r
-\r
- }\r
-\r
-\r
- public SqlDecimal ConvertToPrecScale(SqlDecimal n, int precision, int scale)\r
- {\r
- /** @todo find out what the logic */\r
- throw new NotImplementedException();\r
- }\r
-\r
- /**\r
- * The division operator divides the first SqlDecimal operand by the second.\r
- * @param x A SqlDecimal instance.\r
- * @param y A SqlDecimal instance.\r
- * @return A SqlDecimal instance containing the results of the division operation.\r
- * If one of the parameters is null or null value - return SqlDouble.Null.\r
- */\r
- public static SqlDecimal Divide(SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull)\r
- return SqlDecimal.Null;\r
-\r
- Decimal res = Decimal.Divide(x._value, y._value);\r
-\r
- return new SqlDecimal(res);\r
- }\r
-\r
- public override bool Equals(Object obj)\r
- {\r
- if (obj == null)\r
- return false;\r
-\r
- if (obj is SqlDecimal)\r
- {\r
- SqlDecimal dec = (SqlDecimal)obj;\r
-\r
- return Decimal.Equals(_value, dec._value);\r
- }\r
-\r
- return false;\r
- }\r
-\r
- \r
- /**\r
- * Performs a logical comparison on two instances of SqlDecimal to determine if they are equal.\r
- * @param x A SqlDecimal instance.\r
- * @param y A SqlDecimal instance.\r
- * @return true if the two values are equal, otherwise false.\r
- * If one of the parameters is null or null value return SqlBoolean.Null.\r
- */\r
- public static SqlBoolean Equals(SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull)\r
- return SqlBoolean.Null;\r
-\r
- if (x.Equals(y))\r
- return SqlBoolean.True;\r
-\r
- return SqlBoolean.False;\r
- }\r
-\r
- /**\r
- * Rounds a specified SqlDecimal number to the next lower whole number.\r
- * @param n The SqlDecimal instance for which the floor value is to be calculated.\r
- * @return A SqlDecimal instance containing the whole number portion of this SqlDecimal instance.\r
- */\r
- public static SqlDecimal Floor(SqlDecimal n)\r
- {\r
- Decimal res = Decimal.Floor(n._value);\r
-\r
- return new SqlDecimal(res);\r
- }\r
-\r
- /**\r
- * Compares two instances of SqlDecimal to determine if the first is greater than the second.\r
- * @param x A SqlDecimal instance\r
- * @param y A SqlDecimal instance\r
- * @return A SqlBoolean that is True if the first instance is greater than the second instance, otherwise False.\r
- * If either instance of SqlDouble is null, the Value of the SqlBoolean will be Null.\r
- */\r
- public static SqlBoolean GreaterThan(SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull)\r
- return SqlBoolean.Null;\r
-\r
- if (x.CompareTo(y) > 0)\r
- return SqlBoolean.True;\r
-\r
- return SqlBoolean.False;\r
- }\r
-\r
- /**\r
- * Compares two instances of SqlDecimal to determine if the first is greater than or equal to the second.\r
- * @param x A SqlDecimal instance\r
- * @param y A SqlDecimal instance\r
- * @return A SqlBoolean that is True if the first instance is greaater than or equal to the second instance, otherwise False.\r
- * If either instance of SqlDouble is null, the Value of the SqlBoolean will be Null.\r
- */\r
- public static SqlBoolean GreaterThanOrEqual(SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull)\r
- return SqlBoolean.Null;\r
-\r
- if (x.CompareTo(y) >= 0)\r
- return SqlBoolean.True;\r
-\r
- return SqlBoolean.False;\r
- }\r
-\r
- /**\r
- * Compares two instances of SqlDecimal to determine if the first is less than the second.\r
- * @param x A SqlDecimal instance\r
- * @param y A SqlDecimal instance\r
- * @return A SqlBoolean that is True if the first instance is less than the second instance, otherwise False.\r
- * If either instance of SqlDouble is null, the Value of the SqlBoolean will be Null.\r
- */\r
- public static SqlBoolean LessThan(SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull)\r
- return SqlBoolean.Null;\r
-\r
- if (x.CompareTo(y) < 0)\r
- return SqlBoolean.True;\r
-\r
- return SqlBoolean.False;\r
- }\r
-\r
- /**\r
- * Compares two instances of SqlDecimal to determine if the first is less than the second.\r
- * @param x A SqlDecimal instance\r
- * @param y A SqlDecimal instance\r
- * @return A SqlBoolean that is True if the first instance is less than the second instance, otherwise False.\r
- * If either instance of SqlDouble is null, the Value of the SqlBoolean will be Null.\r
- */\r
- public static SqlBoolean LessThanOrEqual(SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull)\r
- return SqlBoolean.Null;\r
-\r
- if (x.CompareTo(y) <= 0)\r
- return SqlBoolean.True;\r
-\r
- return SqlBoolean.False;\r
- }\r
-\r
- /**\r
- * The multiplication operator computes the product of the two SqlDecimal operands.\r
- * @param x A SqlDecimal instance\r
- * @param y A SqlDecimal instance\r
- * @return The product of the two SqlDecimal operands.\r
- */\r
- public static SqlDecimal Multiply(SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull)\r
- return SqlDecimal.Null;\r
-\r
- Decimal res = Decimal.Multiply(x._value, y._value);\r
-\r
- return new SqlDecimal(res);\r
- }\r
-\r
- /**\r
- * Compares two instances of SqlDecimal to determine if they are equal.\r
- * @param x A SqlDecimal instance\r
- * @param y A SqlDecimal instance\r
- * @return A SqlBoolean that is True if the two instances are not equal or False if the two instances are equal.\r
- * If either instance of SqlDouble is null, the Value of the SqlBoolean will be Null.\r
- */\r
- public static SqlBoolean NotEquals(SqlDecimal x, SqlDecimal y)\r
- {\r
- SqlBoolean eVal = Equals(x, y);\r
-\r
- if (eVal.IsNull)\r
- return eVal;\r
- if (eVal.IsTrue)\r
- return SqlBoolean.False;\r
-\r
- return SqlBoolean.True;\r
- }\r
-\r
- /**\r
- * Converts the String representation of a number to its Decimal number equivalent.\r
- * @param s The String to be parsed.\r
- * @return A SqlDecimal containing the value represented by the String.\r
- */\r
- public static SqlDecimal Parse(String s)\r
- {\r
- Decimal val = Decimal.Parse(s);\r
- SqlDecimal retVal = new SqlDecimal(val);\r
-\r
- if (GreaterThan(retVal, MaxValue).IsTrue || LessThan(retVal, MinValue).IsTrue)\r
- throw new OverflowException("The parse of this string is overflowing : " + val);\r
-\r
- return retVal;\r
-\r
- }\r
-\r
- /**\r
- * Raises the value of the specified SqlDecimal instance to the specified exponential power.\r
- * @param n The SqlDecimal instance to be raised to a power.\r
- * @param exponent A double value indicating the power to which the number should be raised.\r
- * @return A SqlDecimal instance containing the results.\r
- */\r
- public static SqlDecimal Power(SqlDecimal n, double exponent)\r
- {\r
- /** @todo decide if we treat the Decimal as a double and use Math.pow() */\r
- \r
- double d = (double)n._value;\r
-\r
- d = java.lang.Math.pow(d, exponent);\r
-\r
- return new SqlDecimal(d);\r
- }\r
-\r
- /**\r
- * Gets the number nearest the specified SqlDecimal instance's value with the specified precision.\r
- * @param n The SqlDecimal instance to be rounded.\r
- * @param position The number of significant fractional digits (precision) in the return value.\r
- * @return A SqlDecimal instance containing the results of the rounding operation.\r
- */\r
- public static SqlDecimal Round(SqlDecimal n, int position)\r
- {\r
- Decimal val = Decimal.Round(n._value, position);\r
-\r
- return new SqlDecimal(val);\r
- }\r
-\r
- /**\r
- * Gets a value indicating the sign of a SqlDecimal instance's Value property.\r
- * @param n The SqlDecimal instance whose sign is to be evaluated.\r
- * @return A number indicating the sign of the SqlDecimal instance.\r
- */\r
- public static int Sign(SqlDecimal n)\r
- {\r
- if (n._value < 0)\r
- return -1;\r
- if(n._value > 0)\r
- return 1;\r
- return 0;\r
- }\r
-\r
- /**\r
- * The subtraction operator the second SqlDecimal operand from the first.\r
- * @param x A SqlDecimal instance\r
- * @param y A SqlDecimal instance\r
- * @return The results of the subtraction operation.\r
- */\r
- public static SqlDecimal Subtract(SqlDecimal x, SqlDecimal y)\r
- {\r
- Decimal val = Decimal.Subtract(x._value, y._value);\r
- SqlDecimal retVal = new SqlDecimal(val);\r
-\r
- return retVal;\r
-\r
- }\r
-\r
- /**\r
- * Returns the a double equal to the contents of the Value property of this instance.\r
- * @return The decimal representation of the Value property.\r
- */\r
- public double ToDouble()\r
- {\r
- return Decimal.ToDouble(_value);\r
- }\r
-\r
- /**\r
- * Converts this SqlDecimal instance to SqlBoolean.\r
- * @return A SqlBoolean instance whose Value will be True if the SqlDecimal instance's Value is non-zero,\r
- * False if the SqlDecimal is zero\r
- * and Null if the SqlDecimal instance is Null.\r
- */\r
- public SqlBoolean ToSqlBoolean()\r
- {\r
- if (IsNull)\r
- return SqlBoolean.Null;\r
-\r
- return new SqlBoolean(!_value.Equals(Decimal.Zero));\r
- }\r
-\r
- /**\r
- * Converts this SqlDecimal instance to SqlByte.\r
- * @return A SqlByte instance whose Value equals the Value of this SqlDouble instance.\r
- */\r
- public SqlByte ToSqlByte()\r
- {\r
- if (IsNull)\r
- return SqlByte.Null;\r
-\r
- return new SqlByte(checked((byte)_value));\r
- }\r
-\r
- /**\r
- * Converts this SqlDecimal instance to SqlDouble.\r
- * @return A SqlDouble instance whose Value equals the Value of this SqlDecimal instance.\r
- */\r
- public SqlDouble ToSqlDouble()\r
- {\r
- if (IsNull)\r
- return SqlDouble.Null;\r
-\r
- return new SqlDouble((double)_value);\r
- }\r
-\r
- /**\r
- * Converts this SqlDouble structure to SqlInt16.\r
- * @return A SqlInt16 structure whose Value equals the Value of this SqlDouble structure.\r
- */\r
- public SqlInt16 ToSqlInt16()\r
- {\r
- if (IsNull)\r
- return SqlInt16.Null;\r
-\r
- return new SqlInt16(checked((short)_value));\r
- }\r
-\r
- /**\r
- * Converts this SqlDouble structure to SqlInt32.\r
- * @return A SqlInt32 structure whose Value equals the Value of this SqlDouble structure.\r
- */\r
- public SqlInt32 ToSqlInt32()\r
- {\r
- if (IsNull)\r
- return SqlInt32.Null;\r
-\r
- return new SqlInt32(checked((int)_value));\r
- }\r
-\r
- /**\r
- * Converts this SqlDecimal structure to SqlInt64.\r
- * @return A SqlInt64 structure whose Value equals the Value of this SqlDecimal structure.\r
- */\r
- public SqlInt64 ToSqlInt64()\r
- {\r
- if (IsNull)\r
- return SqlInt64.Null;\r
-\r
- return new SqlInt64(checked((long)_value));\r
- }\r
-\r
- /**\r
- * Converts this SqlDecimal instance to SqlDouble.\r
- * @return A SqlMoney instance whose Value equals the Value of this SqlDecimal instance.\r
- */\r
- public SqlMoney ToSqlMoney()\r
- {\r
- if (IsNull)\r
- return SqlMoney.Null;\r
-\r
- return new SqlMoney(_value);\r
- }\r
-\r
- /**\r
- * Converts this SqlDecimal instance to SqlSingle.\r
- * @return A SqlSingle instance whose Value equals the Value of this SqlDecimal instance.\r
- */\r
- public SqlSingle ToSqlSingle()\r
- {\r
- if (IsNull)\r
- return SqlSingle.Null;\r
-\r
- return new SqlSingle(checked((float)_value));\r
- }\r
-\r
- /**\r
- * Converts this SqlDecimal structure to SqlString.\r
- * @return A SqlString structure whose value is a string representing the date and time contained in this SqlDecimal structure.\r
- */\r
- public SqlString ToSqlString()\r
- {\r
- return new SqlString(ToString());\r
- }\r
-\r
-\r
- public override String ToString()\r
- {\r
- if (IsNull)\r
- return "null";\r
-\r
- return _value.ToString();\r
- }\r
-\r
- /**\r
- * Truncates the specified SqlDecimal instance's value to the desired position.\r
- * @param n The SqlDecimal instance to be truncated.\r
- * @param position The decimal position to which the number will be truncated.\r
- * @return Supply a negative value for the position parameter in order to truncate the value to the corresponding positon to the left of the decimal point.\r
- */\r
- public static SqlDecimal Truncate(SqlDecimal n, int position)\r
- {\r
- if (n.IsNull)\r
- return n;\r
- \r
- Decimal tmp = Decimal.Round(n._value, position);\r
-\r
- return new SqlDecimal(tmp);\r
- }\r
-\r
- public override int GetHashCode()\r
- {\r
- return _value.GetHashCode();\r
- }\r
- \r
- public static SqlDecimal operator + (SqlDecimal x, SqlDecimal y)\r
- {\r
- if(x.IsNull || y.IsNull)\r
- return SqlDecimal.Null;\r
-\r
- return new SqlDecimal(x.Value + y.Value);\r
- }\r
-\r
- public static SqlDecimal operator / (SqlDecimal x, SqlDecimal y)\r
- {\r
- if(x.IsNull || y.IsNull)\r
- return SqlDecimal.Null;\r
- return new SqlDecimal (x.Value / y.Value);\r
- }\r
-\r
- public static SqlBoolean operator == (SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull) \r
- return SqlBoolean.Null;\r
-\r
- return new SqlBoolean(x.Value == y.Value);\r
- }\r
-\r
- public static SqlBoolean operator > (SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull) \r
- return SqlBoolean.Null;\r
-\r
- return new SqlBoolean(x.Value > y.Value);\r
- }\r
-\r
- public static SqlBoolean operator >= (SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull) \r
- return SqlBoolean.Null;\r
-\r
- return new SqlBoolean(x.Value >= y.Value);\r
- }\r
-\r
- public static SqlBoolean operator != (SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull) \r
- return SqlBoolean.Null;\r
-\r
- return new SqlBoolean(x.Value != y.Value);\r
- }\r
-\r
- public static SqlBoolean operator < (SqlDecimal x, SqlDecimal y)\r
- {\r
-\r
- if (x.IsNull || y.IsNull) \r
- return SqlBoolean.Null;\r
-\r
- return new SqlBoolean(x.Value < y.Value);\r
-\r
- }\r
-\r
- public static SqlBoolean operator <= (SqlDecimal x, SqlDecimal y)\r
- {\r
- if (x.IsNull || y.IsNull) \r
- return SqlBoolean.Null;\r
-\r
- return new SqlBoolean(x.Value <= y.Value);\r
- }\r
-\r
- public static SqlDecimal operator * (SqlDecimal x, SqlDecimal y)\r
- {\r
- // adjust the scale to the smaller of the two beforehand\r
- if (x.Scale > y.Scale)\r
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);\r
- else if (y.Scale > x.Scale)\r
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);\r
-\r
- return new SqlDecimal(x.Value * y.Value);\r
- }\r
-\r
- public static SqlDecimal operator - (SqlDecimal x, SqlDecimal y)\r
- {\r
- if(x.IsNull || y.IsNull)\r
- return SqlDecimal.Null;\r
-\r
- return new SqlDecimal(x.Value - y.Value);\r
- }\r
-\r
- public static SqlDecimal operator - (SqlDecimal n)\r
- {\r
- if(n.IsNull)\r
- return n;\r
- return new SqlDecimal (Decimal.Negate(n.Value));\r
- }\r
-\r
- public static explicit operator SqlDecimal (SqlBoolean x)\r
- {\r
- if (x.IsNull) \r
- return Null;\r
- else\r
- return new SqlDecimal ((decimal)x.ByteValue);\r
- }\r
-\r
- public static explicit operator Decimal (SqlDecimal n)\r
- {\r
- return n.Value;\r
- }\r
-\r
- public static explicit operator SqlDecimal (SqlDouble x)\r
- {\r
- checked \r
- {\r
- if (x.IsNull) \r
- return Null;\r
- else\r
- return new SqlDecimal ((decimal)x.Value);\r
- }\r
- }\r
-\r
- public static explicit operator SqlDecimal (SqlSingle x)\r
- {\r
- checked \r
- {\r
- if (x.IsNull) \r
- return Null;\r
- else\r
- return new SqlDecimal ((decimal)x.Value);\r
- }\r
- }\r
-\r
- public static explicit operator SqlDecimal (SqlString x)\r
- {\r
- checked \r
- {\r
- return Parse (x.Value);\r
- }\r
- }\r
-\r
- public static implicit operator SqlDecimal (decimal x)\r
- {\r
- return new SqlDecimal (x);\r
- }\r
-\r
- public static implicit operator SqlDecimal (SqlByte x)\r
- {\r
- if (x.IsNull) \r
- return Null;\r
- else\r
- return new SqlDecimal ((decimal)x.Value);\r
- }\r
-\r
- public static implicit operator SqlDecimal (SqlInt16 x)\r
- {\r
- if (x.IsNull) \r
- return Null;\r
- else\r
- return new SqlDecimal ((decimal)x.Value);\r
- }\r
-\r
- public static implicit operator SqlDecimal (SqlInt32 x)\r
- {\r
- if (x.IsNull) \r
- return Null;\r
- else\r
- return new SqlDecimal ((decimal)x.Value);\r
- }\r
-\r
- public static implicit operator SqlDecimal (SqlInt64 x)\r
- {\r
- if (x.IsNull) \r
- return Null;\r
- else\r
- return new SqlDecimal ((decimal)x.Value);\r
- }\r
-\r
- public static implicit operator SqlDecimal (SqlMoney x)\r
- {\r
- if (x.IsNull) \r
- return Null;\r
- else\r
- return new SqlDecimal ((decimal)x.Value);\r
- }\r
-\r
- }\r
-}
\ No newline at end of file
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !TARGET_JVM
using Mono.Data.Tds.Protocol;
-#endif
using System;
using System.Xml;
using System.Text;
return AdjustScale (n, -(n.Scale), false);
}
-#if !TARGET_JVM
internal static SqlDecimal FromTdsBigDecimal (TdsBigDecimal x)
{
if (x == null)
else
return new SqlDecimal (x.Precision, x.Scale, !x.IsNegative, x.Data);
}
-#endif
public override int GetHashCode ()
{
System.Data.SqlClient/SqlCommandBuilder.cs
System.Data.SqlClient/SqlConnection.cs
System.Data.SqlClient/SqlConnectionStringBuilder.cs
+System.Data.SqlClient/SqlCredential.cs
System.Data.SqlClient/SqlDataAdapter.cs
System.Data.SqlClient/SqlDataReader.cs
System.Data.SqlClient/SqlDataSourceConverter.cs
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum ConflictOption
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum ConflictOptions
{
_table = table;
_rowId = rowId;
+ rowError = String.Empty;
}
#endregion // Constructors
/// </summary>
public bool HasErrors {
get {
- if (RowError != string.Empty)
+ if (!string.IsNullOrEmpty (RowError))
return true;
foreach (String columnError in ColumnErrors) {
- if (columnError != null && columnError != string.Empty)
+ if (!string.IsNullOrEmpty (columnError))
return true;
}
return false;
/// </summary>
public string RowError {
get { return rowError; }
- set { rowError = value; }
+ set { rowError = value ?? string.Empty; }
}
internal int IndexFromVersion (DataRowVersion version)
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum FillOptions
{
+++ /dev/null
-namespace System.Data\r
-{\r
-\r
- using java.util;\r
-\r
- using System.Globalization;\r
- //using clr.System;\r
-\r
- public class Res\r
- {\r
- private static readonly String FILE_NAME = "SystemData";\r
- private static readonly ResourceBundle _resource =\r
- ResourceBundle.getBundle(FILE_NAME);\r
-\r
- public static String GetString(String name, Object[] args)\r
- {\r
- return GetString(null, name, args);\r
- }\r
-\r
- public static String GetString(CultureInfo culture, String name, Object[] args)\r
- {\r
- try\r
- {\r
- String str = _resource.getString(name);\r
- if (args != null && (int) args.Length > 0)\r
- {\r
- return String.Format(str, args);\r
- }\r
- else\r
- {\r
- return str;\r
- }\r
- }\r
- catch (MissingResourceException)\r
- {\r
- return null;\r
- }\r
- }\r
-\r
- public static String GetString(String name)\r
- {\r
- return GetString(null, name);\r
- }\r
-\r
- public static String GetString(CultureInfo culture, String name)\r
- {\r
- try\r
- {\r
- return _resource.getString(name);\r
- }\r
- catch (MissingResourceException)\r
- {\r
- return null;\r
- }\r
- }\r
-\r
- public static bool GetBoolean(String name)\r
- {\r
- return GetBoolean(name);\r
- }\r
-\r
- public static bool GetBoolean(CultureInfo culture, String name)\r
- {\r
- // This online demo only decompiles 10 methods in each class\r
- return false;\r
- }\r
-\r
- public static char GetChar(String name)\r
- {\r
- return GetChar(null, name);\r
- }\r
-\r
- public static char GetChar(CultureInfo culture, String name)\r
- {\r
- // This online demo only decompiles 10 methods in each class\r
- return (char)0;\r
- }\r
-\r
- public static int GetByte(String name)\r
- {\r
- return GetByte(null, name);\r
- }\r
-\r
- public static int GetByte(CultureInfo culture, String name)\r
- {\r
- return 0;\r
- }\r
-\r
- public static short GetShort(String name)\r
- {\r
- return GetShort(null, name);\r
- }\r
-\r
- public static short GetShort(CultureInfo culture, String name)\r
- {\r
- // This online demo only decompiles 10 methods in each class\r
- return 0;\r
- }\r
-\r
- public static int GetInt(String name)\r
- {\r
- return GetInt(null, name);\r
- }\r
-\r
- public static int GetInt(CultureInfo culture, String name)\r
- {\r
- // This online demo only decompiles 10 methods in each class\r
- return 0;\r
- }\r
-\r
- public static long GetLong(String name)\r
- {\r
- return GetLong(null, name);\r
- }\r
-\r
- public static long GetLong(CultureInfo culture, String name)\r
- {\r
- // This online demo only decompiles 10 methods in each class\r
- return 0;\r
- }\r
-\r
- public static float GetFloat(String name)\r
- {\r
- return GetFloat(null, name);\r
- }\r
-\r
- public static float GetFloat(CultureInfo culture, String name)\r
- {\r
- // This online demo only decompiles 10 methods in each class\r
- return 0.0f;\r
- }\r
-\r
- public static double GetDouble(String name)\r
- {\r
- return GetDouble(null, name);\r
- }\r
-\r
- public static double GetDouble(CultureInfo culture, String name)\r
- {\r
- // This online demo only decompiles 10 methods in each class\r
- return 0.0;\r
- }\r
-\r
- public static Object GetObject(String name)\r
- {\r
- return GetObject(null, name);\r
- }\r
-\r
- public static Object GetObject(CultureInfo culture, String name)\r
- {\r
- // This online demo only decompiles 10 methods in each class\r
- return null;\r
- }\r
- }\r
-}
\ No newline at end of file
//
-#if NET_2_0 || TARGET_JVM
+#if NET_2_0
namespace System.Data {
public enum UpdateOptions
{
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <appSettings>
- <add key="ConnectionString" value="Provider=SQLOLEDB.1;Data Source=powergh;Initial Catalog=GHTDB;User Id=sa;Password=sa" />
- <!--
- <add key="ConnectionString" value="Provider=SQLOLEDB.1;Data Source=xp050;Initial Catalog=GHTDB;User Id=sa;Password=" />
- <add key="ConnectionString" value="Provider=MSDAORA.1;hostname=xp050;port=1521;User ID=ghtdb;Password=ghtdb;ServiceName=xp050;Data Source=xp050" />
- <add key="ConnectionString" value="Provider=IBMDADB2;Password=db2admin;User ID=db2admin;Data Source=GHTDB;HostName=xp050;Port=50000;Location=xp050:50000" />
- <add key="ConnectionString" value="Provider=Sybase ASE OLE DB Provider;hostname=KONGO;port=5000;User ID=sa;Password=;ServiceName=KONGO;Data Source=sybaseoledb;JdbcDriverClassName=com.sybase.jdbc2.jdbc.SybDriver;JdbcURL=jdbc:sybase:Tds:KONGO:5000/GHTDB;user=sa;DatabaseName=GHTDB" />
- <add key="ConnectionString" value="Provider=Mainsoft.JDBC.OLEDB.1;Persist Security Info=False;User ID=super;Data Source=PostgreSQL_XP050;Extended Properties="DSN=PostgreSQL_XP050;DATABASE=GHTDB;SERVER=xp050;PORT=5432;UID=super;ReadOnly=0;Protocol=6.4;FakeOidIndex=0;ShowOidColumn=0;RowVersioning=0;ShowSystemTables=0;ConnSettings=;Fetch=100;Socket=8192;UnknownSizes=0;MaxVarcharSize=254;MaxLongVarcharSize=8190;Debug=0;CommLog=0;Optimizer=1;Ksqo=1;UseDeclareFetch=0;TextAsLongVarchar=1;UnknownsAsLongVarchar=0;BoolsAsChar=0;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;;LFConversion=1;UpdatableCursors=0;DisallowPremature=0;TrueIsMinus1=0;BI=0;ByteaAsLongVarBinary=0;UseServerSidePrepare=0";Initial Catalog=GHTDB;JdbcDriverClassName=org.postgresql.Driver;JdbcURL=jdbc:postgresql://xp050/GHTDB;User=super;Password=super" />
- -->
- </appSettings>
-</configuration>
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 8.00\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.Data.OleDb.Tests.J2EE", "System.Data.OleDb.Tests.J2EE.vmwcsproj", "{D5887372-DC7D-47E1-8CAA-B348643412ED}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- EndProjectSection\r
-EndProject\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "nunit.framework.dll.J2EE", "..\..\..\..\nunit20\framework\nunit.framework.dll.J2EE.vmwcsproj", "{39CC8FF7-EF1A-41A1-B727-42684211ECD1}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- EndProjectSection\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfiguration) = preSolution\r
- Debug = Debug\r
- Debug_Java = Debug_Java\r
- Debug-Strong = Debug-Strong\r
- Release = Release\r
- Release_Java = Release_Java\r
- EndGlobalSection\r
- GlobalSection(ProjectConfiguration) = postSolution\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Debug.ActiveCfg = Debug|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Debug.Build.0 = Debug|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Debug_Java.ActiveCfg = Debug_Java|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Debug_Java.Build.0 = Debug_Java|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Debug-Strong.ActiveCfg = Debug|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Debug-Strong.Build.0 = Debug|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Release.ActiveCfg = Release_Java|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Release.Build.0 = Release_Java|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Release_Java.ActiveCfg = Release_Java|.NET\r
- {D5887372-DC7D-47E1-8CAA-B348643412ED}.Release_Java.Build.0 = Release_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug.ActiveCfg = Debug|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug_Java.ActiveCfg = Debug_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug_Java.Build.0 = Debug_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug-Strong.ActiveCfg = Debug|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug-Strong.Build.0 = Debug|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release.ActiveCfg = Release_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release.Build.0 = Release_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release_Java.ActiveCfg = Release_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release_Java.Build.0 = Release_Java|.NET\r
- EndGlobalSection\r
- GlobalSection(ExtensibilityGlobals) = postSolution\r
- EndGlobalSection\r
- GlobalSection(ExtensibilityAddIns) = postSolution\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;TARGET_JVM;NET_1_1;NET_2_0;KNOWN_BUG</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{67E25B16-2068-4DA3-8008-5ACA13DE2843}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Data.OleDb.Tests.J2EE</RootNamespace>\r
- <AssemblyName>System.Data.OleDb.Tests.J2EE</AssemblyName>\r
- <JDKName>1.5.0_05</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=0.0.0.0, Culture=neutral">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\System.Data.Test.Utils\DataProvider.cs">\r
- <Link>System.Data.OleDb.jvm\MonoTests.System.Data.Utils\DataProvider.cs</Link>\r
- </Compile>\r
- <Compile Include="System.Data.OleDb.jvm\MonoTests.System.Data.Utils\ADONetTesterClass.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\MonoTests.System.Data.Utils\ConnectedDataProvider.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\MonoTests.System.Data.Utils\DbTypeParameter.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\MonoTests.System.Data.Utils\DbTypeParametersCollection.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\MonoTests.System.Data.Utils\GHTBase.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommandBuilder\OleDbCommandBuilder_DeriveParameters_O.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_CommandText.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_CommandTimeout.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_CommandType.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_Connection.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_Dispose.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_ExecuteNonQuery.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_ExecuteReader.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_ExecuteScalar.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_New.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_Parameters.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_Prepare.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbCommand\OleDbCommand_Transaction.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\IDBConnection_For_OleDb.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_BeginTransaction.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_ChangeDatabase.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_Close.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_ConnectionString.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_ConnectionTimeout.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_CreateCommand.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_Database.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_DataSource.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_Equals.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_GetOleDbSchemaTable.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_InfoMessage.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_New.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_Open.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_Provider.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_State.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbConnection\OleDbConnection_StateChange.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_AcceptChangesDuringFill.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_ContinueUpdateOnError.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_ctor.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_ctor_O.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_ctor_SO.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_ctor_SS.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_DeleteCommand.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Dispose.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_FillError.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_FillSchema_DS.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_FillSchema_DSS.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_FillSchema_DsSt.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_FillSchema_DtSch.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Fill_1.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Fill_2.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Fill_3.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Fill_Ds.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Fill_DsStr.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Fill_Ds_Int_Int_Str.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Fill_Dt.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_GetFillParameters.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_InsertCommand.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_MissingMappingAction.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_MissingSchemaAction.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_RowUpdated.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_RowUpdating.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_SelectCommand.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_TableMappings.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_ToString.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_UpdateCommand.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Update_Dr.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Update_Ds.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Update_DsStr.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataAdapter\OleDbDataAdapter_Update_Dt.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_Close.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_ctor.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_Depth.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetBoolean.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetBytes_IIBII.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetByte_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetChars.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetDataTypeName.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetDateTime.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetDecimal_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetDouble_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetFieldType.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetFloat_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetGuiid_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetInt16.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetInt32_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetInt64.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetName_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetOrdinal.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetSchemaTable.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetString_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetTimeSpan_I.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetValue.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_GetValues.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_HasRows.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_IsDBNull.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_Item.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_NextResult.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_Read.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbDataReader\OleDbDataReader_RecordsAffected.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbLiteral\OleDbLiteral.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameterCollection\OleDbParameterCollection_Add.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameterCollection\OleDbParameterCollection_Contains.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameterCollection\OleDbParameterCollection_Count.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameter\OleDbParameter_ctor.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameter\OleDbParameter_ctor_SO.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameter\OleDbParameter_ctor_SOIPBBBSDO.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameter\OleDbParameter_ctor_SOtype.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameter\OleDbParameter_ctor_SOtypeI.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbParameter\OleDbParameter_ctor_SOtype_IS.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbTransaction\OleDbTransaction_Begin.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbTransaction\OleDbTransaction_Commit.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbTransaction\OleDbTransaction_Connection.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbTransaction\OleDbTransaction_ctor.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbTransaction\OleDbTransaction_IsolationLevel.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbTransaction\OleDbTransaction_Rollback.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbType\OleDbType.cs" />\r
- <Compile Include="System.Data.OleDb.jvm\OleDbType\OleDbType_Date.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlCommandBuilder\SqlCommandBuilder_DeriveParameters_S.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlCommand\SqlCommand_ExecuteReader_.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlCommand\SqlCommand_ExecuteXmlReader_.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlCommand\SqlCommand_Parameters.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlConnection\SqlConnection_BeginTransaction_S.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlConnection\SqlConnection_InfoMessage.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlConnection\SqlConnection_StateChange.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlDataAdapter\SqlDataAdapter_RowUpdated.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlDataAdapter\SqlDataAdapter_RowUpdating.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlParameter\SqlParameter_ctor_SO.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlParameter\SqlParameter_Direction.cs" />\r
- <Compile Include="System.Data.SqlClient.jvm\SqlParameter\SqlParameter_set_DbType_D.cs" />\r
- <Compile Include="System.Data.SqlClient\SqlConnectionStringBuilderTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj">\r
- <Project>{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}</Project>\r
- <Name>nunit.framework.dll20.J2EE</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-rt="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-system-data="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Data.jar" REFS-JarPath-system="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.OleDb.Tests20.J2EE", "System.Data.OleDb.Tests20.J2EE.csproj", "{67E25B16-2068-4DA3-8008-5ACA13DE2843}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll20.J2EE", "..\..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj", "{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {67E25B16-2068-4DA3-8008-5ACA13DE2843}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {67E25B16-2068-4DA3-8008-5ACA13DE2843}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {67E25B16-2068-4DA3-8008-5ACA13DE2843}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {67E25B16-2068-4DA3-8008-5ACA13DE2843}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {67E25B16-2068-4DA3-8008-5ACA13DE2843}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {67E25B16-2068-4DA3-8008-5ACA13DE2843}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {67E25B16-2068-4DA3-8008-5ACA13DE2843}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {67E25B16-2068-4DA3-8008-5ACA13DE2843}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
// The .NET Framework provides support for Oracle LOBs in the OracleClient namespace, but not in the OleDb namespace.
// Since Visual MainWin does not support the OracleClient namespace, a partial support for this important feature is provided in the OleDb namespace.
// See ms-help://MS.VSCC.2003/VMW.GH.1033/ghdoc/vmwdoc_ADONET_data_access_limitations_51.htm
-#if TARGET_JVM
-
- row.Add("BLOB", new byte[] {0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- ,0x00, 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF, 0xF0
- }, 4000);
- row.Add("CLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
- row.Add("NCLOB", SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- + SAMPLE_STRING
- , 4000);
-#endif
break;
#endregion
public void Default ()\r
{\r
DBDataPermissionAttribute a = new NonAbstractDBDataPermissionAttribute (SecurityAction.Assert);\r
-#if !TARGET_JVM\r
Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId");\r
-#endif \r
Assert.IsFalse (a.Unrestricted, "Unrestricted");\r
Assert.IsFalse (a.AllowBlankPassword, "AllowBlankPassword");\r
Assert.AreEqual (String.Empty, a.ConnectionString, "ConnectionString");\r
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
Assert.AreEqual ("System.Data.Common.DataColumnMappingCollection", columnMapCollection.ToString(), "test1");
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
Assert.AreEqual("System.Data.Common.DataTableMappingCollection", tableMapCollection.ToString(), "test1");
dbConnection.Close();
dbConnection = null;
}
+
+ [Test]
+ [Category ("NotWorking")] // Requires newer sqlite than is on wrench
+ public void UpdateResetRowErrorCorrectly ()
+ {
+ const string connectionString = "URI = file::memory:; Version = 3";
+ using (var dbConnection = new SqliteConnection (connectionString)) {
+ dbConnection.Open ();
+
+ using (var cmd = dbConnection.CreateCommand ()) {
+ cmd.CommandText = "CREATE TABLE data (id PRIMARY KEY, name TEXT)";
+ cmd.ExecuteNonQuery ();
+ }
+
+
+ var ts = dbConnection.BeginTransaction ();
+ var da = new SqliteDataAdapter ("SELECT * FROM data", dbConnection);
+ var builder = new SqliteCommandBuilder (da);
+ da.UpdateCommand = builder.GetUpdateCommand ();
+ da.UpdateCommand.Transaction = ts;
+
+ var ds1 = new DataSet ();
+ da.Fill (ds1, "data");
+
+ var table = ds1.Tables [0];
+ var row = table.NewRow ();
+ row ["id"] = 10;
+ row ["name"] = "Bart";
+ table.Rows.Add (row);
+
+ var ds2 = ds1.GetChanges ();
+ da.Update (ds2, "data");
+ Assert.IsFalse (ds2.HasErrors);
+ }
+ }
#endif
#endif
using System.Data.Common;
using System.IO;
-namespace Test.System.Data.Common
+namespace MonoTests.System.Data.Common
{
internal class DbDataReaderMock : DbDataReader
{
using System.Data.Common;
using System.IO;
-namespace Test.System.Data.Common
+namespace MonoTests.System.Data.Common
{
[TestFixture]
public class DbDataReaderTest
using System.Data.SqlTypes;
using System.Threading;
using System.Globalization;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
namespace MonoTests.System.Data.SqlTypes
{
using System;
using System.Xml;
using System.Data.SqlTypes;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
#if NET_2_0
using System.Xml.Serialization;
using System.IO;
using System;
using System.Xml;
using System.Data.SqlTypes;
-#if TARGET_JVM
-using DivideByZeroException = System.ArithmeticException;
-#endif
#if NET_2_0
using System.Xml.Serialization;
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void CompareTo()
{
SqlByte Test = new SqlByte (1);
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void Greaters()
{
// GreateThan ()
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void Lessers()
{
// LessThan()
byte test = Test1.GetUnicodeBytes () [105];
Assert.Fail ("#N05");
} catch (Exception e) {
-#if TARGET_JVM
- Assert.IsTrue (typeof (IndexOutOfRangeException).IsAssignableFrom(e.GetType()), "#N06");
-#else
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType(), "#N06");
-#endif
}
}
}
[Test]
-#if TARGET_JVM
- [Ignore ("The option CompareOptions.IgnoreWidth is not supported")]
-#endif
public void ThanOrEqualOperators()
{
// == -operator
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 8.00\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.Data.Test", "System.Data.Test.vmwcsproj", "{B1B135D9-4FB2-4369-8C4F-983AFD06044F}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- EndProjectSection\r
-EndProject\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "nunit.framework.dll.J2EE", "..\..\..\nunit20\framework\nunit.framework.dll.J2EE.vmwcsproj", "{39CC8FF7-EF1A-41A1-B727-42684211ECD1}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- EndProjectSection\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfiguration) = preSolution\r
- Debug = Debug\r
- Debug_Java = Debug_Java\r
- Release_Java = Release_Java\r
- EndGlobalSection\r
- GlobalSection(ProjectConfiguration) = postSolution\r
- {B1B135D9-4FB2-4369-8C4F-983AFD06044F}.Debug.ActiveCfg = Debug_Java|.NET\r
- {B1B135D9-4FB2-4369-8C4F-983AFD06044F}.Debug.Build.0 = Debug_Java|.NET\r
- {B1B135D9-4FB2-4369-8C4F-983AFD06044F}.Debug_Java.ActiveCfg = Debug_Java|.NET\r
- {B1B135D9-4FB2-4369-8C4F-983AFD06044F}.Debug_Java.Build.0 = Debug_Java|.NET\r
- {B1B135D9-4FB2-4369-8C4F-983AFD06044F}.Release_Java.ActiveCfg = Release_Java|.NET\r
- {B1B135D9-4FB2-4369-8C4F-983AFD06044F}.Release_Java.Build.0 = Release_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug.ActiveCfg = Debug|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug.Build.0 = Debug|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug_Java.ActiveCfg = Debug_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug_Java.Build.0 = Debug_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release_Java.ActiveCfg = Release_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release_Java.Build.0 = Release_Java|.NET\r
- EndGlobalSection\r
- GlobalSection(ExtensibilityGlobals) = postSolution\r
- EndGlobalSection\r
- GlobalSection(ExtensibilityAddIns) = postSolution\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Data.Test</RootNamespace>\r
- <AssemblyName>System.Data.Test</AssemblyName>\r
- <JDKName>1.5.0_05</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=0.0.0.0, Culture=neutral">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="System.Data.Common\DataAdapterTest.cs" />\r
- <Compile Include="System.Data.Common\DataColumnMappingCollectionTest.cs" />\r
- <Compile Include="System.Data.Common\DataTableMappingCollectionTest.cs" />\r
- <Compile Include="System.Data.Common\DbConnectionStringBuilderTest.cs" />\r
- <Compile Include="System.Data.Common\DBDataPermissionAttributeTest.cs" />\r
- <Compile Include="System.Data.Common\DbProviderFactoriesConfigurationHandlerTest.cs" />\r
- <Compile Include="System.Data.SqlClient\SqlConnectionStringBuilderTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlBinaryTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlBooleanTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlBytesTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlByteTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlCharsTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlDateTimeTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlDecimalTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlDoubleTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlGuidTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlInt16Test.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlInt32Test.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlInt64Test.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlMoneyTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlSingleTest.cs" />\r
- <Compile Include="System.Data.SqlTypes\SqlStringTest.cs" />\r
- <Compile Include="System.Data.Test.Utils\DataProvider.cs" />\r
- <Compile Include="System.Data\BinarySerializationTest.cs" />\r
- <Compile Include="System.Data\ConstraintCollectionTest.cs" />\r
- <Compile Include="System.Data\ConstraintCollectionTest2.cs" />\r
- <Compile Include="System.Data\ConstraintExceptionTest.cs" />\r
- <Compile Include="System.Data\ConstraintTest.cs" />\r
- <Compile Include="System.Data\DataColumnCollectionTest.cs" />\r
- <Compile Include="System.Data\DataColumnCollectionTest2.cs" />\r
- <Compile Include="System.Data\DataColumnTest.cs" />\r
- <Compile Include="System.Data\DataColumnTest2.cs" />\r
- <Compile Include="System.Data\DataRelationCollectionTest.cs" />\r
- <Compile Include="System.Data\DataRelationCollectionTest2.cs" />\r
- <Compile Include="System.Data\DataRelationTest.cs" />\r
- <Compile Include="System.Data\DataRelationTest2.cs" />\r
- <Compile Include="System.Data\DataRowCollectionTest.cs" />\r
- <Compile Include="System.Data\DataRowCollectionTest2.cs" />\r
- <Compile Include="System.Data\DataRowTest.cs" />\r
- <Compile Include="System.Data\DataRowTest2.cs" />\r
- <Compile Include="System.Data\DataRowViewTest.cs" />\r
- <Compile Include="System.Data\DataRowViewTest2.cs" />\r
- <Compile Include="System.Data\DataSet1.Designer.cs">\r
- </Compile>\r
- <Compile Include="System.Data\DataSetAssertion.cs" />\r
- <Compile Include="System.Data\DataSetInferXmlSchemaTest.cs" />\r
- <Compile Include="System.Data\DataSetReadXmlSchemaTest.cs" />\r
- <Compile Include="System.Data\DataSetReadXmlTest.cs" />\r
- <Compile Include="System.Data\DataSetTest.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Data\DataSetTest2.cs" />\r
- <Compile Include="System.Data\DataSetTypedDataSetTest.cs" />\r
- <Compile Include="System.Data\DataTableCollectionTest.cs" />\r
- <Compile Include="System.Data\DataTableCollectionTest2.cs" />\r
- <Compile Include="System.Data\DataTableLoadRowTest.cs" />\r
- <Compile Include="System.Data\DataTableReaderTest.cs" />\r
- <Compile Include="System.Data\DataTableReadWriteXmlTest.cs" />\r
- <Compile Include="System.Data\DataTableReadXmlSchemaTest.cs" />\r
- <Compile Include="System.Data\DataTableTest.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Data\DataTableTest2.cs" />\r
- <Compile Include="System.Data\DataTableTest3.cs" />\r
- <Compile Include="System.Data\DataTableTest4.cs" />\r
- <Compile Include="System.Data\DataTableTest5.cs" />\r
- <Compile Include="System.Data\DataViewManagerTest.cs" />\r
- <Compile Include="System.Data\DataViewTest.cs" />\r
- <Compile Include="System.Data\DataViewTest2.cs" />\r
- <Compile Include="System.Data\DataViewTest_IBindingList.cs" />\r
- <Compile Include="System.Data\DataViewTest_IBindingListView.cs" />\r
- <Compile Include="System.Data\DeletedRowInaccessibleExceptionTest.cs" />\r
- <Compile Include="System.Data\DuplicateNameExceptionTest.cs" />\r
- <Compile Include="System.Data\EvaluateExceptionTest.cs" />\r
- <Compile Include="System.Data\ForeignKeyConstraintTest.cs" />\r
- <Compile Include="System.Data\ForeignKeyConstraintTest2.cs" />\r
- <Compile Include="System.Data\InRowChangingEventExceptionTest.cs" />\r
- <Compile Include="System.Data\InvalidConstraintExceptionTest.cs" />\r
- <Compile Include="System.Data\MissingPrimaryKeyExceptionTest.cs" />\r
- <Compile Include="System.Data\MonkeyDataSet.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Data\NoNullAllowedExceptionTest.cs" />\r
- <Compile Include="System.Data\ReadOnlyExceptionTest.cs" />\r
- <Compile Include="System.Data\RowNotInTableExceptionTest.cs" />\r
- <Compile Include="System.Data\SyntaxErrorExceptionTest.cs" />\r
- <Compile Include="System.Data\TrailingSpaceTest.cs" />\r
- <Compile Include="System.Data\UniqueConstraintTest.cs" />\r
- <Compile Include="System.Data\UniqueConstraintTest2.cs" />\r
- <Compile Include="System.Data\VersionNotFoundException.cs" />\r
- <Compile Include="System.Data\XmlDataLoaderTest.cs" />\r
- <Compile Include="System.Data\XmlDataReaderTest.cs" />\r
- <Compile Include="System.Data\XmlExportOfTypedDataSetTest.cs" />\r
- <Compile Include="System.Xml\XmlDataDocumentTest.cs" />\r
- <Compile Include="System.Xml\XmlDataDocumentTest2.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="System.Data\own_schema.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test001.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test002.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test003.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test004.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test005.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test006.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test007.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test008.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test009.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test010.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test011.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test012.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test013.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test014.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\schemas\test103.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\store.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\store2.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\store3.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Data\store4.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- <None Include="System.Xml\store.xsd">\r
- <SubType>Designer</SubType>\r
- </None>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="System.Data\region.xml" />\r
- <Content Include="System.Data\TypedDataSet.xml" />\r
- <Content Include="System.Xml\2books.xml" />\r
- <Content Include="System.Xml\region.xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj">\r
- <Project>{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}</Project>\r
- <Name>nunit.framework.dll20.J2EE</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Data.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Test20", "System.Data.Test20.csproj", "{DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll20.J2EE", "..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj", "{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {DA1981D9-7FE1-493F-8B8C-3DFE47DE7934}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
using NUnit.Framework;
+namespace MonoTests.System.Data
+{
[TestFixture]
public class BinarySerializationTest
{
dt.Rows[1].RejectChanges();
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void DataTableSerializationTest2 ()
{
//Serialize Table
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void Test_With_Null_Values2 ()
{
//Serialize Table
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void DataSetSerializationTest2 ()
{
DataSet ds = new DataSet ();
Assert.AreEqual (ds.Relations [i].RelationName, ds.Relations [i].RelationName, "#9 Relation : {0} differs", ds.Relations [i]);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Net Binary formatting is not supported for DataSet")]
-#endif
public void Constraint_Relations_Test2 ()
{
//Serialize DataSet
}
#endif
+}
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class ConstraintExceptionTest
{
using NUnit.Framework;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
public class DBConcurrencyExceptionTest
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest ()
{
DataTable Table = new DataTable ("test_table");
Assert.AreEqual (1, Rows.Count, "test#01");
Assert.IsFalse (Rows.IsReadOnly, "test#02");
Assert.IsFalse (Rows.IsSynchronized, "test#03");
-#if !TARGET_JVM
Assert.AreEqual ("System.Data.DataRowCollection", Rows.ToString (), "test#04");
-#endif
string [] cols = new string [2];
cols [0] = "first";
Rows.Add (cols);
Assert.AreEqual (3, Rows.Count, "test#05");
-#if !TARGET_JVM
Assert.AreEqual ("System.Data.DataRow", Rows [0].ToString (), "test#06");
-#endif
Assert.AreEqual (DBNull.Value, Rows [0] [0], "test#07");
Assert.AreEqual (DBNull.Value, Rows [0] [1], "test#08");
Assert.AreEqual ("first", Rows [1] [0], "test#09");
Assert.AreEqual(true , dr.HasErrors , "DRW48");
}
+ [Test] public void HasErrorsWithNullError()
+ {
+ DataTable dt = new DataTable("myTable");
+ DataRow dr = dt.NewRow();
+
+ // HasErrors (default)
+ Assert.AreEqual(false, dr.HasErrors, "DRW47.2");
+
+ dr.RowError = null;
+
+ // HasErrors (set/get)
+ Assert.AreEqual(string.Empty , dr.RowError , "DRW48.2");
+ Assert.AreEqual(false , dr.HasErrors , "DRW49.2");
+ }
+
[Test] public void HasVersion_ByDataRowVersion()
{
DataTable t = new DataTable("atable");
using System.Runtime.Serialization.Formatters.Binary;
using System.Globalization;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
public class DataSetTest2
dt.Rows.Add(new object[] {2,"Value3","Value4"});
dt.Rows.Add(new object[] {3,"Value5","Value5"});
- System.Text.StringBuilder resultXML = new System.Text.StringBuilder();
+ StringBuilder resultXML = new StringBuilder();
resultXML.Append("<" + ds.DataSetName + "xmlns=\"namespace\">");
[Test] public void Locale()
{
DataSet ds = new DataSet("MyDataSet");
- System.Globalization.CultureInfo culInfo = System.Globalization.CultureInfo.CurrentCulture ;
+ CultureInfo culInfo = CultureInfo.CurrentCulture ;
// Checking Locale default from system
Assert.AreEqual(culInfo, ds.Locale , "DS156");
// Checking Locale get/set
- culInfo = new System.Globalization.CultureInfo("fr"); // = french
+ culInfo = new CultureInfo("fr"); // = french
ds.Locale = culInfo ;
Assert.AreEqual(culInfo , ds.Locale , "DS157");
}
ds1.Tables.Add(DataProvider.CreateParentDataTable());
ds1.Tables.Add(DataProvider.CreateChildDataTable());
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
+ MemoryStream ms = new MemoryStream();
//write xml schema only
ds1.WriteXmlSchema(ms);
- System.IO.MemoryStream ms1 = new System.IO.MemoryStream(ms.GetBuffer());
+ MemoryStream ms1 = new MemoryStream(ms.GetBuffer());
//copy schema
DataSet ds2 = new DataSet();
ds2.ReadXmlSchema(ms1);
Assert.AreEqual(0, ds2.Tables[1].Rows.Count , "DS282");
//try to delete the file
- System.IO.File.Delete(sTempFileName);
+ File.Delete(sTempFileName);
}
[Test] public void ReadXmlSchema_ByTextReader()
ds1.Tables.Add(DataProvider.CreateParentDataTable());
ds1.Tables.Add(DataProvider.CreateChildDataTable());
- System.IO.StringWriter sw = new System.IO.StringWriter();
+ StringWriter sw = new StringWriter();
//write xml file, schema only
ds1.WriteXmlSchema(sw);
- System.IO.StringReader sr = new System.IO.StringReader(sw.GetStringBuilder().ToString());
+ StringReader sr = new StringReader(sw.GetStringBuilder().ToString());
//copy both data and schema
DataSet ds2 = new DataSet();
ds2.ReadXmlSchema(sr);
ds1.Tables.Add(DataProvider.CreateParentDataTable());
ds1.Tables.Add(DataProvider.CreateChildDataTable());
- System.IO.StringWriter sw = new System.IO.StringWriter();
- System.Xml.XmlTextWriter xmlTW = new System.Xml.XmlTextWriter(sw);
+ StringWriter sw = new StringWriter();
+ XmlTextWriter xmlTW = new XmlTextWriter(sw);
//write xml file, schema only
ds1.WriteXmlSchema(xmlTW);
xmlTW.Flush();
- System.IO.StringReader sr = new System.IO.StringReader(sw.ToString());
- System.Xml.XmlTextReader xmlTR = new System.Xml.XmlTextReader(sr);
+ StringReader sr = new StringReader(sw.ToString());
+ XmlTextReader xmlTR = new XmlTextReader(sr);
//copy both data and schema
DataSet ds2 = new DataSet();
Assert.AreEqual(ds2.Tables[1].Rows.Count, ds1.Tables[1].Rows.Count , "DS299");
//try to delete the file
- System.IO.File.Delete(sTempFileName);
+ File.Delete(sTempFileName);
}
[Test]
ds1.Tables[1].Rows.Add(new object[] {7,2," "," ",new DateTime(2000,1,1,0,0,0,0),35});
ds1.Tables[1].Rows.Add(new object[] {7,3,"","",new DateTime(2000,1,1,0,0,0,0),35});
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
+ MemoryStream ms = new MemoryStream();
//write xml file, data only
ds1.WriteXml(ms);
{
string input = string.Empty;
- System.IO.StringReader sr;
+ StringReader sr;
DataSet ds = new DataSet();
input += "<?xml version=\"1.0\"?>";
input += " </Price>";
input += "</Stock>";
- sr = new System.IO.StringReader(input);
+ sr = new StringReader(input);
ds.ReadXml(sr);
{
DataSet ds = new DataSet("TestDataSet");
string input = string.Empty;
- System.IO.StringReader sr;
+ StringReader sr;
input += "<?xml version=\"1.0\" standalone=\"yes\"?>";
input += "<Stocks><Stock name=\"MSFT\"><Company name=\"Microsoft Corp.\" /><Price type=\"high\"><Value>10.0</Value>";
input += "<Company name=\"General Electric\" /><Price type=\"high\"><Value>22.23</Value><Date>02/12/2001</Date></Price>";
input += "<Price type=\"low\"><Value>1.97</Value><Date>04/20/2003</Date></Price><Price type=\"current\"><Value>3.0</Value>";
input += "<Date>TODAY</Date></Price></Stock></Stocks>";
- sr = new System.IO.StringReader(input);
+ sr = new StringReader(input);
ds.EnforceConstraints = false;
ds.ReadXml(sr);
{
m_ds = new DataSet("Stocks");
string input = string.Empty;
- System.IO.StringReader sr;
+ StringReader sr;
input += "<?xml version=\"1.0\"?>";
input += "<Stocks>";
input += " </Stock>";
input += "</Stocks>";
- sr = new System.IO.StringReader(input);
+ sr = new StringReader(input);
m_ds.EnforceConstraints = true;
m_ds.ReadXml(sr);
this.privateTestCase("TestCase 1", "Company", "name='Microsoft Corp.'", "Stock", "name='MSFT'", "DS320");
#region "TestCase 1 - Empty string"
// Empty string
DataSet ds = new DataSet();
- System.IO.StringReader sr = new System.IO.StringReader (string.Empty);
- System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr);
+ StringReader sr = new StringReader (string.Empty);
+ XmlTextReader xReader = new XmlTextReader(sr);
try
{
ds.ReadXml (xReader);
Assert.Fail("DS335: ReadXml Failed to throw XmlException");
}
- catch (System.Xml.XmlException) {}
+ catch (XmlException) {}
catch (AssertionException exc) {throw exc;}
catch (Exception exc)
{
private void PrivateTestCase(string a_name, string a_expected, string a_xmlData)
{
DataSet ds = new DataSet();
- System.IO.StringReader sr = new System.IO.StringReader(a_xmlData) ;
- System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr) ;
+ StringReader sr = new StringReader(a_xmlData) ;
+ XmlTextReader xReader = new XmlTextReader(sr) ;
ds.ReadXml (xReader);
Assert.AreEqual(a_expected, this.dataSetDescription(ds), "DS337");
}
xmlData += "<c>3</c>";
xmlData += "</b>";
xmlData += "</a>";
- System.IO.StringReader sr = new System.IO.StringReader(xmlData) ;
- System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr) ;
+ StringReader sr = new StringReader(xmlData) ;
+ XmlTextReader xReader = new XmlTextReader(sr) ;
ds.ReadXml (xReader);
Assert.AreEqual(3, ds.Tables["c"].Rows.Count, "DS338");
}
ds1.Tables[1].Rows.Add(new object[] {7,2," "," ",new DateTime(2000,1,1,0,0,0,0),35});
ds1.Tables[1].Rows.Add(new object[] {7,3,"","",new DateTime(2000,1,1,0,0,0,0),35});
- System.IO.StringWriter sw = new System.IO.StringWriter();
+ StringWriter sw = new StringWriter();
//write xml file, data only
ds1.WriteXml(sw);
//clear the data
ds2.Clear();
- System.IO.StringReader sr = new System.IO.StringReader(sw.GetStringBuilder().ToString());
+ StringReader sr = new StringReader(sw.GetStringBuilder().ToString());
ds2.ReadXml(sr);
//check xml data
ds1.Tables[1].Rows.Add(new object[] {7,2," "," ",new DateTime(2000,1,1,0,0,0,0),35});
ds1.Tables[1].Rows.Add(new object[] {7,3,"","",new DateTime(2000,1,1,0,0,0,0),35});
- System.IO.StringWriter sw = new System.IO.StringWriter();
- System.Xml.XmlTextWriter xmlTW = new System.Xml.XmlTextWriter(sw);
+ StringWriter sw = new StringWriter();
+ XmlTextWriter xmlTW = new XmlTextWriter(sw);
//write xml file, data only
ds1.WriteXml(xmlTW);
DataSet ds2 = ds1.Copy();
//clear the data
ds2.Clear();
- System.IO.StringReader sr = new System.IO.StringReader(sw.ToString());
- System.Xml.XmlTextReader xmlTR = new System.Xml.XmlTextReader(sr);
+ StringReader sr = new StringReader(sw.ToString());
+ XmlTextReader xmlTR = new XmlTextReader(sr);
ds2.ReadXml(xmlTR);
//check xml data
[Test] public void WriteXmlSchema_Relations_ForeignKeys ()
{
- System.IO.MemoryStream ms = null;
- System.IO.MemoryStream ms1 = null;
+ MemoryStream ms = null;
+ MemoryStream ms1 = null;
DataSet ds1 = new DataSet();
new DataColumn[] {col1_5, col1_6},
new DataColumn[] {col2_5, col2_6});
- ms = new System.IO.MemoryStream();
+ ms = new MemoryStream();
ds1.WriteXmlSchema (ms);
- ms1 = new System.IO.MemoryStream (ms.GetBuffer());
+ ms1 = new MemoryStream (ms.GetBuffer());
DataSet ds2 = new DataSet();
ds2.ReadXmlSchema(ms1);
[Test] public void WriteXml_ByTextWriterXmlWriteMode()
{
- System.IO.StringReader sr = null;
- System.IO.StringWriter sw = null;
+ StringReader sr = null;
+ StringWriter sw = null;
try // For real
{
// ReadXml - DataSetOut
DataSet oDataset = new DataSet("DataSetOut");
- sw = new System.IO.StringWriter();
- oDataset.WriteXml(sw,System.Data.XmlWriteMode.WriteSchema);
+ sw = new StringWriter();
+ oDataset.WriteXml(sw, XmlWriteMode.WriteSchema);
- sr = new System.IO.StringReader(sw.GetStringBuilder().ToString());
+ sr = new StringReader(sw.GetStringBuilder().ToString());
oDataset = new DataSet("DataSetOut");
oDataset.ReadXml(sr);
{
DataSet ds = new DataSet();
string input = "<a><b><c>2</c></b></a>";
- System.IO.StringReader sr = new System.IO.StringReader(input) ;
- System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr) ;
+ StringReader sr = new StringReader(input) ;
+ XmlTextReader xReader = new XmlTextReader(sr) ;
ds.ReadXml (xReader);
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- System.IO.StringWriter sw = new System.IO.StringWriter(sb);
- System.Xml.XmlTextWriter xWriter = new System.Xml.XmlTextWriter(sw);
+ StringBuilder sb = new StringBuilder();
+ StringWriter sw = new StringWriter(sb);
+ XmlTextWriter xWriter = new XmlTextWriter(sw);
ds.WriteXml(xWriter);
string output = sb.ToString();
Assert.AreEqual(input,output, "DS76");
DataSet ds = new DataSet();
string input = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><a><b><c>2</c></b></a>";
string expectedOutput = "<a><b><c>2</c></b></a>";
- System.IO.StringReader sr = new System.IO.StringReader(input) ;
- System.Xml.XmlTextReader xReader = new System.Xml.XmlTextReader(sr) ;
+ StringReader sr = new StringReader(input) ;
+ XmlTextReader xReader = new XmlTextReader(sr) ;
ds.ReadXml (xReader);
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- System.IO.StringWriter sw = new System.IO.StringWriter(sb);
- System.Xml.XmlTextWriter xWriter = new System.Xml.XmlTextWriter(sw);
+ StringBuilder sb = new StringBuilder();
+ StringWriter sw = new StringWriter(sb);
+ XmlTextWriter xWriter = new XmlTextWriter(sw);
ds.WriteXml(xWriter);
string output = sb.ToString();
Assert.AreEqual(expectedOutput,output, "DS77");
}
{
DataSet ds = new DataSet("DSName");
- System.IO.StringWriter sr = new System.IO.StringWriter();
+ StringWriter sr = new StringWriter();
ds.WriteXml(sr);
Assert.AreEqual("<DSName />",sr.ToString(), "DS78");
}
ds.Tables.Remove("ChildTable");
//Get the xml representation of the dataset.
- System.IO.StringWriter sr = new System.IO.StringWriter();
+ StringWriter sr = new StringWriter();
ds.WriteXml(sr);
string xml = sr.ToString();
}
[Test]
-#if TARGET_JVM
- [Ignore ("Does not work with TARGET_JVM")]
-#endif
public void ToStringTest()
{
DataTableCollection tbcol = _dataset[0].Tables;
using NUnit.Framework;
using System;
+using System.Collections;
+using System.ComponentModel;
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class DataTableCollectionTest2
{
{
counter = 0;
DataSet ds = new DataSet();
- ds.Tables.CollectionChanged+=new System.ComponentModel.CollectionChangeEventHandler(Tables_CollectionChanged);
+ ds.Tables.CollectionChanged+=new CollectionChangeEventHandler(Tables_CollectionChanged);
ds.Tables.Add();
ds.Tables.Add();
Assert.AreEqual(2, counter, "DTC15");
Assert.AreEqual(4, counter, "DTC16");
}
- private void Tables_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e)
+ private void Tables_CollectionChanged(object sender, CollectionChangeEventArgs e)
{
counter++;
}
{
counter = 0;
DataSet ds = new DataSet();
- ds.Tables.CollectionChanging+=new System.ComponentModel.CollectionChangeEventHandler(Tables_CollectionChanging);
+ ds.Tables.CollectionChanging+=new CollectionChangeEventHandler(Tables_CollectionChanging);
ds.Tables.Add();
ds.Tables.Add();
Assert.AreEqual(2, counter, "DTC17");
Assert.AreEqual(4, counter, "DTC18");
}
- private void Tables_CollectionChanging(object sender, System.ComponentModel.CollectionChangeEventArgs e)
+ private void Tables_CollectionChanging(object sender, CollectionChangeEventArgs e)
{
counter++;
}
ds.Tables.Add();
int count=0;
- System.Collections.IEnumerator myEnumerator = ds.Tables.GetEnumerator();
+ IEnumerator myEnumerator = ds.Tables.GetEnumerator();
while (myEnumerator.MoveNext())
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("Should review the test")]
-#endif
public void TestReadXml()
{
// For reading, DataTable.ReadXml only supports reading in xml with
#region Read/Write XML Tests
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ReadXmlSchema ()
{
DataTable Table = new DataTable ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void WriteXmlSchema_Hierarchy ()
{
DataSet ds = new DataSet ();
[Test]
[Ignore ("MS behavior is far from consistent to be regarded as a reference implementation.")]
// See the same-named tests in DataSetTest.cs
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
// WriteXmlSchema doesn't have overload wityh 2 parameters in System.Data
// and is commented-out TWICE below
public void ReadWriteXmlSchema()
[Test]
[Ignore ("MS behavior is far from consistent to be regarded as a reference implementation.")]
// See the same-named tests in DataSetTest.cs
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ReadWriteXmlSchema_IgnoreSchema ()
{
DataSet ds = new DataSet ();
Assert.AreEqual (5, n, "n");
}
-#if !TARGET_JVM && !MONOTOUCH
+#if !MONOTOUCH
[Test]
public void NFIFromBug55978 ()
{
using NUnit.Framework;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
public class DataTableTest2
using NUnit.Framework;
-namespace Monotests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
public class DataTableTest3
using System.Xml;
using NUnit.Framework;
-namespace Monotests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
public class DataTableTest4
DataSet ds = new DataSet ();
DataTable table = new DataTable ("ParentTable");
XmlReadMode mode = XmlReadMode.Auto;
- table.Columns.Add (new DataColumn ("id", System.Type.GetType ("System.Int32")));
+ table.Columns.Add (new DataColumn ("id", Type.GetType ("System.Int32")));
ds.Tables.Add (table);
using (FileStream stream = new FileStream (tempFile, FileMode.Open)) {
using (FileStream stream = new FileStream (tempFile, FileMode.Open)) {
DataSet ds = new DataSet ();
DataTable table = new DataTable ("Table1");
- table.Columns.Add (new DataColumn ("id", System.Type.GetType ("System.Int32")));
+ table.Columns.Add (new DataColumn ("id", Type.GetType ("System.Int32")));
ds.Tables.Add (table);
try {
DataTable table = new DataTable ("DummyTable");
//define the table schame partially with a column name which does not match with any
//table columns in the diffgram
- table.Columns.Add (new DataColumn ("WrongColumnName", System.Type.GetType ("System.String")));
+ table.Columns.Add (new DataColumn ("WrongColumnName", Type.GetType ("System.String")));
XmlReadMode mode = XmlReadMode.Auto;
Assert.AreEqual ("NewDataSet", table.DataSet.DataSetName, "#2");
Assert.AreEqual (2, table.Columns.Count, "#3");
Assert.AreEqual (2, table.Rows.Count, "#4");
- Assert.AreEqual (typeof (System.Int32), table.Columns [0].DataType, "#5");
- Assert.AreEqual (typeof (System.String), table.Columns [1].DataType, "#6");
+ Assert.AreEqual (typeof (Int32), table.Columns [0].DataType, "#5");
+ Assert.AreEqual (typeof (String), table.Columns [1].DataType, "#6");
Assert.AreEqual (1, table.Constraints.Count, "#7");
Assert.AreEqual (typeof (UniqueConstraint), table.Constraints [0].GetType (), "#8");
Assert.AreEqual (1, table.ChildRelations.Count, "#9");
Assert.AreEqual ("NewDataSet", table1.DataSet.DataSetName, "#14");
Assert.AreEqual (3, table1.Columns.Count, "#15");
Assert.AreEqual (4, table1.Rows.Count, "#16");
- Assert.AreEqual (typeof (System.Int32), table1.Columns [0].DataType, "#17");
- Assert.AreEqual (typeof (System.String), table1.Columns [1].DataType, "#18");
- Assert.AreEqual (typeof (System.Int32), table1.Columns [2].DataType, "#19");
+ Assert.AreEqual (typeof (Int32), table1.Columns [0].DataType, "#17");
+ Assert.AreEqual (typeof (String), table1.Columns [1].DataType, "#18");
+ Assert.AreEqual (typeof (Int32), table1.Columns [2].DataType, "#19");
Assert.AreEqual (2, table1.Constraints.Count, "#20");
Assert.AreEqual (typeof (UniqueConstraint), table1.Constraints [0].GetType (), "#21");
Assert.AreEqual (typeof (ForeignKeyConstraint), table1.Constraints [1].GetType (), "#22");
Assert.AreEqual ("NewDataSet", table1.DataSet.DataSetName, "#29");
Assert.AreEqual (2, table1.Columns.Count, "#30");
Assert.AreEqual (8, table1.Rows.Count, "#31");
- Assert.AreEqual (typeof (System.Int32), table1.Columns [0].DataType, "#32");
- Assert.AreEqual (typeof (System.String), table1.Columns [1].DataType, "#33");
+ Assert.AreEqual (typeof (Int32), table1.Columns [0].DataType, "#32");
+ Assert.AreEqual (typeof (String), table1.Columns [1].DataType, "#33");
Assert.AreEqual (1, table1.Constraints.Count, "#34");
Assert.AreEqual (typeof (ForeignKeyConstraint), table1.Constraints [0].GetType (), "#35");
Assert.AreEqual (1, table1.ParentRelations.Count, "#36");
using NUnit.Framework;
-namespace Monotests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
public class DataTableTest5
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")] // defect 5446
-#endif
public void Find_3 ()
{
dataView.Sort = "itemID, itemName";
using NUnit.Framework;
using System;
-using System.IO;
+using System.Collections;
using System.ComponentModel;
+using System.IO;
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class DataViewTest2
{
class EventProperties //hold the event properties to be checked
{
- public System.ComponentModel.ListChangedType lstType ;
+ public ListChangedType lstType ;
public int NewIndex;
public int OldIndex;
}
//create the dataview for the table
DataView dv = new DataView(dt);
- System.Collections.IEnumerator ienm = null;
+ IEnumerator ienm = null;
// GetEnumerator != null
ienm = dv.GetEnumerator();
DataView dv = new DataView(dt);
//add event handler
- dv.ListChanged +=new System.ComponentModel.ListChangedEventHandler(dv_ListChanged);
+ dv.ListChanged +=new ListChangedEventHandler(dv_ListChanged);
// ----- Change Value ---------
evProp = null;
dv[1]["String1"] = "something";
Assert.AreEqual(true , evProp!=null , "DV58");
// change value - ListChangedType
- Assert.AreEqual(System.ComponentModel.ListChangedType.ItemChanged, evProp.lstType , "DV59");
+ Assert.AreEqual(ListChangedType.ItemChanged, evProp.lstType , "DV59");
// change value - NewIndex
Assert.AreEqual(1, evProp.NewIndex, "DV60");
// change value - OldIndex
dv.AddNew();
Assert.AreEqual(true , evProp!=null , "DV62");
// Add New - ListChangedType
- Assert.AreEqual(System.ComponentModel.ListChangedType.ItemAdded , evProp.lstType , "DV63");
+ Assert.AreEqual(ListChangedType.ItemAdded , evProp.lstType , "DV63");
// Add New - NewIndex
Assert.AreEqual(6, evProp.NewIndex, "DV64");
// Add New - OldIndex
dv.Sort = "ParentId Desc";
Assert.AreEqual(true , evProp!=null , "DV66");
// sort - ListChangedType
- Assert.AreEqual(System.ComponentModel.ListChangedType.Reset , evProp.lstType , "DV67");
+ Assert.AreEqual(ListChangedType.Reset , evProp.lstType , "DV67");
// sort - NewIndex
Assert.AreEqual(-1, evProp.NewIndex, "DV68");
// sort - OldIndex
Assert.AreEqual(true , evProp != null , "DV168");
// Clear DataTable - should emit ListChangedType.Reset
- Assert.AreEqual(System.ComponentModel.ListChangedType.Reset , evProp.lstType , "DV169");
+ Assert.AreEqual(ListChangedType.Reset , evProp.lstType , "DV169");
// Clear DataTable - should clear view count
Assert.AreEqual(0, dt.DefaultView.Count , "DV169");
}
- private void dv_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
+ private void dv_ListChanged(object sender, ListChangedEventArgs e)
{
evProp = new EventProperties();
evProp.lstType = e.ListChangedType;
// this test also check DataView.Count property
DataRowView[] drvResult = null;
- System.Collections.ArrayList al = new System.Collections.ArrayList();
+ ArrayList al = new ArrayList();
//create the source datatable
DataTable dt = DataProvider.CreateChildDataTable();
*/
//DataRowView[] drvResult = null;
- System.Collections.ArrayList al = new System.Collections.ArrayList();
+ ArrayList al = new ArrayList();
DataTable dt = DataProvider.CreateParentDataTable();
private DataRow[] GetResultRows(DataTable dt,DataRowState State)
{
//get expected rows
- System.Collections.ArrayList al = new System.Collections.ArrayList();
+ ArrayList al = new ArrayList();
DataRowVersion drVer = DataRowVersion.Current;
//From MSDN - The row the default version for the current DataRowState.
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class DeletedRowInaccessibleExceptionTest
{
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class DuplicateNameExceptionTest
{
using System.Data;
//using GHTUtils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class EvaluateExceptionTest
{
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class ForeignKeyConstraintTest2
{
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class InRowChangingEventExceptionTest
{
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class InvalidConstraintExceptionTest
{
using NUnit.Framework;\r
using MonoTests.System.Data.Utils;\r
\r
-namespace MonoTests_System.Data\r
+namespace MonoTests.System.Data\r
{\r
[TestFixture]\r
class MissingPrimaryKeyExceptionTest\r
tbl.Rows.Contains("Something");\r
}\r
}\r
-}
\ No newline at end of file
+}\r
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class NoNullAllowedExceptionTest
{
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class ReadOnlyExceptionTest
{
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class RowNotInTableExceptionTest
{
using System.IO;
using System.Data;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class SyntaxErrorExceptionTest
{
using System;
using System.Data;
-namespace Monotests_Mono.Data.SqlExpressions
+namespace MonoTests.System.Data
{
[TestFixture]
public class ComparisonTest {
[Test]
public void TestStringTrailingSpaceHandling () {
// test for bug 79695 - does not ignore certain trailing whitespace chars when comparing strings
- System.Data.DataTable dataTable = new System.Data.DataTable ("Person");
+ DataTable dataTable = new DataTable ("Person");
dataTable.Columns.Add ("Name", typeof (string));
dataTable.Rows.Add (new object[] {"Mike "});
DataRow[] selectedRows = dataTable.Select ("Name = 'Mike'");
using System.Data;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture] public class UniqueConstraintTest2
{
using NUnit.Framework;
using MonoTests.System.Data.Utils;
-namespace MonoTests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
class VersionNotFoundExceptionTest
object obj = drParent[0,DataRowVersion.Original];
}
}
-}
\ No newline at end of file
+}
using NUnit.Framework;
-namespace Monotests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
public class XmlDataLoaderTest
DataSet ds = new DataSet ("Set");
DataTable dt = new DataTable ("Test");
dt.Columns.Add ("CustName", typeof (String));
- dt.Columns.Add ("Type", typeof (System.Type));
+ dt.Columns.Add ("Type", typeof (Type));
ds.Tables.Add (dt);
return ds;
}
using System.Xml.Schema;
using NUnit.Framework;
-namespace Monotests_System.Data
+namespace MonoTests.System.Data
{
[TestFixture]
public class XmlDataReaderTest
StringReader sr = new StringReader (xml);
XmlTextReader xr = new XmlTextReader (sr);
DataTable tbl = new DataTable("CustomTypesTable");
- tbl.Columns.Add("Dummy", typeof(System.UInt32));
+ tbl.Columns.Add("Dummy", typeof(UInt32));
tbl.Columns.Add("FuncXml", typeof(CustomTypeXml));
DataSet ds = new DataSet("CustomTypesData");
System.Data.SqlClient/SqlCommandBuilder.cs
System.Data.SqlClient/SqlConnection.cs
System.Data.SqlClient/SqlConnectionStringBuilder.cs
+System.Data.SqlClient/SqlCredential.cs
System.Data.SqlClient/SqlDataAdapter.cs
System.Data.SqlClient/SqlDataReader.cs
System.Data.SqlClient/SqlDataSourceConverter.cs
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
/ChangeLog -crlf
/Secure.config -crlf
/makefile.build -crlf
-/net_1_1_java_System.DirectoryServices.dll.exclude.sources -crlf
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: AllowPartiallyTrustedCallers]
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 8.00\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.DirectoryServices", "System.DirectoryServices.vmwcsproj", "{2A86AAED-1EF5-4BDC-8B53-9DBF6DAFD736}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {0B45F886-E6BB-4871-B9C1-77A0D92DA76E} = {0B45F886-E6BB-4871-B9C1-77A0D92DA76E}\r
- EndProjectSection\r
-EndProject\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "Novell.Directory.Ldap", "..\Novell.Directory.Ldap\Novell.Directory.Ldap.vmwcsproj", "{0B45F886-E6BB-4871-B9C1-77A0D92DA76E}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- EndProjectSection\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfiguration) = preSolution\r
- Debug = Debug\r
- Debug_Java = Debug_Java\r
- Release_Java = Release_Java\r
- EndGlobalSection\r
- GlobalSection(ProjectConfiguration) = postSolution\r
- {2A86AAED-1EF5-4BDC-8B53-9DBF6DAFD736}.Debug.ActiveCfg = Debug|.NET\r
- {2A86AAED-1EF5-4BDC-8B53-9DBF6DAFD736}.Debug.Build.0 = Debug|.NET\r
- {2A86AAED-1EF5-4BDC-8B53-9DBF6DAFD736}.Debug_Java.ActiveCfg = Debug_Java|.NET\r
- {2A86AAED-1EF5-4BDC-8B53-9DBF6DAFD736}.Debug_Java.Build.0 = Debug_Java|.NET\r
- {2A86AAED-1EF5-4BDC-8B53-9DBF6DAFD736}.Release_Java.ActiveCfg = Release_Java|.NET\r
- {2A86AAED-1EF5-4BDC-8B53-9DBF6DAFD736}.Release_Java.Build.0 = Release_Java|.NET\r
- {0B45F886-E6BB-4871-B9C1-77A0D92DA76E}.Debug.ActiveCfg = Debug|.NET\r
- {0B45F886-E6BB-4871-B9C1-77A0D92DA76E}.Debug.Build.0 = Debug|.NET\r
- {0B45F886-E6BB-4871-B9C1-77A0D92DA76E}.Debug_Java.ActiveCfg = Debug_Java|.NET\r
- {0B45F886-E6BB-4871-B9C1-77A0D92DA76E}.Debug_Java.Build.0 = Debug_Java|.NET\r
- {0B45F886-E6BB-4871-B9C1-77A0D92DA76E}.Release_Java.ActiveCfg = Release_Java|.NET\r
- {0B45F886-E6BB-4871-B9C1-77A0D92DA76E}.Release_Java.Build.0 = Release_Java|.NET\r
- EndGlobalSection\r
- GlobalSection(ExtensibilityGlobals) = postSolution\r
- EndGlobalSection\r
- GlobalSection(ExtensibilityAddIns) = postSolution\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.DirectoryServices</RootNamespace>\r
- <AssemblyName>System.DirectoryServices</AssemblyName>\r
- <JDKName>1.5.0_05</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <GHProjectKind>framework</GHProjectKind>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="J2SE.Helpers">\r
- <HintPath>..\lib\J2SE.Helpers.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System">\r
- <Private>False</Private>\r
- </Reference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Assembly\Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>Assembly\MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.DirectoryServices.Design\DirectoryEntryConverter.cs" />\r
- <Compile Include="System.DirectoryServices\AuthenticationTypes.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryEntries.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryEntry.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.DirectoryServices\DirectorySearcher.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.DirectoryServices\DirectoryServicesPermission.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryServicesPermissionAccess.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryServicesPermissionAttribute.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryServicesPermissionEntry.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryServicesPermissionEntryCollection.cs" />\r
- <Compile Include="System.DirectoryServices\DSDescriptionAttribute.cs" />\r
- <Compile Include="System.DirectoryServices\PropertyCollection.cs" />\r
- <Compile Include="System.DirectoryServices\PropertyValueCollection.cs" />\r
- <Compile Include="System.DirectoryServices\ReferralChasingOption.cs" />\r
- <Compile Include="System.DirectoryServices\ResultPropertyCollection.cs" />\r
- <Compile Include="System.DirectoryServices\ResultPropertyValueCollection.cs" />\r
- <Compile Include="System.DirectoryServices\SchemaNameCollection.cs" />\r
- <Compile Include="System.DirectoryServices\SearchResult.cs" />\r
- <Compile Include="System.DirectoryServices\SearchResultCollection.cs" />\r
- <Compile Include="System.DirectoryServices\SearchScope.cs" />\r
- <Compile Include="System.DirectoryServices\SortDirection.cs" />\r
- <Compile Include="System.DirectoryServices\SortOption.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Assembly\Consts.cs.in</Link>\r
- </Compile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\Novell.Directory.Ldap\Novell.Directory.Ldap20.csproj">\r
- <Project>{7BA54046-FD05-4209-9508-D6367CDAFBC0}</Project>\r
- <Name>Novell.Directory.Ldap20</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Data.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.DirectoryServices20", "System.DirectoryServices20.csproj", "{6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Novell.Directory.Ldap20", "..\Novell.Directory.Ldap\Novell.Directory.Ldap20.csproj", "{7BA54046-FD05-4209-9508-D6367CDAFBC0}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {6C8C17FE-0F2F-4515-AC3C-2FB79F10FFA8}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {7BA54046-FD05-4209-9508-D6367CDAFBC0}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {7BA54046-FD05-4209-9508-D6367CDAFBC0}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {7BA54046-FD05-4209-9508-D6367CDAFBC0}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {7BA54046-FD05-4209-9508-D6367CDAFBC0}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {7BA54046-FD05-4209-9508-D6367CDAFBC0}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {7BA54046-FD05-4209-9508-D6367CDAFBC0}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {7BA54046-FD05-4209-9508-D6367CDAFBC0}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {7BA54046-FD05-4209-9508-D6367CDAFBC0}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{4CBF37B7-AFCF-4805-81A4-610282C6D9A5}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.DirectoryServices.Test20</RootNamespace>\r
- <AssemblyName>System.DirectoryServices.Test20</AssemblyName>\r
- <JDKName>1.5.0_05</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA,NET_2_0</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryServicesDirectoryEntryTest.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryServicesDirectorySearcherTest.cs" />\r
- <Compile Include="System.DirectoryServices\DirectoryServicesSearchResultTest.cs" />\r
- <Compile Include="System.DirectoryServices\TestConfiguration.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=0.0.0.0, Culture=neutral">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.DirectoryServices" />\r
- <Reference Include="System.Xml" />\r
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-system-directoryservices="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.DirectoryServices.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\Novell.Directory.Ldap.jar" REFS-JarPath-rt="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Xml.jar" REFS-JarPath-system-data="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Data.jar" REFS-JarPath-system="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\mscorlib.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.DirectoryServices.Test20", "System.DirectoryServices.Test20.csproj", "{4CBF37B7-AFCF-4805-81A4-610282C6D9A5}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {4CBF37B7-AFCF-4805-81A4-610282C6D9A5}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {4CBF37B7-AFCF-4805-81A4-610282C6D9A5}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {4CBF37B7-AFCF-4805-81A4-610282C6D9A5}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {4CBF37B7-AFCF-4805-81A4-610282C6D9A5}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {4CBF37B7-AFCF-4805-81A4-610282C6D9A5}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {4CBF37B7-AFCF-4805-81A4-610282C6D9A5}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {4CBF37B7-AFCF-4805-81A4-610282C6D9A5}.Release_Java20|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {4CBF37B7-AFCF-4805-81A4-610282C6D9A5}.Release_Java20|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 8.00\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.DirectoryServices.Test", "System.DirectoryServices.Test.vmwcsproj", "{63E8DD13-3F4D-4088-9641-FF4030B9054D}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- EndProjectSection\r
-EndProject\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "nunit.framework.dll.J2EE", "..\..\..\nunit20\framework\nunit.framework.dll.J2EE.vmwcsproj", "{39CC8FF7-EF1A-41A1-B727-42684211ECD1}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- EndProjectSection\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfiguration) = preSolution\r
- Debug = Debug\r
- Debug_Java = Debug_Java\r
- Release_Java = Release_Java\r
- EndGlobalSection\r
- GlobalSection(ProjectConfiguration) = postSolution\r
- {63E8DD13-3F4D-4088-9641-FF4030B9054D}.Debug.ActiveCfg = Debug_Java|.NET\r
- {63E8DD13-3F4D-4088-9641-FF4030B9054D}.Debug.Build.0 = Debug_Java|.NET\r
- {63E8DD13-3F4D-4088-9641-FF4030B9054D}.Debug_Java.ActiveCfg = Debug_Java|.NET\r
- {63E8DD13-3F4D-4088-9641-FF4030B9054D}.Debug_Java.Build.0 = Debug_Java|.NET\r
- {63E8DD13-3F4D-4088-9641-FF4030B9054D}.Release_Java.ActiveCfg = Release_Java|.NET\r
- {63E8DD13-3F4D-4088-9641-FF4030B9054D}.Release_Java.Build.0 = Release_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug.ActiveCfg = Debug|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug.Build.0 = Debug|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug_Java.ActiveCfg = Debug_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Debug_Java.Build.0 = Debug_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release_Java.ActiveCfg = Release_Java|.NET\r
- {39CC8FF7-EF1A-41A1-B727-42684211ECD1}.Release_Java.Build.0 = Release_Java|.NET\r
- EndGlobalSection\r
- GlobalSection(ExtensibilityGlobals) = postSolution\r
- EndGlobalSection\r
- GlobalSection(ExtensibilityAddIns) = postSolution\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-System.DirectoryServices/DirectoryServicesPermission.cs\r
-System.DirectoryServices/DirectoryServicesPermissionAccess.cs\r
-System.DirectoryServices/DirectoryServicesPermissionAttribute.cs\r
-System.DirectoryServices/DirectoryServicesPermissionEntry.cs\r
-System.DirectoryServices/DirectoryServicesPermissionEntryCollection.cs\r
+++ /dev/null
-#include System.DirectoryServices.dll.sources
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java20</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{645B83F0-DAE2-4360-96FD-7E8FCFADD3B5}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Drawing.Design</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <RootNamespace>System.Drawing.Design</RootNamespace>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;NET_1_1;NET_2_0;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;NET_1_1;NET_2_0;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="Consts.cs" />\r
- <Compile Include="Locale.cs" />\r
- <Compile Include="MonoTODOAttribute.cs" />\r
- <Compile Include="System.Drawing.Design\BitmapEditor.cs" />\r
- <Compile Include="System.Drawing.Design\ColorEditor.cs" />\r
- <Compile Include="System.Drawing.Design\ContentAlignmentEditor.cs" />\r
- <Compile Include="System.Drawing.Design\CursorEditor.cs" />\r
- <Compile Include="System.Drawing.Design\FontEditor.cs" />\r
- <Compile Include="System.Drawing.Design\FontNameEditor.cs" />\r
- <Compile Include="System.Drawing.Design\IconEditor.cs" />\r
- <Compile Include="System.Drawing.Design\ImageEditor.cs" />\r
- <Compile Include="System.Drawing.Design\MetafileEditor.cs" />\r
- <Compile Include="System.Drawing.Design\ToolboxItemContainer.cs" />\r
- <Compile Include="System.Drawing.Design\ToolboxItemCreator.cs" />\r
- <Compile Include="System.Drawing.Design\ToolboxService.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-JarPath-system-drawing="" REFS-RefInfo-system-windows-forms="repository:vmw:framework:2.0" REFS-JarPath-system-windows-forms="" REFS-RefInfo-rt="repository:jre:sun:1.6.0" REFS-JarPath-rt="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system="" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
+#if !MOBILE
[assembly: AssemblyKeyFile("../msfinal.pub")]
#endif
-r:System.Drawing.dll -r:System.Runtime.Serialization.Formatters.Soap.dll -r:System.Xml.dll \
-nowarn:0618 -nowarn:219 -nowarn:169 -nowarn:1595
-ifeq (net_1_1_java, $(PROFILE))
-LIB_MCS_FLAGS += \
- -r:System.Xml.dll \
- -r:rt.dll \
- -r:J2SE.Helpers.dll
-endif
-
include ../../build/library.make
EXTRA_DISTFILES = Test/resources/indexed.png \
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <ProjectType>Local</ProjectType>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{A6337986-B345-4C49-95F4-40D498C1927B}</ProjectGuid>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ApplicationIcon>\r
- </ApplicationIcon>\r
- <AssemblyKeyContainerName>\r
- </AssemblyKeyContainerName>\r
- <AssemblyName>System.Drawing</AssemblyName>\r
- <AssemblyOriginatorKeyFile>\r
- </AssemblyOriginatorKeyFile>\r
- <DefaultClientScript>JScript</DefaultClientScript>\r
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>\r
- <DefaultTargetSchema>IE50</DefaultTargetSchema>\r
- <DelaySign>false</DelaySign>\r
- <OutputType>Library</OutputType>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>\r
- <StartupObject>\r
- </StartupObject>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <OutputPath>bin\Debug_2.0\</OutputPath>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <BaseAddress>285212672</BaseAddress>\r
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>\r
- <ConfigurationOverrideFile>\r
- </ConfigurationOverrideFile>\r
- <DefineConstants>NET_1_1 NET_2_0 VSTUDIO</DefineConstants>\r
- <DocumentationFile>\r
- </DocumentationFile>\r
- <DebugSymbols>true</DebugSymbols>\r
- <FileAlignment>4096</FileAlignment>\r
- <NoStdLib>false</NoStdLib>\r
- <NoWarn>\r
- </NoWarn>\r
- <Optimize>false</Optimize>\r
- <RegisterForComInterop>false</RegisterForComInterop>\r
- <RemoveIntegerChecks>false</RemoveIntegerChecks>\r
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r
- <WarningLevel>1</WarningLevel>\r
- <DebugType>full</DebugType>\r
- <ErrorReport>prompt</ErrorReport>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <OutputPath>bin\Release\</OutputPath>\r
- <AllowUnsafeBlocks>false</AllowUnsafeBlocks>\r
- <BaseAddress>285212672</BaseAddress>\r
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>\r
- <ConfigurationOverrideFile>\r
- </ConfigurationOverrideFile>\r
- <DefineConstants>\r
- </DefineConstants>\r
- <DocumentationFile>\r
- </DocumentationFile>\r
- <DebugSymbols>false</DebugSymbols>\r
- <FileAlignment>4096</FileAlignment>\r
- <NoStdLib>false</NoStdLib>\r
- <NoWarn>\r
- </NoWarn>\r
- <Optimize>true</Optimize>\r
- <RegisterForComInterop>false</RegisterForComInterop>\r
- <RemoveIntegerChecks>false</RemoveIntegerChecks>\r
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r
- <WarningLevel>1</WarningLevel>\r
- <DebugType>none</DebugType>\r
- <ErrorReport>prompt</ErrorReport>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs">\r
- <Link>Consts.cs</Link>\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\CategoryNameCollection.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\IPropertyValueUIService.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\IToolboxItemProvider.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\IToolboxService.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\IToolboxUser.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\PaintValueEventArgs.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\PropertyValueItem.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\PropertyValueUIHandler.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\PropertyValueUIItemInvokeHandler.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\ToolboxComponentsCreatedEventArgs.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\ToolboxComponentsCreatedEventHandler.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\ToolboxComponentsCreatingEventArgs.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\ToolboxComponentsCreatingEventHandler.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\ToolboxItem.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\ToolboxItemCollection.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\ToolboxItemCreatorCallback.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\UITypeEditor.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Design\UITypeEditorEditStyle.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\AdjustableArrowCap.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\Blend.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\ColorBlend.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\CombineMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\CompostingMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\CompostingQuality.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\CoordinateSpace.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\CustomLineCap.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\DashCap.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\DashStyle.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\FillMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\FlushIntention.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\GraphicsContainer.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\GraphicsPath.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\GraphicsPathIterator.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\GraphicsState.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\HatchBrush.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\HatchStyle.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\InterpolationMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\LinearGradientBrush.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\LinearGradientMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\LineCap.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\LineJoin.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\Matrix.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\MatrixOrder.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\PathData.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\PathGradientBrush.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\PathPointType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\PenAlignment.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\PenType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\PixelOffsetMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\QualityMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\RegionData.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\SmoothingMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\WarpMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Drawing2D\WrapMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\BitmapData.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ColorAdjustType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ColorChannelFlag.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ColorMap.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ColorMapType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ColorMatrix.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ColorMatrixFlag.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ColorMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ColorPalette.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\EmfPlusRecordType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\EmfType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\Encoder.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\EncoderParameter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\EncoderParameters.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\EncoderParameterValueType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\EncoderValue.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\FrameDimension.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ImageAttributes.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ImageCodecFlags.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ImageCodecInfo.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ImageFlags.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ImageFormat.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\ImageLockMode.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\Metafile.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\MetafileFrameUnit.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\MetafileHeader.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\MetafileType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\MetaHeader.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\PaletteFlags.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\PixelFormat.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\PlayRecordCallback.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\PropertyItem.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Imaging\WmfPlaceableFileHeader.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\Duplex.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\InvalidPrinterException.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\Margins.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\MarginsConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PageSettings.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PaperKind.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PaperSize.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PaperSource.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PaperSourceKind.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PreviewPageInfo.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PreviewPrintController.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintAction.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintController.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintDocument.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrinterResolution.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrinterResolutionKind.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrinterSettings.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrinterUnit.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrinterUnitConvert.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintEventArgs.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintEventHandler.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintingPermission.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintingPermissionAttribute.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintingPermissionLevel.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintingServices.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintingServicesUnix.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintingServicesWin32.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintPageEventArgs.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintPageEventHandler.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\PrintRange.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\QueryPageSettingsEventArgs.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\QueryPageSettingsEventHandler.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Printing\StandardPrintController.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Text\FontCollection.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Text\GenericFontFamilies.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Text\HotkeyPrefix.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Text\InstalledFontCollection.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Text\PrivateFontCollection.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing.Text\TextRenderingHint.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Bitmap.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Brush.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Brushes.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\BufferedGraphics.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\BufferedGraphicsContext.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\BufferedGraphicsManager.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\carbonFunctions.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\CharacterRange.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Color.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ColorConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ColorTranslator.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ComIStreamMarshaler.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ComIStreamWrapper.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ContentAlignment.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\CopyPixelOperation.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Font.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\FontConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\FontFamily.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\FontStyle.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\gdipEnums.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\gdipFunctions.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\gdipStructs.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Graphics.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\GraphicsUnit.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Icon.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\IconConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\IDeviceContext.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Image.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ImageAnimator.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ImageConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ImageFormatConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\KnownColor.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\KnownColors.cs" />\r
- <Compile Include="System.Drawing\Pen.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Pens.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Point.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\PointConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\PointF.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Rectangle.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\RectangleConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\RectangleF.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Region.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\RotateFlipType.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\Size.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SizeConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SizeF.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SizeFConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SolidBrush.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SRDescriptionAttribute.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\StringAligment.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\StringDigitSubstitute.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\StringFormat.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\StringFormatFlags.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\StringTrimming.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\StringUnit.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SystemBrushes.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SystemColors.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SystemFonts.cs" />\r
- <Compile Include="System.Drawing\SystemIcons.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\SystemPens.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\TextureBrush.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Drawing\ToolboxBitmapAttribute.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <None Include="System.Drawing.Printing\ChangeLog" />\r
- <None Include="System.Drawing\ChangeLog" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="Assembly\Application.ico" />\r
- <EmbeddedResource Include="Assembly\Asterisk.ico" />\r
- <EmbeddedResource Include="Assembly\Error.ico" />\r
- <EmbeddedResource Include="Assembly\Exclamation.ico" />\r
- <EmbeddedResource Include="Assembly\Hand.ico" />\r
- <EmbeddedResource Include="Assembly\Information.ico" />\r
- <EmbeddedResource Include="Assembly\Mono.ico" />\r
- <EmbeddedResource Include="Assembly\Question.ico" />\r
- <EmbeddedResource Include="Assembly\Warning.ico" />\r
- <EmbeddedResource Include="Assembly\WinLogo.ico" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
- <PropertyGroup>\r
- <PreBuildEvent>\r
- </PreBuildEvent>\r
- <PostBuildEvent>\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>
\ No newline at end of file
editors [typeof (IList)] = "System.ComponentModel.Design.CollectionEditor, " + Consts.AssemblySystem_Design;
editors [typeof (ICollection)] = "System.ComponentModel.Design.CollectionEditor, " + Consts.AssemblySystem_Design;
editors [typeof (string[])] = "System.Windows.Forms.Design.StringArrayEditor, " + Consts.AssemblySystem_Design;
+#if !MOBILE
TypeDescriptor.AddEditorTable (typeof (UITypeEditor), editors);
+#endif
}
public UITypeEditor()
{
return false;
}
-#if !TARGET_JVM
public void PaintValue (object value, Graphics canvas, Rectangle rectangle)
{
PaintValue (new PaintValueEventArgs (null, value, canvas, rectangle));
// but on the other hand the class is not abstract. Could never observe it did paint anything
return;
}
-#endif
#if NET_2_0
public virtual bool IsDropDownResizable {
get { return false; }
+++ /dev/null
-/ExtendedGeneralPath.jvm.cs -crlf
-/GeneralPathIterator.jvm.cs -crlf
+++ /dev/null
-//
-// System.Drawing.Drawing2D.AdjustableArrowCap.cs
-//
-// Authors:
-// Dennis Hayes (dennish@Raytek.com)
-// Ravindra (rkumar@novell.com)
-//
-// Copyright (C) 2002/3 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Drawing.Drawing2D
-{
- /// <summary>
- /// Summary description for AdjustableArrowCap.
- /// </summary>
- [MonoNotSupported ("")]
- public sealed class AdjustableArrowCap : CustomLineCap
- {
- // Constructors
-
- [MonoNotSupported ("")]
- public AdjustableArrowCap (float width, float height) : this (width, height, true)
- {
- }
-
- [MonoNotSupported ("")]
- public AdjustableArrowCap (float width, float height, bool isFilled)
- {
- throw new NotImplementedException();
- }
-
- // Public Properities
- [MonoTODO]
- public bool Filled {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float Width {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float Height {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float MiddleInset {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
- }
-}
/// <summary>
/// Summary description for Blend.
/// </summary>
-#if TARGET_JVM
- [MonoTODO]
-#endif
public sealed class Blend
{
private float [] positions;
+++ /dev/null
-//
-// System.Drawing.Drawing2D.CustomLineCap.cs
-//
-// Authors:
-// Dennis Hayes (dennish@Raytek.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Ravindra (rkumar@novell.com)
-//
-// Copyright (C) 2002/3 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Drawing.Drawing2D
-{
- /// <summary>
- /// Summary description for CustomLineCap.
- /// </summary>
- [MonoNotSupported ("")]
- public class CustomLineCap : MarshalByRefObject, ICloneable
- {
- private bool disposed;
-
- // Constructors
-
- internal CustomLineCap () { }
-
- [MonoNotSupported ("")]
- public CustomLineCap (GraphicsPath fillPath, GraphicsPath strokePath) : this (fillPath, strokePath, LineCap.Flat, 0)
- {
- }
-
- [MonoNotSupported ("")]
- public CustomLineCap (GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap) : this (fillPath, strokePath, baseCap, 0)
- {
- }
-
- [MonoNotSupported ("")]
- public CustomLineCap(GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap, float baseInset)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public LineCap BaseCap {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public LineJoin StrokeJoin {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float BaseInset {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO]
- public float WidthScale {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- // Public Methods
- [MonoTODO]
- public virtual object Clone ()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void GetStrokeCaps (out LineCap startCap, out LineCap endCap)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void SetStrokeCaps(LineCap startCap, LineCap endCap)
- {
- throw new NotImplementedException();
- }
- }
-}
+++ /dev/null
-//\r
-// System.Drawing.Drawing2D.ExtendedGeneralPath.cs\r
-//\r
-// Author:\r
-// Bors Kirzner <boris@mainsoft.com> \r
-//\r
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)\r
-//\r
-// Permission is hereby granted, free of charge, to any person obtaining\r
-// a copy of this software and associated documentation files (the\r
-// "Software"), to deal in the Software without restriction, including\r
-// without limitation the rights to use, copy, modify, merge, publish,\r
-// distribute, sublicense, and/or sell copies of the Software, and to\r
-// permit persons to whom the Software is furnished to do so, subject to\r
-// the following conditions:\r
-// \r
-// The above copyright notice and this permission notice shall be\r
-// included in all copies or substantial portions of the Software.\r
-// \r
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
-//\r
-\r
-using System;\r
-\r
-using java.awt;\r
-using java.awt.geom;\r
-using java.lang;\r
-\r
-namespace System.Drawing.Drawing2D\r
-{\r
- internal class ExtendedGeneralPath : Shape, ICloneable\r
- {\r
- #region Fields\r
-\r
- public const int WIND_EVEN_ODD = 0; //PathIterator__Finals.WIND_EVEN_ODD;\r
- public const int WIND_NON_ZERO = 1; //PathIterator__Finals.WIND_NON_ZERO;\r
- \r
- public const sbyte SEG_MOVETO = 0; //(byte) PathIterator__Finals.SEG_MOVETO;\r
- public const sbyte SEG_LINETO = 1; //(byte) PathIterator__Finals.SEG_LINETO;\r
- public const sbyte SEG_QUADTO = 2; //(byte) PathIterator__Finals.SEG_QUADTO;\r
- public const sbyte SEG_CUBICTO = 3; //(byte) PathIterator__Finals.SEG_CUBICTO;\r
- public const sbyte SEG_CLOSE = 4; //(byte) PathIterator__Finals.SEG_CLOSE;\r
- \r
- public const sbyte SEG_START = 16; // segment start\r
-\r
- public const sbyte SEG_MASK = SEG_MOVETO | SEG_LINETO | SEG_QUADTO | SEG_CUBICTO | SEG_CLOSE; // mask to eliminate SEG_CLOSE and SEG_MARKER\r
-\r
- private const sbyte SEG_MARKER = 32; // path marker\r
- \r
-\r
- private sbyte [] _types;\r
- private float [] _coords;\r
- private int _typesCount;\r
- private int _coordsCount;\r
- private int _windingRule;\r
-\r
- private PathData _pathData;\r
- private GeneralPath _generalPath;\r
-\r
- const int INIT_SIZE = 20;\r
- const int EXPAND_MAX = 500;\r
-\r
- #endregion // Fileds\r
-\r
- #region Constructors\r
-\r
- public ExtendedGeneralPath() : this (WIND_NON_ZERO, INIT_SIZE, INIT_SIZE)\r
- {\r
- }\r
-\r
- public ExtendedGeneralPath(int rule) : this (rule, INIT_SIZE, INIT_SIZE)\r
- {\r
- }\r
-\r
- public ExtendedGeneralPath(int rule, int initialCapacity) : this (rule, initialCapacity, initialCapacity)\r
- {\r
- }\r
-\r
- public ExtendedGeneralPath(Shape s) : this(WIND_NON_ZERO, INIT_SIZE, INIT_SIZE)\r
- {\r
- PathIterator pi = s.getPathIterator (null);\r
- setWindingRule (pi.getWindingRule ());\r
- append (pi, false);\r
- }\r
-\r
- private ExtendedGeneralPath(int rule, int initialTypes, int initialCoords) \r
- {\r
- setWindingRule(rule);\r
- Reset (initialTypes, initialCoords);\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Properties\r
-\r
- private GeneralPath GeneralPath\r
- {\r
- get {\r
- if (_generalPath == null) { \r
- _generalPath = GetGeneralPath ();\r
- }\r
- return _generalPath;\r
- }\r
- }\r
-\r
- public sbyte [] Types\r
- {\r
- get { return _types; }\r
- }\r
-\r
- public float [] Coords\r
- {\r
- get { return _coords; }\r
- }\r
-\r
- public int TypesCount\r
- {\r
- get { return _typesCount; }\r
- }\r
-\r
- public int CoordsCount\r
- {\r
- get { return _coordsCount; }\r
- }\r
-\r
- public bool LastFigureClosed\r
- {\r
- get { \r
- return ((TypesCount == 0) || \r
- ((Types [TypesCount - 1] & ExtendedGeneralPath.SEG_CLOSE) != 0) ||\r
- ((Types [TypesCount - 1] & ExtendedGeneralPath.SEG_START) != 0));\r
- }\r
- }\r
-\r
- public int PointCount\r
- {\r
- get {\r
- return CoordsCount / 2;\r
- }\r
- }\r
-\r
- public PathData PathData \r
- {\r
- get \r
- {\r
- if (_pathData == null)\r
- _pathData = GetPathData ();\r
- \r
- return _pathData;\r
- }\r
- }\r
-\r
- #endregion // Properties\r
-\r
- #region Methods\r
-\r
- #region CachedData\r
-\r
- private void ClearCache ()\r
- {\r
- _pathData = null;\r
- _generalPath = null;\r
- }\r
-\r
- private GeneralPath GetGeneralPath ()\r
- {\r
- PathIterator iter = getPathIterator (null);\r
- GeneralPath path = new GeneralPath ();\r
- path.append (iter, false);\r
- return path;\r
- }\r
-\r
- private PathData GetPathData ()\r
- {\r
- PathData pathData = new PathData();\r
- int nPts = PointCount;\r
- for (int i = 0; i < TypesCount; i++)\r
- if ((Types [i] & SEG_MASK) == SEG_QUADTO)\r
- nPts++;\r
-\r
- pathData.Types = new byte [nPts];\r
- pathData.Points = new PointF [nPts];\r
- int tpos = 0;\r
- int ppos = 0;\r
- int cpos = 0;\r
- byte marker;\r
- bool start;\r
- for (int i = 0; i < TypesCount; i++) {\r
- sbyte segmentType = (sbyte)(Types [i] & SEG_MASK);\r
-\r
- // set the masks and the markers\r
- marker = ((Types [i] & SEG_MARKER) != 0) ? (byte)PathPointType.PathMarker : (byte)0;\r
- start = ((Types [i] & SEG_START) != 0);\r
- \r
- switch (segmentType) {\r
- case SEG_CLOSE:\r
- pathData.Types [tpos - 1] = (byte) (pathData.Types [tpos - 1] | (byte) PathPointType.CloseSubpath | marker);\r
- break;\r
- case SEG_MOVETO:\r
- pathData.Types [tpos++] = (byte)((byte) PathPointType.Start | marker);\r
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);\r
- break;\r
- case SEG_LINETO:\r
- pathData.Types [tpos++] = (byte) ((byte) PathPointType.Line | marker);\r
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);\r
- break;\r
- case SEG_QUADTO:\r
- /*\r
- .net does not support Quadratic curves, so convert to Cubic according to http://pfaedit.sourceforge.net/bezier.html\r
- \r
- The end points of the cubic will be the same as the quadratic's.\r
- CP0 = QP0\r
- CP3 = QP2 \r
-\r
- The two control points for the cubic are:\r
-\r
- CP1 = QP0 + 2/3 *(QP1-QP0)\r
- CP2 = CP1 + 1/3 *(QP2-QP0) \r
- */\r
-\r
- float x0 = Coords[cpos-2]; //QP0\r
- float y0 = Coords[cpos-1]; //QP0\r
- \r
- float x1 = x0 + (2/3 * (Coords [cpos++]-x0));\r
- float y1 = y0 + (2/3 * (Coords [cpos++]-y0));\r
-\r
- float x3 = Coords [cpos++]; //QP2\r
- float y3 = Coords [cpos++]; //QP2\r
- \r
- float x2 = x1 + (1/3 * (x3-x0));\r
- float y2 = y1 + (1/3 * (y3-y0));\r
-\r
- pathData.Types [tpos++] = (byte)(byte) PathPointType.Bezier;\r
- pathData.Points [ppos++] = new PointF (x1, y1);\r
- pathData.Types [tpos++] = (byte)(byte) PathPointType.Bezier;\r
- pathData.Points [ppos++] = new PointF (x2, y2);\r
- pathData.Types [tpos++] = (byte) ((byte)PathPointType.Bezier | marker);\r
- pathData.Points [ppos++] = new PointF (x3, y3);\r
- break;\r
- case SEG_CUBICTO:\r
- pathData.Types [tpos++] = (byte)(byte) PathPointType.Bezier3;\r
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);\r
- pathData.Types [tpos++] = (byte) PathPointType.Bezier3;\r
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);\r
- pathData.Types [tpos++] = (byte) ((byte)PathPointType.Bezier3 | marker);\r
- pathData.Points [ppos++] = new PointF (Coords [cpos++], Coords [cpos++]);\r
- break;\r
- }\r
- }\r
- return pathData;\r
- }\r
-\r
- #endregion // CachedData\r
-\r
- public void append(Shape s)\r
- {\r
- append (s, !LastFigureClosed);\r
- }\r
-\r
- #region GeneralPath\r
-\r
- public void append(PathIterator pi, bool connect) \r
- {\r
- ClearCache ();\r
- float [] coords = new float [6];\r
- while (!pi.isDone ()) {\r
- switch (pi.currentSegment (coords)) {\r
- case SEG_MOVETO:\r
- if (!connect || _typesCount < 1 || _coordsCount < 2) {\r
- moveTo (coords [0], coords [1]);\r
- break;\r
- }\r
- if (_types [_typesCount - 1] != SEG_CLOSE &&\r
- _coords [_coordsCount - 2] == coords [0] &&\r
- _coords [_coordsCount - 1] == coords [1])\r
- break; \r
- goto case SEG_LINETO;\r
- case SEG_LINETO:\r
- lineTo (coords [0], coords [1]);\r
- break;\r
- case SEG_QUADTO:\r
- quadTo (coords [0], coords [1], coords [2], coords [3]);\r
- break;\r
- case SEG_CUBICTO:\r
- curveTo (coords [0], coords [1], coords [2], coords [3], coords [4], coords [5]);\r
- break;\r
- case SEG_CLOSE:\r
- closePath ();\r
- break;\r
- }\r
- pi.next ();\r
- connect = false;\r
- }\r
- }\r
-\r
- public void append(Shape s, bool connect) \r
- {\r
- PathIterator pi = s.getPathIterator (null);\r
- append (pi,connect);\r
- }\r
-\r
- public object Clone() \r
- {\r
- ExtendedGeneralPath copy = (ExtendedGeneralPath)MemberwiseClone ();\r
- copy._types = (sbyte []) _types.Clone ();\r
- copy._coords = (float []) _coords.Clone ();\r
- return copy;\r
- }\r
-\r
- public void closePath() \r
- {\r
- ClearCache ();\r
- if (_typesCount == 0 || _types[_typesCount - 1] != SEG_CLOSE) {\r
- needRoom (1, 0, true);\r
- _types [_typesCount++] = SEG_CLOSE;\r
- }\r
- }\r
-\r
- public bool contains(double x, double y) \r
- { \r
- return GeneralPath.contains (x, y);\r
- }\r
-\r
- public bool contains(double x, double y, double w, double h) \r
- {\r
- return GeneralPath.contains (x, y, w, h);\r
- }\r
-\r
- public bool contains(Point2D p) \r
- {\r
- return contains (p.getX (), p.getY ());\r
- }\r
-\r
- public bool contains(Rectangle2D r) \r
- {\r
- return contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ());\r
- }\r
-\r
- public Shape createTransformedShape(AffineTransform at) \r
- {\r
- ExtendedGeneralPath gp = (ExtendedGeneralPath) Clone ();\r
- if (at != null) {\r
- gp.transform (at);\r
- }\r
- return gp;\r
- }\r
-\r
- public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) \r
- {\r
- ClearCache ();\r
- needRoom (1, 6, true);\r
- _types [_typesCount++] = SEG_CUBICTO;\r
- _coords [_coordsCount++] = x1;\r
- _coords [_coordsCount++] = y1;\r
- _coords [_coordsCount++] = x2;\r
- _coords [_coordsCount++] = y2;\r
- _coords [_coordsCount++] = x3;\r
- _coords [_coordsCount++] = y3;\r
- }\r
-\r
- public java.awt.Rectangle getBounds() \r
- {\r
- return getBounds2D ().getBounds ();\r
- }\r
-\r
- public Rectangle2D getBounds2D() \r
- {\r
- float x1, y1, x2, y2;\r
- int i = _coordsCount;\r
- if (i > 0) {\r
- y1 = y2 = _coords [--i];\r
- x1 = x2 = _coords [--i];\r
- while (i > 0) {\r
- float y = _coords [--i];\r
- float x = _coords [--i];\r
- if (x < x1) x1 = x;\r
- if (y < y1) y1 = y;\r
- if (x > x2) x2 = x;\r
- if (y > y2) y2 = y;\r
- }\r
- } \r
- else {\r
- x1 = y1 = x2 = y2 = 0f;\r
- }\r
- return new Rectangle2D.Float (x1, y1, x2 - x1, y2 - y1);\r
- }\r
-\r
- public Point2D getCurrentPoint() \r
- {\r
- if (_typesCount < 1 || _coordsCount < 2)\r
- return null;\r
- \r
- int index = _coordsCount;\r
- if (_types [_typesCount - 1] == SEG_CLOSE)\r
- for (int i = _typesCount - 2; i > 0; i--) {\r
- switch (_types [i]) {\r
- case SEG_MOVETO:\r
- //break loop;\r
- goto loopend;\r
- case SEG_LINETO:\r
- index -= 2;\r
- break;\r
- case SEG_QUADTO:\r
- index -= 4;\r
- break;\r
- case SEG_CUBICTO:\r
- index -= 6;\r
- break;\r
- case SEG_CLOSE:\r
- break;\r
- }\r
- }\r
- loopend:\r
-\r
- return new Point2D.Float (_coords [index - 2], _coords [index - 1]);\r
- }\r
-\r
- public PathIterator getPathIterator(AffineTransform at) {\r
- return new GeneralPathIterator (this, at);\r
- }\r
-\r
- public PathIterator getPathIterator(AffineTransform at, double flatness) {\r
- return new FlatteningPathIterator (getPathIterator (at), flatness);\r
- }\r
-\r
- public int getWindingRule() \r
- {\r
- return _windingRule;\r
- }\r
-\r
- public bool intersects(double x, double y, double w, double h) \r
- {\r
- return GeneralPath.intersects (x, y, w, h);\r
- }\r
-\r
- public bool intersects(Rectangle2D r) \r
- {\r
- return intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ());\r
- }\r
-\r
- public void lineTo(float x, float y) \r
- {\r
- ClearCache ();\r
- needRoom (1, 2, true);\r
- _types [_typesCount++] = SEG_LINETO;\r
- _coords [_coordsCount++] = x;\r
- _coords [_coordsCount++] = y;\r
- }\r
-\r
- public void moveTo(float x, float y) \r
- {\r
- ClearCache ();\r
- if (_typesCount > 0 && _types [_typesCount - 1] == SEG_MOVETO) {\r
- _coords [_coordsCount - 2] = x;\r
- _coords [_coordsCount - 1] = y;\r
- } \r
- else {\r
- needRoom (1, 2, false);\r
- _types [_typesCount++] = SEG_MOVETO;\r
- _coords [_coordsCount++] = x;\r
- _coords [_coordsCount++] = y;\r
- }\r
- }\r
-\r
- public void quadTo(float x1, float y1, float x2, float y2) \r
- {\r
- // restore quadTo as cubic affects quality\r
- ClearCache ();\r
- needRoom (1, 4, true);\r
- _types [_typesCount++] = SEG_QUADTO;\r
- _coords [_coordsCount++] = x1;\r
- _coords [_coordsCount++] = y1;\r
- _coords [_coordsCount++] = x2;\r
- _coords [_coordsCount++] = y2;\r
- }\r
-\r
- public void reset() \r
- {\r
- ClearCache ();\r
- _typesCount = 0;\r
- _coordsCount = 0;\r
- }\r
-\r
- public void setWindingRule(int rule) \r
- {\r
- if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) {\r
- throw new IllegalArgumentException ("winding rule must be WIND_EVEN_ODD or WIND_NON_ZERO");\r
- }\r
- _windingRule = rule;\r
- }\r
-\r
- public void transform(AffineTransform at) \r
- {\r
- transform(at, 0, CoordsCount);\r
- }\r
-\r
- public void transform(AffineTransform at, int startCoord, int numCoords) {\r
- ClearCache ();\r
- at.transform (_coords, startCoord, _coords, startCoord, numCoords/2);\r
- }\r
-\r
- private void needRoom(int newTypes, int newCoords, bool needMove) \r
- {\r
- if (needMove && _typesCount == 0)\r
- throw new IllegalPathStateException ("missing initial moveto in path definition");\r
- \r
- int size = _coords.Length;\r
- if (_coordsCount + newCoords > size) {\r
- int grow = size;\r
- if (grow > EXPAND_MAX * 2)\r
- grow = EXPAND_MAX * 2;\r
- \r
- if (grow < newCoords)\r
- grow = newCoords;\r
- \r
- float [] arr = new float [size + grow];\r
- Array.Copy (_coords, 0, arr, 0, _coordsCount);\r
- _coords = arr;\r
- }\r
- size = _types.Length;\r
- if (_typesCount + newTypes > size) {\r
- int grow = size;\r
- if (grow > EXPAND_MAX)\r
- grow = EXPAND_MAX;\r
- \r
- if (grow < newTypes)\r
- grow = newTypes;\r
- \r
- sbyte [] arr = new sbyte [size + grow];\r
- Array.Copy (_types, 0, arr, 0, _typesCount);\r
- _types = arr;\r
- }\r
- }\r
-\r
- #endregion // GeneralPath\r
-\r
- public void SetMarkers()\r
- {\r
- ClearCache ();\r
- if (TypesCount > 0)\r
- Types [ TypesCount - 1] |= SEG_MARKER;\r
- }\r
-\r
- public void ClearMarkers()\r
- {\r
- ClearCache ();\r
- for (int i = 0; i < TypesCount; i++)\r
- Types [i] &= ~SEG_MARKER;\r
- }\r
-\r
- public void StartFigure ()\r
- {\r
- ClearCache ();\r
- if (TypesCount > 0)\r
- Types [TypesCount - 1] |= ExtendedGeneralPath.SEG_START;\r
- }\r
-\r
- private void Reset (int initialTypes, int initialCoords)\r
- {\r
- ClearCache ();\r
- _types = new sbyte [initialTypes];\r
- _coords = new float [initialCoords * 2];\r
- _typesCount = 0;\r
- _coordsCount = 0;\r
- }\r
-\r
- internal void Clear ()\r
- {\r
- Reset (INIT_SIZE, INIT_SIZE);\r
- }\r
-\r
- internal void Reverse ()\r
- {\r
- ClearCache ();\r
- // revert coordinates\r
- for (int i=0, max = CoordsCount / 2; i < max;) {\r
- int ix = i++;\r
- int iy = i++;\r
- int rix = CoordsCount - i;\r
- int riy = rix + 1;\r
- float tmpx = Coords [ix];\r
- float tmpy = Coords [iy];\r
- Coords [ix] = Coords [rix];\r
- Coords [iy] = Coords [riy];\r
- Coords [rix] = tmpx;\r
- Coords [riy] = tmpy;\r
- }\r
-\r
- // revert types\r
- sbyte [] newTypes = new sbyte [TypesCount];\r
- int oldIdx = 0;\r
- int newIdx = TypesCount - 1;\r
- int copyStart;\r
- int copyEnd;\r
- sbyte mask1 = 0;\r
- sbyte mask2 = 0;\r
- sbyte closeMask = 0;\r
- bool closedFigure = false;\r
- \r
- while (oldIdx < TypesCount) {\r
- // start copying after moveto\r
- copyStart = ++oldIdx;\r
- // continue to the next figure start\r
- while ((Types [oldIdx] != SEG_MOVETO) && (oldIdx < TypesCount))\r
- oldIdx++;\r
-\r
- copyEnd = oldIdx - 1;\r
- // check whenever current figure is closed\r
- if ((Types [oldIdx - 1] & SEG_CLOSE) != 0) {\r
- closedFigure = true;\r
- // close figure\r
- newTypes [newIdx--] = (sbyte)(SEG_CLOSE | mask1);\r
- mask1 = 0;\r
- mask2 = 0;\r
- // end copy one cell earlier\r
- copyEnd--;\r
- closeMask = (sbyte)(Types [oldIdx - 1] & (sbyte)SEG_MARKER);\r
- }\r
- else {\r
- mask2 = mask1;\r
- mask1 = 0;\r
- }\r
-\r
- // copy reverted "inner" types\r
- for(int i = copyStart; i <= copyEnd; i++) {\r
- newTypes [newIdx--] = (sbyte)((Types [i] & SEG_MASK) | mask2);\r
- mask2 = mask1;\r
- mask1 = (sbyte)(Types [i] & (sbyte)SEG_MARKER);\r
- }\r
-\r
- // copy moveto\r
- newTypes [newIdx--] = SEG_MOVETO;\r
-\r
- // pass close mask to the nex figure\r
- if (closedFigure) {\r
- mask1 = closeMask;\r
- closedFigure = false;\r
- }\r
- }\r
-\r
- _types = newTypes;\r
- }\r
-\r
- public PointF GetLastPoint ()\r
- {\r
- if (CoordsCount == 0)\r
- throw new System.ArgumentException ("Invalid parameter used.");\r
-\r
- return new PointF (Coords [CoordsCount - 2], Coords [CoordsCount - 1]);\r
- }\r
-\r
- #endregion //Methods\r
-\r
- #region Private helpers\r
-\r
-#if DEBUG\r
- private void Print()\r
- {\r
- Console.WriteLine ("\n\n");\r
- float [] fpoints = _coords;\r
- int cpos = 0;\r
- for (int i=0; i < _typesCount; i++) {\r
- sbyte type = _types [i];\r
- string marker = String.Empty;\r
- if ((type & SEG_MARKER) != 0)\r
- marker = " | MARKER";\r
-\r
- switch (type & SEG_MASK) {\r
- case SEG_CLOSE:\r
- Console.WriteLine ("CLOSE {0}",marker);\r
- break;\r
- case SEG_MOVETO:\r
- Console.WriteLine("{0}{3} ({1},{2})","MOVETO", fpoints[cpos++], fpoints[cpos++], marker);\r
- break;\r
- case SEG_LINETO:\r
- Console.WriteLine("{0}{3} ({1},{2})","LINETO", fpoints[cpos++], fpoints[cpos++], marker);\r
- break;\r
- case SEG_QUADTO:\r
- Console.WriteLine("{0}{3} ({1},{2})","QUADTO", fpoints[cpos++], fpoints[cpos++], marker);\r
- Console.WriteLine(" ({1},{2})","QUADTO", fpoints[cpos++], fpoints[cpos++]);\r
- break;\r
- case SEG_CUBICTO:\r
- Console.WriteLine("{0}{3} ({1},{2})","CUBICTO", fpoints[cpos++], fpoints[cpos++], marker);\r
- Console.WriteLine(" ({1},{2})","CUBICTO", fpoints[cpos++], fpoints[cpos++]);\r
- Console.WriteLine(" ({1},{2})","CUBICTO", fpoints[cpos++], fpoints[cpos++]);\r
- break;\r
- }\r
- }\r
- }\r
-#endif\r
- #endregion // Private helpers\r
- \r
- }\r
-}\r
+++ /dev/null
-//
-// System.Drawing.Drawing2D.GeneralPathIterator.cs
-//
-// Author:
-// Bors Kirzner <boris@mainsoft.com>
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.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.
-//
-\r
-using System;\r
-\r
-using java.awt.geom;\r
-\r
-namespace System.Drawing.Drawing2D\r
-{\r
- internal class GeneralPathIterator : PathIterator\r
- {\r
- #region Fields\r
-\r
- int typeIdx = 0;\r
- int pointIdx = 0;\r
- ExtendedGeneralPath _path;\r
- AffineTransform _affine;\r
-\r
- private static readonly int [] curvesize = {2, 2, 4, 6, 0};\r
-\r
- #endregion // Fileds\r
-\r
- #region Constructors\r
-\r
- public GeneralPathIterator(ExtendedGeneralPath _path) : this (_path, null)\r
- {\r
- }\r
-\r
- public GeneralPathIterator(ExtendedGeneralPath _path, AffineTransform at) \r
- {\r
- this._path = _path;\r
- this._affine = at;\r
- }\r
-\r
- #endregion // Constructors\r
-\r
- #region Methods\r
-\r
- public int getWindingRule() \r
- {\r
- return _path.getWindingRule ();\r
- }\r
-\r
- public bool isDone() \r
- {\r
- return (typeIdx >= _path.TypesCount);\r
- }\r
-\r
- public void next() \r
- {\r
- int type = _path.Types [typeIdx++] & ExtendedGeneralPath.SEG_MASK;\r
- pointIdx += curvesize [type];\r
- }\r
-\r
- public int currentSegment(float [] coords) {\r
- int type = _path.Types [typeIdx] & ExtendedGeneralPath.SEG_MASK;\r
- int numCoords = curvesize [type];\r
- if (numCoords > 0 && _affine != null)\r
- _affine.transform (_path.Coords, pointIdx, coords, 0, numCoords/2);\r
- else\r
- Array.Copy (_path.Coords, pointIdx, coords, 0, numCoords);\r
- return type;\r
- }\r
-\r
- public int currentSegment(double [] coords) \r
- {\r
- int type = _path.Types [typeIdx] & ExtendedGeneralPath.SEG_MASK;\r
- int numCoords = curvesize [type];\r
- if (numCoords > 0 && _affine != null)\r
- _affine.transform (_path.Coords, pointIdx, coords, 0, numCoords/2);\r
- else \r
- for (int i=0; i < numCoords; i++)\r
- coords [i] = _path.Coords [pointIdx + i];\r
- \r
- return type;\r
- }\r
-\r
- #endregion // Methods\r
- } \r
-}\r
+++ /dev/null
-//
-// System.Drawing.Drawing2D.GraphicsContainer.cs
-//
-// Authors:
-// Dennis Hayes (dennish@Raytek.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2002/3 Ximian, Inc
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-
-namespace System.Drawing.Drawing2D
-{
- /// <summary>
- /// Summary description for GraphicsContainer.
- /// </summary>
- public sealed class GraphicsContainer : MarshalByRefObject
- {
- readonly GraphicsState _stateObject;
-
- internal GraphicsContainer (GraphicsState stateObject)
- {
- _stateObject = stateObject;
- }
-
- internal GraphicsState StateObject
- {
- get {return _stateObject;}
- }
- }
-}
+++ /dev/null
-//
-// System.Drawing.Drawing2D.GraphicsPath.cs
-//
-// Author:
-// Konstantin Triger <kostat@mainsoft.com>
-// Bors Kirzner <boris@mainsoft.com>
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Drawing;
-using System.Drawing.Text;
-using System.Collections;
-using java.awt.geom;
-using java.awt;
-
-namespace System.Drawing.Drawing2D
-{
- public sealed class GraphicsPath : BasicShape, ICloneable
- {
- internal enum JPI {
- SEG_MOVETO = ExtendedGeneralPath.SEG_MOVETO,
- SEG_LINETO = ExtendedGeneralPath.SEG_LINETO,
- SEG_QUADTO = ExtendedGeneralPath.SEG_QUADTO,
- SEG_CUBICTO = ExtendedGeneralPath.SEG_CUBICTO,
- SEG_CLOSE = ExtendedGeneralPath.SEG_CLOSE
- }
-
- #region Internal
-
- internal ExtendedGeneralPath NativeObject
- {
- get
- {
- return (ExtendedGeneralPath)Shape;
- }
- }
-
- GraphicsPath (ExtendedGeneralPath ptr) : base(ptr)
- {
- }
- #endregion
-
- #region C-tors.
- public GraphicsPath ():
- this(FillMode.Alternate)
- {
- }
-
- public GraphicsPath (FillMode fillMode) : this(new ExtendedGeneralPath ())
- {
- FillMode = fillMode;
- }
-
- public GraphicsPath (Point[] pts, byte[] types) : this(pts, types, FillMode.Alternate)
- {
- }
-
- public GraphicsPath (PointF [] pts, byte [] types) : this(pts, types, FillMode.Alternate)
- {
- }
-
- public GraphicsPath (Point [] pts, byte [] types, FillMode fillMode) : this(new ExtendedGeneralPath ())
- {
- FillMode = fillMode;
- SetPath (pts, types);
- }
-
- public GraphicsPath (PointF [] pts, byte [] types, FillMode fillMode) : this(new ExtendedGeneralPath ())
- {
- FillMode = fillMode;
- SetPath (pts, types);
- }
-
- #endregion
-
- #region Clone
- public object Clone ()
- {
- return new GraphicsPath ((ExtendedGeneralPath) NativeObject.Clone ());
- }
- #endregion
-
- #region Properties
- public FillMode FillMode
- {
- get
- { if(NativeObject.getWindingRule() == GeneralPath.WIND_EVEN_ODD)
- return FillMode.Alternate;
- else
- return FillMode.Winding;
- }
-
- set
- {
- if (value == FillMode.Alternate)
- NativeObject.setWindingRule (GeneralPath.WIND_EVEN_ODD);
- else
- NativeObject.setWindingRule (GeneralPath.WIND_NON_ZERO);
- }
- }
-
- public PathData PathData
- {
- get { return NativeObject.PathData; }
- }
-
- public PointF [] PathPoints
- {
- get
- {
- return PathData.Points;
- }
- }
-
- public byte [] PathTypes
- {
- get
- {
- return PathData.Types;
- }
- }
- #endregion
-
- #region PointCount
- public int PointCount
- {
- get
- {
- return NativeObject.PointCount;
- }
- }
- #endregion
-
- #region AddArc
- public void AddArc (Rectangle rect, float startAngle, float sweepAngle)
- {
- AddArc(rect.X,rect.Y,rect.Width,rect.Height,startAngle,sweepAngle);
- }
-
- public void AddArc (RectangleF rect, float startAngle, float sweepAngle)
- {
- AddArc(rect.X,rect.Y,rect.Width,rect.Height,startAngle,sweepAngle);
- }
-
- public void AddArc (int x, int y, int width, int height, float startAngle, float sweepAngle)
- {
- AddArc((float)x,(float)y,(float)width,(float)height,startAngle,sweepAngle);
- }
-
- public void AddArc (float x, float y, float width, float height, float startAngle, float sweepAngle)
- {
- Shape shape = null;
-
- if (sweepAngle >= 360)
- shape = new Ellipse2D.Float(x, y, width, height);
- else {
-
- double d1Tod2 = width/height;
- double sqrd1Tod2 = d1Tod2*d1Tod2;
- double start = ConvertArcAngle(sqrd1Tod2, startAngle);
- double extent = ConvertArcAngle(sqrd1Tod2, startAngle+sweepAngle) - start;
-
- shape = new Arc2D.Double(x,y,width,height,-start,-extent,Arc2D.OPEN);
- }
-
- NativeObject.append(shape);
- }
-
- /// <summary>
- /// .Net computes an angle by intersection of ellipse with a ray
- /// java does the following: x1 = d1*cos(a), y1 = d2*sin(a)
- /// where: d1 = width/2, d2 = height/2
- /// we need to find angle x, which satisfies:
- /// x1 = m*cos(a) = d1*cos(x)
- /// y1 = m*sin(a) = d2*sin(x)
- /// (x1*x1)/(d1*d1) + (x2*x2)/(d2*d2) = 1
- /// </summary>
- /// <param name="sqrd1Tod2">(d1/d2)*(d1/d2)</param>
- /// <param name="angle">angle in degrees</param>
- /// <returns>converted angle in degrees</returns>
- static double ConvertArcAngle(double sqrd1Tod2, double angle) {
- double angleRad = java.lang.Math.toRadians(angle);
- double tan = Math.Tan(angleRad);
- double cosx = 1/Math.Sqrt( sqrd1Tod2 * (tan*tan) + 1);
- double xRad = Math.Acos(cosx);
- double x = java.lang.Math.toDegrees(xRad);
- int q = (Math.Abs((int)angle))/90;
-
- switch (q&3) {
- case 1:
- x = 180-x;
- break;
- case 2:
- x = 180+x;
- break;
- case 3:
- x = 360-x;
- break;
- }
-
- if (angle < 0)
- x = -x;
-
- x += (((int)angle)/360)*360;
-
- return x;
- }
-
- #endregion
-
- #region AddBezier(s)
- public void AddBezier (Point pt1, Point pt2, Point pt3, Point pt4)
- {
- AddBezier(pt1.X,pt1.Y,pt2.X,pt2.Y,pt3.X,pt3.Y,pt4.X,pt4.Y);
- }
-
- public void AddBezier (PointF pt1, PointF pt2, PointF pt3, PointF pt4)
- {
- AddBezier(pt1.X,pt1.Y,pt2.X,pt2.Y,pt3.X,pt3.Y,pt4.X,pt4.Y);
- }
-
- public void AddBezier (int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
- {
- AddBezier((float)x1,(float)y1,(float)x2,(float)y2,(float)x3,(float)y3,(float)x4,(float)y4);
- }
-
- public void AddBezier (float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
- {
- CubicCurve2D cc = new CubicCurve2D.Float(x1,y1,x2,y2,x3,y3,x4,y4);
- NativeObject.append(cc);
- }
-
- public void AddBeziers (Point [] pts)
- {
- if (pts == null)
- throw new ArgumentNullException("points");
-
- AddBezier(pts [0].X,pts [0].Y,
- pts [1].X,pts [1].Y,
- pts [2].X,pts [2].Y,
- pts [3].X,pts [3].Y);
-
- for (int i = 4; i < pts.Length; i += 3) {
- NativeObject.curveTo(
- pts [i].X,pts [i].Y,
- pts [i+1].X,pts [i+1].Y,
- pts [i+2].X,pts [i+2].Y);
- }
- }
-
- public void AddBeziers (PointF [] pts)
- {
- if (pts == null)
- throw new ArgumentNullException("points");
-
- AddBezier(pts [0].X,pts [0].Y,
- pts [1].X,pts [1].Y,
- pts [2].X,pts [2].Y,
- pts [3].X,pts [3].Y);
-
- for (int i = 4; i < pts.Length; i += 3) {
- NativeObject.curveTo(
- pts [i].X,pts [i].Y,
- pts [i+1].X,pts [i+1].Y,
- pts [i+2].X,pts [i+2].Y);
- }
- }
- #endregion
-
- #region AddEllipse
- public void AddEllipse (float x, float y, float width, float height)
- {
- Ellipse2D e = new Ellipse2D.Float(x,y,width,height);
- NativeObject.append(e,false);
- }
-
- public void AddEllipse (RectangleF r)
- {
- AddEllipse(r.X,r.Y,r.Width,r.Height);
- }
-
- public void AddEllipse (Rectangle r)
- {
- AddEllipse(r.X,r.Y,r.Width,r.Height);
- }
-
- public void AddEllipse (int x, int y, int width, int height)
- {
- AddEllipse((float)x, (float)y, (float)width, (float)height);
- }
- #endregion
-
- #region AddLine
- public void AddLine (float x1, float y1, float x2, float y2)
- {
- Line2D l = new Line2D.Float(x1,y1,x2,y2);
- NativeObject.append(l);
- }
-
- public void AddLine (Point a, Point b)
- {
- AddLine(a.X,a.Y,b.X,b.Y);
- }
-
- public void AddLine (PointF a, PointF b)
- {
- AddLine(a.X,a.Y,b.X,b.Y);
- }
-
- public void AddLine (int x1, int y1, int x2, int y2)
- {
- AddLine((float)x1,(float)y1,(float)x2,(float)y2);
- }
-
- public void AddLines (Point [] points)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length == 0)
- return;
-
- if (NativeObject.LastFigureClosed)
- NativeObject.moveTo(points[0].X, points[0].Y);
- else
- NativeObject.lineTo(points[0].X, points[0].Y);
-
- for (int i = 1; i < points.Length; i ++)
- NativeObject.lineTo(points[i].X, points[i].Y);
- }
-
- public void AddLines (PointF [] points)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length == 0)
- return;
-
- if (NativeObject.LastFigureClosed)
- NativeObject.moveTo(points[0].X, points[0].Y);
- else
- NativeObject.lineTo(points[0].X, points[0].Y);
-
- for (int i = 1; i < points.Length; i ++)
- NativeObject.lineTo(points[i].X, points[i].Y);
- }
- #endregion
-
- #region AddPie
- public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
- {
- Shape shape = null;
-
- if (sweepAngle >= 360)
- shape = new Ellipse2D.Float(x, y, width, height);
- else {
-
- double d1Tod2 = width/height;
- double sqrd1Tod2 = d1Tod2*d1Tod2;
- double start = ConvertArcAngle(sqrd1Tod2, startAngle);
- double extent = ConvertArcAngle(sqrd1Tod2, startAngle+sweepAngle) - start;
-
- shape = new Arc2D.Double(x,y,width,height,-start,-extent,Arc2D.PIE);
- }
-
- NativeObject.append(shape,false);
- }
-
- public void AddPie (Rectangle rect, float startAngle, float sweepAngle)
- {
- AddPie((float)rect.X, (float)rect.Y,(float)rect.Width,(float)rect.Height,startAngle,sweepAngle);
- }
-
- public void AddPie (int x, int y, int width, int height, float startAngle, float sweepAngle)
- {
- AddPie((float)x,(float)y,(float)width,(float)height,startAngle,sweepAngle);
- }
- #endregion
-
- #region AddPolygon
- public void AddPolygon (Point [] points)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length < 3)
- throw new ArgumentException("Invalid parameter used.");
-
- NativeObject.moveTo((float)points[0].X,(float)points[0].Y);
- for (int i = 1; i< points.Length; i++)
- {
- NativeObject.lineTo((float)points[i].X,(float)points[i].Y);
- }
- NativeObject.closePath();
- }
-
- public void AddPolygon (PointF [] points)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length < 3)
- throw new ArgumentException("Invalid parameter used.");
-
- NativeObject.moveTo(points[0].X,points[0].Y);
- for (int i = 1; i < points.Length; i++)
- {
- NativeObject.lineTo(points[i].X,points[i].Y);
- }
- NativeObject.closePath();
- }
- #endregion
-
- #region AddRectangle(s)
- internal void AddRectangle(float x,float y, float w, float h)
- {
- NativeObject.moveTo(x, y);
- NativeObject.lineTo (x + w, y);
- NativeObject.lineTo (x + w, y + h);
- NativeObject.lineTo (x, y + h);
- NativeObject.closePath ();
- }
- public void AddRectangle (RectangleF rect)
- {
- AddRectangle(rect.X,rect.Y,rect.Width,rect.Height);
- }
-
- public void AddRectangle (Rectangle rect)
- {
- AddRectangle(rect.X,rect.Y,rect.Width,rect.Height);
- }
-
- public void AddRectangles (Rectangle [] rects)
- {
- foreach(Rectangle rect in rects)
- AddRectangle(rect.X,rect.Y,rect.Width,rect.Height);
- }
-
- public void AddRectangles (RectangleF [] rects)
- {
- foreach(RectangleF rect in rects)
- AddRectangle(rect.X,rect.Y,rect.Width,rect.Height);
- }
- #endregion
-
- #region AddPath
- public void AddPath (GraphicsPath addingPath, bool connect)
- {
- if (NativeObject.LastFigureClosed || addingPath.NativeObject.LastFigureClosed)
- connect = false;
-
- NativeObject.append(addingPath.NativeObject,connect);
- }
- #endregion
-
- #region GetLastPoint
- public PointF GetLastPoint ()
- {
- return NativeObject.GetLastPoint ();
- }
- #endregion
-
- #region Reset
- public void Reset ()
- {
- NativeObject.reset();
- }
- #endregion
-
- #region GetBounds
- public RectangleF GetBounds ()
- {
- return GetBounds (null, null);
- }
-
- public RectangleF GetBounds (Matrix matrix)
- {
- return GetBounds (matrix, null);
- }
-
- public RectangleF GetBounds (Matrix matrix, Pen pen)
- {
- // FIXME : we do not know exacly how the bounding rectangle
- // is calculated so this implementation obtains different bounds
- // that still contains the path widened by oen and transformed by matrix
- // the order of operations is similar to widening, as .Net does.
-
- // first get original shape bounds
- //Shape shape = NativeObject.getBounds2D();
- Shape shape = NativeObject;
-
- // stroke bounds
- if (pen != null)
- shape = ((Stroke)pen).createStrokedShape (shape);
-
- Rectangle2D rect = shape.getBounds2D ();
-
- // transform bounds
- if (matrix != null)
- rect = matrix.NativeObject.createTransformedShape(rect).getBounds2D();
-
- return new RectangleF (rect);
- }
- #endregion
-
- #region Transform
- public void Transform (Matrix matrix)
- {
- if(matrix == null)
- return;
-
- NativeObject.transform(matrix.NativeObject);
- }
- #endregion
-
- #region IsVisible
- public bool IsVisible (Point point)
- {
- return IsVisible (point.X, point.Y, null);
- }
-
- public bool IsVisible (PointF point)
- {
- return IsVisible (point.X, point.Y, null);
- }
-
- public bool IsVisible (int x, int y)
- {
- return IsVisible (x, y, null);
- }
-
- public bool IsVisible (float x, float y)
- {
- return IsVisible (x, y, null);
- }
-
- public bool IsVisible (Point pt, Graphics graphics)
- {
- return IsVisible (pt.X, pt.Y, graphics);
- }
-
- public bool IsVisible (PointF pt, Graphics graphics)
- {
- return IsVisible (pt.X, pt.Y, graphics);
- }
-
- public bool IsVisible (int x, int y, Graphics graphics)
- {
- return IsVisible((float)x,(float)y,null);
- }
-
- public bool IsVisible (float x, float y, Graphics graphics)
- {
- // LAMESPEC : .Net is currently ignorig Graphics object
- //if (graphics != null && !graphics.IsVisible(x,y))
- // return false;
-
- return NativeObject.contains(x,y);
- }
- #endregion
-
- #region Reverse
- public void Reverse ()
- {
- NativeObject.Reverse ();
- }
- #endregion
-
- #region AddClosedCurve
- public void AddClosedCurve (Point [] points)
- {
- AddClosedCurve(points, 0.5f);
- }
-
- public void AddClosedCurve (PointF [] points)
- {
- AddClosedCurve(points, 0.5f);
- }
-
- public void AddClosedCurve (Point [] points, float tension)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length < 3)
- throw new ArgumentException("Invalid parameter used.");
-
- int length = (points.Length + 3)*2;
-
- float[] pts = new float[length];
- pts[--length] = points[1].Y;
- pts[--length] = points[1].X;
- pts[--length] = points[0].Y;
- pts[--length] = points[0].X;
-
- for (int i = points.Length-1; i >= 0; i--) {
- pts[--length] = points[i].Y;
- pts[--length] = points[i].X;
- }
-
- pts[--length] = points[points.Length-1].Y;
- pts[--length] = points[points.Length-1].X;
-
- AddCurve(pts, !NativeObject.LastFigureClosed, tension);
- CloseFigure ();
- }
-
- public void AddClosedCurve (PointF [] points, float tension)
- {
- if (points == null)
- throw new ArgumentNullException("points");
-
- if (points.Length < 3)
- throw new ArgumentException("Invalid parameter used.");
-
- int length = (points.Length + 3)*2;
-
- float[] pts = new float[length];
- pts[--length] = points[1].Y;
- pts[--length] = points[1].X;
- pts[--length] = points[0].Y;
- pts[--length] = points[0].X;
-
- for (int i = points.Length-1; i >= 0; i--) {
- pts[--length] = points[i].Y;
- pts[--length] = points[i].X;
- }
-
- pts[--length] = points[points.Length-1].Y;
- pts[--length] = points[points.Length-1].X;
-
- AddCurve(pts, !NativeObject.LastFigureClosed, tension);
- CloseFigure ();
- }
- #endregion
-
- #region AddCurve
- //we have now two approaches for drawing cardinal curves
- //the first one is to convert cardinals into approximate beziers
- //the second one - to draw curve ourself with all interpolation staff
- //here. I preffer the first one because we could utilize java antialiasing and
- //flattening features, otherwise curves will be more strict but less cool
- public void AddCurve (Point [] points)
- {
- AddCurve(points,0.5F);
- }
-
- public void AddCurve (PointF [] points)
- {
- AddCurve(points,0.5f);
- }
-
- public void AddCurve (Point [] points, float tension)
- {
- AddCurve(points, 0, points.Length-1, tension);
- }
-
- public void AddCurve (PointF [] points, float tension)
- {
- AddCurve(points, 0, points.Length-1, tension);
- }
-
- public void AddCurve (Point [] points, int offset, int numberOfSegments, float tension)
- {
- int nPoints = numberOfSegments + 1;
- int length = nPoints*2 + 4;
- float[] pts = new float[length];
-
- int lastP = offset + nPoints;
- if (lastP == points.Length) {
- lastP--;
- pts[--length] = points[lastP].Y;
- pts[--length] = points[lastP].X;
- }
-
- for (; length > 0 && lastP >= 0; lastP--) {
- pts[--length] = points[lastP].Y;
- pts[--length] = points[lastP].X;
- }
-
- if (length > 0) {
- pts[1] = points[0].Y;
- pts[0] = points[0].X;
- }
-
- AddCurve(pts, !NativeObject.LastFigureClosed, tension);
- }
-
- public void AddCurve (PointF [] points, int offset, int numberOfSegments, float tension)
- {
- int nPoints = numberOfSegments + 1;
- int length = nPoints*2 + 4;
- float[] pts = new float[length];
-
- int lastP = offset + nPoints;
- if (lastP == points.Length) {
- lastP--;
- pts[--length] = points[lastP].Y;
- pts[--length] = points[lastP].X;
- }
-
- for (; length > 0 && lastP >= 0; lastP--) {
- pts[--length] = points[lastP].Y;
- pts[--length] = points[lastP].X;
- }
-
- if (length > 0) {
- pts[1] = points[0].Y;
- pts[0] = points[0].X;
- }
-
- AddCurve(pts, !NativeObject.LastFigureClosed, tension);
- }
-
- /// <summary>
- /// Based on http://pubpages.unh.edu/~cs770/a5/cardinal.html
- /// </summary>
- /// <param name="pts">point array (x1,y1,x2,y2 ...).
- /// The first and last points considered only for calculations, but are not added.</param>
- void AddCurve(float[] pts, bool connect, float tension) {
- tension /= 3f; //looks like a good pick
-
- if (connect)
- NativeObject.lineTo(pts[2],pts[3]);
- else
- NativeObject.moveTo(pts[2],pts[3]);
-
- float dx = pts[4] - pts[0];
- float dy = pts[5] - pts[1];
-
- float sx = pts[2] + tension*dx;
- float sy = pts[3] + tension*dy;
-
- for (int offset = 2, total = pts.Length-4; offset < total; offset += 2) {
- int cur_offset = offset;
- int pX = cur_offset++;
- int pY = cur_offset++;
- int X = cur_offset++;
- int Y = cur_offset++;
- int nX = cur_offset++;
- int nY = cur_offset++;
-
- dx = pts[nX] - pts[pX];
- dy = pts[nY] - pts[pY];
-
- float rx = pts[X] - tension*dx;
- float ry = pts[Y] - tension*dy;
-
- NativeObject.curveTo(sx, sy, rx, ry, pts[X], pts[Y]);
-
- sx = pts[X] + tension*dx;
- sy = pts[Y] + tension*dy;
- }
- }
- #endregion
-
- #region AddString
- public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
- {
- AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World), origin.X, origin.Y, float.PositiveInfinity, float.PositiveInfinity,
- format);
- }
-
- public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
- {
- AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World), origin.X, origin.Y, float.PositiveInfinity, float.PositiveInfinity,
- format);
- }
-
- public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
- {
- AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World),
- layoutRect.X, layoutRect.Y, layoutRect.Width, layoutRect.Height,
- format);
- }
-
- public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
- {
- AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World),
- layoutRect.X, layoutRect.Y, layoutRect.Width, layoutRect.Height,
- format);
- }
-
- void AddString (string s, Font font,
- float x, float y, float width, float height,
- StringFormat format) {
-
- TextLineIterator iter = new TextLineIterator(s, font,
- new java.awt.font.FontRenderContext(null, false, false),
- format, width, height);
-
- int coordsCount = NativeObject.CoordsCount;
-
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
- NativeObject.append(layout.GetOutline(x, y), false);
- }
-
- AffineTransform lineAlignT = iter.CalcLineAlignmentTransform();
- if (lineAlignT != null)
- NativeObject.transform(lineAlignT, coordsCount, NativeObject.CoordsCount - coordsCount);
- }
- #endregion
-
- #region ClearMarkers
- public void ClearMarkers()
- {
- NativeObject.ClearMarkers ();
- }
- #endregion
-
- #region Close
- public void CloseAllFigures()
- {
- ExtendedGeneralPath p = new ExtendedGeneralPath();
- PathIterator pi = NativeObject.getPathIterator(null);
- JPI lastSeg = JPI.SEG_CLOSE;
- float [] points = new float[6];
-
- p.setWindingRule(pi.getWindingRule());
- while(!pi.isDone())
- {
- JPI curSeg = (JPI)pi.currentSegment(points);
- switch(curSeg)
- {
- case JPI.SEG_CLOSE:
- p.closePath();
- break;
- case JPI.SEG_MOVETO:
- if(lastSeg != JPI.SEG_CLOSE)
- p.closePath();
- p.moveTo(points[0],points[1]);
- break;
- case JPI.SEG_LINETO:
- p.lineTo(points[0],points[1]);
- break;
- case JPI.SEG_QUADTO:
- p.quadTo(points[0],points[1],points[2],points[3]);
- break;
- case JPI.SEG_CUBICTO:
- p.curveTo(points[0],points[1],points[2],points[3],points[4],points[5]);
- break;
- default:
- break;
- }
- lastSeg = curSeg;
- pi.next();
- }
-
- p.closePath();
- Shape = p;
- }
-
- public void CloseFigure() {
- if (!NativeObject.LastFigureClosed)
- NativeObject.closePath();
- }
- #endregion
-
- #region Flatten
- public void Flatten ()
- {
- // 1/4 is the FlatnessDefault as defined in GdiPlusEnums.h
- Flatten (null, 1.0f / 4.0f);
- }
-
- public void Flatten (Matrix matrix)
- {
- Flatten (matrix, 1.0f / 4.0f);
- }
-
- public void Flatten (Matrix matrix, float flatness)
- {
- AffineTransform tr = null;
- if(matrix != null)
- tr = matrix.NativeObject;
-
- //FIXME : Review (perfomance reasons).
- PathIterator pi = NativeObject.getPathIterator(tr,flatness);
- ExtendedGeneralPath newPath = new ExtendedGeneralPath();
- newPath.append(pi,false);
- Shape = newPath;
- }
- #endregion
-
- #region GetOutlineVisible
- public bool IsOutlineVisible (Point point, Pen pen)
- {
- return IsOutlineVisible (point.X, point.Y, pen, null);
- }
-
- public bool IsOutlineVisible (PointF point, Pen pen)
- {
- return IsOutlineVisible (point.X, point.Y, pen, null);
- }
-
- public bool IsOutlineVisible (int x, int y, Pen pen)
- {
- return IsOutlineVisible (x, y, pen, null);
- }
-
- public bool IsOutlineVisible (float x, float y, Pen pen)
- {
- return IsOutlineVisible (x, y, pen, null);
- }
-
- public bool IsOutlineVisible (Point pt, Pen pen, Graphics graphics)
- {
- return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
- }
-
- public bool IsOutlineVisible (PointF pt, Pen pen, Graphics graphics)
- {
- return IsOutlineVisible (pt.X, pt.Y, pen, graphics);
- }
-
- public bool IsOutlineVisible (int x, int y, Pen pen, Graphics graphics)
- {
- // LAMESPEC : .Net is currently ignorig Graphics object
- //if (graphics != null) {
- // if (!graphics.IsVisible (x, y))
- // return false;
- //}
-
- return ((Stroke)pen).createStrokedShape (NativeObject).contains (x, y);
- }
-
- public bool IsOutlineVisible (float x, float y, Pen pen, Graphics graphics)
- {
- return ((Stroke)pen).createStrokedShape (NativeObject).contains (x, y);
- }
- #endregion
-
- #region SetMarkers
- public void SetMarkers ()
- {
- NativeObject.SetMarkers ();
- }
- #endregion
-
- #region StartFigure
- public void StartFigure()
- {
- NativeObject.StartFigure ();
- }
- #endregion
-
- #region Warp
- [MonoNotSupported ("")]
- public void Warp (PointF[] destPoints, RectangleF srcRect)
- {
- Warp (destPoints, srcRect, null, WarpMode.Perspective, 1.0f / 4.0f);
- }
-
- [MonoNotSupported ("")]
- public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix)
- {
- Warp (destPoints, srcRect, matrix, WarpMode.Perspective, 1.0f / 4.0f);
- }
-
- [MonoNotSupported ("")]
- public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode)
- {
- Warp (destPoints, srcRect, matrix, warpMode, 1.0f / 4.0f);
- }
-
- [MonoNotSupported ("")]
- public void Warp (PointF[] destPoints, RectangleF srcRect, Matrix matrix, WarpMode warpMode, float flatness)
- {
- throw new NotImplementedException();
- }
- #endregion
-
- #region Widen
- public void Widen (Pen pen)
- {
- Widen (pen, null);
- }
-
- public void Widen (Pen pen, Matrix matrix)
- {
- Widen (pen, matrix, 2f/3f);
- }
-
- public void Widen (Pen pen, Matrix matrix, float flatness)
- {
- if (pen == null)
- throw new ArgumentNullException("pen");
-
- Shape = new ExtendedGeneralPath(((Stroke)pen).createStrokedShape(this));
- Flatten(matrix, flatness);
- }
- #endregion
-
- private void SetPath (Point [] pts, byte [] types)
- {
- NativeObject.Clear ();
- if (((PathPointType)types [0] & PathPointType.PathTypeMask) != PathPointType.Start)
- NativeObject.moveTo (pts [0].X, pts [0].Y);
-
- for (int i=0; i < pts.Length; i++) {
- switch (((PathPointType)types [i] & PathPointType.PathTypeMask)) {
- case PathPointType.Start :
- NativeObject.moveTo (pts [i].X, pts [i].Y);
- break;
- case PathPointType.Line :
- NativeObject.lineTo (pts [i].X, pts [i].Y);
- break;
- case PathPointType.Bezier3 :
- float x1 = pts [i].X;
- float y1 = pts [i].Y;
- i++;
- float x2 = pts [i].X;
- float y2 = pts [i].Y;
- i++;
- float x3 = pts [i].X;
- float y3 = pts [i].Y;
- NativeObject.curveTo (x1,y1, x2, y2, x3, y3);
- break;
- }
- if (((PathPointType)types [i] & PathPointType.CloseSubpath) != 0)
- NativeObject.closePath();
-
- if (((PathPointType)types [i] & PathPointType.PathMarker) != 0)
- NativeObject.SetMarkers ();
- }
- }
-
- internal void SetPath (PointF [] pts, byte [] types)
- {
- NativeObject.Clear ();
- if (((PathPointType)types [0] & PathPointType.PathTypeMask) != PathPointType.Start)
- NativeObject.moveTo (pts [0].X, pts [0].Y);
- for (int i=0; i < pts.Length; i++) {
- switch (((PathPointType)types [i] & PathPointType.PathTypeMask)) {
- case PathPointType.Start :
- NativeObject.moveTo (pts [i].X, pts [i].Y);
- break;
- case PathPointType.Line :
- NativeObject.lineTo (pts [i].X, pts [i].Y);
- break;
- case PathPointType.Bezier3 :
- float x1 = pts [i].X;
- float y1 = pts [i].Y;
- i++;
- float x2 = pts [i].X;
- float y2 = pts [i].Y;
- i++;
- float x3 = pts [i].X;
- float y3 = pts [i].Y;
- NativeObject.curveTo (x1,y1, x2, y2, x3, y3);
- break;
- }
- if (((PathPointType)types [i] & PathPointType.CloseSubpath) != 0)
- NativeObject.closePath();
-
- if (((PathPointType)types [i] & PathPointType.PathMarker) != 0)
- NativeObject.SetMarkers ();
- }
- }
- }
-}
+++ /dev/null
-//
-// System.Drawing.Drawing2D.GraphicsPathIterator.cs
-//
-// Author:
-// Bors Kirzner <boris@mainsoft.com>
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Drawing;
-
-namespace System.Drawing.Drawing2D
-{
- public sealed class GraphicsPathIterator : MarshalByRefObject, IDisposable
- {
- #region Fields
-
- private readonly GraphicsPath _path;
- private int _marker = -1;
- private int _subpath = -1;
-
- #endregion // Fields
-
- #region Constructors
-
- public GraphicsPathIterator (GraphicsPath path)
- {
- _path = path;
- }
-
- #endregion // Constructors
-
- #region Properites
-
- public int Count
- {
- get { return _path.NativeObject.PointCount; }
- }
-
- public int SubpathCount {
- get {
- int count = 0;
- int start, end;
- bool isClosed;
- while (NextSubpath (out start, out end, out isClosed) != 0)
- count++;
- return count;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- public int CopyData (ref PointF [] points, ref byte [] types, int startIndex, int endIndex)
- {
- int j = 0;
- for (int i = startIndex; i <= endIndex && i < _path.PointCount; i++) {
- points [j] = _path.PathPoints [i];
- types [j++] = _path.PathTypes [i];
- }
- return j;
- }
-
- public void Dispose ()
- {
- }
-
- public int Enumerate (ref PointF [] points, ref byte [] types)
- {
- return CopyData (ref points, ref types, 0, _path.PointCount);
- }
-
- public bool HasCurve ()
- {
- byte [] types = _path.PathTypes;
- for (int i=0; i < types.Length; i++)
- if ((types [i] & (byte)PathPointType.PathTypeMask) == (byte)PathPointType.Bezier3)
- return true;
- return false;
- }
-
- public int NextMarker (GraphicsPath path)
- {
- if (path == null)
- return 0;
-
- int startIndex;
- int endIndex;
- int count = NextMarker (out startIndex, out endIndex);
-
- if (count != 0)
- SetPath (_path, startIndex, count, path);
-
- return count;
- }
-
- public int NextMarker (out int startIndex, out int endIndex)
- {
- if (_marker >= _path.PointCount) {
- startIndex = 0;
- endIndex = 0;
- return 0;
- }
-
- startIndex = ++_marker;
- while ((_marker < _path.PointCount) && ((_path.PathTypes [_marker] & (byte)PathPointType.PathMarker) == 0))
- _marker++;
-
- endIndex = (_marker < _path.PointCount) ? _marker : _path.PointCount - 1;
- return endIndex - startIndex + 1;
- }
-
- public int NextPathType (out byte pathType, out int startIndex, out int endIndex)
- {
- if ((_subpath >= _path.PointCount - 1) | (_subpath < 0)) {
- startIndex = 0;
- endIndex = 0;
- pathType = (_subpath < 0) ? (byte)PathPointType.Start : _path.PathTypes [_path.PointCount - 1];
- return 0;
- }
-
- // .net acts different, but it seems to be a bug
- if ((_path.PathTypes [_subpath + 1] & (byte)PathPointType.PathMarker) != 0) {
- startIndex = 0;
- endIndex = 0;
- pathType = _path.PathTypes [_subpath];
- return 0;
- }
-
- startIndex = _subpath++;
- endIndex = startIndex;
- pathType = (byte)(_path.PathTypes [startIndex + 1] & (byte)PathPointType.PathTypeMask);
-
- while (((_subpath) < _path.PointCount) && ((_path.PathTypes [_subpath] & (byte)PathPointType.PathTypeMask) == pathType))
- _subpath++;
-
- endIndex = (_subpath < _path.PointCount) ? --_subpath : _path.PointCount - 1;
- return endIndex - startIndex + 1;
- }
-
- public int NextSubpath (GraphicsPath path, out bool isClosed)
- {
- int startIndex;
- int endIndex;
- int count = NextSubpath (out startIndex, out endIndex, out isClosed);
-
- if ((count != 0) && (path != null))
- SetPath (_path, startIndex, count, path);
-
- return count;
- }
-
- private void SetPath (GraphicsPath source, int start, int count, GraphicsPath target)
- {
- PointF [] points = new PointF [count];
- byte [] types = new byte [count];
- PointF [] pathPoints = _path.PathPoints;
- byte [] pathTypes = _path.PathTypes;
-
- for (int i = 0; i < count; i++) {
- points [i] = pathPoints [start + i];
- types [i] = pathTypes [start + i];
- }
-
- target.SetPath (points, types);
- }
-
- public int NextSubpath (out int startIndex, out int endIndex, out bool isClosed)
- {
- _subpath++;
- while (((_subpath) < _path.PointCount) && (_path.PathTypes [_subpath] != (byte)PathPointType.Start))
- _subpath++;
-
-
- if (_subpath >= _path.PointCount - 1) {
- startIndex = 0;
- endIndex = 0;
- isClosed = true;
- return 0;
- }
-
- startIndex = _subpath;
- int offset = 1;
- while (((_subpath + offset) < _path.PointCount) && (_path.PathTypes [_subpath + offset] != (byte)PathPointType.Start))
- offset++;
-
- endIndex = ((_subpath + offset) < _path.PointCount) ? _subpath + offset - 1 : _path.PointCount - 1;
- isClosed = (_path.PathTypes [endIndex] & (byte)PathPointType.CloseSubpath) != 0;
- return endIndex - startIndex + 1;
- }
-
- public void Rewind ()
- {
- _marker = -1;
- _subpath = -1;
- }
-
- #endregion // Methods
- }
-}
+++ /dev/null
-//
-// System.Drawing.Drawing2D.ExtendedGraphicsState.jvm.cs
-//
-// Author:
-// Vladimir Krasnov (vladimirk@mainsoft.com)
-//
-// Copyright (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Drawing.Text;
-using geom = java.awt.geom;
-using awt = java.awt;
-
-namespace System.Drawing.Drawing2D
-{
- /// <summary>
- /// Summary description for GraphicsState.
- /// </summary>
- public sealed class GraphicsState : MarshalByRefObject
- {
- readonly CompositingMode _compositingMode;
- readonly CompositingQuality _compositingQuality;
- readonly Region _clip;
- readonly awt.Shape _baseClip;
- readonly InterpolationMode _interpolationMode;
- readonly float _pageScale;
- readonly GraphicsUnit _pageUnit;
- readonly PixelOffsetMode _pixelOffsetMode;
- readonly Point _renderingOrigin;
- readonly SmoothingMode _smoothingMode;
- readonly int _textContrast;
- readonly TextRenderingHint _textRenderingHint;
-
- // additional transform in case that new container has one
- readonly Matrix _transform;
- readonly Matrix _baseTransform;
-
- GraphicsState _next = null;
-
- internal GraphicsState(Graphics graphics, bool resetState)
- : this(graphics, Matrix.IdentityTransform, resetState) {}
-
- internal GraphicsState Next {
- get {
- return _next;
- }
- set {
- _next = value;
- }
- }
-
- internal GraphicsState(Graphics graphics, Matrix matrix, bool resetState)
- {
- _compositingMode = graphics.CompositingMode;
- _compositingQuality = graphics.CompositingQuality;
- _clip = graphics.ScaledClip;
- _baseClip = graphics.NativeObject.getClip();
- _interpolationMode = graphics.InterpolationMode;
- _pageScale = graphics.PageScale;
- _pageUnit = graphics.PageUnit;
- _pixelOffsetMode = graphics.PixelOffsetMode;
-
- // FIXME: render orign is not implemented yet
- //_renderingOrigin = new Point( g.RenderingOrigin.X, g.RenderingOrigin.Y );
-
- _smoothingMode = graphics.SmoothingMode;
- _transform = graphics.Transform;
- _baseTransform = graphics.BaseTransform;
-
- _textContrast = graphics.TextContrast;
- _textRenderingHint = graphics.TextRenderingHint;
-
- if (resetState)
- ResetState(graphics, matrix);
- }
-
- internal void RestoreState(Graphics graphics)
- {
- graphics.CompositingMode = _compositingMode;
- graphics.CompositingQuality = _compositingQuality;
- graphics.ScaledClip = _clip;
- graphics.InterpolationMode = _interpolationMode;
- graphics.PageScale = _pageScale;
- graphics.PageUnit = _pageUnit;
- graphics.PixelOffsetMode = _pixelOffsetMode;
-
- // FIXME: render orign is not implemented yet
- //graphics.RenderingOrigin = new Point( _renderingOrigin.X, _renderingOrigin.Y );
-
- graphics.SmoothingMode = _smoothingMode;
- graphics.Transform = _transform;
- graphics.BaseTransform = _baseTransform;
- graphics.TextContrast = _textContrast;
- graphics.TextRenderingHint = _textRenderingHint;
-
- // must be set after the base transform is restored
- graphics.NativeObject.setClip(_baseClip);
- }
-
- void ResetState(Graphics graphics, Matrix matrix)
- {
- //should be set before the base transform is changed
- if (_baseClip == null)
- graphics.IntersectScaledClipWithBase(graphics.VisibleShape);
-
- graphics.CompositingMode = CompositingMode.SourceOver;
- graphics.CompositingQuality = CompositingQuality.Default;
- graphics.ScaledClip = Region.InfiniteRegion;
- graphics.InterpolationMode = InterpolationMode.Bilinear;
- graphics.PageScale = 1.0f;
- graphics.PageUnit = GraphicsUnit.Display;
- graphics.PixelOffsetMode = PixelOffsetMode.Default;
-
- // FIXME: render orign is not implemented yet
- //graphics.RenderingOrigin = new Point(0, 0);
-
- graphics.SmoothingMode = SmoothingMode.None;
- graphics.ResetTransform();
- graphics.PrependBaseTransform(Graphics.GetFinalTransform(_transform.NativeObject, _pageUnit, _pageScale));
- graphics.PrependBaseTransform(matrix.NativeObject);
- graphics.TextContrast = 4;
- graphics.TextRenderingHint = TextRenderingHint.SystemDefault;
- }
-
- internal void RestoreBaseClip(Graphics graphics) {
- graphics.NativeObject.setClip(_baseClip);
- }
- }
-}
+++ /dev/null
-
-using System;
-using java.awt;
-namespace System.Drawing.Drawing2D
-{
- /// <summary>
- /// Summary description for HatchBrush.
- /// </summary>
- public sealed class HatchBrush : Brush
- {
- private HatchStyle _style;
- private Color _foreColor;
- private Color _backColor;
-
- [MonoTODO]
- public HatchBrush (HatchStyle hatchStyle, Color foreColor)
- : this (hatchStyle, foreColor, Color.Black)
- {
- }
-
- [MonoTODO]
- public HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor)
- {
- _style = hatchStyle;
- _foreColor = foreColor;
- _backColor = backColor;
- }
-
- public Color BackgroundColor {
- get {
- return _backColor;
- }
- }
-
- public Color ForegroundColor {
- get {
- return _foreColor;
- }
- }
-
- public HatchStyle HatchStyle {
- get {
- return _style;
- }
- }
-
- public override object Clone ()
- {
- return new HatchBrush (_style, _foreColor, _backColor);
- }
-
- protected override Paint NativeObject {
- get {
- // FALLBACK: Solid color brush will be used
- return _foreColor.NativeObject;
- }
- }
-
- }
-}
+++ /dev/null
-using System;
-using java.awt;
-using awt = java.awt;
-using geom = java.awt.geom;
-using image = java.awt.image;
-
-namespace System.Drawing.Drawing2D {
- /// <summary>
- /// Summary description for LinearGradientBrush.
- /// </summary>
- public sealed class LinearGradientBrush : Brush {
- Blend _blend;
- bool _gammaCorrection;
- ColorBlend _interpolationColors;
- WrapMode _wrapmode;
- RectangleF _gradientRectangle;
-
- // gradient brush data
- float _x1 = 0;
- float _y1 = 0;
-
- float _x2 = 0;
- float _y2 = 0;
-
- Color _color1, _color2;
- bool _cyclic;
-
- #region NativeObject
-
- GradientPaint _nativeObject = null;
- protected override Paint NativeObject {
- get {
- if ( _nativeObject == null )
- _nativeObject = new GradientPaint(
- _x1, _y1,
- new java.awt.Color(_color1.R, _color1.G, _color1.B, _color1.A),
- _x2, _y2,
- new java.awt.Color(_color2.R, _color2.G, _color2.B, _color2.A), _cyclic);
-
- return _nativeObject;
- }
- }
-
- #endregion
-
- #region Initialization
-
- private void Init(float x1, float y1, Color color1, float x2, float y2, Color color2, bool cyclic) {
- _x1 = x1;
- _y1 = y1;
- _color1 = color1;
-
- _x2 = x2;
- _y2 = y2;
- _color2 = color2;
-
- _cyclic = cyclic;
- _nativeObject = null;
- }
-
- private void Init(float x1, float y1, Color color1, float x2, float y2, Color color2, float angle) {
- _gradientRectangle = new RectangleF(x1, y1, x2-x1, y2-y1);
- PointF [] points = GetMedianeEnclosingRect(x1, y1, x2, y2, angle);
- Init(points[0].X, points[0].Y, color1, points[1].X, points[1].Y, color2, false);
- }
-
- private void Init(float x1, float y1, Color color1, float x2, float y2, Color color2, LinearGradientMode linearGradientMode) {
- _gradientRectangle = new RectangleF(x1, y1, x2-x1, y2-y1);
- PointF [] points;
-
- switch (linearGradientMode) {
- case LinearGradientMode.Horizontal :
- Init(x1, y1, color1, x2, y1, color2, false);
- break;
-
- case LinearGradientMode.Vertical :
- Init(x1, y1, color1, x1, y2, color2, false);
- break;
-
- case LinearGradientMode.BackwardDiagonal :
- points = GetMedianeEnclosingRect(x1, y1, x2, y2, false);
- Init(points[0].X, points[0].Y, color2, points[1].X, points[1].Y, color1, false);
- break;
-
- case LinearGradientMode.ForwardDiagonal :
- points = GetMedianeEnclosingRect(x1, y1, x2, y2, true);
- Init(points[0].X, points[0].Y, color1, points[1].X, points[1].Y, color2, false);
- break;
-
- default :
- throw new ArgumentException("LinearGradientMode");
- }
- }
-
- #endregion
-
- #region Constructors
-
- private LinearGradientBrush (float x1, float y1, Color color1, float x2, float y2, Color color2, bool cyclic) {
- Init(x1, y1, color1, x2, y2, color2, cyclic);
- }
-
- internal LinearGradientBrush (float x1, float y1, Color color1, float x2, float y2, Color color2, LinearGradientMode mode) {
- Init(x1, y1, color1, x2, y2, color2, mode);
- }
- internal LinearGradientBrush (float x1, float y1, Color color1, float x2, float y2, Color color2) {
- Init(x1, y2, color1, x1, y2, color2, false);
- }
- public LinearGradientBrush (Point point1, Point point2, Color color1, Color color2) {
- _gradientRectangle = new RectangleF(point1.X, point1.Y, point2.X - point1.X, point2.Y - point2.Y);
- Init(point1.X, point1.Y, color1, point2.X, point2.Y, color2, false);
- }
- public LinearGradientBrush (PointF point1, PointF point2, Color color1, Color color2) {
- _gradientRectangle = new RectangleF(point1.X, point1.Y, point2.X - point1.X, point2.Y - point2.Y);
- Init(point1.X, point1.Y, color1, point2.X, point2.Y, color2, false);
- }
- public LinearGradientBrush (Rectangle rect, Color color1, Color color2, LinearGradientMode linearGradientMode) {
- Init(rect.X, rect.Y, color1, rect.X + rect.Width, rect.Y + rect.Height, color2, linearGradientMode);
- }
- public LinearGradientBrush (RectangleF rect, Color color1, Color color2, LinearGradientMode linearGradientMode) {
- Init(rect.X, rect.Y, color1, rect.X + rect.Width, rect.Y + rect.Height, color2, linearGradientMode);
- }
- public LinearGradientBrush (Rectangle rect, Color color1, Color color2, float angle) {
- Init(rect.X, rect.Y, color1, rect.X + rect.Width, rect.Y + rect.Height, color2, angle);
- }
- public LinearGradientBrush (RectangleF rect, Color color1, Color color2, float angle) {
- Init(rect.X, rect.Y, color1, rect.X + rect.Width, rect.Y + rect.Height, color2, angle);
- }
- public LinearGradientBrush (Rectangle rect, Color color1, Color color2, float angle, bool isAngleScaleable):
- this(rect, color1, color2, angle) {
- }
- public LinearGradientBrush (RectangleF rect, Color color1, Color color2, float angle, bool isAngleScaleable):
- this(rect, color1, color2, angle) {
- }
- #endregion
-
- #region GetMedianeEnclosingRect
-
- internal PointF [] GetMedianeEnclosingRect(float x1, float y1, float x2, float y2, float rotateAngle) {
- float width = x2 - x1;
- float height = y2 - y1;
- PointF rectCenter = new PointF(x1 + width/2, y1 + height/2);
- float gradLen = width * Math.Abs((float)Math.Cos(rotateAngle * Math.PI / 180)) +
- height * Math.Abs((float)Math.Sin(rotateAngle * Math.PI / 180));
-
- PointF [] points = new PointF []{ new PointF(rectCenter.X - gradLen/2, rectCenter.Y),
- new PointF(rectCenter.X + gradLen/2, rectCenter.Y) };
-
- Matrix mx = new Matrix();
- mx.RotateAt((float)rotateAngle, rectCenter);
- mx.TransformPoints(points);
- return points;
- }
- internal PointF [] GetMedianeEnclosingRect(float x1, float y1, float x2, float y2, bool forwardDiagonal) {
- float width = x2 - x1;
- float height = y2 - y1;
- PointF rectCenter = new PointF(x1 + width/2, y1 + height/2);
- float rotateAngle = (float)Math.Atan2(width, height);
- float gradLen = width * (float)Math.Cos(rotateAngle);
-
- if (!forwardDiagonal)
- rotateAngle = -rotateAngle;
-
- PointF [] points = new PointF []{ new PointF(rectCenter.X - gradLen, rectCenter.Y),
- new PointF(rectCenter.X + gradLen, rectCenter.Y) };
-
- Matrix mx = new Matrix();
- mx.RotateAt((float)rotateAngle * (float)(180/Math.PI), rectCenter);
- mx.TransformPoints(points);
- return points;
- }
-
- #endregion
-
- #region Public Properties
-
- // FALLBACK: no functionality implemented for this property
- [MonoTODO]
- public Blend Blend {
- get {
- return _blend;
- }
- set {
- _blend = value;
- }
- }
-
- // FALLBACK: no functionality implemented for this property
- [MonoTODO]
- public bool GammaCorrection {
- get {
- return _gammaCorrection;
- }
- set {
- _gammaCorrection = value;
- }
- }
-
- // FALLBACK: functionality of two color gradient is implemented
- [MonoTODO]
- public ColorBlend InterpolationColors {
- get {
- return _interpolationColors;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("ColorBlend");
-
- if ( (value.Colors == null) || (value.Colors.Length == 0) )
- throw new ArgumentException("ColorBlend");
-
- _interpolationColors = value;
-
- _color1 = value.Colors[0];
- _color2 = value.Colors[value.Colors.Length - 1];
- _nativeObject = null;
- }
- }
-
- public Color [] LinearColors {
- get {
- Color [] cl = new Color[2];
- cl[0] = _color1;
- cl[1] = _color2;
- return cl;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("colors");
-
- _color1 = value[0];
- _color2 = value[1];
- _nativeObject = null;
- }
- }
-
- public RectangleF Rectangle {
- get {
- return _gradientRectangle;
- }
- }
-
- public Matrix Transform {
- get { return BrushTransform; }
- set { BrushTransform = value; }
- }
-
- // FALLBACK: not functionality implemented for this property
- [MonoTODO]
- public WrapMode WrapMode {
- get {
- return _wrapmode;
- }
- set {
- _wrapmode = value;
- }
- }
- #endregion
-
- #region Public Methods
-
- public void MultiplyTransform (Matrix matrix) {
- BrushMultiplyTransform(matrix, MatrixOrder.Prepend);
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order) {
- BrushMultiplyTransform(matrix, order);
- }
-
- public void ResetTransform () {
- BrushResetTransform();
- }
-
- public void RotateTransform (float angle) {
- BrushRotateTransform(angle, MatrixOrder.Prepend);
- }
-
- public void RotateTransform (float angle, MatrixOrder order) {
- BrushRotateTransform(angle, order);
- }
-
- public void ScaleTransform (float sx, float sy) {
- BrushScaleTransform(sx, sy, MatrixOrder.Prepend);
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order) {
- BrushScaleTransform(sx, sy, order);
- }
-
- public void SetBlendTriangularShape (float focus) {
- SetBlendTriangularShape (focus, 1.0F);
- }
-
- public void SetBlendTriangularShape (float focus, float scale) {
- _x2 = (_x1 + _x2) / 2;
- _y2 = (_y1 + _y2) / 2;
- _cyclic = true;
- _nativeObject = null;
- }
-
- public void SetSigmaBellShape (float focus) {
- SetSigmaBellShape (focus, 1.0F);
- }
-
- [MonoTODO]
- public void SetSigmaBellShape (float focus, float scale) {
- // FALLBACK: Triangle shape used
- SetBlendTriangularShape (focus, scale);
- }
-
- public void TranslateTransform (float dx, float dy) {
- BrushTranslateTransform (dx, dy);
- }
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- BrushTranslateTransform(dx, dy, order);
- }
-
- public override object Clone () {
- LinearGradientBrush copy = (LinearGradientBrush)InternalClone();
-
- if (copy._nativeObject != null)
- copy._nativeObject = null;
-
- if (_interpolationColors != null) {
- copy._interpolationColors = new ColorBlend();
- if (_interpolationColors.Colors != null)
- copy._interpolationColors.Colors = (Color[])_interpolationColors.Colors.Clone();
- if (_interpolationColors.Positions != null)
- copy._interpolationColors.Positions = (float[])_interpolationColors.Positions.Clone();
- }
-
- if (_blend != null) {
- copy._blend = new Blend();
- if (_blend.Factors != null)
- copy._blend.Factors = (float[])_blend.Factors.Clone();
- if (_blend.Positions != null)
- copy._blend.Positions = (float[])_blend.Positions.Clone();
- }
-
- copy.LinearColors = (Color[])LinearColors.Clone();
- return copy;
- }
- #endregion
- }
-}
+++ /dev/null
-using System;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using geom = java.awt.geom;
-using JMath = java.lang.Math;
-
-namespace System.Drawing.Drawing2D
-{
- public sealed class Matrix : MarshalByRefObject, IDisposable
- {
- #region fields
-
- static internal readonly Matrix IdentityTransform = new Matrix();
- readonly geom.AffineTransform _nativeMatrix;
-
- #endregion
-
- #region ctors
-
- internal Matrix (geom.AffineTransform ptr)
- {
- _nativeMatrix = ptr;
- }
-
- public Matrix () : this(new geom.AffineTransform())
- {
- }
-
- public Matrix (Rectangle rect , Point[] plgpts)
- {
- double x1 = plgpts[1].X - plgpts[0].X;
- double y1 = plgpts[1].Y - plgpts[0].Y;
-
- double x2 = plgpts[2].X - plgpts[0].X;
- double y2 = plgpts[2].Y - plgpts[0].Y;
-
- _nativeMatrix = new geom.AffineTransform(x1/rect.Width, y1/rect.Width, x2/rect.Height, y2/rect.Height, plgpts[0].X, plgpts[0].Y);
- _nativeMatrix.translate(-rect.X,-rect.Y);
- }
-
- public Matrix (RectangleF rect , PointF[] plgpts)
- {
- double x1 = plgpts[1].X - plgpts[0].X;
- double y1 = plgpts[1].Y - plgpts[0].Y;
-
- double x2 = plgpts[2].X - plgpts[0].X;
- double y2 = plgpts[2].Y - plgpts[0].Y;
-
- _nativeMatrix = new geom.AffineTransform(x1/rect.Width, y1/rect.Width, x2/rect.Height, y2/rect.Height, plgpts[0].X, plgpts[0].Y);
- _nativeMatrix.translate(-rect.X,-rect.Y);
- }
-
- public Matrix (float m11, float m12, float m21, float m22, float dx, float dy)
- : this(new geom.AffineTransform(m11,m12,m21,m22,dx,dy))
- {
- }
-
- #endregion
-
- #region properties
-
- public float[] Elements
- {
- get
- {
- float [] elems = new float[] {
- (float)NativeObject.getScaleX(),
- (float)NativeObject.getShearY(),
- (float)NativeObject.getShearX(),
- (float)NativeObject.getScaleY(),
- (float)NativeObject.getTranslateX(),
- (float)NativeObject.getTranslateY()};
- return elems;
- }
- }
-
- public bool IsIdentity
- {
- get
- {
- return NativeObject.isIdentity();
- }
- }
-
- public bool IsInvertible
- {
- get
- {
- try
- {
- return NativeObject.getDeterminant() != 0.0;
- }
- catch(geom.NoninvertibleTransformException)
- {
- return false;
- }
- }
- }
-
- public float OffsetX
- {
- get
- {
- return (float)NativeObject.getTranslateX();
- }
- }
-
- public float OffsetY
- {
- get
- {
- return (float)NativeObject.getTranslateY();
- }
- }
-
- #endregion
-
- #region methods
-
- public Matrix Clone()
- {
- return new Matrix ((geom.AffineTransform) NativeObject.clone ());
- }
-
-
- public void Dispose ()
- {
- }
-
- internal void CopyTo(Matrix matrix) {
- matrix.NativeObject.setTransform(NativeObject);
- }
-
- public override bool Equals (object obj)
- {
- Matrix m = obj as Matrix;
-
-
- if (m == null)
- return false;
-
- return NativeObject.Equals(m.NativeObject);
- }
-
- public override int GetHashCode ()
- {
- return NativeObject.GetHashCode();
- }
-
- public void Invert ()
- {
- try {
- _nativeMatrix.setTransform( _nativeMatrix.createInverse() );
- }
- catch(geom.NoninvertibleTransformException e) {
- throw new ArgumentException(e.Message, e);
- }
- }
-
- public void Multiply (Matrix matrix)
- {
- Multiply (matrix, MatrixOrder.Prepend);
- }
-
- public void Multiply (Matrix matrix, MatrixOrder order)
- {
- Multiply(matrix.NativeObject, order);
- }
-
- public void Reset()
- {
- NativeObject.setToIdentity();
- }
-
- public void Rotate (float angle)
- {
- NativeObject.rotate (JMath.toRadians(angle));
- }
-
- public void Rotate (float angle, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getRotateInstance(JMath.toRadians(angle)), order);
- }
-
- public void RotateAt (float angle, PointF point)
- {
- NativeObject.rotate (JMath.toRadians(angle), point.X, point.Y);
- }
-
- public void RotateAt (float angle, PointF point, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getRotateInstance(JMath.toRadians(angle),point.X, point.Y), order);
- }
-
- public void Scale (float scaleX, float scaleY)
- {
- NativeObject.scale (scaleX, scaleY);
- }
-
- public void Scale (float scaleX, float scaleY, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getScaleInstance(scaleX, scaleY), order);
- }
-
- public void Shear (float shearX, float shearY)
- {
- NativeObject.shear(shearX, shearY);
- }
-
- public void Shear (float shearX, float shearY, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getShearInstance (shearX, shearY), order);
- }
-
- public void TransformPoints (Point[] pts)
- {
- geom.Point2D.Float pt = new geom.Point2D.Float();
- for(int i =0;i < pts.Length;i++) {
- pt.setLocation(pts[i].X,pts[i].Y);
- NativeObject.transform(pt,pt);
- pts[i].X=(int)pt.getX();
- pts[i].Y=(int)pt.getY();
- }
- }
-
- public void TransformPoints (PointF[] pts)
- {
- geom.Point2D.Float pt = new geom.Point2D.Float();
- for(int i =0;i < pts.Length;i++) {
- pt.setLocation(pts[i].X,pts[i].Y);
- NativeObject.transform(pt,pt);
- pts[i].X=(float)pt.getX();
- pts[i].Y=(float)pt.getY();
- }
- }
-
- public void TransformVectors (Point[] pts)
- {
- geom.Point2D.Float pt = new geom.Point2D.Float();
- for(int i =0;i < pts.Length;i++) {
- pt.setLocation(pts[i].X,pts[i].Y);
- NativeObject.deltaTransform(pt,pt);
- pts[i].X=(int)pt.getX();
- pts[i].Y=(int)pt.getY();
- }
- }
-
- public void TransformVectors (PointF[] pts)
- {
- geom.Point2D.Float pt = new geom.Point2D.Float();
- for(int i =0;i < pts.Length;i++) {
- pt.setLocation(pts[i].X,pts[i].Y);
- NativeObject.deltaTransform(pt,pt);
- pts[i].X=(float)pt.getX();
- pts[i].Y=(float)pt.getY();
- }
- }
-
- public void Translate (float offsetX, float offsetY)
- {
- NativeObject.translate (offsetX, offsetY);
- }
-
- public void Translate (float offsetX, float offsetY, MatrixOrder order)
- {
- Multiply(geom.AffineTransform.getTranslateInstance(offsetX, offsetY), order);
- }
-
- public void VectorTransformPoints (Point[] pts)
- {
- TransformVectors (pts);
- }
-
- internal geom.AffineTransform NativeObject
- {
- get
- {
- return _nativeMatrix;
- }
- }
-
- void Multiply(geom.AffineTransform at, MatrixOrder order) {
- Multiply(NativeObject, at, order);
- }
-
- internal static void Multiply(geom.AffineTransform to, geom.AffineTransform add, MatrixOrder order) {
- if(order == MatrixOrder.Prepend)
- to.concatenate(add);
- else
- to.preConcatenate(add);
- }
-
- #endregion
- }
-}
+++ /dev/null
-
-
-using System;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using awt = java.awt;
-
-namespace System.Drawing.Drawing2D {
- /// <summary>
- /// Summary description for PathGradientBrush.
- /// </summary>
- [MonoTODO]
- public sealed class PathGradientBrush : Brush {
- Brush _nativeObject;
- Blend _blend;
- Color _centerColor;
- PointF _center;
- PointF _focus;
- RectangleF _rectangle;
- Color [] _surroundColors;
- ColorBlend _interpolationColors;
- WrapMode _wrapMode;
- GraphicsPath _texturePath;
- bool _triangularShape = false;
-
- protected override java.awt.Paint NativeObject {
- get {
- return _nativeObject;
- }
- }
-
- #region initialize
-
- void Initialize(GraphicsPath path, WrapMode wrapMode, bool initColors, bool calcCenter) {
-
- _texturePath = path;
- _wrapMode = wrapMode;
- _rectangle = path.GetBounds();
-
- if (initColors) {
- _centerColor = Color.Black;
- _surroundColors = new Color []{ Color.White };
- }
-
- Bitmap texture = new Bitmap( (int)_rectangle.Width, (int)_rectangle.Height );
- Graphics g = Graphics.FromImage( texture );
- PointF [] pathPoints = path.PathPoints;
-
- if (calcCenter) {
- for (int i=0; i < pathPoints.Length; i++) {
- _center.X += pathPoints[i].X;
- _center.Y += pathPoints[i].Y;
- }
- _center.X /= pathPoints.Length;
- _center.Y /= pathPoints.Length;
- }
-
- int outerColor = 0;
- DrawSector( g, CenterPoint, pathPoints[pathPoints.Length-1], pathPoints[0], CenterColor, SurroundColors[outerColor] );
- for(int i=0; i < pathPoints.Length - 1; i++) {
- if (outerColor < SurroundColors.Length - 1)
- outerColor++;
- DrawSector( g, CenterPoint, pathPoints[i], pathPoints[i+1], CenterColor, SurroundColors[outerColor] );
- }
-
- _nativeObject = new TextureBrush( texture );
- }
- private void DrawSector(Graphics g, PointF center, PointF p1, PointF p2, Color innerColor, Color outerColor) {
- GraphicsPath pt = new GraphicsPath();
- pt.AddLine(p1, center);
- pt.AddLine(center, p2);
- LinearGradientBrush lgb = new LinearGradientBrush( GetVertical(center, p1, p2) , center, outerColor, innerColor );
- if (_triangularShape)
- lgb.SetBlendTriangularShape(0.5f);
- g.FillPath( lgb, pt );
- }
- private PointF GetVertical(PointF c, PointF p1, PointF p2) {
- if (p1.X == p2.X)
- return new PointF(p1.X, c.Y);
- if (p1.Y == p2.Y)
- return new PointF(c.X, p2.Y);
-
- float a = (float)(p2.Y - p1.Y) / (p2.X - p1.X);
- float av = - 1 / a;
-
- float b1 = p1.Y - a * p1.X;
- float b2 = c.Y - av * c.X;
-
- float ox = (b1 - b2) / (av - a);
- float oy = av * ox + b2;
-
- return new PointF(ox, oy);
- }
-
- #endregion
-
- #region ctors
-
- public PathGradientBrush (GraphicsPath path) {
- Initialize( path, WrapMode.Clamp, true, true );
- }
-
- public PathGradientBrush (Point [] points) : this (points, WrapMode.Clamp) {
- }
-
- public PathGradientBrush (PointF [] points) : this (points, WrapMode.Clamp) {
- }
-
- public PathGradientBrush (Point [] points, WrapMode wrapMode) {
- GraphicsPath path = new GraphicsPath();
- path.AddLines( points );
- Initialize( path, wrapMode, true, true );
- }
-
- public PathGradientBrush (PointF [] points, WrapMode wrapMode) {
- GraphicsPath path = new GraphicsPath();
- path.AddLines( points );
- Initialize( path, wrapMode, true, true );
- }
-
- #endregion
-
- #region Properties
-
- [MonoTODO]
- public Blend Blend {
- get {
- return _blend;
- }
- set {
- _blend = value;
- }
- }
-
- public Color CenterColor {
- get {
- return _centerColor;
- }
- set {
- _centerColor = value;
- Initialize(_texturePath, _wrapMode, false, false );
- }
- }
-
- public PointF CenterPoint {
- get {
- return _center;
- }
- set {
- _center = value;
- Initialize(_texturePath, _wrapMode, false, false );
- }
- }
-
- public PointF FocusScales {
- get {
- return _focus;
- }
- set {
- _focus = value;
- }
- }
-
- public ColorBlend InterpolationColors {
- get {
- return _interpolationColors;
- }
- set {
- _interpolationColors = value;
- }
- }
-
- public RectangleF Rectangle {
- get {
- return _rectangle;
- }
- }
-
- public Color [] SurroundColors {
- get {
- return _surroundColors;
- }
- set {
- _surroundColors = value;
- Initialize(_texturePath, _wrapMode, false, false );
- }
- }
-
- public Matrix Transform {
- get {
- return BrushTransform;
- }
- set {
- BrushTransform = value;
- }
- }
-
- public WrapMode WrapMode {
- get {
- return _wrapMode;
- }
- set {
- _wrapMode = value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public void MultiplyTransform (Matrix matrix) {
- base.BrushMultiplyTransform( matrix );
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order) {
- base.BrushMultiplyTransform( matrix, order );
- }
-
- public void ResetTransform () {
- base.BrushResetTransform();
- }
-
- public void RotateTransform (float angle) {
- base.BrushRotateTransform( angle );
- }
-
- public void RotateTransform (float angle, MatrixOrder order) {
- base.BrushRotateTransform( angle, order );
- }
-
- public void ScaleTransform (float sx, float sy) {
- base.BrushScaleTransform( sx, sy );
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order) {
- base.BrushScaleTransform( sx, sy, order );
- }
-
- public void SetBlendTriangularShape (float focus) {
- SetBlendTriangularShape (focus, 1.0F);
- }
-
- public void SetBlendTriangularShape (float focus, float scale) {
- _triangularShape = true;
- Initialize( _texturePath, _wrapMode, false, false );
- }
-
- public void SetSigmaBellShape (float focus) {
- SetSigmaBellShape (focus, 1.0F);
- }
-
- [MonoTODO]
- public void SetSigmaBellShape (float focus, float scale) {
- // FALLBACK: Triangle shape used
- SetBlendTriangularShape (focus, scale);
- }
-
- public void TranslateTransform (float dx, float dy) {
- base.BrushTranslateTransform( dx, dy );
- }
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- base.BrushTranslateTransform( dx, dy, order );
- }
-
- public override object Clone () {
- PathGradientBrush copy = (PathGradientBrush)InternalClone();
-
- if (copy._nativeObject != null)
- copy._nativeObject = (Brush)copy._nativeObject.Clone();
-
- if (copy._surroundColors != null)
- copy._surroundColors = (Color[])copy._surroundColors.Clone();
-
- if (copy._texturePath != null)
- copy._texturePath = (GraphicsPath)copy._texturePath.Clone();
-
- //TBD: clone _blend, _interpolationColors
- //copy._blend = copy._blend
-
- return copy;
- }
-
- #endregion
- }
-}
+++ /dev/null
-/ImageAttributes.jvm.cs -crlf
-/ImageCodec.jvm.cs -crlf
{
// MUST BE KEPT IN SYNC WITH gdip.h in libgdiplus!
// The first 6 fields MUST also match MS definition
-#if TARGET_JVM
- [MonoTODO]
-#endif
[StructLayout(LayoutKind.Sequential)]
public sealed class BitmapData {
private int width;
using System.Reflection;
namespace System.Drawing.Imaging {
-#if TARGET_JVM
- [MonoTODO]
-#endif
public sealed class ColorMap {
private Color newColor;
namespace System.Drawing.Imaging
{
-#if TARGET_JVM
- [MonoTODO]
-#endif
[StructLayout (LayoutKind.Sequential)]
public sealed class ColorMatrix
{
return flags;
}
}
-#if !TARGET_JVM
/* Caller should call FreeHGlobal*/
internal IntPtr getGDIPalette()
{
offset += 4;
}
}
-#endif
}
}
+++ /dev/null
-//
-// System.Drawing.Imaging.EncoderParameter.cs
-//
-// Author:
-// Ravindra (rkumar@novell.com)
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-using System.Runtime.InteropServices;
-
-namespace System.Drawing.Imaging {
-
- [MonoTODO]
- public sealed class EncoderParameter : IDisposable {
-
- private Encoder encoder;
- private int valuesCount;
- private EncoderParameterValueType type;
-
- internal EncoderParameter ()
- {
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, byte value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, byte[] value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, short value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, short[] value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, long value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, long[] value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, string value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, byte value, bool undefined)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, byte[] value, bool undefined)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int numerator, int denominator)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int[] numerator, int[] denominator)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, long rangebegin, long rangeend)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, long[] rangebegin, long[] rangeend)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int numberOfValues, int type, int value)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int numerator1, int denominator1, int numerator2, int denominator2)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public EncoderParameter (Encoder encoder, int[] numerator1, int[] denominator1, int[] numerator2, int[] denominator2)
- {
- throw new NotImplementedException();
- }
-
- public Encoder Encoder {
- get {
- return encoder;
- }
-
- set {
- encoder = value;
- }
- }
-
- public int NumberOfValues {
- get {
- return valuesCount;
- }
- }
-
- public EncoderParameterValueType Type {
- get {
- return type;
- }
- }
-
- public EncoderParameterValueType ValueType {
- get {
- return type;
- }
- }
-
- void Dispose (bool disposing) {
- }
-
- public void Dispose () {
- Dispose (true);
- }
-
- }
-}
// Nothing
GC.SuppressFinalize(this);
}
-#if !TARGET_JVM
internal IntPtr ToNativePtr () {
IntPtr result;
IntPtr ptr;
return result;
}
-#endif
}
}
+++ /dev/null
-\r
-using System;\r
-using System.Drawing;\r
-using System.Drawing.Drawing2D;\r
-\r
-namespace System.Drawing.Imaging\r
-{\r
- /// <summary>\r
- /// Summary description for ImageAttributes.\r
- /// </summary>\r
- /// \r
- [MonoTODO]\r
- public sealed class ImageAttributes : ICloneable, IDisposable\r
- {\r
- [MonoTODO]\r
- public ImageAttributes()\r
- {\r
- }\r
-\r
- public void Dispose()\r
- {\r
- }\r
-\r
- public Object Clone()\r
- {\r
- ImageAttributes imgAttr = new ImageAttributes();\r
- imgAttr.clrMatrix = clrMatrix;\r
- imgAttr.clrMatrixFlag = clrMatrixFlag;\r
- imgAttr.clrAdjustType = clrAdjustType;\r
- imgAttr.gMatrix = gMatrix;\r
- imgAttr.thresh = thresh;\r
- imgAttr.gamma = gamma;\r
- imgAttr.clrChannelFlags = clrChannelFlags;\r
- imgAttr.clrProfileFilename = clrProfileFilename;\r
- imgAttr.clrLow = clrLow;\r
- imgAttr.clrHigh = clrHigh;\r
- imgAttr.clrMap = clrMap;\r
- imgAttr.wrapMode = wrapMode;\r
- imgAttr.col = col;\r
- imgAttr.bClamp = bClamp;\r
- imgAttr.clrPalette = clrPalette;\r
- imgAttr.bNoOp = bNoOp;\r
- return imgAttr;\r
- }\r
-\r
-\r
- public void SetColorMatrix(ColorMatrix newColorMatrix)\r
- {\r
- SetColorMatrix(newColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag flags)\r
- {\r
- SetColorMatrix(newColorMatrix, flags, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)\r
- {\r
- clrMatrix = newColorMatrix;\r
- clrMatrixFlag = mode;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void ClearColorMatrix()\r
- {\r
- ClearColorMatrix(ColorAdjustType.Default);\r
- }\r
-\r
- public void ClearColorMatrix(ColorAdjustType type)\r
- {\r
- ColorMatrix cm = new ColorMatrix();\r
- clrMatrix = cm;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix)\r
- {\r
- SetColorMatrices(newColorMatrix, gMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix, ColorMatrixFlag flags)\r
- {\r
- SetColorMatrices(newColorMatrix, gMatrix, flags, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix gMatrix, ColorMatrixFlag mode, ColorAdjustType type)\r
- {\r
- clrMatrix = newColorMatrix;\r
- this.gMatrix = gMatrix;\r
- clrMatrixFlag = mode;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetThreshold(float thresh)\r
- {\r
- SetThreshold(thresh, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetThreshold(float thresh, ColorAdjustType type)\r
- {\r
- this.thresh = thresh;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void ClearThreshold()\r
- {\r
- ClearThreshold(ColorAdjustType.Default);\r
- }\r
-\r
- public void ClearThreshold(ColorAdjustType type)\r
- {\r
- thresh = 1.0F;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetGamma(float gamma)\r
- {\r
- SetGamma(gamma, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetGamma(float gamma, ColorAdjustType type)\r
- {\r
- this.gamma = gamma;\r
- clrAdjustType = type;\r
- return;\r
- }\r
-\r
- public void ClearGamma()\r
- {\r
- ClearGamma(ColorAdjustType.Default);\r
- }\r
-\r
- public void ClearGamma(ColorAdjustType type)\r
- {\r
- gamma = 1;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetNoOp()\r
- {\r
- SetNoOp(ColorAdjustType.Default);\r
- }\r
-\r
- public void SetNoOp(ColorAdjustType type)\r
- {\r
- bNoOp = true;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void ClearNoOp()\r
- {\r
- ClearNoOp(ColorAdjustType.Default);\r
- }\r
-\r
- public void ClearNoOp(ColorAdjustType type)\r
- {\r
- bNoOp = false;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetColorKey(Color clrLow, Color clrHigh)\r
- {\r
- SetColorKey(clrLow, clrHigh, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetColorKey(Color clrLow, Color clrHigh, ColorAdjustType type)\r
- {\r
- this.clrLow = clrLow;\r
- this.clrHigh = clrHigh;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void ClearColorKey()\r
- {\r
- ClearColorKey(ColorAdjustType.Default);\r
- }\r
-\r
- public void ClearColorKey(ColorAdjustType type)\r
- {\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetOutputChannel(ColorChannelFlag flags)\r
- {\r
- SetOutputChannel(flags, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetOutputChannel(ColorChannelFlag flags, ColorAdjustType type)\r
- {\r
- clrChannelFlags = flags;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void ClearOutputChannel()\r
- {\r
- ClearOutputChannel(ColorAdjustType.Default);\r
- }\r
-\r
- public void ClearOutputChannel(ColorAdjustType type)\r
- {\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetOutputChannelColorProfile(String clrProfileFilename)\r
- {\r
- SetOutputChannelColorProfile(clrProfileFilename, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetOutputChannelColorProfile(String clrProfileFilename, ColorAdjustType type)\r
- {\r
- this.clrProfileFilename = clrProfileFilename;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void ClearOutputChannelColorProfile()\r
- {\r
- ClearOutputChannel(ColorAdjustType.Default);\r
- }\r
-\r
- public void ClearOutputChannelColorProfile(ColorAdjustType type)\r
- {\r
- clrProfileFilename = null;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetRemapTable(ColorMap[] map)\r
- {\r
- SetRemapTable(map, ColorAdjustType.Default);\r
- }\r
-\r
- public void SetRemapTable(ColorMap[] map, ColorAdjustType type)\r
- {\r
- clrMap = map;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void ClearRemapTable()\r
- {\r
- ClearRemapTable(ColorAdjustType.Default);\r
- }\r
-\r
- public void ClearRemapTable(ColorAdjustType type)\r
- {\r
- clrMap = null;\r
- clrAdjustType = type;\r
- }\r
-\r
- public void SetBrushRemapTable(ColorMap []map)\r
- {\r
- SetRemapTable(map, ColorAdjustType.Brush);\r
- }\r
-\r
- public void ClearBrushRemapTable()\r
- {\r
- ClearRemapTable(ColorAdjustType.Brush);\r
- }\r
-\r
- public void SetWrapMode(WrapMode mode)\r
- {\r
- SetWrapMode(mode, new Color(), false);\r
- }\r
-\r
- public void SetWrapMode(WrapMode mode, Color clr)\r
- {\r
- SetWrapMode(mode, clr, false);\r
- }\r
-\r
- public void SetWrapMode(WrapMode mode, Color clr, bool bClamp)\r
- {\r
- wrapMode = mode;\r
- col = clr;\r
- this.bClamp = bClamp;\r
- }\r
-\r
- public void GetAdjustedPalette(ColorPalette palette, ColorAdjustType type)\r
- {\r
- clrPalette = palette;\r
- clrAdjustType = type;\r
- }\r
-\r
- public ColorMatrix clrMatrix;\r
- public ColorMatrixFlag clrMatrixFlag;\r
- public ColorAdjustType clrAdjustType;\r
- public ColorMatrix gMatrix;\r
- public float thresh;\r
- public float gamma;\r
- public ColorChannelFlag clrChannelFlags;\r
- public string clrProfileFilename;\r
- public Color clrLow;\r
- public Color clrHigh;\r
- public ColorMap[] clrMap;\r
- public WrapMode wrapMode;\r
- public Color col;\r
- public bool bClamp;\r
- public ColorPalette clrPalette;\r
- public bool bNoOp;\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-using System;\r
-using System.Configuration;\r
-using System.Collections;\r
-using System.Collections.Specialized;\r
-using System.Drawing.Imaging;\r
-using System.Xml;\r
-using Mainsoft.Drawing.Configuration;\r
-\r
-using imageio = javax.imageio;\r
-using stream = javax.imageio.stream;\r
-using awt = java.awt;\r
-using image = java.awt.image;\r
-using spi = javax.imageio.spi;\r
-using dom = org.w3c.dom;\r
-\r
-namespace Mainsoft.Drawing.Imaging {\r
- /// <summary>\r
- /// Summary description for ImageCodec.\r
- /// </summary>\r
- public class ImageCodec : IDisposable {\r
-\r
- #region Members\r
-\r
- imageio.ImageReader _nativeReader = null;\r
- imageio.ImageWriter _nativeWriter = null;\r
- stream.ImageInputStream _nativeStream = null;\r
-\r
- ImageFormat _imageFormat = null;\r
-\r
- int _currentFrame = 0;\r
-\r
- #endregion\r
-\r
- #region Constructros\r
-\r
- protected ImageCodec() {\r
- }\r
-\r
- static ImageCodec() {\r
- }\r
-\r
- #endregion\r
-\r
- #region Internal properties\r
-\r
- internal imageio.ImageReader NativeReader {\r
- get { return _nativeReader; }\r
- set { \r
- _nativeReader = value; \r
- if (value == null)\r
- return;\r
- _imageFormat = MimeTypesToImageFormat( value.getOriginatingProvider().getMIMETypes() );\r
- }\r
- }\r
- internal imageio.ImageWriter NativeWriter {\r
- get { return _nativeWriter; }\r
- set { \r
- _nativeWriter = value; \r
- if (value == null)\r
- return;\r
- _imageFormat = MimeTypesToImageFormat( value.getOriginatingProvider().getMIMETypes() );\r
- }\r
- }\r
-\r
- internal stream.ImageInputStream NativeStream {\r
- get { return _nativeStream; }\r
- set {\r
- _nativeStream = value;\r
- if (value == null)\r
- return;\r
-\r
- if (NativeReader != null)\r
- NativeReader.setInput( value );\r
-\r
- if (NativeWriter != null)\r
- NativeWriter.setOutput( value );\r
- }\r
- }\r
-\r
- #endregion\r
-\r
- #region ImageCodec factory methods\r
-\r
- public static ImageCodec CreateReader(stream.ImageInputStream inputStream) {\r
- java.util.Iterator iter = imageio.ImageIO.getImageReaders( inputStream );\r
- return CreateReader(iter);\r
- }\r
-\r
- public static ImageCodec CreateReader(ImageFormat imageFormat) {\r
- return CreateReader( ImageFormatToClsid( imageFormat ) );\r
- }\r
-\r
- public static ImageCodec CreateReader(Guid clsid) {\r
- ImageCodec codec = null;\r
- try {\r
- ImageCodecInfo codecInfo = FindDecoder(clsid);\r
- java.util.Iterator iter = imageio.ImageIO.getImageReadersByMIMEType( codecInfo.MimeType );\r
- codec = CreateReader(iter);\r
- }\r
- catch {}\r
-\r
- if (codec == null) {\r
- ImageFormat format = ClsidToImageFormat(clsid);\r
- string name = (format != null) ? format.ToString() : clsid.ToString();\r
- throw new NotSupportedException(String.Format("The '{0}' format decoder is not installed.", name));\r
- }\r
-\r
- return codec;\r
- }\r
-\r
- private static ImageCodec CreateReader(java.util.Iterator iter) {\r
- if ( !iter.hasNext() )
- return null;
-\r
- ImageCodec imageCodec = new ImageCodec();\r
- imageCodec.NativeReader = (imageio.ImageReader) iter.next();\r
- return imageCodec;\r
- }\r
-\r
- public static ImageCodec CreateWriter(ImageFormat imageFormat) {\r
- return CreateWriter( ImageFormatToClsid( imageFormat ) );\r
- }\r
-\r
- public static ImageCodec CreateWriter(Guid clsid) {\r
- ImageCodec codec = null;\r
- try {\r
- ImageCodecInfo codecInfo = FindEncoder(clsid);\r
- java.util.Iterator iter = imageio.ImageIO.getImageWritersByMIMEType( codecInfo.MimeType );\r
- codec = CreateWriter(iter);\r
- }\r
- catch {}\r
-\r
- if (codec == null) {\r
- ImageFormat format = ClsidToImageFormat(clsid);\r
- string name = (format != null) ? format.ToString() : clsid.ToString();\r
- throw new NotSupportedException(String.Format("The '{0}' format encoder is not installed.", name));\r
- }\r
-\r
- return codec;\r
- }\r
-\r
- private static ImageCodec CreateWriter(java.util.Iterator iter) {\r
- if ( !iter.hasNext() )
- return null;
- \r
- ImageCodec imageCodec = new ImageCodec();\r
- imageCodec.NativeWriter = (imageio.ImageWriter) iter.next();\r
- return imageCodec;\r
- }\r
-\r
- #endregion\r
-\r
- #region Codec enumerations\r
-\r
- internal static Hashtable Decoders {
- get {
- const string MYNAME = "System.Drawing.Imaging.ImageCodecInfo.decoders";
- Hashtable o = (Hashtable) AppDomain.CurrentDomain.GetData (MYNAME);
- if (o != null)
- return o;
- o = new ReaderSpiIterator().Iterate();
- AppDomain.CurrentDomain.SetData(MYNAME, o);
- return o;
- }
- }
-
- internal static Hashtable Encoders {
- get {
- const string MYNAME = "System.Drawing.Imaging.ImageCodecInfo.encoders";
- Hashtable o = (Hashtable) AppDomain.CurrentDomain.GetData (MYNAME);
- if (o != null)
- return o;
- o = new WriterSpiIterator().Iterate();
- AppDomain.CurrentDomain.SetData(MYNAME, o);
- return o;
- }
- }
-
- internal static ImageCodecInfo FindEncoder (Guid clsid) {
- ImageCodecInfo codec = (ImageCodecInfo) Encoders[clsid];
- if (codec == null) {
- // .net saves in png if cannot find requested encoder. atc id 316563
- codec = (ImageCodecInfo) Encoders[ ImageCodec.PngClsid ];
- }
- return codec;
- }
-
- internal static ImageCodecInfo FindDecoder (Guid clsid) {
- ImageCodecInfo codec = (ImageCodecInfo) Decoders[clsid];
- if (codec == null) {\r
- ImageFormat format = ClsidToImageFormat(clsid);\r
- string name = (format != null) ? format.ToString() : clsid.ToString();\r
- throw new NotSupportedException(String.Format("The '{0}' format decoder is not installed.", name));\r
- }\r
- return codec;\r
- }
-\r
- #endregion\r
-\r
- #region SpiIterators
-
- abstract class BaseSpiIterator {
- protected abstract java.util.Iterator GetIterator (string mimeType);
- protected abstract spi.ImageReaderWriterSpi GetNext (java.util.Iterator iter);
-
- #region ProcessOneCodec
- private ImageCodecInfo ProcessOneCodec (Guid clsid, Guid formatID, string mimeType) {
- ImageCodecInfo ici = new ImageCodecInfo ();
- ici.Clsid = clsid;
- ici.FormatID = formatID;
- ici.MimeType = mimeType;
- java.util.Iterator iter = null;
- try {
- iter = GetIterator (mimeType);
- }
- catch(Exception) {
- return null;
- }
- while (iter.hasNext ()) {
- spi.ImageReaderWriterSpi rw = GetNext (iter);
-
- ici.CodecName = rw.getDescription (java.util.Locale.getDefault ());
- //ici.DllName = null;
- foreach (string suffix in rw.getFileSuffixes ()) {
- if (ici.FilenameExtension != null)
- ici.FilenameExtension += ";";
- ici.FilenameExtension += "*."+suffix;
- }
- ici.Flags = ImageCodecFlags.Builtin|ImageCodecFlags.SupportBitmap;
- if (rw is spi.ImageReaderSpi)
- ici.Flags |= ImageCodecFlags.Decoder;
-
- if (rw is spi.ImageWriterSpi)
- ici.Flags |= ImageCodecFlags.Encoder;
-
- ici.FormatDescription = string.Join(";",
- rw.getFormatNames());
- try {
- ici.Version = (int)Convert.ToDouble(rw.getVersion ());
- }
- catch (Exception) {
- ici.Version = 1;
- }
- break;
- }
- return ici;
- }
- #endregion
-
- internal Hashtable Iterate () {
- // TBD: Insert Exception handling here
- NameValueCollection nvc = (NameValueCollection) System.Configuration.ConfigurationSettings\r
- .GetConfig ("mainsoft.drawing/codecs");
- Hashtable codecs = new Hashtable (10);
-
- for (int i=0; i<nvc.Count; i++) {
- Guid clsid = new Guid (nvc.GetKey (i));
- ImageFormat format = ClsidToImageFormat (clsid);
- ImageCodecInfo codec = ProcessOneCodec (clsid, format.Guid, nvc[i]);
- if ((codec != null) && (codec.FilenameExtension != null))
- codecs [clsid] = codec;
- }
- return codecs;
- }
- }
-
- class ReaderSpiIterator: BaseSpiIterator {
- protected override java.util.Iterator GetIterator(string mimeType) {\r
- return imageio.ImageIO.getImageReadersByMIMEType (mimeType);\r
- }\r
- protected override javax.imageio.spi.ImageReaderWriterSpi GetNext(java.util.Iterator iter) {\r
- imageio.ImageReader r = (imageio.ImageReader) iter.next ();\r
- return r.getOriginatingProvider ();\r
- }\r
- }
-
- class WriterSpiIterator: BaseSpiIterator {
- protected override java.util.Iterator GetIterator(string mimeType) {\r
- return imageio.ImageIO.getImageWritersByMIMEType (mimeType);\r
- }\r
- protected override javax.imageio.spi.ImageReaderWriterSpi GetNext(java.util.Iterator iter) {\r
- imageio.ImageWriter w = (imageio.ImageWriter) iter.next ();\r
- return w.getOriginatingProvider ();\r
- }\r
- }
- #endregion
-\r
- #region Clsid and FormatID
- static Guid BmpClsid = new Guid ("557cf400-1a04-11d3-9a73-0000f81ef32e");
- static Guid JpegClsid = new Guid ("557cf401-1a04-11d3-9a73-0000f81ef32e");
- static Guid GifClsid = new Guid ("557cf402-1a04-11d3-9a73-0000f81ef32e");
- static Guid EmfClsid = new Guid ("557cf403-1a04-11d3-9a73-0000f81ef32e");
- static Guid WmfClsid = new Guid ("557cf404-1a04-11d3-9a73-0000f81ef32e");
- static Guid TiffClsid = new Guid ("557cf405-1a04-11d3-9a73-0000f81ef32e");
- static Guid PngClsid = new Guid ("557cf406-1a04-11d3-9a73-0000f81ef32e");
- static Guid IconClsid = new Guid ("557cf407-1a04-11d3-9a73-0000f81ef32e");
-
- private static ImageFormat MimeTypesToImageFormat (string [] mimeTypes) {
- foreach (ImageCodecInfo codec in Decoders.Values)
- for (int i=0; i<mimeTypes.Length; i++)\r
- if (codec.MimeType == mimeTypes [i])\r
- return ClsidToImageFormat (codec.Clsid);\r
- return null;
- }
-
- internal static ImageFormat ClsidToImageFormat (Guid clsid) {
- if (clsid.Equals (BmpClsid))
- return ImageFormat.Bmp;
- else if (clsid.Equals (JpegClsid))
- return ImageFormat.Jpeg;
- else if (clsid.Equals (GifClsid))
- return ImageFormat.Gif;
- else if (clsid.Equals (EmfClsid))
- return ImageFormat.Emf;
- else if (clsid.Equals (WmfClsid))
- return ImageFormat.Wmf;
- else if (clsid.Equals (TiffClsid))
- return ImageFormat.Tiff;
- else if (clsid.Equals (PngClsid))
- return ImageFormat.Png;
- else if (clsid.Equals (IconClsid))
- return ImageFormat.Icon;
- else
- return null;
- }
-
- internal static Guid ImageFormatToClsid (ImageFormat format) {
- if (format == null)
- return Guid.Empty;
-
- if (format.Guid.Equals (ImageFormat.Bmp.Guid))
- return BmpClsid;
- else if (format.Guid.Equals (ImageFormat.Jpeg.Guid))
- return JpegClsid;
- else if (format.Guid.Equals (ImageFormat.Gif))
- return GifClsid;
- else if (format.Guid.Equals (ImageFormat.Emf.Guid))
- return EmfClsid;
- else if (format.Guid.Equals (ImageFormat.Wmf.Guid))
- return WmfClsid;
- else if (format.Guid.Equals (ImageFormat.Tiff.Guid))
- return TiffClsid;
- else if (format.Guid.Equals (ImageFormat.Png.Guid))
- return PngClsid;
- else if (format.Guid.Equals (ImageFormat.Icon.Guid))
- return IconClsid;
- else
- return Guid.Empty;
- }
-
- private FrameDimension FormatFrameDimesion {
- get {
- if (ImageFormat == null)
- return FrameDimension.Page;
-
- if (ImageFormat.Guid.Equals (ImageFormat.Bmp.Guid))
- return FrameDimension.Page;
- else if (ImageFormat.Guid.Equals (ImageFormat.Jpeg.Guid))
- return FrameDimension.Page;
- else if (ImageFormat.Guid.Equals (ImageFormat.Gif))
- return FrameDimension.Time;
- else if (ImageFormat.Guid.Equals (ImageFormat.Emf.Guid))
- return FrameDimension.Page;
- else if (ImageFormat.Guid.Equals (ImageFormat.Wmf.Guid))
- return FrameDimension.Page;
- else if (ImageFormat.Guid.Equals (ImageFormat.Tiff.Guid))
- return FrameDimension.Page;
- else if (ImageFormat.Guid.Equals (ImageFormat.Png.Guid))
- return FrameDimension.Page;
- else if (ImageFormat.Guid.Equals (ImageFormat.Icon.Guid))
- return FrameDimension.Resolution;
- else
- return FrameDimension.Page;
- }
- }
-
- #endregion
- \r
- #region Image read/write methods\r
-\r
- internal PlainImage ReadPlainImage() {\r
- awt.Image img = ReadImage( _currentFrame );\r
- if (img == null)\r
- return null;\r
-\r
- // its possible to fail to load thumbnails and metadata, but image is ok.\r
- awt.Image [] th = null;\r
-#if THUMBNAIL_SUPPORTED\r
- try {\r
- th = ReadThumbnails( _currentFrame );\r
- }\r
- catch (Exception) {}\r
-#endif\r
- \r
- XmlDocument md = null;\r
- imageio.metadata.IIOMetadata nativeMd = null;\r
- try {\r
- nativeMd = ReadImageMetadata( _currentFrame );\r
- md = ConvertImageMetadata( nativeMd );\r
- }\r
- catch (Exception) {}\r
-\r
- float [] resolution = GetResolution( md );\r
-\r
- PlainImage pi = new PlainImage( img, th, ImageFormat, resolution[0], resolution[1], FormatFrameDimesion );\r
- pi.NativeMetadata = nativeMd;\r
- return pi;\r
- }\r
-\r
- internal PlainImage ReadNextPlainImage() {\r
- _currentFrame++;\r
- return ReadPlainImage();\r
- }\r
-\r
- private awt.Image ReadImage(int frame) {\r
- if (NativeStream == null)\r
- throw new Exception("Input stream not specified");\r
-\r
- try {\r
- return NativeReader.read (frame);
- }
- catch (java.lang.IndexOutOfBoundsException) {
- return null;
- }
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }\r
-\r
-#if THUMBNAIL_SUPPORTED\r
- private awt.Image [] ReadThumbnails(int frameIndex) {\r
- awt.Image [] thArray = null;
-
- try {
- if (NativeReader.readerSupportsThumbnails()) {
- int tmbNumber = NativeReader.getNumThumbnails(frameIndex);
-
- if (tmbNumber > 0) {
- thArray = new awt.Image[ tmbNumber ];
-
- for (int i = 0; i < tmbNumber; i++) {
- thArray[i] = NativeReader.readThumbnail(frameIndex, i);
- }
- }
- }\r
- return thArray;\r
- }\r
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }\r
-#endif\r
- internal void WritePlainImage(PlainImageCollection pic) {\r
- if ((pic == null) || (pic.Count == 0))\r
- return;\r
-\r
- if (pic.Count == 1) {\r
- WritePlainImage( pic[0] );\r
- return;\r
- }\r
-\r
- try {\r
- if (NativeWriter.canWriteSequence ()) {\r
- NativeWriter.prepareWriteSequence (null);\r
- for (int i=0; i < pic.Count; i++) {\r
- imageio.IIOImage iio = GetIIOImageContainer( pic[i] );\r
- NativeWriter.writeToSequence (iio, null);\r
- }\r
- NativeWriter.endWriteSequence ();\r
- }\r
- else\r
- WritePlainImage( pic[0] );\r
- }\r
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }\r
-\r
- internal void WritePlainImage(PlainImage pi) {\r
- try {\r
- imageio.IIOImage iio = GetIIOImageContainer( pi );\r
- WriteImage( iio );\r
- }\r
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }\r
- }\r
-\r
- private void WriteImage(imageio.IIOImage iio) {\r
- if (NativeStream == null)\r
- throw new Exception("Output stream not specified");\r
-\r
- NativeWriter.write( iio );\r
- }\r
- \r
- private imageio.IIOImage GetIIOImageContainer(PlainImage pi) {\r
- java.util.ArrayList al = null;\r
- \r
- // prepare thumbnails list\r
- if (pi.Thumbnails != null) {\r
- al = new java.util.ArrayList( pi.Thumbnails.Length );\r
- for (int i=0; i < pi.Thumbnails.Length; i++)\r
- al.add(pi.Thumbnails[i]);\r
- }\r
-\r
- // prepare IIOImage container\r
- if (pi.NativeImage is image.BufferedImage) {\r
- imageio.IIOImage iio = new javax.imageio.IIOImage(\r
- (image.BufferedImage)pi.NativeImage, al, null /*pi.NativeMetadata*/);\r
- return iio;\r
- }\r
- else\r
- // TBD: This codec is for raster formats only\r
- throw new NotSupportedException("Only raster formats are supported");\r
- }\r
-\r
-\r
- private imageio.metadata.IIOMetadata ReadImageMetadata(int frameIndex) {\r
- if (NativeStream == null)\r
- throw new Exception("Input stream not specified");\r
-\r
- try {\r
- imageio.metadata.IIOMetadata md = NativeReader.getImageMetadata( frameIndex );\r
- return md;\r
- }\r
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }\r
-\r
- #endregion\r
-\r
- #region Extra properties\r
-\r
- public ImageFormat ImageFormat {\r
- get { return _imageFormat; }\r
- }\r
-\r
- #endregion\r
-\r
- #region Metadata parse\r
-\r
- private float [] GetResolution(XmlDocument metaData) {\r
- if (metaData == null)\r
- return new float[]{0, 0};\r
-\r
- ResolutionConfigurationCollection rcc =
- (ResolutionConfigurationCollection)\r
- ConfigurationSettings.GetConfig ("mainsoft.drawing/codecsmetadata");
-
- if (rcc == null)
- throw new ConfigurationException("Configuration section codecsmetadata not found");
-
- ResolutionConfiguration rc = rcc[ ImageFormat.ToString() ];
-
- if (rc == null)
- return new float[]{0, 0};
-
- // Horizontal resolution
- string xResPath = rc.XResPath;
- string xRes;
-
- if (xResPath == string.Empty)
- xRes = rc.XResDefault;
- else
- xRes = GetValueFromMetadata(metaData, xResPath);
-
- if ((xRes == null) || (xRes == string.Empty))
- xRes = rc.XResDefault;
-
- // Vertical resolution
- string yResPath = rc.YResPath;
- string yRes;
-
- if (yResPath == string.Empty)
- yRes = rc.YResDefault;
- else
- yRes = GetValueFromMetadata(metaData, yResPath);
-
- if ((yRes == null) || (yRes == string.Empty))
- yRes = rc.YResDefault;
-
- // Resolution units
- string resUnitsPath = rc.UnitsTypePath;
- string resUnitsType;
-
- if (resUnitsPath == string.Empty)
- resUnitsType = rc.UnitsTypeDefault;
- else
- resUnitsType = GetValueFromMetadata(metaData, resUnitsPath);
-
- if (resUnitsType == null)
- resUnitsType = rc.UnitsTypeDefault;
-
- // Unit scale
- string unitScale = rc.UnitsScale[resUnitsType].ToString();
-
- // Adjust resolution to its units
- float [] res = new float[2];
- res[0] = ParseFloatValue(xRes) * ParseFloatValue(unitScale);
- res[1] = ParseFloatValue(yRes) * ParseFloatValue(unitScale);
-
- return res;
- }\r
-\r
- private string GetValueFromMetadata(XmlDocument metaData, string path) {\r
- XmlNode n = metaData.SelectSingleNode(path);\r
- if (n == null)\r
- return null;\r
-\r
- return n.InnerText;\r
- }\r
-\r
- private XmlDocument ConvertImageMetadata(imageio.metadata.IIOMetadata metaData) {\r
- string [] formatNames = metaData.getMetadataFormatNames();
- dom.Element rootNode = (dom.Element) metaData.getAsTree(formatNames[0]);
-
- XmlDocument _metadataDocument = new XmlDocument();\r
- XmlConvert(rootNode, _metadataDocument);\r
-\r
- return _metadataDocument;\r
- }\r
-\r
- private void XmlConvert(dom.Node jNode, XmlNode nNode) {\r
- XmlDocument document = nNode.OwnerDocument;\r
- if (document == null)\r
- document = (XmlDocument)nNode;\r
-\r
- XmlNode n = null;\r
- switch (jNode.getNodeType()) {\r
- case 1 :\r
- n = document.CreateNode(XmlNodeType.Element, jNode.getNodeName(), jNode.getNamespaceURI());\r
- break;\r
-\r
- case 4 :\r
- n = document.CreateNode(XmlNodeType.CDATA, jNode.getNodeName(), jNode.getNamespaceURI());\r
- break;\r
-\r
- default:\r
- return;\r
- }\r
- //set value\r
- n.InnerText = jNode.getNodeValue();\r
- nNode.AppendChild( n );\r
-\r
- //copy attributes\r
- org.w3c.dom.NamedNodeMap nm = jNode.getAttributes();\r
- for (int i=0; i<nm.getLength(); i++) {\r
- XmlAttribute a = document.CreateAttribute( nm.item(i).getNodeName() );\r
- a.Value = nm.item(i).getNodeValue();\r
- n.Attributes.Append( a );\r
- }\r
-\r
- //copy childs\r
- org.w3c.dom.NodeList nl = jNode.getChildNodes();\r
- for (int i=0; i<nl.getLength(); i++) {\r
- XmlConvert(nl.item(i), n);\r
- }\r
- }\r
-\r
- protected virtual float ParseFloatValue(string strValue) {\r
- try {\r
- if ((strValue != null) && (strValue != "")) {
- int dividerPos = strValue.IndexOf("/");
-
- if (dividerPos < 0) {
- return float.Parse(strValue);
- }
- else {
- return float.Parse(strValue.Substring( 0, dividerPos )) /
- float.Parse(strValue.Substring( dividerPos + 1 ));
- }
- }\r
- return float.NaN;\r
- }\r
- catch (Exception) {\r
- return float.NaN;\r
- }\r
- }\r
-\r
- #endregion\r
-\r
- #region IDisposable members\r
-\r
- public void Dispose() {\r
- if (NativeReader != null) {\r
- NativeReader.dispose();\r
- NativeReader = null;\r
- }\r
-\r
- if (NativeWriter != null) {\r
- NativeWriter.dispose();\r
- NativeWriter = null;\r
- }\r
- }\r
-\r
- #endregion\r
-\r
- }\r
-}\r
+++ /dev/null
-//
-// System.Drawing.Imaging.ImageCodecInfo.cs
-//
-// Authors:
-// Everaldo Canuto (everaldo.canuto@bol.com.br)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Dennis Hayes (dennish@raytek.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Dennis Hayes (dennish@raytek.com)
-// Jordi Mas i Hernandez (jordi@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Configuration;
-using System.IO;
-using Mainsoft.Drawing.Imaging;
-
-using imageio = javax.imageio;
-using spi = javax.imageio.spi;
-
-namespace System.Drawing.Imaging {
-
- [ComVisible (false)]
- public sealed class ImageCodecInfo
- {
- private Guid clsid;
- private string codecName;
- private string dllName;
- private string filenameExtension;
- private ImageCodecFlags flags;
- private string formatDescription;
- private Guid formatID;
- private string mimeType;
- private byte[][] signatureMasks;
- private byte[][] signaturePatterns;
- private int version;
-
- public static ImageCodecInfo[] GetImageDecoders ()
- {
- Hashtable oldInfo = ImageCodec.Decoders;
- ImageCodecInfo [] newInfo = new ImageCodecInfo [oldInfo.Count];
- int i=0;
- foreach (ImageCodecInfo codec in oldInfo.Values) {
- newInfo [i++] = (ImageCodecInfo) codec.MemberwiseClone ();
- }
- return newInfo;
- }
-
- internal ImageCodecInfo () {
- }
-
- public static ImageCodecInfo[] GetImageEncoders ()
- {
- Hashtable oldInfo = ImageCodec.Encoders;
- ImageCodecInfo [] newInfo = new ImageCodecInfo [oldInfo.Count];
- int i=0;
- foreach (ImageCodecInfo codec in oldInfo.Values) {
- //newInfo [i++] = (ImageCodecInfo) codec.MemberwiseClone ();
- newInfo [i] = new ImageCodecInfo ();
- newInfo [i].clsid = codec.clsid;
- newInfo [i].formatID = codec.formatID;
- newInfo [i].codecName = codec.codecName;
- newInfo [i].dllName = codec.dllName;
- newInfo [i].flags = codec.flags;
- newInfo [i].filenameExtension = codec.filenameExtension;
- newInfo [i].formatDescription = codec.formatDescription;
- newInfo [i].mimeType = codec.mimeType;
- newInfo [i].signatureMasks = codec.signatureMasks;
- newInfo [i].signaturePatterns = codec.signaturePatterns;
- newInfo [i++].version = codec.version;
- }
- return newInfo;
- }
-
- // properties
-
- public Guid Clsid
- {
- get { return clsid; }
- set { clsid = value; }
- }
-
-
- public string CodecName
- {
- get { return codecName; }
- set { codecName = value; }
- }
-
-
- public string DllName
- {
- get { return dllName; }
- set { throw new PlatformNotSupportedException(); }
- }
-
-
- public string FilenameExtension
- {
- get { return filenameExtension; }
- set { filenameExtension = value; }
- }
-
-
- public ImageCodecFlags Flags
- {
- get { return flags; }
- set { flags = value; }
- }
-
- public string FormatDescription
- {
- get { return formatDescription; }
- set { formatDescription = value; }
- }
-
- public Guid FormatID
- {
- get { return formatID; }
- set { formatID = value; }
- }
-
-
- public string MimeType
- {
- get { return mimeType; }
- set { mimeType = value; }
- }
-
-
- [CLSCompliant(false)]
- public byte[][] SignatureMasks
- {
- get { return signatureMasks; }
- set { signatureMasks = value; }
- }
-
- [CLSCompliant(false)]
- public byte[][] SignaturePatterns
- {
- get { return signaturePatterns; }
- set { signaturePatterns = value; }
- }
-
- public int Version
- {
- get { return version; }
- set { version = value; }
- }
-
- }
-
-}
+++ /dev/null
-//
-// System.Drawing.Imaging.Metafile.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-// Dennis Hayes (dennish@raytek.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.IO;
-using System.Reflection;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-
-namespace System.Drawing.Imaging {
-
- [Serializable]
- [ComVisible (false)]
-#if SYSTEM_DRAWING_DESIGN_SUPPORT
- [Editor ("System.Drawing.Design.MetafileEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
-#endif
- [MonoTODO]
- public sealed class Metafile : Image {
-
- // constructors
- [MonoTODO]
- public Metafile (Stream stream)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string filename)
- {
- throw new NotImplementedException ();
- }
-
-#if INTPTR_SUPPORT
-
- [MonoTODO]
- public Metafile (IntPtr henhmetafile, bool deleteEmf)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHtc, EmfType emfType)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHtc, Rectangle frameRect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHtc, RectangleF frameRect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHtc)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (String fileName, IntPtr referenceHtc)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, EmfType emfType, string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader, bool deleteWmf)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, EmfType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, Rectangle frameRect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, RectangleF frameRect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, EmfType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, Rectangle frameRect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHtc, EmfType type, string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, EmfType type, string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type, string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type,
- string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type,
- string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type,
- string description)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type,
- string description)
- {
- throw new NotImplementedException ();
- }
-
- // methods
- [MonoTODO]
- public IntPtr GetHenhmetafile()
- {
- throw new NotImplementedException ();
- }
-#endif
-
- [MonoTODO]
- public MetafileHeader GetMetafileHeader()
- {
- throw new NotFiniteNumberException();
- }
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public static MetafileHeader GetMetafileHeader(IntPtr henhmetafile)
- {
- throw new NotImplementedException ();
- }
-#endif
- [MonoTODO]
- public static MetafileHeader GetMetafileHeader(Stream stream)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static MetafileHeader GetMetafileHeader(string fileName)
- {
- throw new NotImplementedException ();
- }
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public static MetafileHeader GetMetafileHeader(IntPtr henhmetafile, WmfPlaceableFileHeader wmfHeader)
- {
- throw new NotImplementedException ();
- }
-#endif
- [MonoTODO]
- public void PlayRecord(EmfPlusRecordType recordType, int flags, int dataSize, byte[] datawmfHeader)
- {
- throw new NotImplementedException ();
- }
- // properties
-
- [MonoTODO]
- protected override void InternalSave (javax.imageio.stream.ImageOutputStream output, Guid clsid) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override PixelFormat InternalPixelFormat {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- protected override java.awt.Image[] CloneNativeObjects(java.awt.Image[] src) {
- throw new NotImplementedException ();
- }
-
- #region Clone
- [MonoTODO]
- public override object Clone() {
- throw new NotImplementedException ();
- }
- #endregion
-
- }
-
-}
}
[MonoTODO ("Metafiles, both WMF and EMF formats, aren't supported.")]
-#if !TARGET_JVM
[StructLayout(LayoutKind.Sequential)]
-#endif
public sealed class MetafileHeader {
private MonoMetafileHeader header;
+++ /dev/null
-/InstalledFontCollection.jvm.cs -crlf
-/PrivateFontCollection.jvm.cs -crlf
-/TextLineIterator.jvm.cs -crlf
+++ /dev/null
-//
-// System.Drawing.Text.FontCollection.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Everaldo Canuto everaldo.canuto@bol.com.br
-// Sanjay Gupta (gsanjay@novell.com)
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using awt = java.awt;
-
-namespace System.Drawing.Text
-{
- /// <summary>
- /// Summary description for FontCollection.
- /// </summary>
- public abstract class FontCollection : IDisposable
- {
- private readonly Hashtable _fonts;
-
- protected FontCollection()
- {
- _fonts = CollectionsUtil.CreateCaseInsensitiveHashtable( new Hashtable() );
- }
-
- protected FontCollection(Hashtable fonts) {
- _fonts = fonts;
- }
-
- public FontFamily[] Families {
- get {
- ICollection values = _fonts.Keys;
- FontFamily[] families = new FontFamily[values.Count];
-
- string [] keys = new string[_fonts.Count];
- _fonts.Keys.CopyTo(keys, 0);
-
- for (int i = 0; i < _fonts.Count; i++)
- families[i] = new FontFamily( keys[i] );
-
- return families;
- }
- }
-
- internal virtual awt.Font GetInitialFont(string familyName) {
- return (awt.Font)_fonts[familyName];
- }
-
- internal virtual bool Contains(string familyName) {
- return _fonts.ContainsKey( familyName );
- }
-
- protected void AddFont(awt.Font font) {
- _fonts.Add(font.getFamily(), font);
- }
-
- #region IDisposable Members
-
- public void Dispose() {
- // TODO: Add FontCollection.Dispose implementation
- }
-
- #endregion
- }
-}
+++ /dev/null
-//
-// System.Drawing.InstalledFontCollection.cs
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-// Author: Konstantin Triger (kostat@mainsoft.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.
-//\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Collections.Specialized;\r
-using awt = java.awt;\r
-\r
-namespace System.Drawing.Text\r
-{\r
- /// <summary>\r
- /// Summary description for InstalledFontCollection.\r
- /// </summary>\r
- public sealed class InstalledFontCollection : FontCollection\r
- {\r
- static readonly Hashtable _installedFonts;\r
-\r
- static InstalledFontCollection()\r
- {\r
- _installedFonts = CollectionsUtil.CreateCaseInsensitiveHashtable( new Hashtable() );\r
- java.awt.Font [] fonts = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();\r
- for (int i = 0; i < fonts.Length; i++) {\r
- string fontFamilyName = fonts[i].getFamily();\r
- if (!_installedFonts.ContainsKey( fontFamilyName ))\r
- _installedFonts.Add(fontFamilyName, fonts[i]);\r
- }\r
- }\r
-\r
- public InstalledFontCollection() : base( _installedFonts ) {\r
- }\r
- }\r
-}\r
+++ /dev/null
-//
-// System.Drawing.Test.LineLayout.jvm.cs
-//
-// Author:
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Drawing.Drawing2D;
-
-using font = java.awt.font;
-using text = java.text;
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing.Text {
-
- internal sealed class LineLayout {
-
- #region Fields
-
- readonly font.TextLayout _layout;
-
- readonly float _accumulatedHeight;
- readonly TextLineIterator _lineIter;
-
- #endregion
-
- #region ctor
-
- internal LineLayout(font.TextLayout layout,
- TextLineIterator lineIter,
- float accumulatedHeight) {
-
- _layout = layout;
- _lineIter = lineIter;
- _accumulatedHeight = accumulatedHeight;
- }
-
- #endregion
-
- #region Properties
-
- internal float AccumulatedHeight {
- get { return _accumulatedHeight; }
- }
-
- internal float MeasureWidth {
- get {
- return _lineIter.PadWidth (Width);
- }
- }
-
- internal float WidthPadding {
- get {
- return _lineIter.PadWidth (Width) - Width;
- }
- }
-
- internal int CharacterCount {
- get { return _layout.getCharacterCount(); }
- }
-
- internal float Ascent {
- get { return _layout.getAscent(); }
- }
-
- internal float Descent {
- get { return _layout.getDescent(); }
- }
-
- public float Leading {
- get { return _layout.getLeading(); }
- }
-
- internal float NativeY {
- get {
- if (_lineIter.Format.IsVertical) {
- float height = _lineIter.Height;
- if (float.IsPositiveInfinity(height))
- height = 0;
- switch (_lineIter.Format.Alignment) {
- case StringAlignment.Center:
- return (height - Width) / 2;
- case StringAlignment.Far:
- return height - _layout.getVisibleAdvance () - WidthPadding;
- default:
- return WidthPadding;
- }
- }
- else
- return AccumulatedHeight + Ascent;
- }
- }
-
- internal float NativeX {
- get {
- float width = _lineIter.Width;
- if (float.IsPositiveInfinity(width))
- width = 0;
- if (_lineIter.Format.IsVertical)
- return (_lineIter.Format.IsRightToLeft) ?
- width - AccumulatedHeight - Ascent :
- AccumulatedHeight + Leading + Descent;
- else {
- float xOffset;
- switch ( _lineIter.Format.Alignment) {
- case StringAlignment.Center:
- xOffset = (width - Width) / 2;
- break;
- case StringAlignment.Far:
- if (_lineIter.Format.IsRightToLeft)
- xOffset = WidthPadding/2;
- else
- xOffset = width - _layout.getVisibleAdvance () - WidthPadding/2;
- break;
- default:
- if (_lineIter.Format.IsRightToLeft)
- xOffset = width - _layout.getVisibleAdvance () - WidthPadding/2;
- else
- xOffset = WidthPadding / 2;
- break;
- }
-
- return xOffset;
- }
- }
- }
-
- internal float Height {
- get {
- return Ascent + Descent + Leading;
- }
- }
-
- internal float Width {
- get {
- if (_lineIter.Format.MeasureTrailingSpaces)
- if (!(_lineIter.Format.IsRightToLeft ^
- (_lineIter.Format.Alignment == StringAlignment.Far)))
- return _layout.getAdvance();
-
- return _layout.getVisibleAdvance();
- }
- }
-
- #endregion
-
- #region Methods
-
- internal void Draw(awt.Graphics2D g2d, float x, float y) {
- if (_lineIter.Format.IsVertical)
- _layout.draw (g2d, y + NativeY, -(x + NativeX));
- else
- _layout.draw(g2d, x + NativeX, y + NativeY );
- }
-
- internal awt.Shape GetOutline(float x, float y) {
- geom.AffineTransform t = (geom.AffineTransform) _lineIter.Transform.clone();
-
- if (_lineIter.Format.IsVertical)
- t.translate(y + NativeY, -(x + NativeX));
- else
- t.translate(x + NativeX, y + NativeY);
-
- return _layout.getOutline(t);
- }
-
- #endregion
- }
-
-}
+++ /dev/null
-//
-// System.Drawing.PrivateFontCollection.cs
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-// Author: Konstantin Triger (kostat@mainsoft.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.
-//\r
-\r
-using System;\r
-using System.IO;\r
-using awt = java.awt;\r
-using io = java.io;\r
-using vmw.common;\r
-\r
-namespace System.Drawing.Text\r
-{\r
- /// <summary>\r
- /// Summary description for PrivateFontCollection.\r
- /// </summary>\r
- public sealed class PrivateFontCollection : FontCollection\r
- {\r
- public PrivateFontCollection()\r
- {\r
- }\r
-\r
- public void AddFontFile(string filename) {\r
- using(FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read)) {\r
- io.InputStream stream = vmw.common.IOUtils.ToInputStream (fs);\r
- awt.Font font = awt.Font.createFont(awt.Font.TRUETYPE_FONT, stream);\r
- AddFont(font);\r
- }\r
- }\r
-#if INTPTR_SUPPORT\r
- public void AddMemoryFont(IntPtr memory, int length) {\r
- }\r
-#endif\r
- }\r
-}\r
+++ /dev/null
-//
-// System.Drawing.Test.TextLineIterator.jvm.cs
-//
-// Author:
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// Copyright (C) 2005 Mainsoft Corporation, (http://www.mainsoft.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Drawing.Drawing2D;
-
-using font = java.awt.font;\r
-using text = java.text;
-using awt = java.awt;\r
-using geom = java.awt.geom;
-
-namespace System.Drawing.Text {
- internal sealed class TextLineIterator {
-
- #region Fields
-
- readonly float _width;\r
- readonly float _height;\r
- readonly StringFormat _format;\r
- readonly font.FontRenderContext _frc;
- readonly string _s;
- readonly Font _font;
- readonly float _margin;
-
- static readonly string NewLine;\r
-\r
- static readonly geom.AffineTransform Rotate90Transform = \r
- geom.AffineTransform.getRotateInstance(Math.PI/2);\r
-\r
- font.TextMeasurer _measurer;\r
- int _charsConsumed = 0;\r
- int _currentPos = 0;\r
- int _currentRun = 0;\r
- float _accumulatedHeight = 0;\r
-\r
- #endregion\r
-\r
- #region ctors\r
-\r
- static TextLineIterator() {\r
- string newLine = Environment.NewLine;\r
- if (newLine == null || newLine.Length == 0 || newLine[newLine.Length - 1] == '\n')\r
- newLine = "\n";\r
-\r
- NewLine = newLine;\r
- }
-
- internal TextLineIterator(string s, Font font, font.FontRenderContext frc, StringFormat format, float width, float height) {\r
- _format = (format != null) ? format : new StringFormat();\r
- _font = font;\r
- _s = (s != null) ? s : String.Empty;\r
- _frc = frc;\r
- FontFamily ff = font.FontFamily;\r
- _margin = font.Size*ff.GetDrawMargin(font.Style)/ff.GetEmHeight(font.Style);\r
-\r
- _width = width;\r
- _height = height;\r
- }
-
- #endregion
-
- #region Properties\r
-\r
- float WrapWidth\r
- {\r
- get {\r
- float widthOrHeight = _format.IsVertical ? Height : Width;\r
- if (!_format.IsGenericTypographic) {\r
- widthOrHeight =\r
- ((_format.IsVertical ? Height : Width) - (0.463f * FontSize)) / 1.028f;\r
- }\r
- return widthOrHeight;\r
- }\r
- }
-
- internal float WrapHeight {\r
- get {\r
- float widthOrHeight = _format.IsVertical ? Width : Height;\r
- if (!_format.IsGenericTypographic) {\r
- widthOrHeight = (_format.IsVertical ? Width : Height) / 1.08864f;\r
- }\r
- return widthOrHeight;
- }
- }
-
- internal float Width {
- get { return _width; }
- }
-
- internal float Height {
- get { return _height; }
- }
-
- internal StringFormat Format {
- get { return _format; }
- }\r
-\r
- internal float PadWidth (float origWidth)\r
- {\r
- if (Format.IsGenericTypographic)\r
- return origWidth;\r
-\r
- //This is a proximity to .NET calculated Width.\r
- return origWidth * 1.028f + 0.463f * FontSize;\r
- }\r
-\r
- internal float PadHeight (float origHeight)\r
- {\r
- if (Format.IsGenericTypographic)\r
- return origHeight;\r
-\r
- //This is a proximity to .NET calculated Height.\r
- return 1.08864f * origHeight;\r
- } \r
-\r
- internal float FontSize\r
- {\r
- get {\r
- return _font.Size;\r
- }\r
- }
-
- internal int CharsConsumed {
- get { return _charsConsumed; }
- }
-
- internal int CurrentRun {
- get { return _currentRun; }
- }
-
- internal int CurrentPosition {
- get { return _currentPos; }
- }
-
- internal float AccumulatedHeight {
- get { return _accumulatedHeight; }
- }
-
- internal float GetAdvanceBetween(int start, int limit) {
- return _measurer.getAdvanceBetween(start, limit);
- }
-
- internal geom.AffineTransform Transform {
- get { return Format.IsVertical ? Rotate90Transform : Matrix.IdentityTransform.NativeObject; }
- }
-
- #endregion
-
- #region Methods
-
- LineLayout NextTextLayoutFromMeasurer() {
- if (_accumulatedHeight >= WrapHeight) {
- _charsConsumed += _currentPos;
- return null;
- }
-
- int limit = _measurer.getLineBreakIndex(_currentPos, WrapWidth);
-
- int wordBreak = limit;
- if (wordBreak < _currentRun) {
- while (wordBreak >= _currentPos && char.IsLetterOrDigit(_s, _charsConsumed + wordBreak))
- wordBreak--;
-
- if (wordBreak > _currentPos)
- limit = wordBreak + 1;
- }
- font.TextLayout layout = _measurer.getLayout(_currentPos, limit);
-
- LineLayout lineLayout = new LineLayout(
- layout,
- this,
- _accumulatedHeight);\r
-\r
- float lineHeight = PadHeight (lineLayout.Ascent + lineLayout.Descent + lineLayout.Leading);
-
- if (Format.LineLimit && (_accumulatedHeight + lineHeight > WrapHeight)) {
- _charsConsumed += _currentPos;
- return null;
- }
-
- _accumulatedHeight += lineHeight + lineLayout.Leading;
-
- _currentPos = limit;
-
- while (_currentPos < _currentRun) {
- if (char.IsWhiteSpace(_s, _charsConsumed + _currentPos))
- _currentPos++;
- else
- break;
- }
- return lineLayout;
- }
-
- internal LineLayout NextLine() {
- if (_currentPos < _currentRun && !Format.NoWrap)
- return NextTextLayoutFromMeasurer();
-
- _charsConsumed += _currentRun;
- if (_charsConsumed >= _s.Length)\r
- return null;\r
-\r
- string s;\r
- int lineBreakIndex = _s.IndexOf(NewLine, _charsConsumed);\r
- if (lineBreakIndex >= 0) {\r
- s = _s.Substring(_charsConsumed, lineBreakIndex - _charsConsumed + NewLine.Length);\r
- }\r
- else\r
- s = _s.Substring(_charsConsumed);\r
-\r
- _currentRun = s.Length;\r
- _currentPos = 0;\r
-\r
- text.AttributedString aS = new text.AttributedString(s);\r
- \r
- // TODO: add more attribs according to StringFormat\r
- aS.addAttribute(font.TextAttribute.FONT, _font.NativeObject);\r
- if((_font.Style & FontStyle.Underline) != FontStyle.Regular)
- aS.addAttribute(font.TextAttribute.UNDERLINE, font.TextAttribute.UNDERLINE_ON);
- if((_font.Style & FontStyle.Strikeout) != FontStyle.Regular)
- aS.addAttribute(font.TextAttribute.STRIKETHROUGH, font.TextAttribute.STRIKETHROUGH_ON);\r
-\r
- text.AttributedCharacterIterator charIter = aS.getIterator();\r
-
- _measurer = new font.TextMeasurer(charIter, _frc);
- return NextTextLayoutFromMeasurer();
- }
-
- internal geom.AffineTransform CalcLineAlignmentTransform() {
- if (Format.LineAlignment == StringAlignment.Near)\r
- return null;\r
- float height = WrapHeight;\r
- if (float.IsPositiveInfinity(height))\r
- height = 0;\r
-\r
- float shift = height - AccumulatedHeight;\r
- if (height > 0 && shift <= 0)\r
- return null;\r
-\r
- if (Format.LineAlignment == StringAlignment.Center)\r
- shift /= 2;\r
- else\r
- if (Format.IsVertical && Format.IsRightToLeft)\r
- return null;\r
-\r
- return Format.IsVertical ?\r
- geom.AffineTransform.getTranslateInstance(shift, 0) :\r
- geom.AffineTransform.getTranslateInstance(0, shift);
- }
-
- #endregion
- }
-}
+++ /dev/null
-/AdvancedStroke.jvm.cs -crlf
-/PlainImage.jvm.cs -crlf
-/PlainImageCollection.jvm.cs -crlf
-/StrokeFactory.jvm.cs -crlf
+++ /dev/null
-using System;\r
-using System.Drawing.Drawing2D;\r
-using java.lang;\r
-\r
-using java.awt;\r
-using java.awt.geom;\r
-using sun.dc.path;\r
-using sun.dc.pr;\r
-\r
-namespace System.Drawing {\r
-\r
- internal enum PenFit {\r
- NotThin,\r
- Thin,\r
- ThinAntiAlias\r
- }\r
-\r
- internal class AdvancedStroke : Stroke {\r
-\r
- public const float PenUnits = 0.01f;\r
- public const int MinPenUnits = 100;\r
- public const int MinPenUnitsAA = 20;\r
- public const float MinPenSizeAA = PenUnits * MinPenUnitsAA;\r
- public const double MinPenSizeAASquared = (MinPenSizeAA * MinPenSizeAA);\r
- public const double MinPenSizeSquared = 1.000000001;\r
- public const double MinPenSizeNorm = 1.5;\r
- public const double MinPenSizeSquaredNorm = (MinPenSizeNorm * MinPenSizeNorm);\r
-\r
- /**\r
- * Joins path segments by extending their outside edges until\r
- * they meet.\r
- */\r
- public const int JOIN_MITER = 0;\r
-\r
- /**\r
- * Joins path segments by rounding off the corner at a radius\r
- * of half the line width.\r
- */\r
- public const int JOIN_ROUND = 1;\r
-\r
- /**\r
- * Joins path segments by connecting the outer corners of their\r
- * wide outlines with a straight segment.\r
- */\r
- public const int JOIN_BEVEL = 2;\r
-\r
- /**\r
- * Ends unclosed subpaths and dash segments with no added\r
- * decoration.\r
- */\r
- public const int CAP_BUTT = 0;\r
-\r
- /**\r
- * Ends unclosed subpaths and dash segments with a round\r
- * decoration that has a radius equal to half of the width\r
- * of the pen.\r
- */\r
- public const int CAP_ROUND = 1;\r
-\r
- /**\r
- * Ends unclosed subpaths and dash segments with a square\r
- * projection that extends beyond the end of the segment\r
- * to a distance equal to half of the line width.\r
- */\r
- public const int CAP_SQUARE = 2;\r
-\r
- float width;\r
-\r
- int join;\r
- int cap;\r
- float miterlimit;\r
-\r
- float[] dash;\r
- float dash_phase;\r
-\r
- AffineTransform _penTransform;\r
- AffineTransform _outputTransform;\r
- PenFit _penFit;\r
-\r
- /**\r
- * Constructs a new <code>AdvancedStroke</code> with the specified\r
- * attributes.\r
- * @param width the width of this <code>AdvancedStroke</code>. The\r
- * width must be greater than or equal to 0.0f. If width is\r
- * set to 0.0f, the stroke is rendered as the thinnest\r
- * possible line for the target device and the antialias\r
- * hint setting.\r
- * @param cap the decoration of the ends of a <code>AdvancedStroke</code>\r
- * @param join the decoration applied where path segments meet\r
- * @param miterlimit the limit to trim the miter join. The miterlimit\r
- * must be greater than or equal to 1.0f.\r
- * @param dash the array representing the dashing pattern\r
- * @param dash_phase the offset to start the dashing pattern\r
- * @throws IllegalArgumentException if <code>width</code> is negative\r
- * @throws IllegalArgumentException if <code>cap</code> is not either\r
- * CAP_BUTT, CAP_ROUND or CAP_SQUARE\r
- * @throws IllegalArgumentException if <code>miterlimit</code> is less\r
- * than 1 and <code>join</code> is JOIN_MITER\r
- * @throws IllegalArgumentException if <code>join</code> is not\r
- * either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER\r
- * @throws IllegalArgumentException if <code>dash_phase</code>\r
- * is negative and <code>dash</code> is not <code>null</code>\r
- * @throws IllegalArgumentException if the length of\r
- * <code>dash</code> is zero\r
- * @throws IllegalArgumentException if dash lengths are all zero.\r
- */\r
- public AdvancedStroke(float width, int cap, int join, float miterlimit,\r
- float[] dash, float dash_phase, AffineTransform penTransform,\r
- AffineTransform outputTransform, PenFit penFit) {\r
- if (width < 0.0f) {\r
- throw new IllegalArgumentException("negative width");\r
- }\r
- if (cap != CAP_BUTT && cap != CAP_ROUND && cap != CAP_SQUARE) {\r
- throw new IllegalArgumentException("illegal end cap value");\r
- }\r
- if (join == JOIN_MITER) {\r
- if (miterlimit < 1.0f) {\r
- throw new IllegalArgumentException("miter limit < 1");\r
- }\r
- } else if (join != JOIN_ROUND && join != JOIN_BEVEL) {\r
- throw new IllegalArgumentException("illegal line join value");\r
- }\r
- if (dash != null) {\r
- if (dash_phase < 0.0f) {\r
- throw new IllegalArgumentException("negative dash phase");\r
- }\r
- bool allzero = true;\r
- for (int i = 0; i < dash.Length; i++) {\r
- float d = dash[i];\r
- if (d > 0.0) {\r
- allzero = false;\r
- } else if (d < 0.0) {\r
- throw new IllegalArgumentException("negative dash length");\r
- }\r
- }\r
- if (allzero) {\r
- throw new IllegalArgumentException("dash lengths all zero");\r
- }\r
- }\r
- this.width = width;\r
- this.cap = cap;\r
- this.join = join;\r
- this.miterlimit = miterlimit;\r
- if (dash != null) {\r
- this.dash = (float []) dash.Clone();\r
- }\r
- this.dash_phase = dash_phase;\r
- this._penTransform = penTransform;\r
- this._outputTransform = outputTransform;\r
- this._penFit = penFit;\r
- }\r
-\r
- /**\r
- * Constructs a solid <code>AdvancedStroke</code> with the specified \r
- * attributes.\r
- * @param width the width of the <code>AdvancedStroke</code>\r
- * @param cap the decoration of the ends of a <code>AdvancedStroke</code>\r
- * @param join the decoration applied where path segments meet\r
- * @param miterlimit the limit to trim the miter join\r
- * @throws IllegalArgumentException if <code>width</code> is negative\r
- * @throws IllegalArgumentException if <code>cap</code> is not either\r
- * CAP_BUTT, CAP_ROUND or CAP_SQUARE\r
- * @throws IllegalArgumentException if <code>miterlimit</code> is less\r
- * than 1 and <code>join</code> is JOIN_MITER\r
- * @throws IllegalArgumentException if <code>join</code> is not\r
- * either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER\r
- */\r
- public AdvancedStroke(float width, int cap, int join, float miterlimit) :\r
- this(width, cap, join, miterlimit, null, 0.0f, null, null, PenFit.NotThin) {\r
- }\r
-\r
- /**\r
- * Constructs a solid <code>AdvancedStroke</code> with the specified \r
- * attributes. The <code>miterlimit</code> parameter is \r
- * unnecessary in cases where the default is allowable or the \r
- * line joins are not specified as JOIN_MITER.\r
- * @param width the width of the <code>AdvancedStroke</code>\r
- * @param cap the decoration of the ends of a <code>AdvancedStroke</code>\r
- * @param join the decoration applied where path segments meet\r
- * @throws IllegalArgumentException if <code>width</code> is negative\r
- * @throws IllegalArgumentException if <code>cap</code> is not either\r
- * CAP_BUTT, CAP_ROUND or CAP_SQUARE\r
- * @throws IllegalArgumentException if <code>join</code> is not\r
- * either JOIN_ROUND, JOIN_BEVEL, or JOIN_MITER\r
- */\r
- public AdvancedStroke(float width, int cap, int join) :\r
- this(width, cap, join, 10.0f, null, 0.0f, null, null, PenFit.NotThin) {\r
- }\r
-\r
- /**\r
- * Constructs a solid <code>AdvancedStroke</code> with the specified \r
- * line width and with default values for the cap and join \r
- * styles.\r
- * @param width the width of the <code>AdvancedStroke</code>\r
- * @throws IllegalArgumentException if <code>width</code> is negative\r
- */\r
- public AdvancedStroke(float width) :\r
- this(width, CAP_SQUARE, JOIN_MITER, 10.0f, null, 0.0f, null, null, PenFit.NotThin) {\r
- }\r
-\r
- /**\r
- * Constructs a new <code>AdvancedStroke</code> with defaults for all \r
- * attributes.\r
- * The default attributes are a solid line of width 1.0, CAP_SQUARE,\r
- * JOIN_MITER, a miter limit of 10.0.\r
- */\r
- public AdvancedStroke() :\r
- this(1.0f, CAP_SQUARE, JOIN_MITER, 10.0f, null, 0.0f, null, null, PenFit.NotThin) {\r
- }\r
-\r
-\r
- /**\r
- * Returns a <code>Shape</code> whose interior defines the \r
- * stroked outline of a specified <code>Shape</code>.\r
- * @param s the <code>Shape</code> boundary be stroked\r
- * @return the <code>Shape</code> of the stroked outline.\r
- */\r
- public Shape createStrokedShape(Shape s) {\r
- FillAdapter filler = new FillAdapter();\r
- PathStroker stroker = new PathStroker(filler);\r
- PathConsumer consumer;\r
-\r
- stroker.setPenDiameter(width);\r
- switch (_penFit) {\r
- case PenFit.Thin:\r
- stroker.setPenFitting(PenUnits, MinPenUnits);\r
- break;\r
- case PenFit.ThinAntiAlias:\r
- stroker.setPenFitting(PenUnits, MinPenUnitsAA);\r
- break;\r
- }\r
-\r
- float[] t4 = null;\r
- if (PenTransform != null && !PenTransform.isIdentity() && (PenTransform.getDeterminant() > 1e-25)) {\r
- t4 = new float[]{\r
- (float)PenTransform.getScaleX(), (float)PenTransform.getShearY(), \r
- (float)PenTransform.getShearX(), (float)PenTransform.getScaleY()\r
- };\r
- }\r
-\r
- float[] t6 = null;\r
- if (OutputTransform != null && !OutputTransform.isIdentity()) {\r
- t6 = new float[] {\r
- (float)OutputTransform.getScaleX(), (float)OutputTransform.getShearY(), \r
- (float)OutputTransform.getShearX(), (float)OutputTransform.getScaleY(),\r
- (float)OutputTransform.getTranslateX(), (float)OutputTransform.getTranslateY()\r
- };\r
- }\r
-\r
- stroker.setPenT4(t4);\r
- stroker.setOutputT6(t6);\r
- stroker.setCaps(RasterizerCaps[cap]);\r
- stroker.setCorners(RasterizerCorners[join], miterlimit);\r
- if (dash != null) {\r
- PathDasher dasher = new PathDasher(stroker);\r
- dasher.setDash(dash, dash_phase);\r
- dasher.setDashT4(t4);\r
- consumer = dasher;\r
- } else {\r
- consumer = stroker;\r
- }\r
-\r
- PathIterator pi = s.getPathIterator(null);\r
-\r
- try {\r
- consumer.beginPath();\r
- bool pathClosed = false;\r
- float mx = 0.0f;\r
- float my = 0.0f;\r
- float[] point = new float[6];\r
-\r
- while (!pi.isDone()) {\r
- int type = pi.currentSegment(point);\r
- if (pathClosed == true) {\r
- pathClosed = false;\r
- if (type != PathIterator__Finals.SEG_MOVETO) {\r
- // Force current point back to last moveto point\r
- consumer.beginSubpath(mx, my);\r
- }\r
- }\r
- switch ((GraphicsPath.JPI)type) {\r
- case GraphicsPath.JPI.SEG_MOVETO:\r
- mx = point[0];\r
- my = point[1];\r
- consumer.beginSubpath(point[0], point[1]);\r
- break;\r
- case GraphicsPath.JPI.SEG_LINETO:\r
- consumer.appendLine(point[0], point[1]);\r
- break;\r
- case GraphicsPath.JPI.SEG_QUADTO:\r
- // Quadratic curves take two points\r
- consumer.appendQuadratic(point[0], point[1],\r
- point[2], point[3]);\r
- break;\r
- case GraphicsPath.JPI.SEG_CUBICTO:\r
- // Cubic curves take three points\r
- consumer.appendCubic(point[0], point[1],\r
- point[2], point[3],\r
- point[4], point[5]);\r
- break;\r
- case GraphicsPath.JPI.SEG_CLOSE:\r
- consumer.closedSubpath();\r
- pathClosed = true;\r
- break;\r
- }\r
- pi.next();\r
- }\r
-\r
- consumer.endPath();\r
- } catch (PathException e) {\r
- throw new InternalError("Unable to Stroke shape ("+\r
- e.Message+")");\r
- }\r
-\r
- return filler.getShape();\r
- }\r
-\r
- /**\r
- * Returns the line width. Line width is represented in user space, \r
- * which is the default-coordinate space used by Java 2D. See the\r
- * <code>Graphics2D</code> class comments for more information on\r
- * the user space coordinate system.\r
- * @return the line width of this <code>AdvancedStroke</code>.\r
- * @see Graphics2D\r
- */\r
- public float getLineWidth() {\r
- return width;\r
- }\r
-\r
- /**\r
- * Returns the end cap style.\r
- * @return the end cap style of this <code>AdvancedStroke</code> as one\r
- * of the static <code>int</code> values that define possible end cap\r
- * styles.\r
- */\r
- public int getEndCap() {\r
- return cap;\r
- }\r
-\r
- /**\r
- * Returns the line join style.\r
- * @return the line join style of the <code>AdvancedStroke</code> as one\r
- * of the static <code>int</code> values that define possible line\r
- * join styles.\r
- */\r
- public int getLineJoin() {\r
- return join;\r
- }\r
-\r
- /**\r
- * Returns the limit of miter joins.\r
- * @return the limit of miter joins of the <code>AdvancedStroke</code>.\r
- */\r
- public float getMiterLimit() {\r
- return miterlimit;\r
- }\r
-\r
- /**\r
- * Returns the array representing the lengths of the dash segments.\r
- * Alternate entries in the array represent the user space lengths\r
- * of the opaque and transparent segments of the dashes.\r
- * As the pen moves along the outline of the <code>Shape</code>\r
- * to be stroked, the user space\r
- * distance that the pen travels is accumulated. The distance\r
- * value is used to index into the dash array.\r
- * The pen is opaque when its current cumulative distance maps\r
- * to an even element of the dash array and transparent otherwise.\r
- * @return the dash array.\r
- */\r
- public float[] getDashArray() {\r
- if (dash == null) {\r
- return null;\r
- }\r
-\r
- return (float[]) dash.Clone();\r
- }\r
-\r
- /**\r
- * Returns the current dash phase.\r
- * The dash phase is a distance specified in user coordinates that \r
- * represents an offset into the dashing pattern. In other words, the dash \r
- * phase defines the point in the dashing pattern that will correspond to \r
- * the beginning of the stroke.\r
- * @return the dash phase as a <code>float</code> value.\r
- */\r
- public float getDashPhase() {\r
- return dash_phase;\r
- }\r
-\r
- /**\r
- * Returns the hashcode for this stroke.\r
- * @return a hash code for this stroke.\r
- */\r
- public override int GetHashCode() {\r
- int hash = Float.floatToIntBits(width);\r
- hash = hash * 31 + join;\r
- hash = hash * 31 + cap;\r
- hash = hash * 31 + Float.floatToIntBits(miterlimit);\r
- if (dash != null) {\r
- hash = hash * 31 + Float.floatToIntBits(dash_phase);\r
- for (int i = 0; i < dash.Length; i++) {\r
- hash = hash * 31 + Float.floatToIntBits(dash[i]);\r
- }\r
- }\r
- return hash;\r
- }\r
-\r
- /**\r
- * Returns true if this AdvancedStroke represents the same\r
- * stroking operation as the given argument.\r
- */\r
- /**\r
- * Tests if a specified object is equal to this <code>AdvancedStroke</code>\r
- * by first testing if it is a <code>AdvancedStroke</code> and then comparing \r
- * its width, join, cap, miter limit, dash, and dash phase attributes with \r
- * those of this <code>AdvancedStroke</code>.\r
- * @param obj the specified object to compare to this \r
- * <code>AdvancedStroke</code>\r
- * @return <code>true</code> if the width, join, cap, miter limit, dash, and\r
- * dash phase are the same for both objects;\r
- * <code>false</code> otherwise.\r
- */\r
- public override bool Equals(object obj) {\r
- if (!(obj is AdvancedStroke)) {\r
- return false;\r
- }\r
-\r
- AdvancedStroke bs = (AdvancedStroke) obj;\r
- if (width != bs.width) {\r
- return false;\r
- }\r
-\r
- if (join != bs.join) {\r
- return false;\r
- }\r
-\r
- if (cap != bs.cap) {\r
- return false;\r
- }\r
-\r
- if (miterlimit != bs.miterlimit) {\r
- return false;\r
- }\r
-\r
- if (dash != null) {\r
- if (dash_phase != bs.dash_phase) {\r
- return false;\r
- }\r
-\r
- if (!java.util.Arrays.equals(dash, bs.dash)) {\r
- return false;\r
- }\r
- }\r
- else if (bs.dash != null) {\r
- return false;\r
- }\r
-\r
- return true;\r
- }\r
-\r
- public AffineTransform PenTransform { \r
- get{\r
- return _penTransform;\r
- }\r
- set{\r
- _penTransform = value;\r
- }\r
- }\r
-\r
- public AffineTransform OutputTransform {\r
- get {\r
- return _outputTransform;\r
- }\r
- set {\r
- _outputTransform = value;\r
- }\r
- }\r
-\r
- private static readonly int[] RasterizerCaps = {\r
- Rasterizer.BUTT, Rasterizer.ROUND, Rasterizer.SQUARE\r
- };\r
-\r
- private static readonly int[] RasterizerCorners = {\r
- Rasterizer.MITER, Rasterizer.ROUND, Rasterizer.BEVEL\r
- };\r
-\r
- #region FillAdapter\r
-\r
- private class FillAdapter : PathConsumer {\r
- bool closed;\r
- GeneralPath path;\r
-\r
- public FillAdapter() {\r
- path = new GeneralPath(GeneralPath.WIND_NON_ZERO);\r
- }\r
-\r
- public Shape getShape() {\r
- return path;\r
- }\r
-\r
- public void beginPath() {}\r
-\r
- public void beginSubpath(float x0, float y0) {\r
- if (closed) {\r
- path.closePath();\r
- closed = false;\r
- }\r
- path.moveTo(x0, y0);\r
- }\r
-\r
- public void appendLine(float x1, float y1) {\r
- path.lineTo(x1, y1);\r
- }\r
-\r
- public void appendQuadratic(float xm, float ym, float x1, float y1) {\r
- path.quadTo(xm, ym, x1, y1);\r
- }\r
-\r
- public void appendCubic(float xm, float ym,\r
- float xn, float yn,\r
- float x1, float y1) {\r
- path.curveTo(xm, ym, xn, yn, x1, y1);\r
- }\r
-\r
- public void closedSubpath() {\r
- closed = true;\r
- }\r
-\r
- public void endPath() {\r
- if (closed) {\r
- path.closePath();\r
- closed = false;\r
- }\r
- }\r
-\r
- public virtual PathConsumer getConsumer () {\r
- return this;\r
- }\r
-\r
- public void useProxy(FastPathProducer proxy) {\r
- proxy.sendTo(this);\r
- }\r
-\r
- public long getCPathConsumer() {\r
- return 0;\r
- }\r
-\r
- public void dispose() {\r
- }\r
- }\r
-\r
- #endregion\r
- }\r
-}\r
+++ /dev/null
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Runtime.InteropServices;
-
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing
-{
- /// <summary>
- /// Summary description for BasicShape.
- /// </summary>
- public abstract class BasicShape : MarshalByRefObject, awt.Shape, IDisposable
- {
- awt.Shape _shape;
-
- protected BasicShape(awt.Shape shape)
- {
- _shape = shape;
- }
-
- protected awt.Shape Shape {
- get {
- return _shape;
- }
- set {
- _shape = value;
- }
- }
-
- #region IDisposable
- public void Dispose () {
- Dispose (true);
- }
-
- void Dispose (bool disposing) {
- }
- #endregion
-
- #region Shape Members
-
- awt.Rectangle awt.Shape.getBounds() {
- return Shape.getBounds();
- }
-
- bool awt.Shape.contains(double arg_0, double arg_1) {
- return Shape.contains(arg_0, arg_1);
- }
-
- bool awt.Shape.contains(geom.Point2D arg_0) {
- return Shape.contains(arg_0);
- }
-
- bool awt.Shape.contains(double arg_0, double arg_1, double arg_2, double arg_3) {
- return Shape.contains(arg_0, arg_1, arg_2, arg_3);
- }
-
- bool awt.Shape.contains(geom.Rectangle2D arg_0) {
- return Shape.contains(arg_0);
- }
-
- geom.PathIterator awt.Shape.getPathIterator(geom.AffineTransform arg_0) {
- return Shape.getPathIterator(arg_0);
- }
-
- geom.PathIterator awt.Shape.getPathIterator(geom.AffineTransform arg_0, double arg_1) {
- return Shape.getPathIterator(arg_0, arg_1);
- }
-
- geom.Rectangle2D awt.Shape.getBounds2D() {
- return Shape.getBounds2D();
- }
-
- bool awt.Shape.intersects(double arg_0, double arg_1, double arg_2, double arg_3) {
- return Shape.intersects(arg_0, arg_1, arg_2, arg_3);
- }
-
- bool awt.Shape.intersects(geom.Rectangle2D arg_0) {
- return Shape.intersects(arg_0);
- }
-
- #endregion
- }
-}
+++ /dev/null
-using System;
-using System.IO;
-using System.Drawing.Imaging;
-using System.Runtime.Serialization;
-using Mainsoft.Drawing.Imaging;
-
-using io = java.io;
-using imageio = javax.imageio;
-using stream = javax.imageio.stream;
-using spi = javax.imageio.spi;
-using BufferedImage = java.awt.image.BufferedImage;
-using JavaImage = java.awt.Image;
-using awt = java.awt;
-using image = java.awt.image;
-
-namespace System.Drawing
-{
- public sealed class Bitmap : Image {
-
- # region Static fields
-
- static readonly image.ColorModel _jpegColorModel = new image.DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0);
-
- #endregion
-
- #region constructors
-
- Bitmap (PlainImage orig) {
- base.Initialize( orig, false );
- }
-
- [MonoTODO]
- private Bitmap (SerializationInfo info, StreamingContext context) {
- throw new NotImplementedException ();
- }
-
- public Bitmap (int width, int height, Graphics g)
- :this (width, height, PixelFormat.Format32bppArgb) {
- CurrentImage.HorizontalResolution = g.DpiX;
- CurrentImage.VerticalResolution = g.DpiY;
- }
-
- public Bitmap (Image original)
- :this (original, original.Size) {}
-
- public Bitmap (Image orig, Size newSize)
- :this (orig, newSize.Width, newSize.Height) {}
-
- public Bitmap (Image orig, int width, int height)
- :base (CreateScaledImage (orig, width, height), ImageFormat.MemoryBmp) {}
-
- internal Bitmap (java.awt.Image nativeObject, ImageFormat format)
- :base (nativeObject, format) {}
-
- [MonoTODO]
- private Bitmap (java.awt.Image nativeObject, ImageFormat format, PixelFormat pixFormat)
- :this (nativeObject, format) {
- if (pixFormat != this.PixelFormat)
- throw new NotImplementedException ("Converting PixelFormat is not implemented yet.");
- }
-
- public Bitmap (int width, int height)
- :this (width, height, PixelFormat.Format32bppArgb) {}
-
- public Bitmap (int width, int height, PixelFormat format)
- :base (
- new java.awt.image.BufferedImage (width, height,
- ToBufferedImageFormat (format)),
- ImageFormat.Bmp) {
- }
-
- public Bitmap (Stream stream)
- :this (stream, false) {}
-
- public Bitmap (string filename)
- :this (filename, false) {}
-
- [MonoTODO]
- public Bitmap (Stream stream, bool useIcm)
- :this (stream, useIcm, null) {}
-
- [MonoTODO]
- public Bitmap (string filename, bool useIcm)
- :this (filename, useIcm, null) {}
-
- internal Bitmap (Stream stream, bool useIcm, ImageFormat format) {
- // TBD: useIcm param
- io.InputStream jis = vmw.common.IOUtils.ToInputStream (stream);
- Initialize (new stream.MemoryCacheImageInputStream (jis), format);
- }
-
- internal Bitmap (string filename, bool useIcm, ImageFormat format) {
- using(FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read)) {
- // TBD: useIcm param
- io.InputStream jis = vmw.common.IOUtils.ToInputStream (stream);
- Initialize (new stream.MemoryCacheImageInputStream (jis), format);
- }
- }
-
- public Bitmap (Type type, string resource) {
- using (Stream s = type.Assembly.GetManifestResourceStream (resource)) {
- if (s == null)
- throw new ArgumentException("Resource '" + resource + "' could not be found in class '" + type.ToString() + "'");
-
- io.InputStream jis = vmw.common.IOUtils.ToInputStream (s);
- Initialize (new stream.MemoryCacheImageInputStream (jis), null);
- }
- }
-#if INTPTR_SUPPORT
- [MonoTODO]
- public Bitmap (int width, int height, int stride, PixelFormat format, IntPtr scan0)
- {
- throw new NotImplementedException();
- }
-#endif
- #endregion
-
- #region Internal Initialization
-
- private void Initialize (stream.ImageInputStream input, ImageFormat format) {
- ImageCodec ic = null;
-
- if (format == null)
- ic = ImageCodec.CreateReader(input);
- else
- ic = ImageCodec.CreateReader(format);
-
- if (ic == null)
- throw new ArgumentException ("Parameter is not valid.");
-
- try {
- ic.NativeStream = input;
- PlainImage pi = ic.ReadPlainImage();
- base.Initialize( pi, false );
-
- pi = ic.ReadNextPlainImage();
- while ( pi != null) {
- base.Initialize( pi, true );
- pi = ic.ReadNextPlainImage();
- }
-
- _flags |= (int)(ImageFlags.ImageFlagsReadOnly | ImageFlags.ImageFlagsHasRealPixelSize);
- }
- catch (IOException ex) {
- throw ex;
- }
- finally {
- ic.Dispose();
- }
- }
-
- #endregion
-
- #region InternalSave
- protected override void InternalSave (stream.ImageOutputStream output, Guid clsid) {
-
- ImageCodec ic = ImageCodec.CreateWriter( clsid );
- using (ic) {
-
- PlainImage plainImage = CurrentImage;
- plainImage.NativeImage.flush();
-
- if ( ImageCodec.ClsidToImageFormat( clsid ).Equals( ImageFormat.Jpeg ) ) {
- image.ColorModel cm = ((image.BufferedImage)CurrentImage.NativeImage).getColorModel();
- if (cm.hasAlpha()) {
- if (cm is image.DirectColorModel) {
- image.Raster raster = ((image.BufferedImage)CurrentImage.NativeImage).getRaster();
- image.DataBuffer db = raster.getDataBuffer();
- image.DirectColorModel dcm = (image.DirectColorModel)cm;
- image.SinglePixelPackedSampleModel jpegSampleModel = new image.SinglePixelPackedSampleModel(
- db.getDataType(), Width, Height,
- new int[] {dcm.getRedMask(), dcm.getGreenMask(), dcm.getBlueMask()} );
-
- image.BufferedImage tb = new image.BufferedImage(
- _jpegColorModel,
- image.Raster.createWritableRaster( jpegSampleModel, db, null ),
- false, null );
-
- plainImage = new PlainImage( tb, plainImage.Thumbnails, ImageFormat.Jpeg, plainImage.HorizontalResolution, plainImage.VerticalResolution, plainImage.Dimension );
- plainImage.NativeMetadata = plainImage.NativeMetadata;
- }
- }
- }
-
- ic.NativeStream = output;
- ic.WritePlainImage( plainImage );
- }
- }
-
- #endregion
-
- #region private statics: ToBufferedImageFormat, CreateScaledImage
-
- private static int ToBufferedImageFormat (PixelFormat format) {
- switch(format) {
- case PixelFormat.Format16bppGrayScale:
- return BufferedImage.TYPE_USHORT_GRAY;
- case PixelFormat.Format1bppIndexed:
- return BufferedImage.TYPE_BYTE_GRAY;
- case PixelFormat.Format32bppArgb:
- return BufferedImage.TYPE_INT_ARGB;
- case PixelFormat.Format32bppRgb:
- return BufferedImage.TYPE_INT_RGB;
- case PixelFormat.Format32bppPArgb:
- return BufferedImage.TYPE_INT_ARGB_PRE;
- case PixelFormat.Format16bppRgb555:
- return BufferedImage.TYPE_USHORT_555_RGB;
- case PixelFormat.Format16bppRgb565:
- return BufferedImage.TYPE_USHORT_565_RGB;
- case PixelFormat.Indexed:
- return BufferedImage.TYPE_BYTE_INDEXED;
- default:
- return BufferedImage.TYPE_INT_ARGB;
- }
- }
-
- private static java.awt.Image CreateScaledImage(Image original, int width, int height) {
- JavaImage oldscaled = original.CurrentImage.NativeImage.getScaledInstance(width, height,
- JavaImage.SCALE_DEFAULT);
- BufferedImage newimage = new BufferedImage(oldscaled.getWidth(null),
- oldscaled.getHeight(null),
- BufferedImage.TYPE_INT_ARGB);
- java.awt.Graphics2D graphics2d = newimage.createGraphics();
- graphics2d.drawImage(oldscaled, 0, 0, null);
- graphics2d.dispose();
- return newimage;
- }
- #endregion
-
- #region Get-SetPixel
- public Color GetPixel (int x, int y)
- {
-
- int argb = NativeObject.getRGB(x,y);
- return Color.FromArgb(argb);
- }
-
- public void SetPixel (int x, int y, Color color)
- {
- int rgb = color.ToArgb();
- NativeObject.setRGB(x,y,rgb);
- }
- #endregion
-
- #region Clone
- public override object Clone () {
- return new Bitmap ( (PlainImage)CurrentImage.Clone() );
- }
-
- public Bitmap Clone (Rectangle rect, PixelFormat pixFormat)
- {
- return Clone(new RectangleF( rect.X, rect.Y, rect.Width, rect.Height ), pixFormat);
- }
-
- public Bitmap Clone (RectangleF rect, PixelFormat pixFormat)
- {
- PlainImage plainImage = CurrentImage.Clone(false);
- BufferedImage clone = new BufferedImage( (int)rect.Width, (int)rect.Height, ToBufferedImageFormat( pixFormat ) );
- awt.Graphics2D g = clone.createGraphics();
- try {
- g.drawImage( NativeObject, -(int)rect.X, -(int)rect.Y, null );
- }
- finally {
- g.dispose();
- }
-
- plainImage.NativeImage = clone;
- return new Bitmap(plainImage);
- }
- #endregion
-
- #region LockBits
- [MonoTODO]
- public BitmapData LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format) {
- throw new NotImplementedException();
- }
-
-#if NET_2_0
- public
-#endif
- BitmapData LockBits (Rectangle rect, ImageLockMode flags, PixelFormat format, BitmapData bitmapData) {
- throw new NotImplementedException();
- }
- #endregion
-
- #region MakeTransparent
- public void MakeTransparent ()
- {
- Color clr = Color.FromArgb(0,0,0);
- MakeTransparent (clr);
- }
-
- public void MakeTransparent (Color transparentColor)
- {
- image.WritableRaster raster = NativeObject.getRaster();
- int numBands = raster.getNumBands();
- if (numBands != 4)
- return;
-
- int maxWidth = raster.getWidth() + raster.getMinX();
- int maxHeight = raster.getHeight() + raster.getMinY();
- int[] srcPix = new int[numBands];
-
- for (int y = raster.getMinY(); y < maxHeight; y++) {
- for (int x = raster.getMinX(); x < maxWidth; x++) {
- /*srcPix =*/ raster.getPixel(x, y, srcPix);
- if (srcPix[0] == transparentColor.R &&
- srcPix[1] == transparentColor.G &&
- srcPix[2] == transparentColor.B) {
- srcPix[3] = 0;
- raster.setPixel(x, y, srcPix);
- }
- }
- }
- }
- #endregion
-
- #region SetResolution
- public void SetResolution (float xDpi, float yDpi)
- {
- CurrentImage.HorizontalResolution = xDpi;
- CurrentImage.VerticalResolution = yDpi;
- }
- #endregion
-
- #region UnlockBits
- [MonoTODO]
- public void UnlockBits (BitmapData bitmap_data)
- {
- throw new NotImplementedException();
- }
- #endregion
-
- #region NativeObject
- internal new BufferedImage NativeObject {
- get {
- return (BufferedImage)base.NativeObject.CurrentImage.NativeImage;
- }
- }
-
- protected override java.awt.Image[] CloneNativeObjects(java.awt.Image[] src) {
- if (src == null)
- return null;
-
- awt.Image[] dst = new awt.Image[src.Length];
- for (int i = 0; i < dst.Length; i++) {
- BufferedImage image = src[i] as BufferedImage;
- if (image == null)
- throw new ArgumentException(String.Format("Unsupported image type '{0}'", src[i].ToString()), "src");
-
- dst[i] = new BufferedImage(image.getColorModel(), image.copyData(null), image.isAlphaPremultiplied(), null);
- }
-
- return dst;
- }
-
- #endregion
-
- #region InternalPixelFormat
- protected override PixelFormat InternalPixelFormat {
- get {
- int t = NativeObject.getType();
- switch(t) {
- case 11://JavaImage.TYPE_USHORT_GRAY:
- return PixelFormat.Format16bppGrayScale;
- case 10://JavaImage.TYPE_BYTE_GRAY:
- return PixelFormat.Format8bppIndexed;
- case 1: //JavaImage.TYPE_INT_RGB
- return PixelFormat.Format32bppRgb;
- case 2: //JavaImage.TYPE_INT_ARGB:
- return PixelFormat.Format32bppArgb;
- case 3://JavaImage.TYPE_INT_ARGB_PRE:
- return PixelFormat.Format32bppPArgb;
- case 9://JavaImage.TYPE_USHORT_555_RGB:
- return PixelFormat.Format16bppRgb555;
- case 8://JavaImage.TYPE_USHORT_565_RGB:
- return PixelFormat.Format16bppRgb565;
- case 13://JavaImage.TYPE_BYTE_INDEXED:
- return PixelFormat.Indexed;
- //TBD: support this
- case 12://JavaImage.TYPE_BYTE_BINARY:
- case 0://JavaImage.TYPE_CUSTOM:
- case 4://JavaImage.TYPE_INT_BGR:
- case 5://JavaImage.TYPE_3BYTE_BGR:
- case 6://JavaImage.TYPE_4BYTE_ABGR:
- case 7://JavaImage.TYPE_4BYTE_ABGR_PRE:
- default:
- return PixelFormat.Undefined;
- }
- }
- }
- #endregion
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public static Bitmap FromHicon (IntPtr hicon)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static Bitmap FromResource (IntPtr hinstance, string bitmapName) //TBD: Untested
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IntPtr GetHbitmap ()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IntPtr GetHbitmap (Color background)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IntPtr GetHicon ()
- {
- throw new NotImplementedException();
- }
-#endif
-
- }
-}
+++ /dev/null
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Collections;
-
-using awt = java.awt;
-using image = java.awt.image;
-using geom = java.awt.geom;
-
-
-namespace System.Drawing
-{
- public abstract class Brush : MarshalByRefObject, ICloneable, IDisposable, awt.Paint {
-
- #region fields
-
- private Matrix _brushTransform = new Matrix();
-
- #endregion
-
- protected abstract java.awt.Paint NativeObject {
- get;
- }
-
- awt.PaintContext awt.Paint.createContext (image.ColorModel cm,
- awt.Rectangle deviceBounds, geom.Rectangle2D userBounds, geom.AffineTransform xform,
- awt.RenderingHints hints) {
-
- return createContextInternal(cm, deviceBounds, userBounds, xform, hints);
- }
-
- protected virtual awt.PaintContext createContextInternal (image.ColorModel cm,
- awt.Rectangle deviceBounds, geom.Rectangle2D userBounds, geom.AffineTransform xform,
- awt.RenderingHints hints) {
-
- Matrix.Multiply(xform, _brushTransform.NativeObject, MatrixOrder.Append);
- return NativeObject.createContext (cm, deviceBounds, userBounds, xform, hints);
- }
-
- int awt.Transparency.getTransparency () {
- return NativeObject.getTransparency ();
- }
-
- abstract public object Clone ();
-
- public void Dispose () {
- Dispose (true);
- }
-
- protected virtual void Dispose (bool disposing) {
- }
-
- protected Brush InternalClone() {
- Brush brush = (Brush)this.MemberwiseClone();
- brush._brushTransform = this._brushTransform.Clone();
- return brush;
- }
-
- #region Brush transform
-
- internal Matrix BrushTransform {
- get { return _brushTransform.Clone(); }
- set {
- if (value == null)
- throw new ArgumentNullException("matrix");
-
- value.CopyTo( _brushTransform );
- }
- }
-
- protected internal void BrushTranslateTransform (float dx, float dy) {
- BrushTranslateTransform(dx, dy, MatrixOrder.Prepend);
- }
- protected internal void BrushTranslateTransform (float dx, float dy, MatrixOrder order) {
- _brushTransform.Translate(dx,dy,order);
- }
- protected internal void BrushResetTransform () {
- _brushTransform.Reset();
- }
- protected internal void BrushRotateTransform (float angle) {
- BrushRotateTransform(angle, MatrixOrder.Prepend);
- }
- protected internal void BrushRotateTransform (float angle, MatrixOrder order) {
- _brushTransform.Rotate(angle, order);
- }
- protected internal void BrushScaleTransform (float sx, float sy) {
- BrushScaleTransform(sx, sy, MatrixOrder.Prepend);
- }
- protected internal void BrushScaleTransform (float sx, float sy, MatrixOrder order) {
- _brushTransform.Scale(sx, sy, order);
- }
- protected internal void BrushMultiplyTransform (Matrix matrix) {
- BrushMultiplyTransform(matrix, MatrixOrder.Prepend);
- }
- protected internal void BrushMultiplyTransform (Matrix matrix, MatrixOrder order) {
- if (matrix == null)
- throw new ArgumentNullException("matrix");
- _brushTransform.Multiply(matrix, order);
- }
-
- #endregion
- }
-}
-
#if ONLY_1_1
[ComVisible (true)]
#endif
-#if !TARGET_JVM
[Editor ("System.Drawing.Design.ColorEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
-#endif
[Serializable]
public struct Color {
// however it's bad to keep a string (reference) in a struct
internal string name;
// #endif
-#if TARGET_JVM
- internal java.awt.Color NativeObject {
- get {
- return new java.awt.Color (R, G, B, A);
- }
- }
-
- internal static Color FromArgbNamed (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
- {
- Color color = FromArgb (alpha, red, green, blue);
- color.state = (short) (ColorType.Known|ColorType.Named);
- color.name = KnownColors.GetName (knownColor);
- color.knownColor = (short) knownColor;
- return color;
- }
-
- internal static Color FromArgbSystem (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
- {
- Color color = FromArgbNamed (alpha, red, green, blue, name, knownColor);
- color.state |= (short) ColorType.System;
- return color;
- }
-#endif
public string Name {
get {
lock (creatingCached) {
if (cached != null)
return cached;
-#if TARGET_JVM
- Color [] colors = new Color [KnownColors.Values.Length - 1];
- Array.Copy (KnownColors.Values, 1, colors, 0, colors.Length);
-#else
Array colors = Array.CreateInstance (typeof (Color), KnownColors.ArgbValues.Length - 1);
for (int i=1; i < KnownColors.ArgbValues.Length; i++) {
colors.SetValue (KnownColors.FromKnownColor ((KnownColor)i), i - 1);
}
-#endif
Array.Sort (colors, 0, colors.Length, new CompareColors ());
cached = new StandardValuesCollection (colors);
+++ /dev/null
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-using awt = java.awt;
-using TextAttribute = java.awt.font.TextAttribute;
-
-namespace System.Drawing {
- [Serializable]
- public sealed class Font: MarshalByRefObject, ISerializable, ICloneable, IDisposable {
-
- #region variables
-
- const byte DEFAULT_CHARSET = 1;
-
- private readonly GraphicsUnit _gUnit = GraphicsUnit.Point;
- private readonly FontFamily _fontFamily;
- private readonly awt.Font _jFont;
- private readonly byte _charset;
-
- static readonly float [] _screenResolutionConverter = {
- 1, // World
- 1, // Display
- 1, // Pixel
- Graphics.DefaultScreenResolution, // Point
- Graphics.DefaultScreenResolution, // Inch
- Graphics.DefaultScreenResolution, // Document
- Graphics.DefaultScreenResolution // Millimeter
- };
-
-#if NET_2_0
- private readonly string _systemFontName;
-#endif
-
- #endregion
-
- internal awt.Font NativeObject {
- get {
- return _jFont;
- }
- }
-
- #region ISerializable
-
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) {
- info.AddValue("Name", Name);
- info.AddValue("Size", Size);
- info.AddValue("Style", Style, typeof(FontStyle));
- info.AddValue("Unit", Unit, typeof(GraphicsUnit));
- }
-
- #endregion
-
- #region ctors
-
- private Font (SerializationInfo info, StreamingContext context)
- : this(
- info.GetString("Name"),
- info.GetSingle("Size"),
- (FontStyle)info.GetValue("Style", typeof(FontStyle)),
- (GraphicsUnit)info.GetValue("Unit", typeof(GraphicsUnit)) ) {
- }
-
- public Font(Font original, FontStyle style) {
- _jFont = original.NativeObject.deriveFont( DeriveStyle(original.NativeObject.getAttributes(), style, true) );
- _gUnit = original._gUnit;
- _fontFamily = original._fontFamily;
- _charset = original._charset;
- }
-
- public Font(FontFamily family, float emSize)
- : this(family, emSize, FontStyle.Regular, GraphicsUnit.Point, DEFAULT_CHARSET, false) {
- }
-
- public Font(FontFamily family, float emSize, FontStyle style)
- : this(family, emSize, style, GraphicsUnit.Point, DEFAULT_CHARSET, false) {
- }
- public Font(FontFamily family, float emSize, GraphicsUnit unit)
- : this(family, emSize, FontStyle.Regular, unit, DEFAULT_CHARSET, false) {
- }
-
- public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit)
- : this(family, emSize, style, unit, DEFAULT_CHARSET, false) {
- }
-
- public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte charSet)
- : this(family, emSize, style, unit, charSet, false) {
- }
-
- public Font(FontFamily family, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical) {
- if (family == null)
- throw new ArgumentNullException("family");
-
- _gUnit = unit;
- _fontFamily = family;
- _charset = charSet;
-
- java.util.Hashtable attribs = new java.util.Hashtable();
- attribs.put(TextAttribute.FAMILY, family.Name/*TODO: family doungrade possibility*/);
- //init defaults
- attribs.put(TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR);
-
- float newSize = emSize * Graphics.UnitConversion[ (int)_gUnit ];
- attribs.put(TextAttribute.SIZE, new java.lang.Float(newSize));
-
- DeriveStyle(attribs, style, false);
-
- _jFont = family.FamilyFont.deriveFont(attribs);
- }
-
- public Font(string familyName, float emSize)
- : this(familyName, emSize, FontStyle.Regular, GraphicsUnit.Point, (byte)0, false) {
- }
-
- public Font(string familyName, float emSize, FontStyle style)
- : this(familyName, emSize, style, GraphicsUnit.Point, (byte)0, false) {
- }
-
- public Font(string familyName, float emSize, GraphicsUnit unit)
- : this(familyName, emSize, FontStyle.Regular, unit, (byte)0, false) {
- }
-
- public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit)
- : this(familyName, emSize, style, unit, (byte)0, false) {
- }
-
- public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet)
- : this(familyName, emSize, style, unit, charSet, false) {
- }
-
- public Font(string familyName, float emSize, FontStyle style, GraphicsUnit unit, byte charSet, bool isVertical)
- : this (GetFontFamily (familyName), emSize, style, unit, charSet, isVertical) {
- }
-
-#if NET_2_0
- internal Font (string familyName, float emSize, string systemName)
- : this (familyName, emSize) {
- _systemFontName = systemName;
- }
-#endif
-
- static FontFamily GetFontFamily (string familyName) {
-#if ONLY_1_1
- if (familyName == null)
- throw new ArgumentNullException ("familyName");
-#endif
- // NOTE: If family name is null, empty or invalid,
- // MS creates Microsoft Sans Serif font.
- try {
- return new FontFamily (familyName);
- }
- catch {
- return FontFamily.GenericSansSerif;
- }
- }
-
- #endregion
-
- #region IDisposable members
-
- public void Dispose() {
- }
-
- #endregion
-
- #region ICloneable
-
- public object Clone() {
- return (Font)MemberwiseClone();
- }
-
- #endregion
-
- public override bool Equals (object obj)
- {
- Font other = obj as Font;
- if (other == null) {
- return false;
- }
-
- return NativeObject.Equals (other.NativeObject);
- }
-
- public override int GetHashCode ()
- {
- return NativeObject.GetHashCode ();
- }
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public IntPtr ToHfont ()
- {
- throw new NotImplementedException();
- }
-#endif
-
- #region public properties
-
- public bool Bold {
- get {
- return _jFont.isBold();
- }
- }
-
- public FontFamily FontFamily {
- get {
- return _fontFamily;
- }
- }
-
- public byte GdiCharSet {
- get {
- return _charset;
- }
- }
-
- public bool GdiVerticalFont {
- get {
- return Name.StartsWith("@");
- }
- }
-
- public int Height {
- get {
- return FontFamily.Container.getFontMetrics(NativeObject).getHeight();
- }
- }
-
- public float GetHeight () {
- return GetHeight (Graphics.DefaultScreenResolution);
- }
-
- public float GetHeight (float dpi) {
- return (FontFamily.GetLineSpacing (Style) / FontFamily.GetEmHeight (Style))
- * (SizeInPoints / _screenResolutionConverter [(int) Unit])
- * dpi;
- }
-
- public float GetHeight (Graphics graphics) {
- if (graphics == null)
- throw new ArgumentNullException ("graphics");
- return GetHeight (graphics.DpiY);
- }
-
- public bool Italic {
- get {
- return _jFont.isItalic();
- }
- }
-
- public string Name {
- get {
- return _jFont.getName();
- }
- }
-
- public float Size {
- get {
- return SizeInPoints / Graphics.UnitConversion[ (int)_gUnit ];
- }
- }
-
- public float SizeInPoints {
- get {
- return _jFont.getSize2D();
- }
- }
-
- public bool Strikeout {
- get {
- try {
- if((java.lang.Boolean)_jFont.getAttributes().get(TextAttribute.STRIKETHROUGH)
- == TextAttribute.STRIKETHROUGH_ON )
- return true;
- }
- catch {
- }
- return false;
- }
- }
-
- public FontStyle Style {
- get {
- FontStyle style = FontStyle.Regular;
- if (Bold)
- style |= FontStyle.Bold;
- if (Italic)
- style |= FontStyle.Italic;
- if (Underline)
- style |= FontStyle.Underline;
- if (Strikeout)
- style |= FontStyle.Strikeout;
-
- return style;
- }
- }
-
- public bool Underline {
- get {
- try {
- if((java.lang.Integer)_jFont.getAttributes().get(TextAttribute.UNDERLINE)
- == TextAttribute.UNDERLINE_ON )
- return true;
- }
- catch {
- }
- return false;
- }
- }
-
- [TypeConverter(typeof(FontConverter.FontUnitConverter))]
- public GraphicsUnit Unit {
- get {
- return _gUnit;
- }
- }
-
-#if NET_2_0
- [Browsable (false)]
- public bool IsSystemFont {
- get {
- return !string.IsNullOrEmpty (_systemFontName);
- }
- }
-
- [Browsable (false)]
- public string SystemFontName {
- get {
- return _systemFontName;
- }
- }
-#endif
-
- #endregion
-
- public override System.String ToString() {
- return ("[Font: Name="+ Name +", Size="+ Size +", Style="+ Style +", Units="+ Unit +"]");
- }
-
- static internal java.util.Map DeriveStyle(java.util.Map attribs, FontStyle style, bool createNew) {
- java.util.Map newAttribs;
- if (createNew) {
- newAttribs = new java.util.Hashtable( attribs.size() );
- java.util.Iterator it = attribs.keySet().iterator();
- while (it.hasNext ()) {
- object key = it.next ();
- object value = attribs.get (key);
- if (value != null)
- newAttribs.put (key, value);
- }
- }
- else
- newAttribs = attribs;
-
- //Bold
- if((style & FontStyle.Bold) == FontStyle.Bold)
- newAttribs.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
- else
- newAttribs.remove(TextAttribute.WEIGHT);
-
- //Italic
- if((style & FontStyle.Italic) == FontStyle.Italic)
- newAttribs.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
- else
- newAttribs.put(TextAttribute.POSTURE, TextAttribute.POSTURE_REGULAR);
-
- //Underline
- if((style & FontStyle.Underline) == FontStyle.Underline)
- newAttribs.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
- else
- newAttribs.remove(TextAttribute.UNDERLINE);
-
- //Strikeout
- if((style & FontStyle.Strikeout) == FontStyle.Strikeout)
- newAttribs.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
- else
- newAttribs.remove(TextAttribute.STRIKETHROUGH);
-
- return newAttribs;
- }
- }
-}
public FontConverter ()
{
}
-#if !TARGET_JVM
~FontConverter ()
{
// required to match API definition
}
-#endif
public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof (string))
+++ /dev/null
-//
-// System.Drawing.FontFamily.cs
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-// Author: Konstantin Triger (kostat@mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Drawing.Text;
-using System.Text;
-using System.Runtime.InteropServices;
-using System.Globalization;
-using awt = java.awt;
-using geom = java.awt.geom;
-using font = java.awt.font;
-using TextAttribute = java.awt.font.TextAttribute;
-
-namespace System.Drawing {
-
- public sealed class FontFamily : MarshalByRefObject, IDisposable {
-
- static readonly FontFamily _genericMonospace;
- static readonly FontFamily _genericSansSerif;
- static readonly FontFamily _genericSerif;
- static readonly FontCollection _installedFonts;
- internal static readonly awt.Container Container;
-
- static FontFamily() {
- Container = new awt.Container();
- _installedFonts = new InstalledFontCollection();
- _genericMonospace = new FontFamily(GenericFontFamilies.Monospace);
- _genericSansSerif = new FontFamily(GenericFontFamilies.SansSerif);
- _genericSerif = new FontFamily(GenericFontFamilies.Serif);
- }
-
- private readonly string _name;
-
- private awt.FontMetrics _fontMetrics = null;
- private FontStyle _lastStyle = FontStyle.Regular;
- private readonly awt.Font _font;
-
- // this is unavailable through Java API, usually 2048 for TT fonts
- const int UnitsPerEm = 2048;
- // the margin for text drawing
- const int DrawMargin = 571;
-
- #region ctors
-
- // dummy ctors to work around convertor problems
- internal FontFamily() {}
- internal FontFamily(IntPtr family) {}
-
- static string ToGenericFontName(GenericFontFamilies genericFamily) {
- switch(genericFamily) {
- case GenericFontFamilies.SansSerif:
- return "SansSerif";
- case GenericFontFamilies.Serif:
- return "Serif";
- default:
- return "Monospaced";
- }
- }
-
- public FontFamily(string familyName) : this(familyName, null) {
- }
-
- public FontFamily(string name, FontCollection fontCollection) {
- if (name == null)
- throw new ArgumentNullException("name");
-
- if (fontCollection == null)
- fontCollection = _installedFonts;
-
- if (fontCollection.Contains(name))
- _name = name;
- else {
- _name = ToGenericFontName(GenericFontFamilies.SansSerif);
- fontCollection = _installedFonts;
- }
-
- _font = fontCollection.GetInitialFont( _name );
- }
-
- public FontFamily(GenericFontFamilies genericFamily) : this(ToGenericFontName(genericFamily)) {
- }
-
- #endregion
-
- public string Name {
- get {
- return _name;
- }
- }
-
- internal int GetDrawMargin(FontStyle style) {
- return DrawMargin;
- }
-
- awt.FontMetrics GetMetrics(FontStyle style) {
- if ((_lastStyle != style) || (_fontMetrics == null)) {
- java.util.Map attrib = Font.DeriveStyle( FamilyFont.getAttributes(), style, true);
- attrib.put(TextAttribute.SIZE, new java.lang.Float((float)(UnitsPerEm<<1)));
- _fontMetrics = Container.getFontMetrics( FamilyFont.deriveFont( attrib ) );
- }
- return _fontMetrics;
- }
-
- public int GetCellAscent(FontStyle style) {
- return GetMetrics(style).getMaxAscent()>>1;
- }
-
- public int GetCellDescent(FontStyle style) {
- return GetMetrics(style).getMaxDecent()>>1;
- }
-
- public int GetEmHeight(FontStyle style) {
- return UnitsPerEm;
- }
-
- public int GetLineSpacing(FontStyle style) {
- return GetMetrics(style).getHeight()>>1;
- }
-
- public string GetName(int language) {
- try {
- CultureInfo culture = new CultureInfo(language, false);
- java.util.Locale locale = vmw.@internal.EnvironmentUtils.getLocaleFromCultureInfo( culture );
-
- return FamilyFont.getFamily( locale );
- }
- catch {
- return Name;
- }
- }
-
- public bool IsStyleAvailable(FontStyle style) {
- //unable to get this infromation from java
- return true;
- }
-
- #region static members
-
- public static FontFamily[] Families {
- get {
- return _installedFonts.Families;
- }
- }
-
- public static FontFamily GenericMonospace {
- get {
- return (FontFamily)_genericMonospace.MemberwiseClone();
- }
- }
-
- public static FontFamily GenericSansSerif {
- get {
- return (FontFamily)_genericSansSerif.MemberwiseClone();
- }
- }
-
- public static FontFamily GenericSerif {
- get {
- return (FontFamily)_genericSerif.MemberwiseClone();
- }
- }
-
- public static FontFamily[] GetFamilies(Graphics graphics) {
- if (graphics == null) {
- throw new ArgumentNullException("graphics");
- }
- return _installedFonts.Families;
- }
-
- #endregion
-
- #region Object members
-
- public override bool Equals(object obj) {
- if (this == obj)
- return true;
-
- if (!(obj is FontFamily))
- return false;
-
- return string.Compare(Name, ((FontFamily)obj).Name, true) == 0;
- }
-
- public override int GetHashCode() {
- return Name.ToLower().GetHashCode();
- }
-
- public override string ToString() {
- return string.Format("[{0}: Name={1}]", GetType().Name, Name);
- }
-
- #endregion
-
- #region IDisposable Members
-
- public void Dispose() {
- }
-
- #endregion
-
- internal awt.Font FamilyFont {
- get {
- return _font;
- }
- }
- }
-}
-
+++ /dev/null
-using System;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-using System.Drawing.Text;
-using System.ComponentModel;
-using System.Collections;
-using System.Runtime.InteropServices;
-using System.Text;
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing {
- [ComVisible(false)]
- public sealed class Graphics : MarshalByRefObject, IDisposable {
- sealed class DummyStroke : awt.Stroke {
- #region Stroke Members
-
- awt.Shape awt.Stroke.createStrokedShape(awt.Shape arg_0) {
- throw new NotImplementedException("DummyStroke");
- }
-
- #endregion
- }
-
- sealed class NormalizingPathIterator : geom.PathIterator {
-
- #region fields
-
- readonly geom.PathIterator _iter;
-
- const float norm = 0.5f;
- const float rnd = (1.0f - norm);
- float ax = 0.0f;
- float ay = 0.0f;
-
- #endregion
-
- #region ctor
-
- public NormalizingPathIterator(geom.PathIterator iter) {
- _iter = iter;
- }
-
- #endregion
-
- #region methods
-
- static int GetIndex(int type) {
- int index;
- switch ((GraphicsPath.JPI)type) {
- case GraphicsPath.JPI.SEG_CUBICTO:
- index = 4;
- break;
- case GraphicsPath.JPI.SEG_QUADTO:
- index = 2;
- break;
- case GraphicsPath.JPI.SEG_MOVETO:
- case GraphicsPath.JPI.SEG_LINETO:
- index = 0;
- break;
- case GraphicsPath.JPI.SEG_CLOSE:
- default:
- index = -1;
- break;
- }
-
- return index;
- }
-
- #endregion
-
- #region PathIterator Members
-
- void geom.PathIterator.next() {
- _iter.next();
- }
-
- bool geom.PathIterator.isDone() {
- return _iter.isDone();
- }
-
- int geom.PathIterator.currentSegment(float[] point) {
- int type = _iter.currentSegment(point);
-
- int index = GetIndex(type);
-
- if (index >= 0) {
- float ox = point[index];
- float oy = point[index+1];
- float newax = (float) java.lang.Math.floor(ox + rnd) + norm;
- float neway = (float) java.lang.Math.floor(oy + rnd) + norm;
- point[index] = newax;
- point[index+1] = neway;
- newax -= ox;
- neway -= oy;
- switch ((GraphicsPath.JPI)type) {
- case GraphicsPath.JPI.SEG_CUBICTO:
- point[0] += ax;
- point[1] += ay;
- point[2] += newax;
- point[3] += neway;
- break;
- case GraphicsPath.JPI.SEG_QUADTO:
- point[0] += (newax + ax) / 2;
- point[1] += (neway + ay) / 2;
- break;
- // case GraphicsPath.JPI.SEG_MOVETO:
- // case GraphicsPath.JPI.SEG_LINETO:
- // case GraphicsPath.JPI.SEG_CLOSE:
- // break;
- }
- ax = newax;
- ay = neway;
- }
-
- return type;
- }
-
- int geom.PathIterator.currentSegment(double[] point) {
- int type = _iter.currentSegment(point);
-
- int index = GetIndex(type);
-
- if (index >= 0) {
- float ox = (float)point[index];
- float oy = (float)point[index+1];
- float newax = (float)java.lang.Math.floor(ox + rnd) + norm;
- float neway = (float)java.lang.Math.floor(oy + rnd) + norm;
- point[index] = newax;
- point[index+1] = neway;
- newax -= ox;
- neway -= oy;
- switch ((GraphicsPath.JPI)type) {
- case GraphicsPath.JPI.SEG_CUBICTO:
- point[0] += ax;
- point[1] += ay;
- point[2] += newax;
- point[3] += neway;
- break;
- case GraphicsPath.JPI.SEG_QUADTO:
- point[0] += (newax + ax) / 2;
- point[1] += (neway + ay) / 2;
- break;
- // case GraphicsPath.JPI.SEG_MOVETO:
- // case GraphicsPath.JPI.SEG_LINETO:
- // case GraphicsPath.JPI.SEG_CLOSE:
- // break;
- }
- ax = newax;
- ay = neway;
- }
-
- return type;
- }
-
- int geom.PathIterator.getWindingRule() {
- return _iter.getWindingRule();
- }
-
- #endregion
-
- }
-
-
- #region Variables
-
- readonly awt.Graphics2D _nativeObject;
- PixelOffsetMode _pixelOffsetMode = PixelOffsetMode.Default;
- int _textContrast = 4;
- TextRenderingHint _textRenderingHint;
- readonly Image _image;
-
- readonly Matrix _transform;
- GraphicsUnit _pageUnit = GraphicsUnit.Display;
- float _pageScale = 1.0f;
-
- readonly Region _clip;
- readonly awt.Rectangle _windowRect;
-
- GraphicsState _nextGraphicsState = null;
-
- static readonly float [] _unitConversion = {
- 1, // World
- 1, // Display
- 1, // Pixel
- DefaultScreenResolution / 72.0f, // Point
- DefaultScreenResolution, // Inch
- DefaultScreenResolution / 300.0f,// Document
- DefaultScreenResolution / 25.4f // Millimeter
- };
-
- static int _isHeadless;
- static internal bool IsHeadless {
- get {
- if (_isHeadless == 0) {
- bool isHeadless = awt.GraphicsEnvironment.isHeadless();
- if (!isHeadless) {
- try {
- awt.Toolkit.getDefaultToolkit();
- }
- catch{
- isHeadless = true;
- }
- }
-
- _isHeadless = isHeadless ? 2 : 1;
- }
-
- return _isHeadless > 1;
- }
- }
-
- #endregion
-
-#if INTPTR_SUPPORT
- [ComVisible(false)]
- public delegate bool EnumerateMetafileProc (EmfPlusRecordType recordType,
- int flags,
- int dataSize,
- IntPtr data,
- PlayRecordCallback callbackData);
- [ComVisible (false)]
- public delegate bool DrawImageAbort (IntPtr callbackData);
-#endif
-
- #region Constr. and Destr.
- private Graphics (Image image) {
- _nativeObject = (awt.Graphics2D)image.NativeObject.CurrentImage.NativeImage.getGraphics();
- _image = image;
- _transform = new Matrix ();
-
- NativeObject.setStroke(new DummyStroke());
- NativeObject.setRenderingHint(awt.RenderingHints.KEY_COLOR_RENDERING, awt.RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-
- InterpolationMode = InterpolationMode.Bilinear;
- TextRenderingHint = TextRenderingHint.SystemDefault;
-
- _windowRect = new awt.Rectangle(_image.Width, _image.Height);
- _clip = new Region();
- }
-
- #endregion
-
- #region Internal Accessors
-
- static internal float [] UnitConversion {
- get {
- return _unitConversion;
- }
- }
-
- static internal int DefaultScreenResolution {
- get {
- return IsHeadless ? 96 :
- awt.Toolkit.getDefaultToolkit().getScreenResolution();
- }
- }
-
- internal java.awt.Graphics2D NativeObject {
- get {
- return _nativeObject;
- }
- }
- #endregion
-
- #region FromImage (static accessor)
- public static Graphics FromImage (Image image) {
- return new Graphics(image);
- }
- #endregion
-
-
- #region Workers [INTERNAL]
- void DrawShape(Pen pen, awt.Shape shape) {
- if (pen == null)
- throw new ArgumentNullException("pen");
-
- if (StrokeFactory.CanCreateAdvancedStroke &&
- (!pen.CanCreateBasicStroke || !NeedsNormalization)) {
- geom.AffineTransform oldT = NativeObject.getTransform();
- NativeObject.setTransform(Matrix.IdentityTransform.NativeObject);
-
- try {
- geom.AffineTransform t = GetFinalTransform();
- if (!oldT.isIdentity()) {
- t = (geom.AffineTransform)t.clone();
- t.preConcatenate(oldT);
- }
-
- double widthsquared = pen.GetSquaredTransformedWidth(t);
-
- bool antiAlias = (SmoothingMode == SmoothingMode.AntiAlias);
-
- bool thin = (widthsquared <= (antiAlias ?
- AdvancedStroke.MinPenSizeAASquared :
- AdvancedStroke.MinPenSizeSquared));
-
- PenFit penFit = thin ? (antiAlias ? PenFit.ThinAntiAlias : PenFit.Thin) : PenFit.NotThin;
-
- if (NeedsNormalization) {
-
- bool normThin =
- widthsquared <= AdvancedStroke.MinPenSizeSquaredNorm;
-
- if (normThin) {
- shape = GetNormalizedShape(shape, t);
- shape = pen.GetNativeObject(
- t, null, penFit).createStrokedShape(shape);
- }
- else {
- shape = pen.GetNativeObject(t, penFit).createStrokedShape(shape);
- shape = GetNormalizedShape(shape, null);
- }
- }
- else {
- shape = pen.GetNativeObject(t, penFit).createStrokedShape(shape);
- }
-
- FillScaledShape(pen.Brush, shape);
- }
- finally {
- NativeObject.setTransform(oldT);
- }
- }
- else {
- awt.Stroke oldStroke = NativeObject.getStroke();
- NativeObject.setStroke(pen.GetNativeObject(null, PenFit.NotThin));
- try {
-
- NativeObject.setPaint(pen.Brush);
-
- geom.AffineTransform oldT = NativeObject.getTransform();
- NativeObject.transform(GetFinalTransform());
- try {
- NativeObject.draw(shape);
- }
- finally {
- NativeObject.setTransform(oldT);
- }
- }
- finally {
- NativeObject.setStroke(oldStroke);
- }
- }
- }
- void FillShape(Brush paint, awt.Shape shape) {
- if (paint == null)
- throw new ArgumentNullException("brush");
-
- geom.AffineTransform oldT = null;
- if (NeedsNormalization) {
- oldT = NativeObject.getTransform();
- geom.AffineTransform t = GetFinalTransform();
- if (!oldT.isIdentity()) {
- t = (geom.AffineTransform) t.clone ();
- t.preConcatenate(oldT);
- }
- shape = GetNormalizedShape(shape, t);
- }
- else {
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity())
- shape = t.createTransformedShape(shape);
- }
-
- if (oldT != null)
- NativeObject.setTransform(Matrix.IdentityTransform.NativeObject);
-
- try {
- FillScaledShape(paint, shape);
- }
- finally {
- if (oldT != null)
- NativeObject.setTransform(oldT);
- }
- }
-
- bool NeedsNormalization {
- get {
- return PixelOffsetMode != PixelOffsetMode.Half &&
- PixelOffsetMode != PixelOffsetMode.HighQuality;
- }
- }
-
- static awt.Shape GetNormalizedShape(awt.Shape shape, geom.AffineTransform t) {
- geom.PathIterator iter = new NormalizingPathIterator(shape.getPathIterator(t));
-
- geom.GeneralPath path = new geom.GeneralPath(iter.getWindingRule());
- path.append(iter, false);
- return path;
- }
-
- void FillScaledShape(Brush paint, awt.Shape shape) {
- Matrix m = null;
- if (!(paint is SolidBrush || paint is HatchBrush) && !_transform.IsIdentity) {
- m = paint.BrushTransform;
- paint.BrushMultiplyTransform( _transform );
- }
-
- try {
- NativeObject.setPaint(paint);
- NativeObject.fill(shape);
- }
- finally {
- if (m != null)
- paint.BrushTransform = m;
- }
- }
-
- #endregion
-
- #region Dispose
- public void Dispose() {
- NativeObject.dispose();
- }
- #endregion
-
- #region Clear
- public void Clear (Color color) {
- FillScaledShape(new SolidBrush( color ), _clip.NativeObject);
- }
- #endregion
-
- #region DrawArc
- public void DrawArc (Pen pen, Rectangle rect, float startAngle, float sweepAngle) {
- DrawArc (pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- startAngle,
- sweepAngle);
- }
-
-
- public void DrawArc (Pen pen, RectangleF rect, float startAngle, float sweepAngle) {
- DrawArc (pen,
- rect.X,
- rect.Y,
- rect.Width,
- rect.Height,
- startAngle,
- sweepAngle);
- }
-
- public void DrawArc (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) {
- DrawArc(pen,
- (float)x,
- (float)y,
- (float)width,
- (float)height,
- (float)startAngle,
- (float)sweepAngle);
- }
-
- public void DrawArc (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle) {
- GraphicsPath path = new GraphicsPath();
- path.AddArc(x, y, width, height, startAngle, sweepAngle);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawBezier(s)
- public void DrawBezier (Pen pen, PointF pt1, PointF pt2, PointF pt3, PointF pt4) {
- DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
- }
-
- public void DrawBezier (Pen pen, Point pt1, Point pt2, Point pt3, Point pt4) {
- DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y);
- }
-
- public void DrawBezier (Pen pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) {
- geom.GeneralPath path = new geom.GeneralPath();
- path.moveTo(x1,y1);
- path.curveTo(x2,y2,x3,y3,x4,y4);
- DrawShape(pen, path);
- }
-
- public void DrawBeziers (Pen pen, Point [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddBeziers(points);
- DrawPath(pen, path);
- }
-
- public void DrawBeziers (Pen pen, PointF [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddBeziers(points);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawClosedCurve
- public void DrawClosedCurve (Pen pen, PointF [] points) {
- DrawClosedCurve(pen, points, 0.5f, FillMode.Alternate);
- }
-
- public void DrawClosedCurve (Pen pen, Point [] points) {
- DrawClosedCurve(pen, points, 0.5f, FillMode.Alternate);
- }
-
- public void DrawClosedCurve (Pen pen, Point [] points, float tension, FillMode fillmode) {
- GraphicsPath path = new GraphicsPath(fillmode);
- path.AddClosedCurve(points, tension);
- DrawPath(pen, path);
- }
-
- public void DrawClosedCurve (Pen pen, PointF [] points, float tension, FillMode fillmode) {
- GraphicsPath path = new GraphicsPath(fillmode);
- path.AddClosedCurve(points, tension);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawCurve
- public void DrawCurve (Pen pen, Point [] points) {
- DrawCurve(pen, points, 0.5f);
- }
-
- public void DrawCurve (Pen pen, PointF [] points) {
- DrawCurve(pen, points, 0.5f);
- }
-
- public void DrawCurve (Pen pen, PointF [] points, float tension) {
- DrawCurve(pen, points, 0, points.Length-1, tension);
- }
-
- public void DrawCurve (Pen pen, Point [] points, float tension) {
- DrawCurve(pen, points, 0, points.Length-1, tension);
- }
-
-
- public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments) {
- DrawCurve(pen, points, offset, numberOfSegments, 0.5f);
- }
-
- public void DrawCurve (Pen pen, Point [] points, int offset, int numberOfSegments, float tension) {
- GraphicsPath path = new GraphicsPath();
- path.AddCurve(points, offset, numberOfSegments, tension);
- DrawPath(pen, path);
- }
-
-
- public void DrawCurve (Pen pen, PointF [] points, int offset, int numberOfSegments, float tension) {
- GraphicsPath path = new GraphicsPath();
- path.AddCurve(points, offset, numberOfSegments, tension);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawEllipse
- public void DrawEllipse (Pen pen, Rectangle rect) {
- DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void DrawEllipse (Pen pen, RectangleF rect) {
- DrawEllipse (pen, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void DrawEllipse (Pen pen, int x, int y, int width, int height) {
- DrawEllipse(pen,(float)x,(float)y,(float)width,(float)height);
- }
-
- public void DrawEllipse (Pen pen, float x, float y, float width, float height) {
- DrawShape(pen, new geom.Ellipse2D.Float(x,y,width,height));
- }
- #endregion
-
- #region DrawIcon
- public void DrawIcon (Icon icon, Rectangle targetRect) {
- Bitmap b = icon.ToBitmap ();
- this.DrawImage (b, targetRect);
- }
-
- public void DrawIcon (Icon icon, int x, int y) {
- Bitmap b = icon.ToBitmap ();
- this.DrawImage (b, x, y);
- }
-
- public void DrawIconUnstretched (Icon icon, Rectangle targetRect) {
- Bitmap b = icon.ToBitmap ();
- this.DrawImageUnscaled (b, targetRect);
- }
- #endregion
-
- #region DrawImage
-
- public void DrawImage (Image image, Point point) {
- DrawImage(image, point.X, point.Y);
- }
-
- public void DrawImage (Image image, PointF point) {
- DrawImage(image, point.X, point.Y);
- }
-
-
- public void DrawImage (Image image, Point [] destPoints) {
- Matrix m = new Matrix(new Rectangle(0, 0, image.Width, image.Height), destPoints);
- DrawImage(image, m);
- }
-
- public void DrawImage (Image image, PointF [] destPoints) {
- Matrix m = new Matrix(new RectangleF(0, 0, image.Width, image.Height), destPoints);
- DrawImage(image, m);
- }
-
-
- public void DrawImage (Image image, Rectangle rect) {
- DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void DrawImage (Image image, RectangleF rect) {
- DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
-
- public void DrawImage (Image image, int x, int y) {
- DrawImage(image, (float)x, (float)y);
- }
-
- public void DrawImage (Image image, float x, float y) {
- if ((image.HorizontalResolution != DpiX) || (image.VerticalResolution != DpiY))
- DrawImage( image, x, y,
- (float)image.Width * (DpiX / image.HorizontalResolution) / _unitConversion[(int)PageUnit],
- (float)image.Height * (DpiY / image.VerticalResolution) / _unitConversion[(int)PageUnit]) ;
- else
- DrawImage( image, x, y,
- (float)image.Width / _unitConversion[(int)PageUnit],
- (float)image.Height / _unitConversion[(int)PageUnit] );
- }
-
-
- public void DrawImage (Image image, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit) {
- DrawImage(
- image,
- new Point [] {
- new Point( destRect.X, destRect.Y),
- new Point( destRect.X + destRect.Width, destRect.Y),
- new Point( destRect.X, destRect.Y + destRect.Height)},
- srcRect,
- srcUnit);
- }
-
- public void DrawImage (Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit) {
- DrawImage(
- image,
- new PointF [] {
- new PointF( destRect.X, destRect.Y),
- new PointF( destRect.X + destRect.Width, destRect.Y),
- new PointF( destRect.X, destRect.Y + destRect.Height)},
- srcRect,
- srcUnit);
- }
-
-
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit) {
- DrawImage(image, destPoints, srcRect, srcUnit, null);
- }
-
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit) {
- DrawImage(image, destPoints, srcRect, srcUnit, null);
- }
-
- [MonoLimitation("ImageAttributes parameter is ignored.")]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr) {
- //TBD: ImageAttributes
- if (srcUnit != GraphicsUnit.Pixel)
- throw new NotImplementedException();
- // Like in .NET http://dotnet247.com/247reference/msgs/45/227979.aspx
-
- Matrix mx = new Matrix(srcRect, destPoints);
-
- Region region = new Region(srcRect);
- DrawImage(image, mx, region);
- }
-
- [MonoLimitation ("ImageAttributes parameter is ignored.")]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr) {
- //TBD: ImageAttributes
- if (srcUnit != GraphicsUnit.Pixel)
- throw new NotImplementedException();
- // Like in .NET http://dotnet247.com/247reference/msgs/45/227979.aspx
-
- Matrix mx = new Matrix(srcRect, destPoints);
-
- Region region = new Region(srcRect);
- DrawImage(image, mx, region);
- }
-
-
- public void DrawImage (Image image, int x, int y, int width, int height) {
- DrawImage(image, (float)x, (float)y, (float)width, (float)height);
- }
-
- public void DrawImage (Image image, float x, float y, float width, float height) {
- Matrix mx = new Matrix();
- mx.Translate((float)x, (float)y);
- mx.Scale(width / (float)image.Width, height / (float)image.Height);
-
- DrawImage( image, mx );
- }
-
-
- public void DrawImage (Image image, int x, int y, Rectangle srcRect, GraphicsUnit srcUnit) {
- DrawImage(image, new Rectangle(x, y, srcRect.Width, srcRect.Height), srcRect, srcUnit);
- }
-
- public void DrawImage (Image image, float x, float y, RectangleF srcRect, GraphicsUnit srcUnit) {
- DrawImage(image, new RectangleF(x, y, srcRect.Width, srcRect.Height), srcRect, srcUnit);
- }
-
-
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit) {
- DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, null);
- }
-
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit) {
- DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, null);
- }
-
- [MonoLimitation ("ImageAttributes parameter is ignored.")]
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr) {
- //TBD: attributes
- DrawImage(
- image,
- destRect,
- new Rectangle(srcX, srcY, srcWidth, srcHeight),
- srcUnit);
- }
-
- [MonoLimitation ("ImageAttributes parameter is ignored.")]
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs) {
- //TBD: attributes
- DrawImage(
- image,
- destRect,
- new RectangleF(srcX, srcY, srcWidth, srcHeight),
- srcUnit);
- }
-
-
- public delegate bool DrawImageAbort (IntPtr callbackdata);
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- internal void DrawImage (Image image, Matrix m) {
- DrawImage(image, m, null);
- }
-
- internal void DrawImage (Image image, Matrix m, Region clip) {
- if (clip == null) {
- clip = new Region( new RectangleF( 0, 0, image.Width, image.Height ) );
- }
-
- geom.AffineTransform t = GetFinalTransform(_transform.NativeObject, PageUnit, 1.0f);
- if (!t.isIdentity())
- m.NativeObject.preConcatenate(t);
-
- clip.Transform( m );
-
- if (NeedsNormalization) {
- Matrix normMatrix = ComputeClipNormalization(clip.GetBounds(this));
- clip.Transform(normMatrix);
- }
-
- awt.Shape oldClip = NativeObject.getClip();
- IntersectScaledClipWithBase(clip);
-
- try {
- Matrix mm = ComputeImageNormalization(image, m);
- NativeObject.drawImage(image.NativeObject.CurrentImage.NativeImage, mm.NativeObject, null);
- }
- finally {
- NativeObject.setClip( oldClip );
- }
- }
-
- private static Matrix ComputeImageNormalization(Image img, Matrix m) {
- if ( m.IsIdentity )
- return m;
-
- //m.Translate( -(m.Elements[0] + m.Elements[2]) / 2.0f, -(m.Elements[3] + m.Elements[1]) / 2.0f, MatrixOrder.Append);
- m.Translate(
- -(float)(m.NativeObject.getScaleX() + m.NativeObject.getShearX()) / 2.0f,
- -(float)(m.NativeObject.getScaleY() + m.NativeObject.getShearY()) / 2.0f, MatrixOrder.Append);
-
- PointF [] p = new PointF[] {
- new PointF( 0, 0 ),
- new PointF( img.Width, 0 ),
- new PointF( 0, img.Height )};
-
- m.TransformPoints(p);
- for (int i=0; i < p.Length; i++) {
- p[i].X = (float)( p[i].X + 0.5f );
- p[i].Y = (float)( p[i].Y + 0.5f );
- }
-
- return new Matrix( new Rectangle(0, 0, img.Width, img.Height), p );
- }
- private static Matrix ComputeClipNormalization(RectangleF rect) {
- PointF [] p = new PointF[] {
- new PointF( rect.X, rect.Y ),
- new PointF( rect.X + rect.Width, rect.Y ),
- new PointF( rect.X, rect.Y + rect.Height )};
-
- for (int i=0; i < p.Length; i++) {
- p[i].X = (float)Math.Round( p[i].X + 0.5f ) + 0.5f;
- p[i].Y = (float)Math.Round( p[i].Y + 0.5f ) + 0.5f;
- }
-
- return new Matrix( rect, p );
- }
-
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
-
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void DrawImage (Image image, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException();
- }
-#endif
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public void DrawImage (Image image, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, int callbackData)
- {
- throw new NotImplementedException();
- }
-#endif
-
-#if INTPTR_SUPPORT
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- //TBD:units,attributes, callback
- java.awt.Graphics2D g = (java.awt.Graphics2D)nativeObject;
- g.drawImage(image.NativeObject,destRect.X,destRect.Y,destRect.Width,destRect.Height,srcX,srcY,srcWidth,srcHeight,null);
- }
-
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
- {
- //TBD:units,attributes, callback
- java.awt.Graphics2D g = (java.awt.Graphics2D)nativeObject;
- g.drawImage(image.NativeObject,
- (int)destRect.X,
- (int)destRect.Y,
- (int)destRect.Width,
- (int)destRect.Height,
- (int)srcX,
- (int)srcY,
- (int)srcWidth,
- (int)srcHeight,null);
- }
-
- public void DrawImage (Image image, Rectangle destRect, float srcX, float srcY, float srcWidth, float srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
- {
- //TBD:units,attributes, callback
- java.awt.Graphics2D g = (java.awt.Graphics2D)nativeObject;
- g.drawImage(image.NativeObject,
- (int)destRect.X,
- (int)destRect.Y,
- (int)destRect.Width,
- (int)destRect.Height,
- (int)srcX,
- (int)srcY,
- (int)srcWidth,
- (int)srcHeight,null);
- }
-
- public void DrawImage (Image image, Rectangle destRect, int srcX, int srcY, int srcWidth, int srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, IntPtr callbackData)
- {
- //TBD:units,attributes, callback
- java.awt.Graphics2D g = (java.awt.Graphics2D)nativeObject;
- g.drawImage(image.NativeObject,
- destRect.X,
- destRect.Y,
- destRect.Width,
- destRect.Height,
- srcX,
- srcY,
- srcWidth,
- srcHeight,null);
- }
-#endif
-
- public void DrawImageUnscaled (Image image, Point point)
- {
- DrawImageUnscaled (image, point.X, point.Y);
- }
-
- public void DrawImageUnscaled (Image image, Rectangle rect) {
- DrawImageUnscaled (image, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void DrawImageUnscaled (Image image, int x, int y) {
- DrawImage (image, x, y, image.Width, image.Height);
- }
-
- public void DrawImageUnscaled (Image image, int x, int y, int width, int height) {
- Image tmpImg = new Bitmap (width, height);
- Graphics g = FromImage (tmpImg);
- g.DrawImage (image, 0, 0, image.Width, image.Height);
- this.DrawImage (tmpImg, x, y, width, height);
- tmpImg.Dispose ();
- g.Dispose ();
- }
-
-#if NET_2_0
- [MonoNotSupported ("")]
- public void DrawImageUnscaledAndClipped (Image image, Rectangle rect)
- {
- throw new NotImplementedException ();
- }
-
-#endif
- #endregion
-
- #region DrawLine
- public void DrawLine (Pen pen, PointF pt1, PointF pt2) {
- DrawLine(pen,pt1.X,pt1.Y,pt2.X,pt2.Y);
- }
-
- public void DrawLine (Pen pen, Point pt1, Point pt2) {
- DrawLine(pen,(float)pt1.X,(float)pt1.Y,(float)pt2.X,(float)pt2.Y);
- }
-
- public void DrawLine (Pen pen, int x1, int y1, int x2, int y2) {
- DrawLine(pen,(float)x1,(float)y1,(float)x2,(float)y2);
- }
-
- public void DrawLine (Pen pen, float x1, float y1, float x2, float y2) {
- DrawShape(pen, new geom.Line2D.Float(x1,y1,x2,y2));
- }
-
- public void DrawLines (Pen pen, PointF [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddLines(points);
- DrawShape(pen, path);
- }
-
- public void DrawLines (Pen pen, Point [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddLines(points);
- DrawShape(pen, path);
- }
- #endregion
-
- #region DrawPath
- public void DrawPath (Pen pen, GraphicsPath path) {
- DrawShape(pen, path);
- }
- #endregion
-
- #region DrawPie
- public void DrawPie (Pen pen, Rectangle rect, float startAngle, float sweepAngle) {
- DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
- }
-
- public void DrawPie (Pen pen, RectangleF rect, float startAngle, float sweepAngle) {
- DrawPie (pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
- }
-
- public void DrawPie (Pen pen, float x, float y, float width, float height, float startAngle, float sweepAngle) {
- GraphicsPath path = new GraphicsPath();
- path.AddPie(x, y, width, height, startAngle, sweepAngle);
- DrawPath(pen, path);
- }
-
- public void DrawPie (Pen pen, int x, int y, int width, int height, int startAngle, int sweepAngle) {
- DrawPie(pen,(float)x,(float)y,(float)width,(float)height,(float)startAngle,(float)sweepAngle);
- }
- #endregion
-
- #region DrawPolygon
- public void DrawPolygon (Pen pen, Point [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddPolygon(points);
- DrawPath(pen, path);
- }
-
- public void DrawPolygon (Pen pen, PointF [] points) {
- GraphicsPath path = new GraphicsPath();
- path.AddPolygon(points);
- DrawPath(pen, path);
- }
- #endregion
-
- #region DrawRectangle(s)
- internal void DrawRectangle (Pen pen, RectangleF rect) {
- DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- public void DrawRectangle (Pen pen, Rectangle rect) {
- DrawRectangle (pen, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- public void DrawRectangle (Pen pen, float x, float y, float width, float height) {
- DrawShape(pen, new geom.Rectangle2D.Float(x,y,width,height));
- }
-
- public void DrawRectangle (Pen pen, int x, int y, int width, int height) {
- DrawRectangle (pen,(float) x,(float) y,(float) width,(float) height);
- }
-
- public void DrawRectangles (Pen pen, RectangleF [] rects) {
- foreach(RectangleF r in rects)
- DrawRectangle (pen, r.Left, r.Top, r.Width, r.Height);
- }
-
- public void DrawRectangles (Pen pen, Rectangle [] rects) {
- foreach(Rectangle r in rects)
- DrawRectangle (pen, r.Left, r.Top, r.Width, r.Height);
- }
- #endregion
-
- #region DrawString
- public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle) {
- DrawString(s, font, brush, layoutRectangle.X, layoutRectangle.Y, layoutRectangle.Width, layoutRectangle.Height, null);
- }
-
- public void DrawString (string s, Font font, Brush brush, PointF point) {
- DrawString(s, font, brush, point.X, point.Y, float.PositiveInfinity, float.PositiveInfinity, null);
- }
-
- public void DrawString (string s, Font font, Brush brush, PointF point, StringFormat format) {
- DrawString(s, font, brush, point.X, point.Y, float.PositiveInfinity, float.PositiveInfinity, format);
- }
-
- public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format) {
- DrawString(s, font, brush, layoutRectangle.X, layoutRectangle.Y, layoutRectangle.Width, layoutRectangle.Height, format);
- }
-
- public void DrawString (string s, Font font, Brush brush, float x, float y) {
- DrawString(s, font, brush, x, y, float.PositiveInfinity, float.PositiveInfinity, null);
- }
-
- public void DrawString (string s, Font font, Brush brush, float x, float y, StringFormat format) {
- DrawString(s, font, brush, x, y, float.PositiveInfinity, float.PositiveInfinity, format);
- }
-
- void DrawString (string s, Font font, Brush brush,
- float x, float y, float width, float height,
- StringFormat format) {
- if (brush == null)
- throw new ArgumentNullException("brush");
-
- if (font == null)
- throw new ArgumentNullException("font");
-
- if (format != null && format.LineAlignment != StringAlignment.Near) {
-
- SizeF sizeF = MeasureString(s, font, format, width, height, null);
-
- float lineAWidth = width;
- float lineAHeight = height;
-
- if (float.IsPositiveInfinity(width))
- lineAWidth = lineAHeight = 0;
-
- float wdelta = format.IsVertical ? lineAWidth - sizeF.Width : lineAHeight - sizeF.Height;
- float pdelta = format.LineAlignment == StringAlignment.Center ? wdelta/2 : wdelta;
- if (format.IsVertical) {
- if (!(format.IsRightToLeft && format.LineAlignment == StringAlignment.Far))
- x += pdelta;
- if (!float.IsPositiveInfinity(width))
- width -= wdelta;
- }
- else {
- y += pdelta;
- if (!float.IsPositiveInfinity(width))
- height -= wdelta;
- }
- }
-
- awt.Paint oldP = NativeObject.getPaint();
- NativeObject.setPaint(brush);
- try {
- geom.AffineTransform oldT = NativeObject.getTransform();
- try {
-
- bool noclip = float.IsPositiveInfinity(width) || (format != null && format.NoClip);
-
- awt.Shape oldClip = null;
- if (!noclip) {
- oldClip = NativeObject.getClip();
- NativeObject.clip(new geom.Rectangle2D.Float(x, y, width, height));
- }
- try {
- TextLineIterator iter = new TextLineIterator(s, font, NativeObject.getFontRenderContext(), format, width, height);
- NativeObject.transform(iter.Transform);
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
- layout.Draw (NativeObject, x * UnitConversion [(int) PageUnit], y * UnitConversion [(int) PageUnit]);
- }
- }
- finally {
- if (!noclip)
- NativeObject.setClip(oldClip);
- }
- }
- finally {
- NativeObject.setTransform(oldT);
- }
- }
- finally {
- NativeObject.setPaint(oldP);
- }
- }
- #endregion
-
- #region Container
-
- void PushGraphicsState(GraphicsState state) {
- state.Next = _nextGraphicsState;
- _nextGraphicsState = state;
- }
-
- GraphicsState PopGraphicsState() {
- GraphicsState state = _nextGraphicsState;
- _nextGraphicsState = _nextGraphicsState.Next;
- return state;
- }
-
- bool ContainsGraphicsState(GraphicsState state) {
- GraphicsState gs = _nextGraphicsState;
-
- while(gs != null) {
- if (gs == state)
- return true;
-
- gs = gs.Next;
- }
-
- return false;
- }
-
- public void EndContainer (GraphicsContainer container) {
- Restore(container.StateObject);
- }
-
- public GraphicsContainer BeginContainer () {
- return new GraphicsContainer(Save(Matrix.IdentityTransform, true));
- }
-
- public GraphicsContainer BeginContainer (Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit) {
- Matrix containerTransfrom =
- new Matrix( srcrect,
- new Point [] { new Point (dstrect.X, dstrect.Y),
- new Point (dstrect.X + dstrect.Width, dstrect.Y),
- new Point (dstrect.X, dstrect.Y + dstrect.Height) });
-
- float scale = _unitConversion[ (int)PageUnit ] / _unitConversion[ (int)unit ];
- containerTransfrom.Scale(scale, scale);
-
- return new GraphicsContainer(Save(containerTransfrom, true));
- }
-
-
- public GraphicsContainer BeginContainer (RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit) {
- Matrix containerTransfrom =
- new Matrix( srcrect,
- new PointF [] { new PointF (dstrect.X, dstrect.Y),
- new PointF (dstrect.X + dstrect.Width, dstrect.Y),
- new PointF (dstrect.X, dstrect.Y + dstrect.Height) });
-
- float scale = _unitConversion[ (int)PageUnit ] / _unitConversion[ (int)unit ];
- containerTransfrom.Scale(scale, scale);
-
- return new GraphicsContainer(Save(containerTransfrom, true));
- }
-
- GraphicsState Save(Matrix matrix, bool resetState) {
- GraphicsState graphicsState = new GraphicsState(this, matrix, resetState);
-
- PushGraphicsState( graphicsState );
- return graphicsState;
- }
-
- public GraphicsState Save () {
- return Save(Matrix.IdentityTransform, false);
- }
-
- public void Restore (GraphicsState graphicsState) {
- if (ContainsGraphicsState(graphicsState)) {
- GraphicsState gs = PopGraphicsState();
- while ( gs != graphicsState )
- gs = PopGraphicsState();
-
- graphicsState.RestoreState(this);
- }
- }
-
- #endregion
-
- #region Metafiles Staff
- [MonoTODO]
- public void AddMetafileComment (byte [] data) {
- throw new NotImplementedException ();
- }
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit srcUnit, EnumerateMetafileProc callback, IntPtr callbackData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point [] destPoints, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF [] destPoints, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EnumerateMetafile (Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes imageAttr)
- {
- throw new NotImplementedException ();
- }
-#endif
- #endregion
-
- #region ExcludeClip
- void ExcludeClip(geom.Area area) {
-
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- area = (geom.Area) area.clone ();
- area.transform(t);
- }
-
- _clip.NativeObject.subtract(area);
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
-
- public void ExcludeClip (Rectangle rect) {
- ExcludeClip(new geom.Area(rect.NativeObject));
- }
-
- public void ExcludeClip (Region region) {
- if (region == null)
- throw new ArgumentNullException("region");
- ExcludeClip(region.NativeObject);
- }
- #endregion
-
- #region FillClosedCurve
- public void FillClosedCurve (Brush brush, PointF [] points) {
- FillClosedCurve (brush, points, FillMode.Alternate);
- }
-
-
- public void FillClosedCurve (Brush brush, Point [] points) {
- FillClosedCurve (brush, points, FillMode.Alternate);
- }
-
-
- public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode) {
- FillClosedCurve (brush, points, fillmode, 0.5f);
- }
-
- public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode) {
- FillClosedCurve (brush, points, fillmode, 0.5f);
- }
-
- public void FillClosedCurve (Brush brush, PointF [] points, FillMode fillmode, float tension) {
- GraphicsPath path = new GraphicsPath(fillmode);
- path.AddClosedCurve(points, tension);
- FillPath(brush, path);
- }
-
- public void FillClosedCurve (Brush brush, Point [] points, FillMode fillmode, float tension) {
- GraphicsPath path = new GraphicsPath(fillmode);
- path.AddClosedCurve(points, tension);
- FillPath(brush, path);
- }
- #endregion
-
- #region FillEllipse
- public void FillEllipse (Brush brush, Rectangle rect) {
- FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void FillEllipse (Brush brush, RectangleF rect) {
- FillEllipse (brush, rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public void FillEllipse (Brush brush, float x, float y, float width, float height) {
- FillShape(brush,new java.awt.geom.Ellipse2D.Float(x,y,width,height));
- }
-
- public void FillEllipse (Brush brush, int x, int y, int width, int height) {
- FillEllipse (brush,(float)x,(float)y,(float)width,(float)height);
- }
- #endregion
-
- #region FillPath
- public void FillPath (Brush brush, GraphicsPath path) {
- if (path == null)
- throw new ArgumentNullException("path");
-
- FillShape(brush,path);
- }
- #endregion
-
- #region FillPie
- public void FillPie (Brush brush, Rectangle rect, float startAngle, float sweepAngle) {
- FillPie(brush,(float)rect.X,(float)rect.Y,(float)rect.Width,(float)rect.Height,(float)startAngle,(float)sweepAngle);
- }
-
- public void FillPie (Brush brush, int x, int y, int width, int height, int startAngle, int sweepAngle) {
- FillPie(brush,(float)x,(float)y,(float)width,(float)height,(float)startAngle,(float)sweepAngle);
- }
-
- public void FillPie (Brush brush, float x, float y, float width, float height, float startAngle, float sweepAngle) {
- GraphicsPath path = new GraphicsPath();
- path.AddPie(x, y, width, height, startAngle, sweepAngle);
- FillPath(brush, path);
- }
- #endregion
-
- #region FillPolygon
- public void FillPolygon (Brush brush, PointF [] points) {
- FillPolygon(brush, points, FillMode.Alternate);
- }
-
- public void FillPolygon (Brush brush, Point [] points) {
- FillPolygon(brush, points, FillMode.Alternate);
- }
-
- public void FillPolygon (Brush brush, Point [] points, FillMode fillMode) {
- GraphicsPath path = new GraphicsPath(fillMode);
- path.AddPolygon(points);
- FillPath(brush,path);
- }
-
- public void FillPolygon (Brush brush, PointF [] points, FillMode fillMode) {
- GraphicsPath path = new GraphicsPath(fillMode);
- path.AddPolygon(points);
- FillPath(brush,path);
- }
- #endregion
-
- #region FillRectangle
- public void FillRectangle (Brush brush, RectangleF rect) {
- FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- public void FillRectangle (Brush brush, Rectangle rect) {
- FillRectangle (brush, rect.Left, rect.Top, rect.Width, rect.Height);
- }
-
- public void FillRectangle (Brush brush, int x, int y, int width, int height) {
- FillRectangle(brush,(float)x,(float)y,(float)width,(float)height);
- }
-
- public void FillRectangle (Brush brush, float x, float y, float width, float height) {
- FillShape(brush,new java.awt.geom.Rectangle2D.Float(x,y,width,height));
- }
-
- public void FillRectangles (Brush brush, Rectangle [] rects) {
- GraphicsPath path = new GraphicsPath();
- path.AddRectangles(rects);
- FillPath(brush,path);
- }
-
- public void FillRectangles (Brush brush, RectangleF [] rects) {
- GraphicsPath path = new GraphicsPath();
- path.AddRectangles(rects);
- FillPath(brush,path);
- }
- #endregion
-
- #region FillRegion
- public void FillRegion (Brush brush, Region region) {
- FillShape(brush,region);
- }
-
- #endregion
-
- public void Flush () {
- Flush (FlushIntention.Flush);
- }
-
-
- public void Flush (FlushIntention intention) {
- if (_image != null)
- _image.NativeObject.CurrentImage.NativeImage.flush();
- }
-
-#if INTPTR_SUPPORTED
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public void ReleaseHdc (IntPtr hdc)
- {
- throw new NotImplementedException();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public void ReleaseHdcInternal (IntPtr hdc)
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHdc (IntPtr hdc)
- {
- throw new NotImplementedException();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHdc (IntPtr hdc, IntPtr hdevice)
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHdcInternal (IntPtr hdc)
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHwnd (IntPtr hwnd)
- {
- throw new NotImplementedException();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public static Graphics FromHwndInternal (IntPtr hwnd)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- internal static Graphics FromXDrawable (IntPtr drawable, IntPtr display)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static IntPtr GetHalftonePalette ()
- {
- throw new NotImplementedException ();
- }
-
- [EditorBrowsable (EditorBrowsableState.Advanced)]
- [MonoTODO]
- public IntPtr GetHdc ()
- {
- throw new NotImplementedException();
- }
-#endif
-
- #region GetNearestColor
- [MonoTODO]
- public Color GetNearestColor (Color color) {
- throw new NotImplementedException();
- }
- #endregion
-
- #region IntersectClip
- void IntersectClip (geom.Area area) {
-
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- area = (geom.Area) area.clone ();
- area.transform(t);
- }
-
- _clip.NativeObject.intersect(area);
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
-
- public void IntersectClip (Region region) {
- if (region == null)
- throw new ArgumentNullException("region");
-
- IntersectClip(region.NativeObject);
- }
-
- public void IntersectClip (RectangleF rect) {
- IntersectClip(new geom.Area(rect.NativeObject));
- }
-
- public void IntersectClip (Rectangle rect) {
- IntersectClip(new geom.Area(rect.NativeObject));
- }
- #endregion
-
- #region IsVisible
- public bool IsVisible (Point point) {
- return IsVisible(point.X,point.Y);
- }
-
-
- public bool IsVisible (RectangleF rect) {
- return IsVisible ((float)rect.X,(float)rect.Y,(float)rect.Width,(float)rect.Height);
- }
-
- public bool IsVisible (PointF point) {
- return IsVisible(point.X,point.Y);
- }
-
- public bool IsVisible (Rectangle rect) {
- return IsVisible ((float)rect.X,(float)rect.Y,(float)rect.Width,(float)rect.Height);
- }
-
- public bool IsVisible (float x, float y) {
- double dx = x;
- double dy = y;
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- double[] p = new double[] {dx, dy};
- t.transform(p, 0, p, 0, 1);
-
- dx = p[0];
- dy = p[1];
- }
- if (!_clip.NativeObject.contains(dx, dy))
- return false;
-
- awt.Shape clip = NativeObject.getClip();
- if (clip == null)
- return true;
-
- return clip.contains(dx, dy);
- }
-
- public bool IsVisible (int x, int y) {
- return IsVisible ((float)x,(float)y);
- }
-
- public bool IsVisible (float x, float y, float width, float height) {
-
- geom.AffineTransform t = GetFinalTransform();
- geom.Rectangle2D r = new geom.Rectangle2D.Float(x, y, width, height);
-
- if (!t.isIdentity())
- r = t.createTransformedShape(r).getBounds2D();
-
- return NativeObject.hitClip(
- (int)(r.getX()+0.5), (int)(r.getY()+0.5),
- (int)(r.getWidth()+0.5), (int)(r.getHeight()+0.5))
- && _clip.NativeObject.intersects(r);
- }
-
-
- public bool IsVisible (int x, int y, int width, int height) {
- return IsVisible ((float)x,(float)y,(float)width,(float)height);
- }
- #endregion
-
- #region MeasureCharacterRanges
- public Region [] MeasureCharacterRanges (string text, Font font, RectangleF layoutRect, StringFormat stringFormat) {
- if (stringFormat == null)
- throw new ArgumentException("stringFormat");
-
- CharacterRange[] ranges = stringFormat.CharRanges;
- if (ranges == null || ranges.Length == 0)
- return new Region[0];
-
- GraphicsPath[] pathes = new GraphicsPath[ranges.Length];
- for (int i = 0; i < pathes.Length; i++)
- pathes[i] = new GraphicsPath();
-
- TextLineIterator iter = new TextLineIterator(text, font, NativeObject.getFontRenderContext(),
- stringFormat, layoutRect.Width, layoutRect.Height);
-
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
-
- for (int i = 0; i < ranges.Length; i++) {
- int start = ranges[i].First;
- int length = ranges[i].Length;
- start -= iter.CharsConsumed;
- int limit = start + length;
- int layoutStart = iter.CurrentPosition - layout.CharacterCount;
- if (start < iter.CurrentPosition && limit > layoutStart) {
-
- float layoutOffset;
- if (start > layoutStart)
- layoutOffset = iter.GetAdvanceBetween(layoutStart, start);
- else {
- layoutOffset = 0;
- start = layoutStart;
- }
-
- float width = (limit < iter.CurrentPosition) ?
- iter.GetAdvanceBetween(start, limit) :
- layout.Width - layoutOffset;
-
- float height = layout.Ascent + layout.Descent;
-
- float x = layout.NativeX;
- float y = layout.NativeY;
-
- if (stringFormat.IsVertical) {
- y += layoutOffset;
- x -= layout.Descent;
- }
- else {
- x += layoutOffset;
- y -= layout.Ascent;
- }
-
- if (layout.AccumulatedHeight + height > iter.WrapHeight) {
- float diff = iter.WrapHeight - layout.AccumulatedHeight;
- if (stringFormat.IsVertical && stringFormat.IsRightToLeft) {
- x += diff;
- height -= diff;
- }
- else
- height = diff;
- }
-
- if (stringFormat.IsVertical)
- pathes[i].AddRectangle(x + layoutRect.X, y + layoutRect.Y, height, width);
- else
- pathes[i].AddRectangle(x + layoutRect.X, y + layoutRect.Y, width, height);
- }
- }
- }
-
- geom.AffineTransform lineAlignT = iter.CalcLineAlignmentTransform();
- if (lineAlignT != null) {
- for (int i = 0; i < pathes.Length; i++)
- pathes[i].NativeObject.transform(lineAlignT);
- }
-
- Region[] regions = new Region[ranges.Length];
- for (int i = 0; i < regions.Length; i++)
- regions[i] = new Region(pathes[i]);
-
- return regions;
- }
- #endregion
-
- #region MeasureString
- public SizeF MeasureString (string text, Font font) {
- return MeasureString(text, font, null, float.PositiveInfinity, float.PositiveInfinity, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, SizeF layoutArea) {
- return MeasureString(text, font, layoutArea, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, int width) {
- return MeasureString(text, font, width, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat format) {
- return MeasureString(text, font, format, layoutArea.Width, layoutArea.Height, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, int width, StringFormat format) {
- return MeasureString(text, font, format, width, float.PositiveInfinity, null);
- }
-
-
- public SizeF MeasureString (string text, Font font, PointF origin, StringFormat format) {
- return MeasureString(text, font, format, float.PositiveInfinity, float.PositiveInfinity, null);
- }
-
- SizeF MeasureString (string text, Font font, StringFormat format, float width, float height, int[] statistics) {
-
- if (statistics != null) {
- statistics[0] = 0;
- statistics[1] = 0;
- }
-
- TextLineIterator iter = new TextLineIterator(text, font, NativeObject.getFontRenderContext(), format, width, height);
-
- float mwidth = 0;
- int linesFilled = 0;
- for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
-
- linesFilled ++;
- float w = layout.MeasureWidth;
-
- if (w > mwidth)
- mwidth = w;
- }
-
- if (linesFilled == 0)
- return SizeF.Empty;
-
- float mheight = iter.AccumulatedHeight;
-
- if (format != null) {
- if (format.IsVertical) {
- float temp = mheight;
- mheight = mwidth;
- mwidth = temp;
- }
- }
-
- if (!(format != null && format.NoClip)) {
- if (mwidth > width)
- mwidth = width;
- if (mheight > height)
- mheight = height;
- }
-
- if (statistics != null) {
- statistics[0] = linesFilled;
- statistics[1] = iter.CharsConsumed;
- }
-
- return new SizeF (mwidth / UnitConversion [(int) _pageUnit], mheight / UnitConversion [(int) _pageUnit]);
- }
-
-
- public SizeF MeasureString (string text, Font font, SizeF layoutArea, StringFormat stringFormat, out int charactersFitted, out int linesFilled) {
- linesFilled = 0;
- charactersFitted = 0;
-
- int[] statistics = new int[2];
- SizeF sz = MeasureString(text, font, stringFormat, layoutArea.Width, layoutArea.Height, statistics);
- linesFilled = statistics[0];
- charactersFitted = statistics[1];
- return sz;
- }
- #endregion
-
- #region MultiplyTransform
- public void MultiplyTransform (Matrix matrix) {
- MultiplyTransform (matrix, MatrixOrder.Prepend);
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order) {
- ConcatenateTransform(matrix.NativeObject, order);
- }
- #endregion
-
- #region Reset (Clip and Transform)
- public void ResetClip () {
- _clip.MakeInfinite();
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
-
- public void ResetTransform () {
- _transform.Reset();
- }
- #endregion
-
- #region RotateTransform
- public void RotateTransform (float angle) {
- RotateTransform (angle, MatrixOrder.Prepend);
- }
-
- public void RotateTransform (float angle, MatrixOrder order) {
- ConcatenateTransform(
- geom.AffineTransform.getRotateInstance(java.lang.Math.toRadians(angle)),
- order);
- }
- #endregion
-
- #region ScaleTransform
- public void ScaleTransform (float sx, float sy) {
- ScaleTransform (sx, sy, MatrixOrder.Prepend);
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order) {
- ConcatenateTransform(
- geom.AffineTransform.getScaleInstance(sx, sy),
- order);
- }
- #endregion
-
- #region SetClip [Must be reviewed - more abstraction needed]
- public void SetClip (RectangleF rect) {
- SetClip (rect, CombineMode.Replace);
- }
-
- public void SetClip (GraphicsPath path) {
- SetClip (path, CombineMode.Replace);
- }
-
- public void SetClip (Rectangle rect) {
- SetClip (rect, CombineMode.Replace);
- }
-
- public void SetClip (Graphics g) {
- SetClip (g, CombineMode.Replace);
- }
-
- public void SetClip (Graphics g, CombineMode combineMode) {
- if(g == null)
- throw new NullReferenceException();
-
- CombineClipArea(g._clip.NativeObject, combineMode);
- }
-
- public void SetClip (Rectangle rect, CombineMode combineMode) {
- SetClip(rect.X,rect.Y,rect.Width,rect.Height,combineMode);
- }
- public void SetClip (RectangleF rect, CombineMode combineMode) {
- SetClip(rect.X,rect.Y,rect.Width,rect.Height,combineMode);
- }
-
- public void SetClip (Region region, CombineMode combineMode) {
- if(region == null)
- throw new ArgumentNullException("region");
-
- CombineClipArea ((geom.Area) region.NativeObject.clone (), combineMode);
- }
-
- public void SetClip (GraphicsPath path, CombineMode combineMode) {
- if(path == null)
- throw new ArgumentNullException("path");
-
- CombineClipArea(new geom.Area(path.NativeObject), combineMode);
- }
- #endregion
-
- #region Clipping Staff [INTERNAL]
- internal Region ScaledClip {
- get {
- return _clip.Clone();
- }
- set {
- _clip.NativeObject.reset();
- _clip.NativeObject.add(value.NativeObject);
- }
- }
- internal void SetClip(float x,float y,float width,float height,CombineMode combineMode) {
- CombineClipArea(new geom.Area(
- new geom.Rectangle2D.Float(x,y,width,height)),combineMode);
- }
-
- void CombineClipArea(geom.Area area, CombineMode combineMode) {
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity())
- area.transform(t);
- if (combineMode == CombineMode.Replace) {
- _clip.NativeObject.reset();
- _clip.NativeObject.add(area);
- }
- else {
- geom.Area curClip = _clip.NativeObject;
- switch(combineMode) {
- case CombineMode.Complement:
- curClip.add(area);
- break;
- case CombineMode.Exclude:
- curClip.subtract(area);
- break;
- case CombineMode.Intersect:
- curClip.intersect(area);
- break;
- case CombineMode.Union:
- curClip.add(area);
- break;
- case CombineMode.Xor:
- curClip.exclusiveOr(area);
- break;
- default:
- throw new ArgumentOutOfRangeException();
- }
- }
-
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
-
- internal void IntersectScaledClipWithBase(awt.Shape clip) {
- NativeObject.clip(clip);
- }
-
- void RestoreBaseClip() {
- if (_nextGraphicsState == null) {
- NativeObject.setClip(_windowRect);
- return;
- }
-
- _nextGraphicsState.RestoreBaseClip(this);
- }
-
- #endregion
-
- #region TransformPoints
- [MonoTODO]
- public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, PointF [] pts) {
- //TBD:CoordinateSpace
- java.awt.geom.AffineTransform tr = this.Transform.NativeObject;
- float[] fpts = new float[2];
- for(int i = 0; i< pts.Length; i++) {
- fpts[0] = pts[i].X;
- fpts[1] = pts[i].Y;
- tr.transform(fpts, 0, fpts, 0, 1);
- pts[i].X = fpts[0];
- pts[i].Y = fpts[1];
- }
- }
-
- [MonoTODO]
- public void TransformPoints (CoordinateSpace destSpace, CoordinateSpace srcSpace, Point [] pts) {
- //TBD:CoordinateSpace
- java.awt.geom.AffineTransform tr = this.Transform.NativeObject;
- float[] fpts = new float[2];
- for(int i = 0; i< pts.Length; i++) {
- fpts[0] = pts[i].X;
- fpts[1] = pts[i].Y;
- tr.transform(fpts, 0, fpts, 0, 1);
- pts[i].X = (int)fpts[0];
- pts[i].Y = (int)fpts[1];
- }
- }
- #endregion
-
- #region TranslateClip
- public void TranslateClip (int dx, int dy) {
- TranslateClip((float)dx, (float)dy);
- }
-
-
- public void TranslateClip (float dx, float dy) {
- double x = dx;
- double y = dy;
- geom.AffineTransform f = GetFinalTransform();
-
- if (!f.isIdentity()) {
- double[] p = new double[] {x, y};
- f.deltaTransform(p, 0, p, 0, 1);
-
- x = p[0];
- y = p[1];
- }
-
- // It seems .Net does exactly this...
- x = Math.Floor(x+0.96875);
- y = Math.Floor(y+0.96875);
-
- geom.AffineTransform t = geom.AffineTransform.getTranslateInstance(x, y);
-
- _clip.NativeObject.transform(t);
- RestoreBaseClip();
- NativeObject.clip(_clip);
- }
- #endregion
-
- #region TranslateTransform
- public void TranslateTransform (float dx, float dy) {
- TranslateTransform (dx, dy, MatrixOrder.Prepend);
- }
-
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- ConcatenateTransform(
- geom.AffineTransform.getTranslateInstance(dx, dy),
- order);
- }
- #endregion
-
- #region Properties [Partial TODO]
- public Region Clip {
- get {
- Region r = _clip.Clone();
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity())
- r.NativeObject.transform(t.createInverse());
-
- return r;
- }
- set {
- SetClip (value, CombineMode.Replace);
- }
- }
-
- public RectangleF ClipBounds {
- get {
- awt.Shape shape = _clip.NativeObject;
- if (shape == null)
- shape = Region.InfiniteRegion.NativeObject;
-
- geom.RectangularShape r = shape.getBounds2D();
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- geom.AffineTransform it = t.createInverse();
- r = it.createTransformedShape(r).getBounds2D();
- }
-
- return new RectangleF (r);
- }
- }
-
- public CompositingMode CompositingMode {
- //TBD:check this carefully
- get {
- return (NativeObject.getComposite() == awt.AlphaComposite.SrcOver) ?
- CompositingMode.SourceOver : CompositingMode.SourceCopy;
- }
- set {
- NativeObject.setComposite(
- (value == CompositingMode.SourceOver) ?
- awt.AlphaComposite.SrcOver : awt.AlphaComposite.Src);
- }
-
- }
-
- public CompositingQuality CompositingQuality {
- get {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- if(hints.containsKey(awt.RenderingHints.KEY_ALPHA_INTERPOLATION)) {
- object value_ai = hints.get(awt.RenderingHints.KEY_ALPHA_INTERPOLATION);
-
- if (value_ai == awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED)
- return CompositingQuality.HighSpeed;
- if (value_ai == awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY)
- return CompositingQuality.HighQuality;
- if (value_ai == awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT)
- return CompositingQuality.Default;
- }
-
- return CompositingQuality.Default;
-
- }
- set {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- switch (value) {
- case CompositingQuality.AssumeLinear:
- case CompositingQuality.Default:
- case CompositingQuality.GammaCorrected:
- hints.put(awt.RenderingHints.KEY_ALPHA_INTERPOLATION,
- awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT);
- break;
- case CompositingQuality.HighQuality:
- hints.put(awt.RenderingHints.KEY_ALPHA_INTERPOLATION,
- awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- break;
- case CompositingQuality.HighSpeed:
- hints.put(awt.RenderingHints.KEY_ALPHA_INTERPOLATION,
- awt.RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);
- break;
-// case CompositingQuality.Invalid:
-// if(hints.containsKey(awt.RenderingHints.KEY_ALPHA_INTERPOLATION))
-// hints.remove(awt.RenderingHints.KEY_ALPHA_INTERPOLATION);
- }
-
- NativeObject.setRenderingHints(hints);
- }
- }
-
- public float DpiX {
- get {
- if (_image != null)
- return _image.HorizontalResolution;
-
- return DefaultScreenResolution;
- }
- }
-
- public float DpiY {
- get {
- if (_image != null)
- return _image.VerticalResolution;
-
- return DefaultScreenResolution;
- }
- }
-
- public InterpolationMode InterpolationMode {
- get {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- if(hints.containsKey(awt.RenderingHints.KEY_INTERPOLATION)) {
- object value_i = hints.get(awt.RenderingHints.KEY_INTERPOLATION);
-
- if (value_i == awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR)
- return InterpolationMode.Bilinear;
- if (value_i == awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC)
- return InterpolationMode.Bicubic;
- if (value_i == awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR)
- return InterpolationMode.NearestNeighbor;
- }
-
- return InterpolationMode.Default;
- }
- set {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
-
- switch (value) {
- case InterpolationMode.Bicubic:
- case InterpolationMode.HighQualityBicubic:
- case InterpolationMode.Low:
- hints.put(awt.RenderingHints.KEY_INTERPOLATION, awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- break;
- case InterpolationMode.High:
- case InterpolationMode.Bilinear:
- case InterpolationMode.HighQualityBilinear:
- hints.put(awt.RenderingHints.KEY_INTERPOLATION, awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR);
- break;
- case InterpolationMode.Default:
- if (hints.containsKey(awt.RenderingHints.KEY_INTERPOLATION))
- hints.remove(awt.RenderingHints.KEY_INTERPOLATION);
- break;
- case InterpolationMode.NearestNeighbor:
- hints.put(awt.RenderingHints.KEY_INTERPOLATION, awt.RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
- break;
- case InterpolationMode.Invalid:
- throw new ArgumentException();
- default:
- throw new ArgumentOutOfRangeException();
- }
-
- NativeObject.setRenderingHints(hints);
- }
- }
-
- public bool IsClipEmpty {
- get {
- return _clip.IsEmpty(this);
- }
- }
-
- public bool IsVisibleClipEmpty {
- get {
- if (_clip.IsEmpty(this))
- return true;
-
- return VisibleClipBounds.IsEmpty;
- }
- }
-
- public float PageScale {
- get {
- return _pageScale;
- }
- set {
- _pageScale = value;
- }
- }
-
- public GraphicsUnit PageUnit {
- get {
- return _pageUnit;
- }
- set {
- _pageUnit = value;
- }
- }
-
- static internal geom.AffineTransform GetFinalTransform(
- geom.AffineTransform transform, GraphicsUnit pageUnit, float pageScale) {
- geom.AffineTransform t = null;
- if (pageUnit != GraphicsUnit.Display) {
- float scale = pageScale * _unitConversion[ (int)pageUnit ];
- if (Math.Abs(scale-1f) > float.Epsilon)
- t = geom.AffineTransform.getScaleInstance(scale, scale);
- }
-
- if (t != null)
- t.concatenate(transform);
- else
- t = transform;
-
- return t;
- }
-
- internal geom.AffineTransform GetFinalTransform() {
- return GetFinalTransform(_transform.NativeObject, PageUnit, PageScale);
- }
-
- public PixelOffsetMode PixelOffsetMode {
- get {
- return _pixelOffsetMode;
- }
- set {
- _pixelOffsetMode = value;
- }
- }
-
- [MonoTODO]
- public Point RenderingOrigin {
- get {
- throw new NotImplementedException();
- }
- set {
- throw new NotImplementedException();
- }
- }
-
- public SmoothingMode SmoothingMode {
- get {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- if(hints.containsKey(awt.RenderingHints.KEY_ANTIALIASING)) {
- object value_aa = hints.get(awt.RenderingHints.KEY_ANTIALIASING);
- if (value_aa == awt.RenderingHints.VALUE_ANTIALIAS_ON) {
- if(hints.containsKey(awt.RenderingHints.KEY_RENDERING)) {
- object value_render = hints.get(awt.RenderingHints.KEY_RENDERING);
- if (value_render == awt.RenderingHints.VALUE_RENDER_QUALITY)
- return SmoothingMode.HighQuality;
- if (value_render == awt.RenderingHints.VALUE_RENDER_SPEED)
- return SmoothingMode.HighSpeed;
- }
-
- return SmoothingMode.AntiAlias;
- }
-
- if (value_aa == awt.RenderingHints.VALUE_ANTIALIAS_DEFAULT)
- return SmoothingMode.Default;
- }
- return SmoothingMode.None;
-
- }
-
- set {
- awt.RenderingHints hints = NativeObject.getRenderingHints();
-
- switch (value) {
- case SmoothingMode.None:
- if(hints.containsKey(awt.RenderingHints.KEY_ANTIALIASING))
- hints.remove(awt.RenderingHints.KEY_ANTIALIASING);
- if(hints.containsKey(awt.RenderingHints.KEY_RENDERING))
- hints.remove(awt.RenderingHints.KEY_RENDERING);
- break;
- case SmoothingMode.AntiAlias:
- hints.put(awt.RenderingHints.KEY_ANTIALIASING, awt.RenderingHints.VALUE_ANTIALIAS_ON);
- break;
- case SmoothingMode.HighQuality:
- hints.put(awt.RenderingHints.KEY_RENDERING, awt.RenderingHints.VALUE_RENDER_QUALITY);
- goto case SmoothingMode.AntiAlias;
- case SmoothingMode.HighSpeed:
- hints.put(awt.RenderingHints.KEY_RENDERING, awt.RenderingHints.VALUE_RENDER_SPEED);
- goto case SmoothingMode.None;
- case SmoothingMode.Default:
- hints.put(awt.RenderingHints.KEY_RENDERING, awt.RenderingHints.VALUE_RENDER_DEFAULT);
- goto case SmoothingMode.AntiAlias;
- case SmoothingMode.Invalid:
- throw new ArgumentException("Invalid parameter used.");
- }
-
- NativeObject.setRenderingHints(hints);
- }
- }
-
- /// <summary>
- /// Java does not have similar functionality
- /// </summary>
- public int TextContrast {
- get {
- return _textContrast;
- }
-
- set {
- _textContrast = value;
- }
- }
-
- public TextRenderingHint TextRenderingHint {
- get {
- return _textRenderingHint;
-// awt.RenderingHints hints = NativeObject.getRenderingHints();
-// if(hints.containsKey(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING)) {
-// if(hints.get(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING) ==
-// java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON)
-// return TextRenderingHint.AntiAlias;
-// if(hints.get(java.awt.RenderingHints.KEY_TEXT_ANTIALIASING) ==
-// java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF)
-// return TextRenderingHint.SingleBitPerPixel;
-// }
-// //return TextRenderingHint.SystemDefault;
-// return TextRenderingHint.SingleBitPerPixelGridFit;
- }
-
- set {
- _textRenderingHint = value;
- awt.RenderingHints hints = NativeObject.getRenderingHints();
- switch (value) {
- case TextRenderingHint.AntiAlias:
- case TextRenderingHint.AntiAliasGridFit:
- case TextRenderingHint.ClearTypeGridFit:
-// case TextRenderingHint.SystemDefault:
- hints.put(awt.RenderingHints.KEY_TEXT_ANTIALIASING,
- awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- break;
-
- case TextRenderingHint.SingleBitPerPixelGridFit:
- hints.put(awt.RenderingHints.KEY_TEXT_ANTIALIASING,
- awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
- break;
-
- case TextRenderingHint.SingleBitPerPixel:
- hints.put(awt.RenderingHints.KEY_TEXT_ANTIALIASING,
- awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
- break;
-
- case TextRenderingHint.SystemDefault:
- hints.put(awt.RenderingHints.KEY_TEXT_ANTIALIASING,
- awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
- break;
- }
-
- NativeObject.setRenderingHints(hints);
- }
- }
-
- public Matrix Transform {
- get {
- return _transform.Clone();
- }
- set {
- if (value == null)
- throw new ArgumentNullException("matrix");
-
- if (!value.IsInvertible)
- throw new ArgumentException("Invalid parameter used.");
-
- value.CopyTo(_transform);
- }
- }
-
- internal Matrix BaseTransform {
- get {
- return new Matrix(NativeObject.getTransform());
- }
- set {
- NativeObject.setTransform(value.NativeObject);
- }
- }
-
- internal void PrependBaseTransform(geom.AffineTransform t) {
- NativeObject.transform(t);
- }
-
- internal awt.Shape VisibleShape {
- get {
- return _windowRect;
- }
- }
-
- public RectangleF VisibleClipBounds {
- get {
- if (_clip.IsEmpty(this))
- return RectangleF.Empty;
-
- geom.Rectangle2D r = _clip.NativeObject.getBounds2D();
- awt.Shape clip = NativeObject.getClip();
- geom.Rectangle2D clipBounds = (clip != null) ? clip.getBounds2D() : _windowRect;
- geom.Rectangle2D.intersect(r, clipBounds, r);
- if ((r.getWidth() <= 0) || (r.getHeight() <= 0))
- return RectangleF.Empty;
-
- geom.AffineTransform t = GetFinalTransform();
- if (!t.isIdentity()) {
- geom.AffineTransform it = t.createInverse();
- r = it.createTransformedShape(r).getBounds2D();
- }
-
- return new RectangleF (r);
- }
- }
-
- void ConcatenateTransform(geom.AffineTransform transform, MatrixOrder order) {
- geom.AffineTransform at = _transform.NativeObject;
- Matrix.Multiply(at, transform, order);
- }
- #endregion
- }
-}
-
-
-
+++ /dev/null
-//
-// System.Drawing.Icon.cs
-//
-// Authors:
-// Andrew Skiba (andrews@mainsoft.com)
-// Dennis Hayes (dennish@Raytek.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Sanjay Gupta (gsanjay@novell.com)
-//
-// Copyright (C) 2005 Mainsoft, Corp. http://mainsoft.com
-// Copyright (C) 2002 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Drawing.Imaging;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- [Serializable]
- [ComVisible (false)]
- [TypeConverter(typeof(IconConverter))]
- public sealed class Icon
- : MarshalByRefObject, ISerializable, ICloneable, IDisposable
- {
- private System.Drawing.Bitmap _bitmap;
-
- #region Ctors
- private void SelectSize (int width, int height) {
- int count = _bitmap.GetFrameCount (FrameDimension.Resolution);
- bool sizeObtained = false;
- for (int i=0; i<count; i++){
- _bitmap.SelectActiveFrame (
- System.Drawing.Imaging.FrameDimension.Resolution, i);
- if (!sizeObtained)
- if (_bitmap.Height==height && _bitmap.Width==width) {
- sizeObtained = true;
- break;
- }
- }
-
- if (!sizeObtained){
- uint largestSize = 0;
- Bitmap tmpBmp = _bitmap;
- for (int j=0; j<count; j++){
- tmpBmp.SelectActiveFrame (FrameDimension.Resolution, j);
- uint thisSize = (uint)_bitmap.Height * (uint)_bitmap.Width;
- if (thisSize >= largestSize){
- largestSize = thisSize;
- _bitmap = tmpBmp;
- }
- }
- }
- }
-
- private Icon () {
- }
-
- internal Icon (Bitmap bitmap) {
- _bitmap = bitmap;
- }
-
- public Icon (Icon original, int width, int height) {
- _bitmap = original._bitmap;
- SelectSize (width, height);
- }
-
- public Icon (Icon original, Size size)
- :this (original, size.Width, size.Height) {
- }
-
- public Icon (Stream stream)
- : this (stream, 32, 32) {
- }
-
- public Icon (Stream stream, int width, int height)
- {
- _bitmap = new Bitmap (stream, false, ImageFormat.Icon);
- SelectSize (width, height);
- }
-
- public Icon (string fileName) {
- _bitmap = new Bitmap (fileName, false, ImageFormat.Icon);
- }
-
- public Icon (Type type, string resource)
- {
- using (Stream s = type.Assembly.GetManifestResourceStream (resource)) {
- if (s == null)
- throw new FileNotFoundException ("Resource name was not found: `" + resource + "'");
- _bitmap = new Bitmap (s, false, ImageFormat.Icon);
- }
- }
-
- [MonoTODO]
- private Icon (SerializationInfo info, StreamingContext context)
- {
- //FIXME, need to check how MS stores Icon structure
- //Will serialized form help
- throw new NotImplementedException ();
- }
- #endregion
-
- [MonoTODO]
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- public void Dispose ()
- {
-#if INTPTR_SUPPORT
- if (winHandle!=IntPtr.Zero)
- winHandle = IntPtr.Zero;
-#endif
- }
-
- public object Clone ()
- {
- Icon newIcon = new Icon ();
- newIcon._bitmap = (Bitmap)_bitmap.Clone ();
- return newIcon;
- }
-
-#if INTPTR_SUPPORT
- [MonoTODO]
- public static Icon FromHandle (IntPtr handle)
- {
- throw new NotImplementedException ();
- }
-#endif
- public void Save (Stream outputStream) {
- _bitmap.Save (outputStream, System.Drawing.Imaging.ImageFormat.Icon);
- }
-
- public Bitmap ToBitmap () {
- return _bitmap;
- }
-
- public override string ToString ()
- {
- //is this correct, this is what returned by .Net
- return "<Icon>";
- }
-
-#if INTPTR_SUPPORT
- [Browsable (false)]
- public IntPtr Handle {
- get {
- return winHandle;
- }
- }
-#endif
-
- [Browsable (false)]
- public int Height {
- get {
- return _bitmap.Height;
- }
- }
-
- public Size Size {
- get {
- return _bitmap.Size;
- }
- }
-
- [Browsable (false)]
- public int Width {
- get {
- return _bitmap.Width;
- }
- }
- }
-}
+++ /dev/null
-//
-// System.Drawing.Icon.cs
-//
-// Authors:
-// Dennis Hayes (dennish@Raytek.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Sanjay Gupta (gsanjay@novell.com)
-//
-// Copyright (C) 2002 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- [Serializable]
- [ComVisible (false)]
- [Editor ("System.Drawing.Design.IconEditor, " + Consts.AssemblySystem_Drawing_Design, typeof (System.Drawing.Design.UITypeEditor))]
- [TypeConverter(typeof(IconConverter))]
- public sealed class Icon : MarshalByRefObject, ISerializable, ICloneable, IDisposable
- {
- [StructLayout(LayoutKind.Sequential)]
- internal struct IconDirEntry {
- internal byte width; // Width of icon
- internal byte height; // Height of icon
- internal byte colorCount; // colors in icon
- internal byte reserved; // Reserved
- internal ushort planes; // Color Planes
- internal ushort bitCount; // Bits per pixel
- internal uint bytesInRes; // bytes in resource
- internal uint imageOffset; // position in file
- };
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct IconDir {
- internal ushort idReserved; // Reserved
- internal ushort idType; // resource type (1 for icons)
- internal ushort idCount; // how many images?
- internal IconDirEntry [] idEntries; // the entries for each image
- };
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct BitmapInfoHeader {
- internal uint biSize;
- internal int biWidth;
- internal int biHeight;
- internal ushort biPlanes;
- internal ushort biBitCount;
- internal uint biCompression;
- internal uint biSizeImage;
- internal int biXPelsPerMeter;
- internal int biYPelsPerMeter;
- internal uint biClrUsed;
- internal uint biClrImportant;
- };
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct IconImage {
- internal BitmapInfoHeader iconHeader; //image header
- internal uint [] iconColors; //colors table
- internal byte [] iconXOR; // bits for XOR mask
- internal byte [] iconAND; //bits for AND mask
- };
-
- private Size iconSize;
- private IntPtr winHandle = IntPtr.Zero;
- private IconDir iconDir;
- private ushort id;
- private IconImage [] imageData;
- bool destroyIcon = true;
-
- private Icon ()
- {
- }
-#if INTPTR_SUPPORTED
- [MonoTODO ("Implement fully")]
- private Icon (IntPtr handle)
- {
- this.winHandle = handle;
-
- IconInfo ii;
- GDIPlus.GetIconInfo (winHandle, out ii);
- if (ii.IsIcon) {
- // If this structure defines an icon, the hot spot is always in the center of the icon
- iconSize = new Size (ii.xHotspot * 2, ii.yHotspot * 2);
- }
- else {
- throw new NotImplementedException ();
- }
-
- this.destroyIcon = false;
- }
-#endif
- public Icon (Icon original, int width, int height) : this (original, new Size(width, height))
- {
- }
-
- public Icon (Icon original, Size size)
- {
- this.iconSize = size;
- this.winHandle = original.winHandle;
- this.iconDir = original.iconDir;
- this.imageData = original.imageData;
-
- int count = iconDir.idCount;
- bool sizeObtained = false;
- for (int i=0; i<count; i++){
- IconDirEntry ide = iconDir.idEntries [i];
- if (!sizeObtained)
- if (ide.height==size.Height && ide.width==size.Width) {
- this.id = (ushort) i;
- sizeObtained = true;
- this.iconSize.Height = ide.height;
- this.iconSize.Width = ide.width;
- break;
- }
- }
-
- if (!sizeObtained){
- uint largestSize = 0;
- for (int j=0; j<count; j++){
- if (iconDir.idEntries [j].bytesInRes >= largestSize){
- largestSize = iconDir.idEntries [j].bytesInRes;
- this.id = (ushort) j;
- this.iconSize.Height = iconDir.idEntries [j].height;
- this.iconSize.Width = iconDir.idEntries [j].width;
- }
- }
- }
- }
-
- public Icon (Stream stream) : this (stream, 32, 32)
- {
- }
-
- public Icon (Stream stream, int width, int height)
- {
- InitFromStreamWithSize (stream, width, height);
- }
-
- public Icon (string fileName) : this (new FileStream (fileName, FileMode.Open))
- {
- }
-
- public Icon (Type type, string resource)
- {
- using (Stream s = type.Assembly.GetManifestResourceStream (type, resource)) {
- if (s == null) {
- throw new FileNotFoundException ("Resource name was not found: `" + resource + "'");
- }
- InitFromStreamWithSize (s, 32, 32); // 32x32 is default
- }
- }
-
- private Icon (SerializationInfo info, StreamingContext context)
- {
- MemoryStream dataStream = null;
- int width=0;
- int height=0;
- foreach (SerializationEntry serEnum in info) {
- if (String.Compare(serEnum.Name, "IconData", true) == 0) {
- dataStream = new MemoryStream ((byte []) serEnum.Value);
- }
- if (String.Compare(serEnum.Name, "IconSize", true) == 0) {
- Size iconSize = (Size) serEnum.Value;
- width = iconSize.Width;
- height = iconSize.Height;
- }
- }
- if (dataStream != null && width != 0 && height != 0) {
- dataStream.Seek (0, SeekOrigin.Begin);
- InitFromStreamWithSize (dataStream, width, height);
- }
- }
-
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
- {
- MemoryStream ms = new MemoryStream ();
- Save (ms);
- info.AddValue ("IconSize", this.Size, typeof (Size));
- info.AddValue ("IconData", ms.ToArray ());
- }
-
- public void Dispose ()
- {
-#if !TARGET_JVM
- DisposeIcon ();
- GC.SuppressFinalize(this);
-#endif
- }
-#if !TARGET_JVM
- void DisposeIcon ()
- {
- if (winHandle ==IntPtr.Zero)
- return;
-
- if (destroyIcon) {
- //TODO: will have to call some win32 icon stuff
- winHandle = IntPtr.Zero;
- }
- }
-#endif
-
- public object Clone ()
- {
- return new Icon (this, this.Width, this.Height);
- }
-#if INTPTR_SUPPORTED
- public static Icon FromHandle (IntPtr handle)
- {
- if (handle == IntPtr.Zero)
- throw new ArgumentException ("handle");
-
- return new Icon (handle);
- }
-#endif
- public void Save (Stream outputStream)
- {
- if (iconDir.idEntries!=null){
- BinaryWriter bw = new BinaryWriter (outputStream);
- //write icondir
- bw.Write (iconDir.idReserved);
- bw.Write (iconDir.idType);
- ushort count = iconDir.idCount;
- bw.Write (count);
-
- //now write iconDirEntries
- for (int i=0; i<(int)count; i++){
- IconDirEntry ide = iconDir.idEntries [i];
- bw.Write (ide.width);
- bw.Write (ide.height);
- bw.Write (ide.colorCount);
- bw.Write (ide.reserved);
- bw.Write (ide.planes);
- bw.Write (ide.bitCount);
- bw.Write (ide.bytesInRes);
- bw.Write (ide.imageOffset);
- }
-
- //now write iconImage data
- for (int i=0; i<(int)count; i++){
- BitmapInfoHeader bih = imageData [i].iconHeader;
- bw.Write (bih.biSize);
- bw.Write (bih.biWidth);
- bw.Write (bih.biHeight);
- bw.Write (bih.biPlanes);
- bw.Write (bih.biBitCount);
- bw.Write (bih.biCompression);
- bw.Write (bih.biSizeImage);
- bw.Write (bih.biXPelsPerMeter);
- bw.Write (bih.biYPelsPerMeter);
- bw.Write (bih.biClrUsed);
- bw.Write (bih.biClrImportant);
-
- //now write color table
- int colCount = imageData [i].iconColors.Length;
- for (int j=0; j<colCount; j++)
- bw.Write (imageData [i].iconColors [j]);
-
- //now write XOR Mask
- bw.Write (imageData [i].iconXOR);
-
- //now write AND Mask
- bw.Write (imageData [i].iconAND);
- }
- bw.Flush();
- }
- }
-
- public Bitmap ToBitmap ()
- {
- Bitmap bmp;
-
- if (imageData != null) {
-
- // select active icon from the iconDirEntry
- IconImage ii = imageData [this.id];
- MemoryStream stream = new MemoryStream ();
-
- BinaryWriter writer = new BinaryWriter (stream);
-
- try {
- // write bitmap file header
- // start with writing signature
- writer.Write ('B');
- writer.Write ('M');
-
- // write the file size
- // file size = bitmapfileheader + bitmapinfo +
- // colorpalette + image bits
- // sizeof bitmapfileheader = 14 bytes
- // sizeof bitmapinfo = 40 bytes
- uint offSet = (uint) (14 + 40 + ii.iconColors.Length * 4);
- uint fileSize = (uint) (offSet + ii.iconXOR.Length);
- writer.Write (fileSize);
-
- // write reserved words
- ushort reserved12 = 0;
- writer.Write (reserved12);
- writer.Write (reserved12);
-
- // write offset
- writer.Write (offSet);
-
- // write bitmapfile header
- BitmapInfoHeader bih = ii.iconHeader;
- writer.Write (bih.biSize);
- writer.Write (bih.biWidth);
- writer.Write (bih.biHeight/2);
- writer.Write (bih.biPlanes);
- writer.Write (bih.biBitCount);
- writer.Write (bih.biCompression);
- writer.Write (bih.biSizeImage);
- writer.Write (bih.biXPelsPerMeter);
- writer.Write (bih.biYPelsPerMeter);
- writer.Write (bih.biClrUsed);
- writer.Write (bih.biClrImportant);
-
- // write color table
- int colCount = ii.iconColors.Length;
- for (int j = 0; j < colCount; j++)
- writer.Write (ii.iconColors [j]);
-
- // write image bits
- writer.Write (ii.iconXOR);
-
- writer.Flush ();
-
- stream.Position = 0;
-
- // create bitmap from stream and return
- if (colCount > 0) {
- Bitmap new_bmp;
-
- new_bmp = new Bitmap(stream);
- bmp = new Bitmap(new_bmp, bih.biWidth, bih.biHeight/2);
- new_bmp.Dispose();
- } else {
- bmp = new Bitmap(stream);
- }
-
- // This hack is so ugly, it's embarassing.
- // But icons are small, so it should be ok for now
- for (int y = 0; y < bih.biHeight/2; y++) {
- for (int x = 0; x < bih.biWidth / 8; x++) {
- for (int bit = 7; bit >= 0; bit--) {
- if (((ii.iconAND[y * bih.biWidth / 8 +x] >> bit) & 1) != 0) {
- bmp.SetPixel(x*8 + 7-bit, bih.biHeight/2 - y - 1, Color.Transparent);
- }
- }
- }
- }
-
- } catch (Exception e) {
- throw e;
- } finally {
- writer.Close (); // closes the underlying stream as well
- }
- } else {
- bmp = new Bitmap (32, 32);
- }
-
- return bmp;
- }
-
- public override string ToString ()
- {
- //is this correct, this is what returned by .Net
- return "<Icon>";
- }
-
- [Browsable (false)]
- public IntPtr Handle {
- get {
- return winHandle;
- }
- }
-
- [Browsable (false)]
- public int Height {
- get {
- return iconSize.Height;
- }
- }
-
- public Size Size {
- get {
- return iconSize;
- }
- }
-
- [Browsable (false)]
- public int Width {
- get {
- return iconSize.Width;
- }
- }
-
-#if !TARGET_JVM
- ~Icon ()
- {
- DisposeIcon ();
- }
-#endif
-
- private void InitFromStreamWithSize (Stream stream, int width, int height)
- {
- //read the icon header
- if (stream == null || stream.Length == 0)
- throw new System.ArgumentException ("The argument 'stream' must be a picture that can be used as a Icon", "stream");
-
- BinaryReader reader = new BinaryReader (stream);
-
- //iconDir = new IconDir ();
- iconDir.idReserved = reader.ReadUInt16();
- if (iconDir.idReserved != 0) //must be 0
- throw new System.ArgumentException ("Invalid Argument", "stream");
-
- iconDir.idType = reader.ReadUInt16();
- if (iconDir.idType != 1) //must be 1
- throw new System.ArgumentException ("Invalid Argument", "stream");
-
- ushort dirEntryCount = reader.ReadUInt16();
- iconDir.idCount = dirEntryCount;
- iconDir.idEntries = new IconDirEntry [dirEntryCount];
- imageData = new IconImage [dirEntryCount];
- bool sizeObtained = false;
- //now read in the IconDirEntry structures
- for (int i=0; i<dirEntryCount; i++){
- IconDirEntry ide;
- ide.width = reader.ReadByte ();
- ide.height = reader.ReadByte ();
- ide.colorCount = reader.ReadByte ();
- ide.reserved = reader.ReadByte ();
- ide.planes = reader.ReadUInt16 ();
- ide.bitCount = reader.ReadUInt16 ();
- ide.bytesInRes = reader.ReadUInt32 ();
- ide.imageOffset = reader.ReadUInt32 ();
- iconDir.idEntries [i] = ide;
- //is this is the best fit??
- if (!sizeObtained)
- if (ide.height==height && ide.width==width) {
- this.id = (ushort) i;
- sizeObtained = true;
- this.iconSize.Height = ide.height;
- this.iconSize.Width = ide.width;
- }
- }
- //if we havent found the best match, return the one with the
- //largest size. Is this approach correct??
- if (!sizeObtained){
- uint largestSize = 0;
- for (int j=0; j<dirEntryCount; j++){
- if (iconDir.idEntries [j].bytesInRes >= largestSize) {
- largestSize = iconDir.idEntries [j].bytesInRes;
- this.id = (ushort) j;
- this.iconSize.Height = iconDir.idEntries [j].height;
- this.iconSize.Width = iconDir.idEntries [j].width;
- }
- }
- }
-
- //now read in the icon data
- for (int j = 0; j<dirEntryCount; j++)
- {
- IconImage iidata = new IconImage();
- BitmapInfoHeader bih = new BitmapInfoHeader();
- stream.Seek (iconDir.idEntries [j].imageOffset, SeekOrigin.Begin);
- byte [] buffer = new byte [iconDir.idEntries [j].bytesInRes];
- stream.Read (buffer, 0, buffer.Length);
- BinaryReader bihReader = new BinaryReader (new MemoryStream(buffer));
- bih.biSize = bihReader.ReadUInt32 ();
- bih.biWidth = bihReader.ReadInt32 ();
- bih.biHeight = bihReader.ReadInt32 ();
- bih.biPlanes = bihReader.ReadUInt16 ();
- bih.biBitCount = bihReader.ReadUInt16 ();
- bih.biCompression = bihReader.ReadUInt32 ();
- bih.biSizeImage = bihReader.ReadUInt32 ();
- bih.biXPelsPerMeter = bihReader.ReadInt32 ();
- bih.biYPelsPerMeter = bihReader.ReadInt32 ();
- bih.biClrUsed = bihReader.ReadUInt32 ();
- bih.biClrImportant = bihReader.ReadUInt32 ();
-
- iidata.iconHeader = bih;
- //Read the number of colors used and corresponding memory occupied by
- //color table. Fill this memory chunk into rgbquad[]
- int numColors;
- switch (bih.biBitCount){
- case 1: numColors = 2;
- break;
- case 4: numColors = 16;
- break;
- case 8: numColors = 256;
- break;
- default: numColors = 0;
- break;
- }
-
- iidata.iconColors = new uint [numColors];
- for (int i=0; i<numColors; i++)
- iidata.iconColors [i] = bihReader.ReadUInt32 ();
-
- //XOR mask is immediately after ColorTable and its size is
- //icon height* no. of bytes per line
-
- //icon height is half of BITMAPINFOHEADER.biHeight, since it contains
- //both XOR as well as AND mask bytes
- int iconHeight = bih.biHeight/2;
-
- //bytes per line should should be uint aligned
- int numBytesPerLine = ((((bih.biWidth * bih.biPlanes * bih.biBitCount)+ 31)>>5)<<2);
-
- //Determine the XOR array Size
- int xorSize = numBytesPerLine * iconHeight;
- iidata.iconXOR = new byte [xorSize];
- for (int i=0; i<xorSize; i++)
- iidata.iconXOR[i] = bihReader.ReadByte();
-
- //Determine the AND array size
- //For this i subtract the current position from the length.
- //ugly hack...
- int andSize = (int) (bihReader.BaseStream.Length - bihReader.BaseStream.Position);
- iidata.iconAND = new byte [andSize];
- for (int i=0; i<andSize; i++)
- iidata.iconAND[i] = bihReader.ReadByte();
-
- imageData [j] = iidata;
- bihReader.Close();
- }
-
- reader.Close();
- }
- }
-}
+++ /dev/null
-//
-// System.Drawing.Image.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Christian Meyer (Christian.Meyer@cs.tum.edu)
-// Alexandre Pigolkine (pigolkine@gmx.de)
-// Jordi Mas i Hernandez (jordi@ximian.com)
-//
-namespace System.Drawing {
-
- using System;
- using System.Runtime.Remoting;
- using System.Runtime.Serialization;
- using System.Runtime.InteropServices;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Imaging;
- using System.IO;
- using System.Xml;
- using Mainsoft.Drawing.Imaging;
-
- using BufferedImage = java.awt.image.BufferedImage;
- using java.io;
- using javax.imageio;
- using javax.imageio.stream;
- using vmw.common;
- using awt = java.awt;
- using image = java.awt.image;
-
- public abstract class Image : MarshalByRefObject, IDisposable , ICloneable {
- #region Vars
- PlainImageCollection _nativeObject = new PlainImageCollection();
- protected int _flags = 0;
-
- //consider using Image[] to support many thumbnails per Image
- #endregion
-
- #region flags enum
- [Flags]
- protected enum ImageFlags {
- ImageFlagsNone = 0,
- ImageFlagsScalable = 0x0001,
- ImageFlagsHasAlpha = 0x0002,
- ImageFlagsHasTranslucent = 0x0004,
- ImageFlagsPartiallyScalable = 0x0008,
- ImageFlagsColorSpaceRGB = 0x0010,
- ImageFlagsColorSpaceCMYK = 0x0020,
- ImageFlagsColorSpaceGRAY = 0x0040,
- ImageFlagsColorSpaceYCBCR = 0x0080,
- ImageFlagsColorSpaceYCCK = 0x0100,
- ImageFlagsHasRealDPI = 0x1000,
- ImageFlagsHasRealPixelSize = 0x2000,
- ImageFlagsReadOnly = 0x00010000,
- ImageFlagsCaching = 0x00020000
- }
- #endregion
-
- #region Constructor
- public void Dispose () {
- }
-
- protected virtual void DisposeResources () {
- }
-
- protected virtual void Dispose (bool disposing) {
- }
-
- // Derived classes must call Initialize () when they use this constructor
- protected Image () {
- }
-
- protected Image (java.awt.Image nativeObject) : this(nativeObject, ImageFormat.MemoryBmp) {
- }
-
- protected Image (java.awt.Image nativeObject, ImageFormat format) {
- PlainImage pi = new PlainImage( nativeObject, null, format, 0, 0, FrameDimension.Page );
- Initialize( pi, false );
- }
-
- protected void Initialize (PlainImage pi, bool addToCollection) {
- if (!addToCollection)
- NativeObject.Clear();
-
- NativeObject.Add( pi );
- }
-
- #endregion
-
- #region Internals
-
- internal PlainImageCollection NativeObject {
- get {
- return _nativeObject;
- }
- }
-
- internal PlainImage CurrentImage {
- get {
- return NativeObject.CurrentImage;
- }
- }
-
- #endregion
-
- #region FromFile
- [MonoTODO]
- public static Image FromFile(string filename) {
- //FIXME: check if it's not a metafile, throw NotImplementedException
- return new Bitmap (filename);
- }
-
- [MonoTODO]
- public static Image FromFile(string filename, bool useIcm) {
- //FIXME: check if it's not a metafile, throw NotImplementedException
- return new Bitmap (filename, useIcm);
- }
- #endregion
-
- #region GetThumbnailImageAbort
- [Serializable]
- public delegate bool GetThumbnailImageAbort();
- #endregion
-
- #region Clone
- public abstract object Clone();
- #endregion
-
- // static
- #region FromStream
- [MonoTODO]
- public static Image FromStream (Stream stream) {
- //FIXME: check if it's not a metafile, throw NotImplementedException
- return new Bitmap (stream);
- }
-
- [MonoTODO]
- public static Image FromStream (Stream stream, bool useIcm) {
- //FIXME: check if it's not a metafile, throw NotImplementedException
- return new Bitmap (stream, useIcm);
- }
- #endregion
-
- #region GetPixelFormatSize
- public static int GetPixelFormatSize(PixelFormat pixfmt) {
-
- int result = 0;
- switch (pixfmt) {
- case PixelFormat.Format16bppArgb1555:
- case PixelFormat.Format16bppGrayScale:
- case PixelFormat.Format16bppRgb555:
- case PixelFormat.Format16bppRgb565:
- result = 16;
- break;
- case PixelFormat.Format1bppIndexed:
- result = 1;
- break;
- case PixelFormat.Format24bppRgb:
- result = 24;
- break;
- case PixelFormat.Format32bppArgb:
- case PixelFormat.Format32bppPArgb:
- case PixelFormat.Format32bppRgb:
- result = 32;
- break;
- case PixelFormat.Format48bppRgb:
- result = 48;
- break;
- case PixelFormat.Format4bppIndexed:
- result = 4;
- break;
- case PixelFormat.Format64bppArgb:
- case PixelFormat.Format64bppPArgb:
- result = 64;
- break;
- case PixelFormat.Format8bppIndexed:
- result = 8;
- break;
- }
- return result;
- }
- #endregion
-
- #region IsAlphaPixelFormat
- public static bool IsAlphaPixelFormat(PixelFormat pixfmt) {
- return (pixfmt & PixelFormat.Alpha) != PixelFormat.Undefined;
- }
- #endregion
-
- #region IsCanonicalPixelFormat
- // TBD: implement this
- public static bool IsCanonicalPixelFormat (PixelFormat pixfmt) {
- return (pixfmt & PixelFormat.Canonical) != PixelFormat.Undefined;
- }
- #endregion
-
- #region IsExtendedPixelFormat
- // TBD: implement this
- public static bool IsExtendedPixelFormat (PixelFormat pixfmt) {
- return (pixfmt & PixelFormat.Extended) != PixelFormat.Undefined;
- }
- #endregion
-
- // non-static
- #region GetBounds
- public RectangleF GetBounds (ref GraphicsUnit pageUnit) {
- pageUnit = GraphicsUnit.Pixel; //java.awt.Image always returns pixels
- return new RectangleF((float)0,(float)0,(float)Width,(float)Height);
- }
- #endregion
-
- #region GetEncoderParameterList
- [MonoTODO]
- public EncoderParameters GetEncoderParameterList(Guid encoder) {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region GetFrameCount
- public int GetFrameCount(FrameDimension dimension) {
- // FALLBACK: now, only one dimension assigned for all frames
- if (dimension.Guid != CurrentImage.Dimension.Guid)
- throw new ArgumentException ("dimension");
-
- return NativeObject.Count;
- }
- #endregion
-
- #region GetPropertyItem
- [MonoTODO]
- public PropertyItem GetPropertyItem(int propid) {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region RemovePropertyItem
- [MonoTODO]
- public void RemovePropertyItem (int propid) {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region RotateFlip
- public void RotateFlip (RotateFlipType rotateFlipType) {
- awt.geom.AffineTransform tx;
-
- if ( !(CurrentImage.NativeImage is image.BufferedImage) )
- // TBD: This implementation is for raster formats only
- throw new NotImplementedException("Only raster formats are supported");
-
- switch (rotateFlipType) {
- case RotateFlipType.RotateNoneFlipNone :
- return;
-
- case RotateFlipType.Rotate90FlipNone :
- tx = awt.geom.AffineTransform.getRotateInstance(Math.PI / 2);
- tx.translate( 0, -Height );
- break;
-
- case RotateFlipType.Rotate180FlipNone :
- tx = awt.geom.AffineTransform.getScaleInstance(-1, -1);
- tx.translate( -Width, -Height );
- break;
-
- case RotateFlipType.Rotate270FlipNone :
- tx = awt.geom.AffineTransform.getRotateInstance(-Math.PI / 2);
- tx.translate( -Width, 0 );
- break;
-
- case RotateFlipType.RotateNoneFlipX :
- tx = awt.geom.AffineTransform.getScaleInstance(-1, 1);
- tx.translate( -Width, 0 );
- break;
-
- case RotateFlipType.Rotate90FlipX :
- tx = awt.geom.AffineTransform.getRotateInstance(Math.PI / 2);
- tx.scale(1, -1);
- break;
-
- case RotateFlipType.Rotate180FlipX :
- tx = awt.geom.AffineTransform.getScaleInstance(1, -1);
- tx.translate( 0, -Height );
- break;
-
- case RotateFlipType.Rotate270FlipX :
- tx = awt.geom.AffineTransform.getRotateInstance(Math.PI / 2);
- tx.scale(-1, 1);
- tx.translate( -Width, -Height );
- break;
-
- default:
- throw new ArgumentOutOfRangeException();
- }
- image.AffineTransformOp op = new image.AffineTransformOp(tx, image.AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
- CurrentImage.NativeImage = op.filter((BufferedImage)CurrentImage.NativeImage, null);
- }
- #endregion
-
- #region Save
- protected abstract void InternalSave (ImageOutputStream output, Guid clsid);
-
- [MonoTODO]
- public void Save (Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) {
- //TBD: implement encoderParams
- if (encoder == null)
- throw new ArgumentNullException("Value cannot be null.");
-
- try {
- java.io.OutputStream jos = vmw.common.IOUtils.ToOutputStream (stream);
- MemoryCacheImageOutputStream output = new MemoryCacheImageOutputStream(jos);
- InternalSave (output, encoder.Clsid);
- output.flush();
- }
- catch (java.io.IOException ex) {
- throw new System.IO.IOException(ex.Message, ex);
- }
- }
-
- public void Save(string filename, ImageCodecInfo encoder, EncoderParameters encoderParams) {
- using (Stream outputStream = new FileStream(filename, FileMode.Create))
- Save(outputStream, encoder, encoderParams);
- }
-
- public void Save (string filename) {
- Save (filename, ImageFormat.Png);
- }
-
- public void Save (Stream stream, ImageFormat format) {
- ImageCodecInfo encoder = ImageCodec.FindEncoder ( ImageCodec.ImageFormatToClsid (format) );
- Save (stream, encoder, null);
- }
-
- public void Save(string filename, ImageFormat format) {
- using (Stream outputStream = new FileStream(filename, FileMode.Create))
- Save(outputStream, format);
- }
- #endregion
-
- #region SaveAdd
- [MonoTODO]
- public void SaveAdd(EncoderParameters encoderParams) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SaveAdd(Image image, EncoderParameters encoderParams) {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region SelectActiveFrame
-
- // TBD: .Net does not load all frames at the initialization. New frames loaded by request.
- [MonoTODO]
- public int SelectActiveFrame(FrameDimension dimension, int frameIndex) {
- // FALLBACK: now, only one dimension assigned for all frames
- if (dimension.Guid != CurrentImage.Dimension.Guid)
- throw new ArgumentException ("dimension");
-
- if (frameIndex < NativeObject.Count)
- NativeObject.CurrentImageIndex = frameIndex;
-
- return frameIndex;
- }
- #endregion
-
- #region SetPropertyItem
- [MonoTODO]
- public void SetPropertyItem(PropertyItem propitem) {
- throw new NotImplementedException ();
- }
- #endregion
-
- // properties
- #region Flags
- public int Flags {
- // TDB: ImageFlagsScalable, ImageFlagsHasTranslucent, ImageFlagsPartiallyScalable, ImageFlagsCaching
- [MonoTODO]
- get {
- image.ColorModel colorModel = ((BufferedImage)CurrentImage.NativeImage).getColorModel();
- int t = colorModel.getColorSpace().getType();
-
- if (t == awt.color.ColorSpace.TYPE_RGB)
- _flags |= (int)ImageFlags.ImageFlagsColorSpaceRGB;
- else if (t == awt.color.ColorSpace.TYPE_CMYK)
- _flags |= (int)ImageFlags.ImageFlagsColorSpaceCMYK;
- else if (t == awt.color.ColorSpace.TYPE_GRAY)
- _flags |= (int)ImageFlags.ImageFlagsColorSpaceGRAY;
- else if (t == awt.color.ColorSpace.TYPE_YCbCr)
- _flags |= (int)ImageFlags.ImageFlagsColorSpaceYCBCR;
-
- if (colorModel.hasAlpha())
- _flags |= (int)ImageFlags.ImageFlagsHasAlpha;
-
- if ((CurrentImage.HorizontalResolution > 0) || (CurrentImage.VerticalResolution > 0))
- _flags |= (int)ImageFlags.ImageFlagsHasRealDPI;
-
- return _flags;
- }
- }
- #endregion
-
- #region FrameDimensionsList
- [MonoTODO]
- public Guid[] FrameDimensionsList {
- // TBD: look over all frames and build array of dimensions
- // FALLBACK: now, only one dimension assigned for all frames
- get {
- Guid [] dimList = new Guid[]{CurrentImage.Dimension.Guid};
- return dimList;
- }
- }
- #endregion
-
- #region Height
- public int Height {
- get {
- return CurrentImage.NativeImage.getHeight(null);
- }
- }
- #endregion
-
- #region HorizontalResolution
- public float HorizontalResolution {
- get {
- if (CurrentImage.HorizontalResolution <= 1)
- return Graphics.DefaultScreenResolution;
-
- return CurrentImage.HorizontalResolution;
- }
- }
- #endregion
-
- #region ColorPalette
- [MonoTODO]
- public ColorPalette Palette {
- get {
- if (!(CurrentImage.NativeImage is BufferedImage))
- // TBD: This implementation is for raster formats only
- throw new NotImplementedException("Only raster formats are supported");
-
- image.ColorModel colorModel = ((BufferedImage)CurrentImage.NativeImage).getColorModel();
- if (colorModel is image.IndexColorModel) {
-
- Color [] colors = new Color[ ((image.IndexColorModel)colorModel).getMapSize() ];
- for (int i=0; i<colors.Length; i++) {
- colors[i] = Color.FromArgb( ((image.IndexColorModel)colorModel).getRGB(i) );
- }
- ColorPalette palette = new ColorPalette(0, colors);
- return palette;
- }
- return new ColorPalette();
- }
- set {
- throw new NotImplementedException ();
- }
- }
- #endregion
-
- #region PhysicalDimension
- public SizeF PhysicalDimension {
- get {
- return new Size(Width, Height);
- }
- }
- #endregion
-
- #region PixelFormat
- abstract protected PixelFormat InternalPixelFormat {get;}
-
- public PixelFormat PixelFormat {
- get {
- return InternalPixelFormat;
- }
- }
- #endregion
-
- #region PropertiIdList
- [MonoTODO]
- public int[] PropertyIdList {
- get {
- throw new NotImplementedException ();
- }
- }
- #endregion
-
- #region PropertItems
- [MonoTODO]
- public PropertyItem[] PropertyItems {
- get {
- throw new NotImplementedException ();
- }
- }
- #endregion
-
- #region RawFormat
- public ImageFormat RawFormat {
- get {
- return CurrentImage.ImageFormat;
- }
- }
- #endregion
-
- #region Size
- public Size Size {
- get {
- return new Size(Width, Height);
- }
- }
- #endregion
-
- #region VerticalResolution
- public float VerticalResolution {
- get {
- if (CurrentImage.VerticalResolution <= 1)
- return Graphics.DefaultScreenResolution;
-
- return CurrentImage.VerticalResolution;
- }
- }
- #endregion
-
- #region Width
- public int Width {
- get {
- return CurrentImage.NativeImage.getWidth(null);
- }
- }
- #endregion
-
- public Image GetThumbnailImage(int thumbWidth, int thumbHeight, Image.GetThumbnailImageAbort callback, IntPtr callbackData) {
- awt.Image img;
-
-#if THUMBNAIL_SUPPORTED
- if (CurrentImage.Thumbnails != null) {
- for (int i=0; i < CurrentImage.Thumbnails.Length; i++)
- if (CurrentImage.Thumbnails[i] != null) {
- img = CurrentImage.Thumbnails[i];
- if (img.getHeight(null) == thumbHeight && img.getWidth(null) == thumbWidth)
- return ImageFromNativeImage(img, RawFormat);
- }
- }
-#endif
- img = CurrentImage.NativeImage.getScaledInstance(thumbWidth, thumbHeight, awt.Image.SCALE_DEFAULT);
-
- return ImageFromNativeImage(img, RawFormat);
- }
-#if INTPTR_SUPPORT
- [MonoTODO]
- public static Bitmap FromHbitmap(IntPtr hbitmap)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Bitmap FromHbitmap(IntPtr hbitmap, IntPtr hpalette)
- {
- throw new NotImplementedException ();
- }
-#endif
-
- internal static Image ImageFromNativeImage(awt.Image nativeImage, ImageFormat format) {
- if (nativeImage is BufferedImage)
- return new Bitmap(nativeImage, format);
-
- throw new ArgumentException("Invalid image type");
- }
-
- protected abstract awt.Image [] CloneNativeObjects(awt.Image [] src);
- }
-
-}
+++ /dev/null
-//
-// System.Drawing.KnownColors.cs
-//
-// Authors:
-// Konstantin Triger (kostat@mainsoft.com)
-//
-// Copyright (C) 2007 Mainsoft Corporation (http://www.mainsoft.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 awt = java.awt;
-
-namespace System.Drawing
-{
- sealed class KnownColors
- {
- static readonly Color [] SystemColorsCache;
-
- KnownColors () { }
-
- static KnownColors ()
- {
-#if !NET_2_0
- SystemColorsCache = new Color[27]; //enough for all system color indices
-#else
- SystemColorsCache = new Color [175]; //enough for all system color indices
-#endif
-
- if (Graphics.IsHeadless) {
- SystemColorsCache[(int)KnownColor.ActiveBorder] = Color.FromArgbSystem (255, 212, 208, 200, "ActiveBorder", KnownColor.ActiveBorder);
- SystemColorsCache[(int)KnownColor.ActiveCaption] = Color.FromArgbSystem (255, 10, 36, 106, "ActiveCaption", KnownColor.ActiveCaption);
- SystemColorsCache[(int)KnownColor.ActiveCaptionText] = Color.FromArgbSystem (255, 255, 255, 255, "ActiveCaptionText", KnownColor.ActiveCaptionText);
- //TODO: find a more close approximation
- SystemColorsCache[(int)KnownColor.AppWorkspace] = Color.FromArgbSystem (255, 128, 128, 128, "AppWorkspace", KnownColor.AppWorkspace);
- SystemColorsCache[(int)KnownColor.Control] = Color.FromArgbSystem (255, 212, 208, 200, "Control", KnownColor.Control);
- SystemColorsCache[(int)KnownColor.ControlDark] = Color.FromArgbSystem (255, 128, 128, 128, "ControlDark", KnownColor.ControlDark);
- SystemColorsCache[(int)KnownColor.ControlDarkDark] = Color.FromArgbSystem (255, 64, 64, 64, "ControlDarkDark", KnownColor.ControlDarkDark);
- SystemColorsCache[(int)KnownColor.ControlLight] = Color.FromArgbSystem (255, 212, 208, 200, "ControlLight", KnownColor.ControlLight);
- SystemColorsCache[(int)KnownColor.ControlLightLight] = Color.FromArgbSystem (255, 255, 255, 255, "ControlLightLight", KnownColor.ControlLightLight);
- SystemColorsCache[(int)KnownColor.ControlText] = Color.FromArgbSystem (255, 0, 0, 0, "ControlText", KnownColor.ControlText);
- SystemColorsCache[(int)KnownColor.Desktop] = Color.FromArgbSystem (255, 58, 110, 165, "Desktop", KnownColor.Desktop);
- SystemColorsCache[(int)KnownColor.GrayText] = Color.FromArgbSystem (255, 128, 128, 128, "GrayText", KnownColor.GrayText);
- SystemColorsCache[(int)KnownColor.Highlight] = Color.FromArgbSystem (255, 10, 36, 106, "Highlight", KnownColor.Highlight);
- SystemColorsCache[(int)KnownColor.HighlightText] = Color.FromArgbSystem (255, 255, 255, 255, "HighlightText", KnownColor.HighlightText);
- //TODO: find a more close approximation
- SystemColorsCache[(int)KnownColor.HotTrack] = Color.FromArgbSystem (255, 0, 0, 128, "HotTrack", KnownColor.HotTrack);
- SystemColorsCache[(int)KnownColor.InactiveBorder] = Color.FromArgbSystem (255, 212, 208, 200, "InactiveBorder", KnownColor.InactiveBorder);
- SystemColorsCache[(int)KnownColor.InactiveCaption] = Color.FromArgbSystem (255, 128, 128, 128, "InactiveCaption", KnownColor.InactiveCaption);
- SystemColorsCache[(int)KnownColor.InactiveCaptionText] = Color.FromArgbSystem (255, 212, 208, 200, "InactiveCaptionText", KnownColor.InactiveCaptionText);
- SystemColorsCache[(int)KnownColor.Info] = Color.FromArgbSystem (255, 255, 255, 225, "Info", KnownColor.Info);
- SystemColorsCache[(int)KnownColor.InfoText] = Color.FromArgbSystem (255, 0, 0, 0, "InfoText", KnownColor.InfoText);
- SystemColorsCache[(int)KnownColor.Menu] = Color.FromArgbSystem (255, 212, 208, 200, "Menu", KnownColor.Menu);
- SystemColorsCache[(int)KnownColor.MenuText] = Color.FromArgbSystem (255, 0, 0, 0, "MenuText", KnownColor.MenuText);
- SystemColorsCache[(int)KnownColor.ScrollBar] = Color.FromArgbSystem (255, 212, 208, 200, "ScrollBar", KnownColor.ScrollBar);
- SystemColorsCache[(int)KnownColor.Window] = Color.FromArgbSystem (255, 255, 255, 255, "Window", KnownColor.Window);
- SystemColorsCache[(int)KnownColor.WindowFrame] = Color.FromArgbSystem (255, 0, 0, 0, "WindowFrame", KnownColor.WindowFrame);
- SystemColorsCache[(int)KnownColor.WindowText] = Color.FromArgbSystem (255, 0, 0, 0, "WindowText", KnownColor.WindowText);
-
-#if NET_2_0
- SystemColorsCache [(int) KnownColor.ButtonFace] = Color.FromArgbSystem (255, 192, 192, 192, "ButtonFace", KnownColor.ButtonFace);
- SystemColorsCache [(int) KnownColor.ButtonHighlight] = Color.FromArgbSystem (255, 255, 255, 255, "ButtonHighlight", KnownColor.ButtonHighlight);
- SystemColorsCache [(int) KnownColor.ButtonShadow] = Color.FromArgbSystem (255, 128, 128, 128, "ButtonShadow", KnownColor.ButtonShadow);
- SystemColorsCache [(int) KnownColor.GradientActiveCaption] = Color.FromArgbSystem (255, 16, 132, 208, "GradientActiveCaption", KnownColor.GradientActiveCaption);
- SystemColorsCache [(int) KnownColor.GradientInactiveCaption] = Color.FromArgbSystem (255, 181, 181, 181, "GradientInactiveCaption", KnownColor.GradientInactiveCaption);
- SystemColorsCache [(int) KnownColor.MenuBar] = Color.FromArgbSystem (255, 192, 192, 192, "MenuBar", KnownColor.MenuBar);
- SystemColorsCache [(int) KnownColor.MenuHighlight] = Color.FromArgbSystem (255, 0, 0, 0, "MenuHighlight", KnownColor.MenuHighlight);
-#endif
- }
- else {
- SystemColorsCache[(int)KnownColor.ActiveBorder] = FromNativeColor (awt.SystemColor.activeCaptionBorder, "ActiveBorder", KnownColor.ActiveBorder);
- SystemColorsCache[(int)KnownColor.ActiveCaption] = FromNativeColor (awt.SystemColor.activeCaption, "ActiveCaption", KnownColor.ActiveCaption);
- SystemColorsCache[(int)KnownColor.ActiveCaptionText] = FromNativeColor (awt.SystemColor.activeCaptionText, "ActiveCaptionText", KnownColor.ActiveCaptionText);
- //TODO: find a more close approximation
- SystemColorsCache[(int)KnownColor.AppWorkspace] = FromNativeColor (awt.SystemColor.desktop, "AppWorkspace", KnownColor.AppWorkspace);
- SystemColorsCache[(int)KnownColor.Control] = FromNativeColor (awt.SystemColor.control, "Control", KnownColor.Control);
- SystemColorsCache[(int)KnownColor.ControlDark] = FromNativeColor (awt.SystemColor.controlShadow, "ControlDark", KnownColor.ControlDark);
- SystemColorsCache[(int)KnownColor.ControlDarkDark] = FromNativeColor (awt.SystemColor.controlDkShadow, "ControlDarkDark", KnownColor.ControlDarkDark);
- SystemColorsCache[(int)KnownColor.ControlLight] = FromNativeColor (awt.SystemColor.controlHighlight, "ControlLight", KnownColor.ControlLight);
- SystemColorsCache[(int)KnownColor.ControlLightLight] = FromNativeColor (awt.SystemColor.controlLtHighlight, "ControlLightLight", KnownColor.ControlLightLight);
- SystemColorsCache[(int)KnownColor.ControlText] = FromNativeColor (awt.SystemColor.controlText, "ControlText", KnownColor.ControlText);
- SystemColorsCache[(int)KnownColor.Desktop] = FromNativeColor (awt.SystemColor.desktop, "Desktop", KnownColor.Desktop);
- SystemColorsCache[(int)KnownColor.GrayText] = FromNativeColor (awt.SystemColor.textInactiveText, "GrayText", KnownColor.GrayText);
- SystemColorsCache[(int)KnownColor.Highlight] = FromNativeColor (awt.SystemColor.textHighlight, "Highlight", KnownColor.Highlight);
- SystemColorsCache[(int)KnownColor.HighlightText] = FromNativeColor (awt.SystemColor.textHighlightText, "HighlightText", KnownColor.HighlightText);
- //TODO: find a more close approximation
- SystemColorsCache[(int)KnownColor.HotTrack] = FromNativeColor (awt.SystemColor.textText, "HotTrack", KnownColor.HotTrack);
- SystemColorsCache[(int)KnownColor.InactiveBorder] = FromNativeColor (awt.SystemColor.inactiveCaptionBorder, "InactiveBorder", KnownColor.InactiveBorder);
- SystemColorsCache[(int)KnownColor.InactiveCaption] = FromNativeColor (awt.SystemColor.inactiveCaption, "InactiveCaption", KnownColor.InactiveCaption);
- SystemColorsCache[(int)KnownColor.InactiveCaptionText] = FromNativeColor (awt.SystemColor.inactiveCaptionText, "InactiveCaptionText", KnownColor.InactiveCaptionText);
- SystemColorsCache[(int)KnownColor.Info] = FromNativeColor (awt.SystemColor.info, "Info", KnownColor.Info);
- SystemColorsCache[(int)KnownColor.InfoText] = FromNativeColor (awt.SystemColor.infoText, "InfoText", KnownColor.InfoText);
- SystemColorsCache[(int)KnownColor.Menu] = FromNativeColor (awt.SystemColor.menu, "Menu", KnownColor.Menu);
- SystemColorsCache[(int)KnownColor.MenuText] = FromNativeColor (awt.SystemColor.menuText, "MenuText", KnownColor.MenuText);
- SystemColorsCache[(int)KnownColor.ScrollBar] = FromNativeColor (awt.SystemColor.scrollbar, "ScrollBar", KnownColor.ScrollBar);
- SystemColorsCache[(int)KnownColor.Window] = FromNativeColor (awt.SystemColor.window, "Window", KnownColor.Window);
- SystemColorsCache[(int)KnownColor.WindowFrame] = FromNativeColor (awt.SystemColor.windowBorder, "WindowFrame", KnownColor.WindowFrame);
- SystemColorsCache[(int)KnownColor.WindowText] = FromNativeColor (awt.SystemColor.windowText, "WindowText", KnownColor.WindowText);
-
-#if NET_2_0
- SystemColorsCache [(int) KnownColor.ButtonFace] = FromNativeColor (awt.SystemColor.control, "ButtonFace", KnownColor.ButtonFace);
- SystemColorsCache [(int) KnownColor.ButtonHighlight] = FromNativeColor (awt.SystemColor.controlHighlight, "ButtonHighlight", KnownColor.ButtonHighlight);
- SystemColorsCache [(int) KnownColor.ButtonShadow] = FromNativeColor (awt.SystemColor.controlShadow, "ButtonShadow", KnownColor.ButtonShadow);
- SystemColorsCache [(int) KnownColor.GradientActiveCaption] = FromNativeColor (awt.SystemColor.activeCaption, "GradientActiveCaption", KnownColor.GradientActiveCaption);
- SystemColorsCache [(int) KnownColor.GradientInactiveCaption] = FromNativeColor (awt.SystemColor.inactiveCaption, "GradientInactiveCaption", KnownColor.GradientInactiveCaption);
- SystemColorsCache [(int) KnownColor.MenuBar] = FromNativeColor (awt.SystemColor.menu, "MenuBar", KnownColor.MenuBar);
- SystemColorsCache [(int) KnownColor.MenuHighlight] = FromNativeColor (awt.SystemColor.menu, "MenuHighlight", KnownColor.MenuHighlight);
-#endif
- }
-
- Color [] namedColors = new Color [] {
- Color.FromArgbNamed (0x00, 0xFF, 0xFF, 0xFF, "Transparent", KnownColor.Transparent),
- Color.FromArgbNamed (0xFF, 0xF0, 0xF8, 0xFF, "AliceBlue", KnownColor.AliceBlue),
- Color.FromArgbNamed (0xFF, 0xFA, 0xEB, 0xD7, "AntiqueWhite", KnownColor.AntiqueWhite),
- Color.FromArgbNamed (0xFF, 0x00, 0xFF, 0xFF, "Aqua", KnownColor.Aqua),
- Color.FromArgbNamed (0xFF, 0x7F, 0xFF, 0xD4, "Aquamarine", KnownColor.Aquamarine),
- Color.FromArgbNamed (0xFF, 0xF0, 0xFF, 0xFF, "Azure", KnownColor.Azure),
- Color.FromArgbNamed (0xFF, 0xF5, 0xF5, 0xDC, "Beige", KnownColor.Beige),
- Color.FromArgbNamed (0xFF, 0xFF, 0xE4, 0xC4, "Bisque", KnownColor.Bisque),
- Color.FromArgbNamed (0xFF, 0x00, 0x00, 0x00, "Black", KnownColor.Black),
- Color.FromArgbNamed (0xFF, 0xFF, 0xEB, 0xCD, "BlanchedAlmond", KnownColor.BlanchedAlmond),
- Color.FromArgbNamed (0xFF, 0x00, 0x00, 0xFF, "Blue", KnownColor.Blue),
- Color.FromArgbNamed (0xFF, 0x8A, 0x2B, 0xE2, "BlueViolet", KnownColor.BlueViolet),
- Color.FromArgbNamed (0xFF, 0xA5, 0x2A, 0x2A, "Brown", KnownColor.Brown),
- Color.FromArgbNamed (0xFF, 0xDE, 0xB8, 0x87, "BurlyWood", KnownColor.BurlyWood),
- Color.FromArgbNamed (0xFF, 0x5F, 0x9E, 0xA0, "CadetBlue", KnownColor.CadetBlue),
- Color.FromArgbNamed (0xFF, 0x7F, 0xFF, 0x00, "Chartreuse", KnownColor.Chartreuse),
- Color.FromArgbNamed (0xFF, 0xD2, 0x69, 0x1E, "Chocolate", KnownColor.Chocolate),
- Color.FromArgbNamed (0xFF, 0xFF, 0x7F, 0x50, "Coral", KnownColor.Coral),
- Color.FromArgbNamed (0xFF, 0x64, 0x95, 0xED, "CornflowerBlue", KnownColor.CornflowerBlue),
- Color.FromArgbNamed (0xFF, 0xFF, 0xF8, 0xDC, "Cornsilk", KnownColor.Cornsilk),
- Color.FromArgbNamed (0xFF, 0xDC, 0x14, 0x3C, "Crimson", KnownColor.Crimson),
- Color.FromArgbNamed (0xFF, 0x00, 0xFF, 0xFF, "Cyan", KnownColor.Cyan),
- Color.FromArgbNamed (0xFF, 0x00, 0x00, 0x8B, "DarkBlue", KnownColor.DarkBlue),
- Color.FromArgbNamed (0xFF, 0x00, 0x8B, 0x8B, "DarkCyan", KnownColor.DarkCyan),
- Color.FromArgbNamed (0xFF, 0xB8, 0x86, 0x0B, "DarkGoldenrod", KnownColor.DarkGoldenrod),
- Color.FromArgbNamed (0xFF, 0xA9, 0xA9, 0xA9, "DarkGray", KnownColor.DarkGray),
- Color.FromArgbNamed (0xFF, 0x00, 0x64, 0x00, "DarkGreen", KnownColor.DarkGreen),
- Color.FromArgbNamed (0xFF, 0xBD, 0xB7, 0x6B, "DarkKhaki", KnownColor.DarkKhaki),
- Color.FromArgbNamed (0xFF, 0x8B, 0x00, 0x8B, "DarkMagenta", KnownColor.DarkMagenta),
- Color.FromArgbNamed (0xFF, 0x55, 0x6B, 0x2F, "DarkOliveGreen", KnownColor.DarkOliveGreen),
- Color.FromArgbNamed (0xFF, 0xFF, 0x8C, 0x00, "DarkOrange", KnownColor.DarkOrange),
- Color.FromArgbNamed (0xFF, 0x99, 0x32, 0xCC, "DarkOrchid", KnownColor.DarkOrchid),
- Color.FromArgbNamed (0xFF, 0x8B, 0x00, 0x00, "DarkRed", KnownColor.DarkRed),
- Color.FromArgbNamed (0xFF, 0xE9, 0x96, 0x7A, "DarkSalmon", KnownColor.DarkSalmon),
- Color.FromArgbNamed (0xFF, 0x8F, 0xBC, 0x8B, "DarkSeaGreen", KnownColor.DarkSeaGreen),
- Color.FromArgbNamed (0xFF, 0x48, 0x3D, 0x8B, "DarkSlateBlue", KnownColor.DarkSlateBlue),
- Color.FromArgbNamed (0xFF, 0x2F, 0x4F, 0x4F, "DarkSlateGray", KnownColor.DarkSlateGray),
- Color.FromArgbNamed (0xFF, 0x00, 0xCE, 0xD1, "DarkTurquoise", KnownColor.DarkTurquoise),
- Color.FromArgbNamed (0xFF, 0x94, 0x00, 0xD3, "DarkViolet", KnownColor.DarkViolet),
- Color.FromArgbNamed (0xFF, 0xFF, 0x14, 0x93, "DeepPink", KnownColor.DeepPink),
- Color.FromArgbNamed (0xFF, 0x00, 0xBF, 0xFF, "DeepSkyBlue", KnownColor.DeepSkyBlue),
- Color.FromArgbNamed (0xFF, 0x69, 0x69, 0x69, "DimGray", KnownColor.DimGray),
- Color.FromArgbNamed (0xFF, 0x1E, 0x90, 0xFF, "DodgerBlue", KnownColor.DodgerBlue),
- Color.FromArgbNamed (0xFF, 0xB2, 0x22, 0x22, "Firebrick", KnownColor.Firebrick),
- Color.FromArgbNamed (0xFF, 0xFF, 0xFA, 0xF0, "FloralWhite", KnownColor.FloralWhite),
- Color.FromArgbNamed (0xFF, 0x22, 0x8B, 0x22, "ForestGreen", KnownColor.ForestGreen),
- Color.FromArgbNamed (0xFF, 0xFF, 0x00, 0xFF, "Fuchsia", KnownColor.Fuchsia),
- Color.FromArgbNamed (0xFF, 0xDC, 0xDC, 0xDC, "Gainsboro", KnownColor.Gainsboro),
- Color.FromArgbNamed (0xFF, 0xF8, 0xF8, 0xFF, "GhostWhite", KnownColor.GhostWhite),
- Color.FromArgbNamed (0xFF, 0xFF, 0xD7, 0x00, "Gold", KnownColor.Gold),
- Color.FromArgbNamed (0xFF, 0xDA, 0xA5, 0x20, "Goldenrod", KnownColor.Goldenrod),
- Color.FromArgbNamed (0xFF, 0x80, 0x80, 0x80, "Gray", KnownColor.Gray),
- Color.FromArgbNamed (0xFF, 0x00, 0x80, 0x00, "Green", KnownColor.Green),
- Color.FromArgbNamed (0xFF, 0xAD, 0xFF, 0x2F, "GreenYellow", KnownColor.GreenYellow),
- Color.FromArgbNamed (0xFF, 0xF0, 0xFF, 0xF0, "Honeydew", KnownColor.Honeydew),
- Color.FromArgbNamed (0xFF, 0xFF, 0x69, 0xB4, "HotPink", KnownColor.HotPink),
- Color.FromArgbNamed (0xFF, 0xCD, 0x5C, 0x5C, "IndianRed", KnownColor.IndianRed),
- Color.FromArgbNamed (0xFF, 0x4B, 0x00, 0x82, "Indigo", KnownColor.Indigo),
- Color.FromArgbNamed (0xFF, 0xFF, 0xFF, 0xF0, "Ivory", KnownColor.Ivory),
- Color.FromArgbNamed (0xFF, 0xF0, 0xE6, 0x8C, "Khaki", KnownColor.Khaki),
- Color.FromArgbNamed (0xFF, 0xE6, 0xE6, 0xFA, "Lavender", KnownColor.Lavender),
- Color.FromArgbNamed (0xFF, 0xFF, 0xF0, 0xF5, "LavenderBlush", KnownColor.LavenderBlush),
- Color.FromArgbNamed (0xFF, 0x7C, 0xFC, 0x00, "LawnGreen", KnownColor.LawnGreen),
- Color.FromArgbNamed (0xFF, 0xFF, 0xFA, 0xCD, "LemonChiffon", KnownColor.LemonChiffon),
- Color.FromArgbNamed (0xFF, 0xAD, 0xD8, 0xE6, "LightBlue", KnownColor.LightBlue),
- Color.FromArgbNamed (0xFF, 0xF0, 0x80, 0x80, "LightCoral", KnownColor.LightCoral),
- Color.FromArgbNamed (0xFF, 0xE0, 0xFF, 0xFF, "LightCyan", KnownColor.LightCyan),
- Color.FromArgbNamed (0xFF, 0xFA, 0xFA, 0xD2, "LightGoldenrodYellow", KnownColor.LightGoldenrodYellow),
- Color.FromArgbNamed (0xFF, 0xD3, 0xD3, 0xD3, "LightGray", KnownColor.LightGray),
- Color.FromArgbNamed (0xFF, 0x90, 0xEE, 0x90, "LightGreen", KnownColor.LightGreen),
- Color.FromArgbNamed (0xFF, 0xFF, 0xB6, 0xC1, "LightPink", KnownColor.LightPink),
- Color.FromArgbNamed (0xFF, 0xFF, 0xA0, 0x7A, "LightSalmon", KnownColor.LightSalmon),
- Color.FromArgbNamed (0xFF, 0x20, 0xB2, 0xAA, "LightSeaGreen", KnownColor.LightSeaGreen),
- Color.FromArgbNamed (0xFF, 0x87, 0xCE, 0xFA, "LightSkyBlue", KnownColor.LightSkyBlue),
- Color.FromArgbNamed (0xFF, 0x77, 0x88, 0x99, "LightSlateGray", KnownColor.LightSlateGray),
- Color.FromArgbNamed (0xFF, 0xB0, 0xC4, 0xDE, "LightSteelBlue", KnownColor.LightSteelBlue),
- Color.FromArgbNamed (0xFF, 0xFF, 0xFF, 0xE0, "LightYellow", KnownColor.LightYellow),
- Color.FromArgbNamed (0xFF, 0x00, 0xFF, 0x00, "Lime", KnownColor.Lime),
- Color.FromArgbNamed (0xFF, 0x32, 0xCD, 0x32, "LimeGreen", KnownColor.LimeGreen),
- Color.FromArgbNamed (0xFF, 0xFA, 0xF0, 0xE6, "Linen", KnownColor.Linen),
- Color.FromArgbNamed (0xFF, 0xFF, 0x00, 0xFF, "Magenta", KnownColor.Magenta),
- Color.FromArgbNamed (0xFF, 0x80, 0x00, 0x00, "Maroon", KnownColor.Maroon),
- Color.FromArgbNamed (0xFF, 0x66, 0xCD, 0xAA, "MediumAquamarine", KnownColor.MediumAquamarine),
- Color.FromArgbNamed (0xFF, 0x00, 0x00, 0xCD, "MediumBlue", KnownColor.MediumBlue),
- Color.FromArgbNamed (0xFF, 0xBA, 0x55, 0xD3, "MediumOrchid", KnownColor.MediumOrchid),
- Color.FromArgbNamed (0xFF, 0x93, 0x70, 0xDB, "MediumPurple", KnownColor.MediumPurple),
- Color.FromArgbNamed (0xFF, 0x3C, 0xB3, 0x71, "MediumSeaGreen", KnownColor.MediumSeaGreen),
- Color.FromArgbNamed (0xFF, 0x7B, 0x68, 0xEE, "MediumSlateBlue", KnownColor.MediumSlateBlue),
- Color.FromArgbNamed (0xFF, 0x00, 0xFA, 0x9A, "MediumSpringGreen", KnownColor.MediumSpringGreen),
- Color.FromArgbNamed (0xFF, 0x48, 0xD1, 0xCC, "MediumTurquoise", KnownColor.MediumTurquoise),
- Color.FromArgbNamed (0xFF, 0xC7, 0x15, 0x85, "MediumVioletRed", KnownColor.MediumVioletRed),
- Color.FromArgbNamed (0xFF, 0x19, 0x19, 0x70, "MidnightBlue", KnownColor.MidnightBlue),
- Color.FromArgbNamed (0xFF, 0xF5, 0xFF, 0xFA, "MintCream", KnownColor.MintCream),
- Color.FromArgbNamed (0xFF, 0xFF, 0xE4, 0xE1, "MistyRose", KnownColor.MistyRose),
- Color.FromArgbNamed (0xFF, 0xFF, 0xE4, 0xB5, "Moccasin", KnownColor.Moccasin),
- Color.FromArgbNamed (0xFF, 0xFF, 0xDE, 0xAD, "NavajoWhite", KnownColor.NavajoWhite),
- Color.FromArgbNamed (0xFF, 0x00, 0x00, 0x80, "Navy", KnownColor.Navy),
- Color.FromArgbNamed (0xFF, 0xFD, 0xF5, 0xE6, "OldLace", KnownColor.OldLace),
- Color.FromArgbNamed (0xFF, 0x80, 0x80, 0x00, "Olive", KnownColor.Olive),
- Color.FromArgbNamed (0xFF, 0x6B, 0x8E, 0x23, "OliveDrab", KnownColor.OliveDrab),
- Color.FromArgbNamed (0xFF, 0xFF, 0xA5, 0x00, "Orange", KnownColor.Orange),
- Color.FromArgbNamed (0xFF, 0xFF, 0x45, 0x00, "OrangeRed", KnownColor.OrangeRed),
- Color.FromArgbNamed (0xFF, 0xDA, 0x70, 0xD6, "Orchid", KnownColor.Orchid),
- Color.FromArgbNamed (0xFF, 0xEE, 0xE8, 0xAA, "PaleGoldenrod", KnownColor.PaleGoldenrod),
- Color.FromArgbNamed (0xFF, 0x98, 0xFB, 0x98, "PaleGreen", KnownColor.PaleGreen),
- Color.FromArgbNamed (0xFF, 0xAF, 0xEE, 0xEE, "PaleTurquoise", KnownColor.PaleTurquoise),
- Color.FromArgbNamed (0xFF, 0xDB, 0x70, 0x93, "PaleVioletRed", KnownColor.PaleVioletRed),
- Color.FromArgbNamed (0xFF, 0xFF, 0xEF, 0xD5, "PapayaWhip", KnownColor.PapayaWhip),
- Color.FromArgbNamed (0xFF, 0xFF, 0xDA, 0xB9, "PeachPuff", KnownColor.PeachPuff),
- Color.FromArgbNamed (0xFF, 0xCD, 0x85, 0x3F, "Peru", KnownColor.Peru),
- Color.FromArgbNamed (0xFF, 0xFF, 0xC0, 0xCB, "Pink", KnownColor.Pink),
- Color.FromArgbNamed (0xFF, 0xDD, 0xA0, 0xDD, "Plum", KnownColor.Plum),
- Color.FromArgbNamed (0xFF, 0xB0, 0xE0, 0xE6, "PowderBlue", KnownColor.PowderBlue),
- Color.FromArgbNamed (0xFF, 0x80, 0x00, 0x80, "Purple", KnownColor.Purple),
- Color.FromArgbNamed (0xFF, 0xFF, 0x00, 0x00, "Red", KnownColor.Red),
- Color.FromArgbNamed (0xFF, 0xBC, 0x8F, 0x8F, "RosyBrown", KnownColor.RosyBrown),
- Color.FromArgbNamed (0xFF, 0x41, 0x69, 0xE1, "RoyalBlue", KnownColor.RoyalBlue),
- Color.FromArgbNamed (0xFF, 0x8B, 0x45, 0x13, "SaddleBrown", KnownColor.SaddleBrown),
- Color.FromArgbNamed (0xFF, 0xFA, 0x80, 0x72, "Salmon", KnownColor.Salmon),
- Color.FromArgbNamed (0xFF, 0xF4, 0xA4, 0x60, "SandyBrown", KnownColor.SandyBrown),
- Color.FromArgbNamed (0xFF, 0x2E, 0x8B, 0x57, "SeaGreen", KnownColor.SeaGreen),
- Color.FromArgbNamed (0xFF, 0xFF, 0xF5, 0xEE, "SeaShell", KnownColor.SeaShell),
- Color.FromArgbNamed (0xFF, 0xA0, 0x52, 0x2D, "Sienna", KnownColor.Sienna),
- Color.FromArgbNamed (0xFF, 0xC0, 0xC0, 0xC0, "Silver", KnownColor.Silver),
- Color.FromArgbNamed (0xFF, 0x87, 0xCE, 0xEB, "SkyBlue", KnownColor.SkyBlue),
- Color.FromArgbNamed (0xFF, 0x6A, 0x5A, 0xCD, "SlateBlue", KnownColor.SlateBlue),
- Color.FromArgbNamed (0xFF, 0x70, 0x80, 0x90, "SlateGray", KnownColor.SlateGray),
- Color.FromArgbNamed (0xFF, 0xFF, 0xFA, 0xFA, "Snow", KnownColor.Snow),
- Color.FromArgbNamed (0xFF, 0x00, 0xFF, 0x7F, "SpringGreen", KnownColor.SpringGreen),
- Color.FromArgbNamed (0xFF, 0x46, 0x82, 0xB4, "SteelBlue", KnownColor.SteelBlue),
- Color.FromArgbNamed (0xFF, 0xD2, 0xB4, 0x8C, "Tan", KnownColor.Tan),
- Color.FromArgbNamed (0xFF, 0x00, 0x80, 0x80, "Teal", KnownColor.Teal),
- Color.FromArgbNamed (0xFF, 0xD8, 0xBF, 0xD8, "Thistle", KnownColor.Thistle),
- Color.FromArgbNamed (0xFF, 0xFF, 0x63, 0x47, "Tomato", KnownColor.Tomato),
- Color.FromArgbNamed (0xFF, 0x40, 0xE0, 0xD0, "Turquoise", KnownColor.Turquoise),
- Color.FromArgbNamed (0xFF, 0xEE, 0x82, 0xEE, "Violet", KnownColor.Violet),
- Color.FromArgbNamed (0xFF, 0xF5, 0xDE, 0xB3, "Wheat", KnownColor.Wheat),
- Color.FromArgbNamed (0xFF, 0xFF, 0xFF, 0xFF, "White", KnownColor.White),
- Color.FromArgbNamed (0xFF, 0xF5, 0xF5, 0xF5, "WhiteSmoke", KnownColor.WhiteSmoke),
- Color.FromArgbNamed (0xFF, 0xFF, 0xFF, 0x00, "Yellow", KnownColor.Yellow),
- Color.FromArgbNamed (0xFF, 0x9A, 0xCD, 0x32, "YellowGreen", KnownColor.YellowGreen),
- };
-
- Array.Copy (namedColors, 0, SystemColorsCache, (int) KnownColor.Transparent, namedColors.Length);
- }
-
- static private Color FromNativeColor (
- awt.Color awtColor, string name, KnownColor knownColor) {
- return Color.FromArgbSystem (awtColor.getAlpha(),
- awtColor.getRed(), awtColor.getGreen(), awtColor.getBlue(),
- name, knownColor);
- }
-
- public static Color [] Values {
- get { return SystemColorsCache; }
- }
-
- public static Color FromKnownColor (KnownColor kc) {
- int n = (int) kc;
- if ((n <= 0) || (n >= Values.Length)) {
- // This is what it returns!
- Color c = Color.FromArgb (0, 0, 0, 0);
- c.name = kc.ToString ();
- c.state |= (short) Color.ColorType.Named;
- c.knownColor = (short) kc;
- return c;
- }
- return Values [n];
- }
-
- public static string GetName (short kc)
- {
- switch (kc) {
- case 1: return "ActiveBorder";
- case 2: return "ActiveCaption";
- case 3: return "ActiveCaptionText";
- case 4: return "AppWorkspace";
- case 5: return "Control";
- case 6: return "ControlDark";
- case 7: return "ControlDarkDark";
- case 8: return "ControlLight";
- case 9: return "ControlLightLight";
- case 10: return "ControlText";
- case 11: return "Desktop";
- case 12: return "GrayText";
- case 13: return "Highlight";
- case 14: return "HighlightText";
- case 15: return "HotTrack";
- case 16: return "InactiveBorder";
- case 17: return "InactiveCaption";
- case 18: return "InactiveCaptionText";
- case 19: return "Info";
- case 20: return "InfoText";
- case 21: return "Menu";
- case 22: return "MenuText";
- case 23: return "ScrollBar";
- case 24: return "Window";
- case 25: return "WindowFrame";
- case 26: return "WindowText";
- case 27: return "Transparent";
- case 28: return "AliceBlue";
- case 29: return "AntiqueWhite";
- case 30: return "Aqua";
- case 31: return "Aquamarine";
- case 32: return "Azure";
- case 33: return "Beige";
- case 34: return "Bisque";
- case 35: return "Black";
- case 36: return "BlanchedAlmond";
- case 37: return "Blue";
- case 38: return "BlueViolet";
- case 39: return "Brown";
- case 40: return "BurlyWood";
- case 41: return "CadetBlue";
- case 42: return "Chartreuse";
- case 43: return "Chocolate";
- case 44: return "Coral";
- case 45: return "CornflowerBlue";
- case 46: return "Cornsilk";
- case 47: return "Crimson";
- case 48: return "Cyan";
- case 49: return "DarkBlue";
- case 50: return "DarkCyan";
- case 51: return "DarkGoldenrod";
- case 52: return "DarkGray";
- case 53: return "DarkGreen";
- case 54: return "DarkKhaki";
- case 55: return "DarkMagenta";
- case 56: return "DarkOliveGreen";
- case 57: return "DarkOrange";
- case 58: return "DarkOrchid";
- case 59: return "DarkRed";
- case 60: return "DarkSalmon";
- case 61: return "DarkSeaGreen";
- case 62: return "DarkSlateBlue";
- case 63: return "DarkSlateGray";
- case 64: return "DarkTurquoise";
- case 65: return "DarkViolet";
- case 66: return "DeepPink";
- case 67: return "DeepSkyBlue";
- case 68: return "DimGray";
- case 69: return "DodgerBlue";
- case 70: return "Firebrick";
- case 71: return "FloralWhite";
- case 72: return "ForestGreen";
- case 73: return "Fuchsia";
- case 74: return "Gainsboro";
- case 75: return "GhostWhite";
- case 76: return "Gold";
- case 77: return "Goldenrod";
- case 78: return "Gray";
- case 79: return "Green";
- case 80: return "GreenYellow";
- case 81: return "Honeydew";
- case 82: return "HotPink";
- case 83: return "IndianRed";
- case 84: return "Indigo";
- case 85: return "Ivory";
- case 86: return "Khaki";
- case 87: return "Lavender";
- case 88: return "LavenderBlush";
- case 89: return "LawnGreen";
- case 90: return "LemonChiffon";
- case 91: return "LightBlue";
- case 92: return "LightCoral";
- case 93: return "LightCyan";
- case 94: return "LightGoldenrodYellow";
- case 95: return "LightGray";
- case 96: return "LightGreen";
- case 97: return "LightPink";
- case 98: return "LightSalmon";
- case 99: return "LightSeaGreen";
- case 100: return "LightSkyBlue";
- case 101: return "LightSlateGray";
- case 102: return "LightSteelBlue";
- case 103: return "LightYellow";
- case 104: return "Lime";
- case 105: return "LimeGreen";
- case 106: return "Linen";
- case 107: return "Magenta";
- case 108: return "Maroon";
- case 109: return "MediumAquamarine";
- case 110: return "MediumBlue";
- case 111: return "MediumOrchid";
- case 112: return "MediumPurple";
- case 113: return "MediumSeaGreen";
- case 114: return "MediumSlateBlue";
- case 115: return "MediumSpringGreen";
- case 116: return "MediumTurquoise";
- case 117: return "MediumVioletRed";
- case 118: return "MidnightBlue";
- case 119: return "MintCream";
- case 120: return "MistyRose";
- case 121: return "Moccasin";
- case 122: return "NavajoWhite";
- case 123: return "Navy";
- case 124: return "OldLace";
- case 125: return "Olive";
- case 126: return "OliveDrab";
- case 127: return "Orange";
- case 128: return "OrangeRed";
- case 129: return "Orchid";
- case 130: return "PaleGoldenrod";
- case 131: return "PaleGreen";
- case 132: return "PaleTurquoise";
- case 133: return "PaleVioletRed";
- case 134: return "PapayaWhip";
- case 135: return "PeachPuff";
- case 136: return "Peru";
- case 137: return "Pink";
- case 138: return "Plum";
- case 139: return "PowderBlue";
- case 140: return "Purple";
- case 141: return "Red";
- case 142: return "RosyBrown";
- case 143: return "RoyalBlue";
- case 144: return "SaddleBrown";
- case 145: return "Salmon";
- case 146: return "SandyBrown";
- case 147: return "SeaGreen";
- case 148: return "SeaShell";
- case 149: return "Sienna";
- case 150: return "Silver";
- case 151: return "SkyBlue";
- case 152: return "SlateBlue";
- case 153: return "SlateGray";
- case 154: return "Snow";
- case 155: return "SpringGreen";
- case 156: return "SteelBlue";
- case 157: return "Tan";
- case 158: return "Teal";
- case 159: return "Thistle";
- case 160: return "Tomato";
- case 161: return "Turquoise";
- case 162: return "Violet";
- case 163: return "Wheat";
- case 164: return "White";
- case 165: return "WhiteSmoke";
- case 166: return "Yellow";
- case 167: return "YellowGreen";
-#if NET_2_0
- case 168: return "ButtonFace";
- case 169: return "ButtonHighlight";
- case 170: return "ButtonShadow";
- case 171: return "GradientActiveCaption";
- case 172: return "GradientInactiveCaption";
- case 173: return "MenuBar";
- case 174: return "MenuHighlight";
-#endif
- default: return String.Empty;
- }
- }
-
- public static string GetName (KnownColor kc)
- {
- return GetName ((short)kc);
- }
-
- public static Color FindColorMatch (Color c)
- {
- uint argb = (uint) c.ToArgb ();
- for (int i = 0; i < Values.Length; i++) {
- if (argb == Values [i].ToArgb ())
- return KnownColors.FromKnownColor ((KnownColor) i);
- }
- return Color.Empty;
- }
- }
-}
+++ /dev/null
-//
-// System.Drawing.Pen.cs
-//
-// Authors:
-// Miguel de Icaza (miguel@ximian.com)
-// Alexandre Pigolkine (pigolkine@gmx.de)
-// Duncan Mak (duncan@ximian.com)
-// Ravindra (rkumar@novell.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-// (C) Novell, Inc. http://www.novell.com
-//
-
-using System;
-using System.Drawing.Drawing2D;
-using System.Runtime.InteropServices;
-
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing
-{
-
- public sealed class Pen : MarshalByRefObject, ICloneable, IDisposable, awt.Stroke
- {
- #region Member Vars
-
- static readonly float [] DASH_ARRAY = {4.0f,1.0f};
- static readonly float [] DASHDOT_ARRAY = {4.0f,1.0f,1.0f,1.0f};
- static readonly float [] DASHDOTDOT_ARRAY = {4.0f,1.0f,1.0f,1.0f,1.0f,1.0f};
- static readonly float [] DOT_ARRAY = {1.0f,1.0f};
-
- internal bool isModifiable = true;
-
- Brush _brush;
- DashStyle _dashStyle;
- DashCap _dashCap;
- LineCap _startCap;
- LineCap _endCap;
-
- LineJoin _lineJoin;
-
- PenAlignment _alignment;
- Matrix _transform;
- float _width;
- float _dashOffset;
- float[] _dashPattern;
- //float[] _compoundArray;
-
- float _miterLimit;
-
- #endregion
-
- #region Ctors. and Dtor
-
- public Pen (Brush brush) : this (brush, 1.0F)
- {}
-
- public Pen (Color color) : this (color, 1.0F)
- {}
-
- public Pen (Color color, float width) : this(new SolidBrush(color), width)
- {}
-
- public Pen (Brush brush, float width)
- {
- _brush = (Brush)brush.Clone();;
- _width = width;
- _dashStyle = DashStyle.Solid;
- _startCap = LineCap.Flat;
- _dashCap = DashCap.Flat;
- _endCap = LineCap.Flat;
- _alignment = PenAlignment.Center;
- _lineJoin = LineJoin.Miter;
- _miterLimit = 10f;
- _transform = new Matrix();
- }
- #endregion
- //
- // Properties
- //
- #region Alignment [TODO]
- public PenAlignment Alignment
- {
- get
- {
- return _alignment;
- }
-
- set
- {
- EnsureModifiable();
- _alignment = value;
- }
- }
- #endregion
-
- #region Brush
- public Brush Brush
- {
- get
- {
- return _brush;
- }
-
- set
- {
- EnsureModifiable();
- if (value == null)
- throw new ArgumentNullException("brush");
- _brush = value;
- }
- }
- #endregion
-
- #region Color
- public Color Color
- {
- get
- {
- if(Brush is SolidBrush)
- return ((SolidBrush)Brush).Color;
- else if(Brush is HatchBrush)
- return ((HatchBrush)Brush).ForegroundColor;
- else
- return Color.Empty;
- }
-
- set
- {
- EnsureModifiable();
- _brush = new SolidBrush (value);
- }
- }
- #endregion
-
- #region CompoundArray [TODO]
- [MonoTODO]
- public float[] CompoundArray {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
- #endregion
-
- #region CustomEndCap [TODO]
- [MonoTODO]
- public CustomLineCap CustomEndCap
- {
- get
- {
- throw new NotImplementedException ();
- }
- // do a check for isModifiable when implementing this property
- set
- {
- throw new NotImplementedException ();
- }
- }
- #endregion
-
- #region CustomStartCap [TODO]
- [MonoTODO]
- public CustomLineCap CustomStartCap
- {
- get
- {
- throw new NotImplementedException ();
- }
-
- // do a check for isModifiable when implementing this property
- set
- {
- throw new NotImplementedException ();
- }
- }
- #endregion
-
- #region DashCap
- [MonoTODO]
- public DashCap DashCap {
- get {
- return _dashCap;
- }
-
- set {
- EnsureModifiable();
- _dashCap = value;
- }
- }
- #endregion
-
- #region DashOffset
- public float DashOffset
- {
-
- get
- {
- return _dashOffset;
- }
-
- set
- {
- EnsureModifiable();
- _dashOffset = value;
- }
- }
- #endregion
-
- #region DashPattern
-
- public float [] DashPattern
- {
- get
- {
- return (float [])_dashPattern.Clone();
- }
-
- set
- {
- EnsureModifiable();
-
- _dashPattern = value;
- DashStyle = (_dashPattern == null) ? DashStyle.Solid : DashStyle.Custom;
- }
- }
- #endregion
-
- #region DashStyle
- public DashStyle DashStyle
- {
- get
- {
- return _dashStyle;
- }
-
- set
- {
- EnsureModifiable();
- _dashStyle = value;
- }
- }
- #endregion
-
- #region StartCap [TODO - now allways endcap]
- [MonoTODO]
- public LineCap StartCap {
- get {
- return _startCap;
- }
-
- set {
- EnsureModifiable();
- _startCap = value;
- }
- }
- #endregion
-
- #region EndCap
- [MonoTODO]
- public LineCap EndCap
- {
- get
- {
- return _endCap;
- }
-
- set
- {
- EnsureModifiable();
-
- _endCap = value;
- }
- }
- #endregion
-
- #region LineJoin [partial TODO - missed styles]
- [MonoTODO]
- public LineJoin LineJoin {
- get {
- return _lineJoin;
- }
-
- set {
- EnsureModifiable();
- _lineJoin = value;
- }
- }
-
- #endregion
-
- #region MiterLimit
- public float MiterLimit
- {
-
- get
- {
- return _miterLimit;
- }
-
- set
- {
- EnsureModifiable();
-
- _miterLimit = value;
- }
-
- }
- #endregion
-
- #region PenType
- public PenType PenType
- {
- get
- {
- if (Brush is TextureBrush)
- return PenType.TextureFill;
- else if (Brush is HatchBrush)
- return PenType.HatchFill;
- else if (Brush is LinearGradientBrush)
- return PenType.LinearGradient;
- else if (Brush is PathGradientBrush)
- return PenType.PathGradient;
- else
- return PenType.SolidColor;
- }
- }
- #endregion
-
- #region Transform
- public Matrix Transform
- {
- get
- {
- return _transform.Clone();
- }
-
- set
- {
- EnsureModifiable();
-
- value.CopyTo(_transform);
- }
- }
- #endregion
-
- #region Width
- public float Width
- {
- get
- {
- return _width;
- }
- set
- {
- EnsureModifiable();
-
- _width = value;
- }
- }
- #endregion
-
- #region Clone
- public object Clone ()
- {
- Pen clone = (Pen)MemberwiseClone();
- if (clone._transform != null)
- clone._transform = clone._transform.Clone();
- if (clone._dashPattern != null)
- clone._dashPattern = (float[])clone._dashPattern.Clone();
- return clone;
- }
- #endregion
-
- #region Dispose
- public void Dispose ()
- {
- Dispose (true);
- }
- void Dispose (bool disposing)
- {
- if (!isModifiable && disposing)
- throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
- // Restore the dtor if adding anything below
- }
- #endregion
-
- #region Transform Funcs
- public void MultiplyTransform (Matrix matrix)
- {
- _transform.Multiply (matrix);
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order)
- {
- _transform.Multiply (matrix, order);
- }
-
- public void ResetTransform ()
- {
- _transform.Reset ();
- }
-
- public void RotateTransform (float angle)
- {
- _transform.Rotate (angle);
- }
-
- public void RotateTransform (float angle, MatrixOrder order)
- {
- _transform.Rotate (angle, order);
- }
-
- public void ScaleTransform (float sx, float sy)
- {
- _transform.Scale (sx, sy);
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order)
- {
- _transform.Scale (sx, sy, order);
- }
-
- public void TranslateTransform (float dx, float dy) {
- _transform.Translate (dx, dy);
- }
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- _transform.Translate (dx, dy, order);
- }
- #endregion
-
- public void SetLineCap (LineCap startCap, LineCap endCap, DashCap dashCap)
- {
- StartCap = startCap;
- DashCap = dashCap;
- EndCap = endCap;
- }
-
- void EnsureModifiable() {
- if (!isModifiable)
- throw new ArgumentException ("You may not change this Pen because it does not belong to you.");
- }
-
- internal double GetSquaredTransformedWidth(geom.AffineTransform coordsTransform) {
- geom.AffineTransform transform = _transform.NativeObject;
- double A = transform.getScaleX(); // m00
- double B = transform.getShearY(); // m10
- double C = transform.getShearX(); // m01
- double D = transform.getScaleY(); // m11
-
- double K = coordsTransform.getScaleX(); // m00
- double L = coordsTransform.getShearY(); // m10
- double M = coordsTransform.getShearX(); // m01
- double N = coordsTransform.getScaleY(); // m11
-
- double AD = A*D, BC = B*C, KN = K*N, LM = L*M;
- double KN_LM = KN-LM;
- return Math.Abs(Width*Width * (AD*KN_LM - BC*KN_LM));
- }
-
-
- internal bool CanCreateBasicStroke {
- get {
- if (!_transform.IsIdentity)
- return false;
-
- //FIXME: add more logic when more features will
- // be implemented.
- return true;
- }
- }
-
- internal awt.Stroke GetNativeObject(geom.AffineTransform outputTransform, PenFit penFit) {
- return GetNativeObject(null, outputTransform, penFit);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="outputTransform">transform which will be applied on the final shape</param>
- /// <param name="fitPen">ensure the shape will wide enough to be visible</param>
- /// <returns></returns>
- internal awt.Stroke GetNativeObject(geom.AffineTransform penTransform, geom.AffineTransform outputTransform, PenFit penFit) {
- float[] dashPattern = null;
-
- switch (DashStyle) {
- case DashStyle.Custom:
- if (_dashPattern != null) {
- dashPattern = new float[_dashPattern.Length];
- for(int i = 0; i < _dashPattern.Length; i++) {
-
- if (EndCap == LineCap.Flat)
- dashPattern[i] = _dashPattern[i] * Width;
- else {
- if ((i & 1) == 0) {
- // remove the size of caps from the opaque parts
- dashPattern[i] = (_dashPattern[i] * Width) - Width;
- if (_dashPattern[i] < 0)
- dashPattern[i] = 0;
- }
- else
- // add the size of caps to the transparent parts
- dashPattern[i] = (_dashPattern[i] * Width) + Width;
- }
- }
- }
- break;
- case DashStyle.Dash:
- dashPattern = DASH_ARRAY;
- break;
- case DashStyle.DashDot:
- dashPattern = DASHDOT_ARRAY;
- break;
- case DashStyle.DashDotDot:
- dashPattern = DASHDOTDOT_ARRAY;
- break;
-
- // default:
- // case DashStyle.Solid:
- // break;
- }
-
- int join;
- switch (LineJoin) {
- case LineJoin.Bevel:
- join = java.awt.BasicStroke.JOIN_BEVEL;
- break;
- default:
- case LineJoin.Miter:
- case LineJoin.MiterClipped:
- join = java.awt.BasicStroke.JOIN_MITER;
- break;
- case LineJoin.Round:
- join = java.awt.BasicStroke.JOIN_ROUND;
- break;
- }
-
- // We go by End cap for now.
- int cap;
- switch (EndCap) {
- default:
- case LineCap.Square:
- case LineCap.SquareAnchor:
- cap = awt.BasicStroke.CAP_SQUARE;
- break;
- case LineCap.Round:
- case LineCap.RoundAnchor:
- cap = awt.BasicStroke.CAP_ROUND;
- break;
- case LineCap.Flat:
- cap = awt.BasicStroke.CAP_BUTT;
- break;
- }
-
- geom.AffineTransform penT = _transform.NativeObject;
- if (penTransform != null && !penTransform.isIdentity()) {
- penT = (geom.AffineTransform) penT.clone();
- penT.concatenate(penTransform);
- }
-
- return StrokeFactory.CreateStroke(Width, cap,
- join, MiterLimit, dashPattern, DashOffset,
- penT, outputTransform, penFit);
- }
-
- #region Stroke Members
-
- awt.Shape awt.Stroke.createStrokedShape(awt.Shape arg_0) {
- return GetNativeObject(null, PenFit.NotThin).createStrokedShape(arg_0);
- }
-
- #endregion
- }
-}
+++ /dev/null
-using System;\r
-using System.Drawing.Imaging;\r
-using System.Xml;\r
-\r
-using Mainsoft.Drawing.Imaging;\r
-\r
-using awt = java.awt;\r
-using java.awt.image;\r
-using imageio = javax.imageio;\r
-\r
-namespace Mainsoft.Drawing.Imaging\r
-{\r
- /// <summary>\r
- /// Summary description for PlainImage.\r
- /// </summary>\r
- public class PlainImage : ICloneable {\r
-\r
- #region Members\r
-\r
- awt.Image _nativeObject;\r
- awt.Image [] _thumbnails;\r
- FrameDimension _dimension;\r
- XmlDocument _metadata;\r
- imageio.metadata.IIOMetadata _nativeMetadata;\r
- ImageFormat _imageFormat;\r
-\r
- float _xResolution;\r
- float _yResolution;\r
-\r
-\r
- #endregion\r
-\r
- #region Constructors\r
-\r
- public PlainImage() {\r
- }\r
-\r
- public PlainImage(awt.Image image, awt.Image [] thumbnails, ImageFormat format, float xRes, float yRes, FrameDimension dimension) {\r
- _nativeObject = image;\r
- _thumbnails = thumbnails;\r
- _imageFormat = format;\r
-\r
- _xResolution = xRes;\r
- _yResolution = yRes;\r
-\r
- _dimension = dimension;\r
- }\r
-\r
- #endregion\r
-\r
-\r
- private awt.Image NativeObject {\r
- get { return _nativeObject; }\r
- set { _nativeObject = value; }\r
- }\r
-\r
- #region PlainImage properties\r
-\r
- public awt.Image NativeImage {\r
- get { return NativeObject; }\r
- set { NativeObject = value; }\r
- }\r
-\r
- internal imageio.metadata.IIOMetadata NativeMetadata {\r
- get { return _nativeMetadata; }\r
- set { _nativeMetadata = value; }\r
- }\r
-\r
- public XmlDocument Metadata {\r
- get { return _metadata; }\r
- set { _metadata = value; }\r
- }\r
-\r
- public ImageFormat ImageFormat {\r
- get { return _imageFormat; }\r
- }\r
-\r
- public FrameDimension Dimension {\r
- get { return _dimension; }\r
- set { _dimension = value; }\r
- }\r
-\r
- public awt.Image [] Thumbnails {\r
- get { return _thumbnails; }\r
- }\r
-\r
- public float HorizontalResolution {\r
- get { return _xResolution; }\r
- set { _xResolution = value; }\r
- }\r
-\r
- public float VerticalResolution {\r
- get { return _yResolution; }\r
- set { _yResolution = value; }\r
- }\r
-\r
- #endregion\r
-\r
- #region ICloneable members\r
-\r
- public object Clone() {\r
- return Clone(true);\r
- }\r
-\r
- public PlainImage Clone(bool cloneImage) {\r
- awt.Image img = NativeImage;\r
- awt.Image [] th = _thumbnails;\r
-\r
- if (cloneImage) {\r
- img = new BufferedImage(\r
- ((BufferedImage)NativeObject).getColorModel(), \r
- ((BufferedImage)NativeObject).copyData(null), \r
- ((BufferedImage)NativeObject).isAlphaPremultiplied(), null);\r
-\r
- if (Thumbnails != null) {\r
- th = new java.awt.Image[ Thumbnails.Length ];\r
- for (int i=0; i < Thumbnails.Length; i++) {\r
- th[i] = new BufferedImage(\r
- ((BufferedImage)Thumbnails[i]).getColorModel(), \r
- ((BufferedImage)Thumbnails[i]).copyData(null), \r
- ((BufferedImage)Thumbnails[i]).isAlphaPremultiplied(), null);\r
- }\r
- }\r
- }\r
-\r
- return new PlainImage( \r
- img, \r
- th, \r
- ImageFormat, \r
- HorizontalResolution, \r
- VerticalResolution, \r
- Dimension );\r
- }\r
-\r
- #endregion\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections;\r
-\r
-namespace Mainsoft.Drawing.Imaging\r
-{\r
- /// <summary>\r
- /// Summary description for PlainImageCollection.\r
- /// </summary>\r
- public class PlainImageCollection : ICollection, IEnumerable\r
- {\r
- ArrayList collection = new ArrayList();\r
- int _position = 0;\r
-\r
- public PlainImageCollection()\r
- {\r
- //\r
- // TODO: Add constructor logic here\r
- //\r
- }\r
-\r
- #region ICollection members\r
- \r
- public bool IsSynchronized {\r
- get {\r
- return collection.IsSynchronized;\r
- }\r
- }\r
-\r
- public int Count {\r
- get {\r
- return collection.Count;\r
- }\r
- }\r
-\r
- public void CopyTo(Array array, int index) {\r
- collection.CopyTo(array, index);\r
- }\r
-\r
- public object SyncRoot {\r
- get {\r
- return collection.SyncRoot;\r
- }\r
- }\r
-\r
- #endregion\r
-\r
- #region IEnumerable members\r
-\r
- public IEnumerator GetEnumerator() {\r
- return collection.GetEnumerator();\r
- }\r
-\r
- #endregion\r
-\r
- #region Collection members\r
-\r
- public int Add(PlainImage plainImage) {\r
- return collection.Add( plainImage );\r
- }\r
-\r
- public void Clear() {\r
- collection.Clear();\r
- }\r
-\r
- public bool Contains(PlainImage plainImage) {\r
- return collection.Contains(plainImage);\r
- }\r
-\r
- public int IndexOf(PlainImage plainImage) {\r
- return collection.IndexOf( plainImage );\r
- }\r
-\r
- public void Insert(int index, PlainImage value) {\r
- collection.Insert( index, value );\r
- }\r
-\r
- public void Remove(PlainImage value) {\r
- collection.Remove( value );\r
- }\r
-\r
- public void RemoveAt(int index) {\r
- collection.RemoveAt( index );\r
- }\r
-\r
- public PlainImage this[int index] {\r
- get { return (PlainImage) collection[ index ]; }\r
- }\r
-\r
- public PlainImage CurrentImage {\r
- get { return (PlainImage) collection[ _position ]; }\r
- set { collection[ _position ] = value; }\r
- }\r
-\r
- public int CurrentImageIndex {\r
- get { return _position; }\r
- set { _position = value; }\r
- }\r
-\r
- #endregion\r
- }\r
-}\r
public static readonly Rectangle Empty;
-#if TARGET_JVM
- internal java.awt.Rectangle NativeObject {
- get {
- return new java.awt.Rectangle(X,Y,Width,Height);
- }
- }
-#endif
/// <summary>
/// Ceiling Shared Method
public static readonly RectangleF Empty;
-#if TARGET_JVM
- internal java.awt.geom.Rectangle2D NativeObject {
- get {
- return new java.awt.geom.Rectangle2D.Float(X,Y,Width,Height);
- }
- }
-#endif
/// <summary>
/// FromLTRB Shared Method
}
-#if TARGET_JVM
- internal RectangleF (java.awt.geom.RectangularShape r2d) {
- this.x = (float) r2d.getX ();
- this.y = (float) r2d.getY ();
- this.width = (float) r2d.getWidth ();
- this.height = (float) r2d.getHeight ();
- }
-#endif
/// <summary>
/// Bottom Property
+++ /dev/null
-
-using System;
-using System.Drawing.Drawing2D;
-using System.Runtime.InteropServices;
-
-using awt = java.awt;
-using geom = java.awt.geom;
-
-namespace System.Drawing
-{
- [ComVisible (false)]
- public sealed class Region : BasicShape
- {
- #region Member Vars
- internal static readonly Region InfiniteRegion = new Region(new Rectangle(-0x400000, -0x400000, 0x800000, 0x800000));
- #endregion
-
- #region Internals
- internal geom.Area NativeObject
- {
- get
- {
- return (geom.Area)Shape;
- }
- }
- #endregion
-
- #region Ctors. and Dtor
-
-
- public Region ()
- : this ((geom.Area) InfiniteRegion.NativeObject.clone ())
- {
- }
-
- internal Region(geom.Area native) : base(native)
- {
- }
-
-
- public Region (GraphicsPath path) : this(new geom.Area(path.NativeObject))
- {
- }
-
- public Region (Rectangle rect) : this(new geom.Area(rect.NativeObject))
- {
- }
-
- public Region (RectangleF rect) : this(new geom.Area(rect.NativeObject))
- {
- }
-
- [MonoTODO]
- public Region (RegionData region_data) : this((geom.Area)null)
- {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region Union
- public void Union (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- NativeObject.add(new geom.Area(path.NativeObject));
- }
-
-
- public void Union (Rectangle rect)
- {
- NativeObject.add(new geom.Area(rect.NativeObject));
- }
-
- public void Union (RectangleF rect)
- {
- NativeObject.add(new geom.Area(rect.NativeObject));
- }
-
- public void Union (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- NativeObject.add(region.NativeObject);
- }
- #endregion
-
- #region Intersect
- //
- public void Intersect (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- NativeObject.intersect(new geom.Area(path.NativeObject));
- }
-
- public void Intersect (Rectangle rect)
- {
- NativeObject.intersect(new geom.Area(rect.NativeObject));
- }
-
- public void Intersect (RectangleF rect)
- {
- NativeObject.intersect(new geom.Area(rect.NativeObject));
- }
-
- public void Intersect (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- NativeObject.intersect(region.NativeObject);
- }
- #endregion
-
- #region Complement
- //
- public void Complement (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- geom.Area a = new geom.Area(path.NativeObject);
- a.subtract(NativeObject);
- Shape = a;
- }
-
- public void Complement (Rectangle rect)
- {
- geom.Area a = new geom.Area(rect.NativeObject);
- a.subtract(NativeObject);
- Shape = a;
- }
-
- public void Complement (RectangleF rect)
- {
- geom.Area a = new geom.Area(rect.NativeObject);
- a.subtract(NativeObject);
- Shape = a;
- }
-
- public void Complement (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- geom.Area a = (geom.Area) region.NativeObject.clone ();
- a.subtract(NativeObject);
- Shape = a;
- }
- #endregion
-
- #region Exclude
- //
- public void Exclude (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- NativeObject.subtract(new geom.Area(path.NativeObject));
- }
-
- public void Exclude (Rectangle rect)
- {
- NativeObject.subtract(new geom.Area(rect.NativeObject));
- }
-
- public void Exclude (RectangleF rect)
- {
- NativeObject.subtract(new geom.Area(rect.NativeObject));
- }
-
- public void Exclude (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- NativeObject.subtract(region.NativeObject);
- }
- #endregion
-
- #region Xor
- //
- public void Xor (GraphicsPath path)
- {
- if (path == null)
- throw new ArgumentNullException("path");
- NativeObject.exclusiveOr(new geom.Area(path.NativeObject));
- }
-
- public void Xor (Rectangle rect)
- {
- NativeObject.exclusiveOr(new geom.Area(rect.NativeObject));
- }
-
- public void Xor (RectangleF rect)
- {
- NativeObject.exclusiveOr(new geom.Area(rect.NativeObject));
- }
-
- public void Xor (Region region)
- {
- if (region == null)
- throw new ArgumentNullException("region");
- NativeObject.exclusiveOr(region.NativeObject);
- }
- #endregion
-
- #region GetBounds
- //
- public RectangleF GetBounds (Graphics graphics)
- {
- if (graphics == null)
- throw new ArgumentNullException("graphics");
- return new RectangleF(NativeObject.getBounds2D());
- }
- #endregion
-
- #region Translate
- //
- public void Translate (int dx, int dy)
- {
- Translate((float)dx, (float)dy);
- }
-
- public void Translate (float dx, float dy)
- {
- if (NativeObject.equals(InfiniteRegion.NativeObject))
- return;
- NativeObject.transform(geom.AffineTransform.getTranslateInstance(
- dx,
- dy));
- }
- #endregion
-
- #region IsVisible [TODO]
- //
- public bool IsVisible (int x, int y, Graphics g)
- {
- return IsVisible((float)x, (float)y, g);
- }
-
- public bool IsVisible (int x, int y, int width, int height)
- {
- return IsVisible((float)x, (float)y, (float)width, (float)height);
- }
-
- public bool IsVisible (int x, int y, int width, int height, Graphics g)
- {
- return IsVisible((float)x, (float)y, (float)width, (float)height, g);
- }
-
- public bool IsVisible (Point point)
- {
- return IsVisible(point.X, point.Y);
- }
-
- public bool IsVisible (PointF point)
- {
- return IsVisible(point.X, point.Y);
- }
-
- public bool IsVisible (Point point, Graphics g)
- {
- return IsVisible(point.X, point.Y, g);
- }
-
- public bool IsVisible (PointF point, Graphics g)
- {
- return IsVisible(point.X, point.Y, g);
- }
-
- public bool IsVisible (Rectangle rect)
- {
- return IsVisible(rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public bool IsVisible (RectangleF rect)
- {
- return IsVisible(rect.X, rect.Y, rect.Width, rect.Height);
- }
-
- public bool IsVisible (Rectangle rect, Graphics g)
- {
- return IsVisible(rect.X, rect.Y, rect.Width, rect.Height, g);
- }
-
- public bool IsVisible (RectangleF rect, Graphics g)
- {
- return IsVisible(rect.X, rect.Y, rect.Width, rect.Height, g);
- }
-
- public bool IsVisible (float x, float y)
- {
- return NativeObject.contains(x,y);
- }
-
- public bool IsVisible (float x, float y, Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- return NativeObject.contains(x,y);
- }
-
- public bool IsVisible (float x, float y, float width, float height)
- {
- return NativeObject.intersects(x,y,width,height);
- }
-
- public bool IsVisible (float x, float y, float width, float height, Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- return NativeObject.intersects(x,y,width,height);
- }
- #endregion
-
- #region IsEmpty
- public bool IsEmpty(Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- return NativeObject.isEmpty();
- }
- #endregion
-
- #region IsInfinite
- public bool IsInfinite(Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- //probably too naive.
- return NativeObject.equals(InfiniteRegion.NativeObject);
- }
- #endregion
-
- #region MakeEmpty
- public void MakeEmpty()
- {
- NativeObject.reset();
- }
- #endregion
-
- #region MakeInfinite
- public void MakeInfinite()
- {
- Shape = (geom.Area) InfiniteRegion.NativeObject.clone ();
- }
- #endregion
-
- #region Equals
- public bool Equals(Region region, Graphics g)
- {
- if (g == null)
- throw new ArgumentNullException("graphics");
- return NativeObject.equals(region.NativeObject);
- }
- #endregion
-
- [MonoTODO]
- public RegionData GetRegionData()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IntPtr GetHrgn(Graphics g) {
- throw new NotImplementedException();
- }
-
-
- public RectangleF[] GetRegionScans(Matrix matrix)
- {
- throw new NotImplementedException();
- }
-
- #region Transform
- public void Transform(Matrix matrix)
- {
- if (matrix == null)
- throw new ArgumentNullException("matrix");
- if (NativeObject.equals(InfiniteRegion.NativeObject))
- return;
- NativeObject.transform(matrix.NativeObject);
- }
- #endregion
-
- #region Clone
- public Region Clone()
- {
- return new Region ((geom.Area) NativeObject.clone ());
- }
- #endregion
- }
-}
+++ /dev/null
-//
-// System.Drawing.SolidBrush.cs
-//
-// Author:
-// Dennis Hayes (dennish@Raytek.com)
-// Alexandre Pigolkine(pigolkine@gmx.de)
-// Ravindra (rkumar@novell.com)
-//
-// (C) 2002 Ximian, Inc.
-// (C) 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-namespace System.Drawing
-{
- public sealed class SolidBrush : Brush
- {
- internal bool isModifiable = true;
- Color _color;
-
- protected override java.awt.Paint NativeObject {
- get {
- return _color.NativeObject;
- }
- }
-
- public SolidBrush (Color color)
- {
- _color = color;
- }
-
- public Color Color {
- get {
- return _color;
- }
- set {
- if (isModifiable)
- _color = value;
- else
- throw new ArgumentException ("This SolidBrush object can't be modified.");
- }
- }
-
- public override object Clone()
- {
- return new SolidBrush(_color);
- }
-
- protected override void Dispose (bool disposing)
- {
- if (!isModifiable && disposing)
- throw new ArgumentException ("This SolidBrush object can't be modified.");
- }
- }
-}
+++ /dev/null
-//
-// System.Drawing.StringFormat.cs
-//
-// Authors:
-// Dennis Hayes (dennish@Raytek.com)
-// Miguel de Icaza (miguel@ximian.com)
-// Jordi Mas i Hernandez (jordi@ximian.com)
-//
-// Copyright (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Drawing.Text;
-
-namespace System.Drawing {
- /// <summary>
- /// Summary description for StringFormat.
- /// </summary>
- public sealed class StringFormat : MarshalByRefObject, IDisposable, ICloneable {
-
-
- private CharacterRange [] _charRanges;
- private StringAlignment _alignment;
- private StringAlignment _lineAlignment;
- private HotkeyPrefix _hotkeyPrefix;
- private StringFormatFlags _flags;
- private StringDigitSubstitute _digitSubstituteMethod;
- private int _digitSubstituteLanguage;
- private StringTrimming _trimming;
-
- private float _firstTabOffset;
- private float [] _tabStops;
-
- private bool _genericTypeographic = false;
-
- #region Constructors
-
- public StringFormat() : this(0, 0) {
- }
-
- public StringFormat(StringFormatFlags options) : this(options,0) {
- }
-
- public StringFormat(StringFormatFlags options, int lang) {
- _alignment = StringAlignment.Near;
- _digitSubstituteLanguage = lang;
- _digitSubstituteMethod = StringDigitSubstitute.User;
- _flags = options;
- _hotkeyPrefix = HotkeyPrefix.None;
- _lineAlignment = StringAlignment.Near;
- _trimming = StringTrimming.Character;
- }
-
- public StringFormat (StringFormat source) {
- if (source == null)
- throw new ArgumentNullException("format");
-
- _alignment = source.LineAlignment;
- _digitSubstituteLanguage = source.DigitSubstitutionLanguage;
- _digitSubstituteMethod = source.DigitSubstitutionMethod;
- _flags = source.FormatFlags;
- _hotkeyPrefix = source.HotkeyPrefix;
- _lineAlignment = source.LineAlignment;
- _trimming = source.Trimming;
- }
-
-
- #endregion
-
- #region IDisposable
-
- public void Dispose() {
- }
-
- #endregion
-
- #region Public properties
-
- public StringAlignment Alignment {
- get {
- return _alignment;
- }
-
- set {
- _alignment = value;
- }
- }
-
- public StringAlignment LineAlignment {
- get {
- return _lineAlignment;
- }
- set {
- _lineAlignment = value;
- }
- }
-
- [MonoTODO]
- public StringFormatFlags FormatFlags {
- get {
- return _flags;
- }
-
- set {
- _flags = value;
- }
- }
-
- [MonoTODO]
- public HotkeyPrefix HotkeyPrefix {
- get {
- return _hotkeyPrefix;
- }
-
- set {
- _hotkeyPrefix = value;
- }
- }
-
- [MonoTODO]
- public StringTrimming Trimming {
- get {
- return _trimming;
- }
-
- set {
- _trimming = value;
- }
- }
-
- public int DigitSubstitutionLanguage {
- get {
- return _digitSubstituteLanguage;
- }
- }
-
- public StringDigitSubstitute DigitSubstitutionMethod {
- get {
- return _digitSubstituteMethod;
- }
- }
-
-
- #endregion
-
- #region static properties
-
- public static StringFormat GenericDefault {
- get {
- StringFormat genericDefault = new StringFormat();
- return genericDefault;
- }
- }
-
- public static StringFormat GenericTypographic {
- get {
- StringFormat genericTypographic = new StringFormat(
- StringFormatFlags.FitBlackBox |
- StringFormatFlags.LineLimit |
- StringFormatFlags.NoClip,
- 0 );
- genericTypographic.Trimming = StringTrimming.None;
- genericTypographic._genericTypeographic = true;
- return genericTypographic;
- }
- }
-
- #endregion
-
- #region internal accessors
- internal bool NoWrap {
- get {
- return (FormatFlags & StringFormatFlags.NoWrap) != 0;
- }
- }
-
- internal bool IsVertical {
- get {
- return (FormatFlags & StringFormatFlags.DirectionVertical) != 0;
- }
- }
-
- internal bool MeasureTrailingSpaces {
- get {
- return (FormatFlags & StringFormatFlags.MeasureTrailingSpaces) != 0;
- }
- }
-
- internal bool LineLimit {
- get {
- return (FormatFlags & StringFormatFlags.LineLimit) != 0;
- }
- }
-
- internal bool NoClip {
- get {
- return (FormatFlags & StringFormatFlags.NoClip) != 0;
- }
- }
-
- internal bool IsRightToLeft {
- get {
- return (FormatFlags & StringFormatFlags.DirectionRightToLeft) != 0;
- }
- }
-
- internal CharacterRange [] CharRanges {
- get {
- return _charRanges;
- }
- }
-
- internal bool IsGenericTypographic
- {
- get {
- return _genericTypeographic;
- }
- }
- #endregion
-
- #region public methods
-
- public void SetMeasurableCharacterRanges (CharacterRange [] range) {
- _charRanges = range != null ? (CharacterRange [])range.Clone() : null;
- }
-
- public object Clone() {
- StringFormat copy = (StringFormat)MemberwiseClone();
- if (_charRanges != null)
- copy._charRanges = (CharacterRange [])_charRanges.Clone();
- if (_tabStops != null)
- copy._tabStops = (float[])_tabStops.Clone();
- return copy;
- }
-
- public override string ToString() {
- return "[StringFormat, FormatFlags=" + this.FormatFlags.ToString() + "]";
- }
-
- public void SetTabStops(float firstTabOffset, float[] tabStops) {
-// _firstTabOffset = firstTabOffset;
-// _tabStops = tabStops != null ? (float[])tabStops.Clone() : null;
- throw new NotImplementedException();
- }
-
- public void SetDigitSubstitution(int language, StringDigitSubstitute substitute) {
-// _digitSubstituteMethod = substitute;
-// _digitSubstituteLanguage = language;
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public float[] GetTabStops(out float firstTabOffset) {
- firstTabOffset = _firstTabOffset;
- return _tabStops != null ? (float[])_tabStops.Clone() : null;
- }
-
- #endregion
- }
-}
+++ /dev/null
-using System;\r
-using awt = java.awt;\r
-using geom = java.awt.geom;\r
-\r
-namespace System.Drawing {\r
- internal sealed class StrokeFactory {\r
-\r
- StrokeFactory() {}\r
-\r
- interface StrokeCreator {\r
- awt.Stroke Create(float width, int cap, int join, float miterlimit,\r
- float[] dash, float dash_phase, geom.AffineTransform penTransform,\r
- geom.AffineTransform outputTransform, PenFit penFit);\r
- }\r
-\r
- sealed class AdvancedCreator : StrokeCreator {\r
- #region StrokeCreator Members\r
-\r
- public awt.Stroke Create(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase, geom.AffineTransform penTransform,\r
- geom.AffineTransform outputTransform, PenFit penFit) {\r
- if ((penFit == PenFit.NotThin) &&\r
- (outputTransform == null || outputTransform.isIdentity()) &&\r
- (penTransform == null || penTransform.isIdentity()))\r
- return new awt.BasicStroke(width, cap, join, miterlimit, dash, dash_phase);\r
- return new System.Drawing.AdvancedStroke(width, cap, join, miterlimit, dash, dash_phase, penTransform, outputTransform, penFit);\r
- }\r
-\r
- #endregion\r
- }\r
-\r
- sealed class DefaultCreator : StrokeCreator {\r
- #region StrokeCreator Members\r
-\r
- public awt.Stroke Create(float width, int cap, int join, float miterlimit, float[] dash, float dash_phase, geom.AffineTransform penTransform,\r
- geom.AffineTransform outputTransform, PenFit penFit) {\r
- return new awt.BasicStroke(width, cap, join, miterlimit, dash, dash_phase);\r
- }\r
-\r
- #endregion\r
- }\r
-\r
- static readonly StrokeCreator Creator;\r
- static StrokeFactory() {\r
- try {\r
- Type type = typeof(System.Drawing.AdvancedStroke);\r
- Activator.CreateInstance(type);\r
- Creator = new AdvancedCreator();\r
- }\r
- catch{\r
- Creator = new DefaultCreator();\r
- }\r
- }\r
-\r
- static public bool CanCreateAdvancedStroke {\r
- get {\r
- return !(Creator is DefaultCreator);\r
- }\r
- }\r
-\r
- static public awt.Stroke CreateStroke(float width, int cap, int join, float miterlimit,\r
- float[] dash, float dash_phase, geom.AffineTransform penTransform,\r
- geom.AffineTransform outputTransform, PenFit penFit) {\r
-\r
- return Creator.Create(width, cap, join, miterlimit, dash, dash_phase, penTransform, outputTransform, penFit);\r
- }\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-//
-// System.Drawing.SystemColors.cs
-//
-// Authors:
-// Andrew Skiba (andrews@mainsoft.com)
-// Konstantin Triger (kostat@mainsoft.com)
-//
-// Copyright (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Drawing {
-
- public sealed class SystemColors
- {
- private SystemColors (){}
-
- static Color [] SystemColorsCache {
- get {
- return KnownColors.Values;
- }
- }
-
- static public Color ActiveBorder
- {
- get {
- return SystemColorsCache[(int)KnownColor.ActiveBorder];
- }
- }
-
- static public Color ActiveCaption
- {
- get {
- return SystemColorsCache[(int)KnownColor.ActiveCaption];
- }
- }
-
- static public Color ActiveCaptionText
- {
- get {
- return SystemColorsCache[(int)KnownColor.ActiveCaptionText];
- }
- }
-
- static public Color AppWorkspace
- {
- get {
- return SystemColorsCache[(int)KnownColor.AppWorkspace];
- }
- }
-
- static public Color Control
- {
- get {
- return SystemColorsCache[(int)KnownColor.Control];
- }
- }
-
- static public Color ControlDark
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlDark];
- }
- }
-
- static public Color ControlDarkDark
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlDarkDark];
- }
- }
-
- static public Color ControlLight
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlLight];
- }
- }
-
- static public Color ControlLightLight
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlLightLight];
- }
- }
-
- static public Color ControlText
- {
- get {
- return SystemColorsCache[(int)KnownColor.ControlText];
- }
- }
-
- static public Color Desktop
- {
- get {
- return SystemColorsCache[(int)KnownColor.Desktop];
- }
- }
-
- static public Color GrayText
- {
- get {
- return SystemColorsCache[(int)KnownColor.GrayText];
- }
- }
-
- static public Color Highlight
- {
- get {
- return SystemColorsCache[(int)KnownColor.Highlight];
- }
- }
-
- static public Color HighlightText
- {
- get {
- return SystemColorsCache[(int)KnownColor.HighlightText];
- }
- }
-
- static public Color HotTrack
- {
- get {
- return SystemColorsCache[(int)KnownColor.HotTrack];
- }
- }
-
- static public Color InactiveBorder
- {
- get {
- return SystemColorsCache[(int)KnownColor.InactiveBorder];
- }
- }
-
- static public Color InactiveCaption
- {
- get {
- return SystemColorsCache[(int)KnownColor.InactiveCaption];
- }
- }
-
- static public Color InactiveCaptionText
- {
- get {
- return SystemColorsCache[(int)KnownColor.InactiveCaptionText];
- }
- }
-
- static public Color Info
- {
- get {
- return SystemColorsCache[(int)KnownColor.Info];
- }
- }
-
- static public Color InfoText
- {
- get {
- return SystemColorsCache[(int)KnownColor.InfoText];
- }
- }
-
- static public Color Menu
- {
- get {
- return SystemColorsCache[(int)KnownColor.Menu];
- }
- }
-
- static public Color MenuText
- {
- get {
- return SystemColorsCache[(int)KnownColor.MenuText];
- }
- }
-
- static public Color ScrollBar
- {
- get {
- return SystemColorsCache[(int)KnownColor.ScrollBar];
- }
- }
-
- static public Color Window
- {
- get {
- return SystemColorsCache[(int)KnownColor.Window];
- }
- }
-
- static public Color WindowFrame
- {
- get {
- return SystemColorsCache[(int)KnownColor.WindowFrame];
- }
- }
-
- static public Color WindowText
- {
- get {
- return SystemColorsCache[(int)KnownColor.WindowText];
- }
- }
-
-#if NET_2_0
-
- static public Color ButtonFace
- {
- get {
- return SystemColorsCache [(int) KnownColor.ButtonFace];
- }
- }
-
- static public Color ButtonHighlight
- {
- get {
- return SystemColorsCache [(int) KnownColor.ButtonHighlight];
- }
- }
-
- static public Color ButtonShadow
- {
- get {
- return SystemColorsCache [(int) KnownColor.ButtonShadow];
- }
- }
-
- static public Color GradientActiveCaption
- {
- get {
- return SystemColorsCache [(int) KnownColor.GradientActiveCaption];
- }
- }
-
- static public Color GradientInactiveCaption
- {
- get {
- return SystemColorsCache [(int) KnownColor.GradientInactiveCaption];
- }
- }
-
- static public Color MenuBar
- {
- get {
- return SystemColorsCache [(int) KnownColor.MenuBar];
- }
- }
-
- static public Color MenuHighlight
- {
- get {
- return SystemColorsCache [(int) KnownColor.MenuHighlight];
- }
- }
-#endif
- }
-}
+++ /dev/null
-//
-// System.Drawing.systemIcons.cs
-//
-// Authors:
-// Vladimir Krasnov (vladimirk@mainsoft.com)
-// Konstantin Triger (kostat@mainsoft.com)
-//
-// Copyright (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Configuration;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Reflection;
-
-namespace System.Drawing {
- public sealed class SystemIcons {
- static readonly Icon[] systemIcons;
-
- enum IconName {
- Application, Asterisk, Error,
- Exclamation, Hand, Information,
- Question, Warning, WinLogo
- }
-
- static SystemIcons() {
-
- Type nameType = typeof(IconName);
- string [] iconNames = Enum.GetNames(nameType);
- systemIcons = new Icon[iconNames.Length];
- Assembly assembly = Assembly.GetExecutingAssembly();
- for (int i = 0; i < iconNames.Length; i++)
- systemIcons[(int)(IconName)Enum.Parse(nameType, iconNames[i])] =
- new Icon(assembly.GetManifestResourceStream(String.Format("System.Drawing.Assembly.{0}.ico", iconNames[i])));
- }
-
- private SystemIcons() {
- }
-
- public static Icon Application { get { return systemIcons[(int)IconName.Application];} }
- public static Icon Asterisk { get { return systemIcons[(int)IconName.Asterisk];} }
- public static Icon Error { get { return systemIcons[(int)IconName.Error];} }
- public static Icon Exclamation { get { return systemIcons[(int)IconName.Exclamation];} }
- public static Icon Hand { get { return systemIcons[(int)IconName.Hand];} }
- public static Icon Information { get { return systemIcons[(int)IconName.Information];} }
- public static Icon Question { get { return systemIcons[(int)IconName.Question];} }
- public static Icon Warning { get { return systemIcons[(int)IconName.Warning];} }
- public static Icon WinLogo { get { return systemIcons[(int)IconName.WinLogo];} }
- }
-}
+++ /dev/null
-//
-// System.Drawing.TextureBrush.cs
-//
-// Author:
-// Dennis Hayes (dennish@Raytek.com)
-// Ravindra (rkumar@novell.com)
-//
-// (C) 2002 Ximian, Inc
-// (C) 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-
-using awt = java.awt;
-using geom = java.awt.geom;
-using image = java.awt.image;
-
-namespace System.Drawing {
- /// <summary>
- /// Summary description for TextureBrush.
- /// </summary>
- public sealed class TextureBrush : Brush {
- readonly awt.TexturePaint _nativeObject;
- RectangleF _sourceRectangle;
- Image _texture = null;
- WrapMode _wrapMode;
-
- protected override java.awt.Paint NativeObject {
- get {
- return _nativeObject;
- }
- }
-
- #region ctors
-
- public TextureBrush (Image image) : this (image, WrapMode.Tile) {
- }
-
- public TextureBrush (Image image, WrapMode wrapMode) :
- this( image, wrapMode, new RectangleF(0, 0, image.Width, image.Height )){
- }
-
- public TextureBrush (Image image, Rectangle dstRect) :
- this( image, WrapMode.Tile, dstRect ) {
- }
-
- public TextureBrush (Image image, RectangleF dstRect) :
- this( image, WrapMode.Tile, dstRect ) {
- }
-
- [MonoTODO]
- public TextureBrush (Image image, Rectangle dstRect, ImageAttributes imageAttr) : this( image, dstRect ) {
- // TBD: Implement ImageAttributes
- }
-
- [MonoTODO]
- public TextureBrush (Image image, RectangleF dstRect, ImageAttributes imageAttr) : this( image, dstRect ) {
- // TBD: Implement ImageAttributes
- }
-
- public TextureBrush (Image image, WrapMode wrapMode, Rectangle dstRect) :
- this( image, wrapMode, new RectangleF(dstRect.X, dstRect.Y, dstRect.Width, dstRect.Height )){
- }
-
- [MonoTODO]
- public TextureBrush (Image image, WrapMode wrapMode, RectangleF dstRect) {
- // TBD: check if not metafile
- _sourceRectangle = dstRect;
- _texture = (Image)((Bitmap)image).Clone(dstRect, image.PixelFormat);
- _wrapMode = wrapMode;
-
- if (wrapMode != Drawing2D.WrapMode.Tile)
- image = CreateWrappedImage(_texture, wrapMode);
- else
- image = _texture;
-
- _nativeObject = new awt.TexturePaint((image.BufferedImage)image.NativeObject.CurrentImage.NativeImage,
- new geom.Rectangle2D.Float(0, 0, image.Width, image.Height));
- }
-
- #endregion
-
- #region CreateWrappedImage
-
- private Image CreateWrappedImage(Image image, WrapMode wrapMode) {
- Image b = null;
- Graphics g = null;
-
- switch (wrapMode) {
- case Drawing2D.WrapMode.TileFlipX :
- b = new Bitmap(image.Width * 2, image.Height);
- g = Graphics.FromImage( b );
- g.DrawImage(image, new Matrix());
- g.DrawImage(image, new Matrix(-1, 0, 0, 1, image.Width * 2 - 1, 0));
- break;
- case Drawing2D.WrapMode.TileFlipY :
- b = new Bitmap(image.Width, image.Height * 2);
- g = Graphics.FromImage( b );
- g.DrawImage(image, new Matrix());
- g.DrawImage(image, new Matrix(1, 0, 0, -1, 0, image.Height * 2 - 1));
- break;
- case Drawing2D.WrapMode.TileFlipXY :
- b = new Bitmap(image.Width * 2, image.Height * 2);
- g = Graphics.FromImage( b );
- g.DrawImage(image, new Matrix());
- g.DrawImage(image, new Matrix(-1, 0, 0, 1, image.Width * 2 - 1, 0));
- g.DrawImage(image, new Matrix(1, 0, 0, -1, 0, image.Height * 2 - 1));
- g.DrawImage(image, new Matrix(-1, 0, 0, -1, image.Width * 2 - 1, image.Height * 2 - 1));
- break;
- case Drawing2D.WrapMode.Clamp :
- // TBD: Implement WrapMode.Clamp
- return image;
- default :
- b = image;
- break;
- }
-
- return b;
- }
-
- #endregion
-
- #region properties
-
- public Image Image {
- get {
- return (Image)_texture.Clone();
- }
- }
-
- public Matrix Transform {
- get {
- return BrushTransform;
- }
- set {
- BrushTransform = value;
- }
- }
-
- [MonoTODO]
- public WrapMode WrapMode {
- get {
- return _wrapMode;
- }
- set {
- _wrapMode = value;
- }
- }
-
- #endregion
-
- #region public methods
-
- public override object Clone () {
- TextureBrush copy = (TextureBrush)InternalClone();
-
- if (_texture != null)
- copy._texture = (Image)_texture.Clone();
-
- return copy;
- }
-
- public void MultiplyTransform (Matrix matrix) {
- base.BrushMultiplyTransform( matrix );
- }
-
- public void MultiplyTransform (Matrix matrix, MatrixOrder order) {
- base.BrushMultiplyTransform( matrix, order );
- }
-
- public void ResetTransform () {
- base.BrushResetTransform();
- }
-
- public void RotateTransform (float angle) {
- base.BrushRotateTransform( angle );
- }
-
- public void RotateTransform (float angle, MatrixOrder order) {
- base.BrushRotateTransform( angle, order );
- }
-
- public void ScaleTransform (float sx, float sy) {
- base.BrushScaleTransform( sx, sy );
- }
-
- public void ScaleTransform (float sx, float sy, MatrixOrder order) {
- base.BrushScaleTransform( sx, sy, order );
- }
-
- public void TranslateTransform (float dx, float dy) {
- base.BrushTranslateTransform( dx, dy );
- }
-
- public void TranslateTransform (float dx, float dy, MatrixOrder order) {
- base.BrushTranslateTransform( dx, dy, order );
- }
-
- #endregion
- }
-}
\r
#if MONOTOUCH\r
#else\r
-#if TARGET_JVM\r
-using awt = java.awt;\r
-using javax.imageio;\r
-using java.lang;\r
-using java.security;\r
-using java.awt.image;\r
-#else\r
using System.Windows.Forms;\r
#endif\r
-#endif\r
\r
using NUnit.Framework;\r
\r
Hashtable _hash;\r
CachedResults _results;\r
\r
-#if TARGET_JVM\r
- public const string FileName = "CachedResults.xml";\r
- public const string NewFileName = "NewCachedResults.xml";\r
-#else\r
public const string FileName = "dotnet.CachedResults.xml";\r
public const string NewFileName = "dotnet.NewCachedResults.xml";\r
-#endif\r
public readonly static XmlSerializer TestSuiteSerializer =\r
new XmlSerializer(typeof(CachedResults));\r
\r
}\r
public static DrawingTest Create (int width, int height, string ownerClass) {\r
DrawingTest test;\r
-#if TARGET_JVM\r
- test = new JavaDrawingTest ();\r
-#else\r
test = new NetDrawingTest ();\r
-#endif\r
test.Init (width, height);\r
test.OwnerClass = ownerClass;\r
return test;\r
#endregion\r
}\r
\r
-#if TARGET_JVM\r
- internal class JavaDrawingTest:DrawingTest {\r
- java.awt.image.BufferedImage _image;\r
- java.awt.image.BufferedImage Image {\r
- get {\r
- if (_image != null)\r
- return _image;\r
- Type imageType = typeof (Bitmap);\r
- PropertyInfo [] props = imageType.GetProperties (\r
- BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);\r
-\r
- PropertyInfo prop = null;\r
- foreach (PropertyInfo p in props) {\r
- if (p.Name == "NativeObject")\r
- if (p.PropertyType == typeof(java.awt.image.BufferedImage))\r
- prop = p;\r
- }\r
-\r
- MethodInfo method = prop.GetGetMethod (true);\r
- _image = (java.awt.image.BufferedImage) method.Invoke (_bitmap, new object [0]);\r
- return _image;\r
- }\r
- }\r
-\r
- public JavaDrawingTest () {}\r
-\r
- protected override double GetExpectedNorm (double myNorm) {\r
- return ExpectedResults.GetNorm(TestName);\r
- }\r
-\r
- protected override Bitmap GetReferenceImage(string testName) {\r
- try{\r
- string dotNetResultsFolder = @"";\r
- string fileName = dotNetResultsFolder + testName.Replace(":", "_") + ".png";\r
- return new Bitmap(fileName);\r
- }\r
- catch(System.Exception e) {\r
- throw new System.Exception("Error creating .Net reference image");\r
- }\r
- }\r
-\r
- private class JavaForm:java.awt.Dialog,IMyForm {\r
- class EventListener : java.awt.@event.WindowListener {\r
- #region WindowListener Members\r
-\r
- public void windowOpened(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowOpened implementation\r
- }\r
-\r
- public void windowActivated(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowActivated implementation\r
- }\r
-\r
- public void windowClosed(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowClosed implementation\r
- }\r
-\r
- public void windowDeiconified(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowDeiconified implementation\r
- }\r
-\r
- public void windowIconified(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowIconified implementation\r
- }\r
-\r
- public void windowClosing(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowClosing implementation\r
- java.awt.Window w = arg_0.getWindow();\r
- java.awt.Window par = w.getOwner ();\r
- w.dispose();\r
- par.dispose ();\r
- }\r
-\r
- public void windowDeactivated(java.awt.@event.WindowEvent arg_0) {\r
- // TODO: Add ttt.windowDeactivated implementation\r
- }\r
-\r
- #endregion\r
- }\r
-\r
- java.awt.Image _image;\r
- Size _s;\r
-\r
- public JavaForm (string title, java.awt.Image anImage, Size s)\r
- : base(new java.awt.Frame(), title, true) {\r
- _image = anImage;\r
- _s = s;\r
- \r
- addWindowListener(new EventListener());\r
- }\r
- public override void paint (java.awt.Graphics g) {\r
- base.paint (g);\r
- awt.Insets insets = this.getInsets ();\r
- g.drawImage (_image, insets.left, insets.top, null);\r
- }\r
- void IMyForm.Show () {\r
- awt.Insets insets = this.getInsets ();\r
- base.setSize (_s.Width + insets.left + insets.right,\r
- _s.Width + insets.top + insets.bottom);\r
- this.show ();\r
- //save the image\r
- //ImageIO.write((java.awt.image.RenderedImage)_image, "png", new java.io.File("test.java.png"));\r
- }\r
- }\r
-\r
- protected override IMyForm CreateForm(string title) {\r
- return new JavaForm (title, Image, _bitmap.Size);\r
- }\r
- \r
- protected override string DetermineCallingFunction() {\r
- System.Exception e = new System.Exception ();\r
- java.lang.Class c = vmw.common.TypeUtils.ToClass (e);\r
- java.lang.reflect.Method m = c.getMethod ("getStackTrace",\r
- new java.lang.Class [0]);\r
- java.lang.StackTraceElement [] els = (java.lang.StackTraceElement [])\r
- m.invoke (e, new object [0]);\r
- java.lang.StackTraceElement el = els [4];\r
- return el.getClassName () + "." + _ownerClass + "." + el.getMethodName ();\r
- }\r
-\r
- public override string CalculateSHA1() {\r
- MessageDigest md = MessageDigest.getInstance ("SHA");\r
- DataBufferInt dbi = (DataBufferInt) Image.getRaster ().getDataBuffer ();\r
- for (int i=0; i<dbi.getNumBanks (); i++) {\r
- int [] curBank = dbi.getData (i);\r
- for (int j=0; j<curBank.Length; j++) {\r
- int x = curBank[j];\r
- md.update ((sbyte) (x & 0xFF));\r
- md.update ((sbyte) ((x>>8) & 0xFF));\r
- md.update ((sbyte) ((x>>16) & 0xFF));\r
- md.update ((sbyte) ((x>>24) & 0xFF));\r
- }\r
- }\r
- byte [] resdata = (byte[])vmw.common.TypeUtils.ToByteArray(md.digest());\r
- return Convert.ToBase64String (resdata);\r
- }\r
- }\r
-#else\r
internal class NetDrawingTest:DrawingTest {\r
public NetDrawingTest () {}\r
\r
}\r
\r
}\r
-#endif\r
\r
}\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>DrawingTest</RootNamespace>\r
- <AssemblyName>DrawingTest</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <OldToolsVersion>2.0</OldToolsVersion>\r
- <jarserver>ip2</jarserver>\r
- <PublishUrl>publish\</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Disk</InstallFrom>\r
- <UpdateEnabled>false</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>false</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral">\r
- <Private>False</Private>\r
- <HintPath>..\..\..\..\lib\J2SE.Helpers.dll</HintPath>\r
- </Reference>\r
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
- </Reference>\r
- <Reference Include="rt">\r
- <HintPath>..\..\..\..\lib\rt.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="AssemblyInfo.cs" />\r
- <Compile Include="DrawingTest.cs" />\r
- <Compile Include="PDComparer.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\Exocortex.DSP\src\Exocortex.DSP20.v1.J2EE.csproj">\r
- <Project>{995DE32D-06AB-4926-97FF-565B9205D5F8}</Project>\r
- <Name>Exocortex.DSP20.v1.J2EE</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-RefInfo-nunit-framework="j2il:" REFS-JarPath-system-drawing="" REFS-JarPath-j2se-helpers="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\J2SE.Helpers.jar" REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\jre5\lib\rt.jar" REFS-JarPath-system-xml="" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Data.jar" REFS-JarPath-system="" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\mscorlib.jar" REFS-JarPath-nunit-framework="..\..\..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-nunit-util="..\..\..\..\..\nunit20\util\bin\Debug_Java20\nunit.util.jar" REFS-JarPath-nunit-core="..\..\..\..\..\nunit20\util\bin\Debug_Java20\nunit.core.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{995DE32D-06AB-4926-97FF-565B9205D5F8}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>Exocortex.DSP</RootNamespace>\r
- <AssemblyName>Exocortex.DSP.v1</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <OldToolsVersion>2.0</OldToolsVersion>\r
- <jarserver>ip2</jarserver>\r
- <PublishUrl>publish\</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Disk</InstallFrom>\r
- <UpdateEnabled>false</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>false</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="rt">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="AssemblyInfo.cs" />\r
- <Compile Include="Complex.cs" />\r
- <Compile Include="ComplexArray.cs" />\r
- <Compile Include="ComplexF.cs" />\r
- <Compile Include="ComplexMath.cs" />\r
- <Compile Include="ComplexStats.cs" />\r
- <Compile Include="Fourier.cs" />\r
- <Compile Include="FourierDirection.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system-drawing="" REFS-JarPath-j2se-helpers="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\J2SE.Helpers.jar" REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\jre5\lib\rt.jar" REFS-JarPath-system-xml="" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Data.jar" REFS-JarPath-system="" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\mscorlib.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
Assert.That(t.Compare(), Is.True);\r
}\r
[Test]\r
-#if TARGET_JVM\r
- [Category("NotWorking")] // defect 6145\r
-#endif\r
public void DrawImageWithResolution() {\r
t.Graphics.DrawImage(bmp2, 0, 0);\r
t.Show();\r
Assert.That(t.Compare(), Is.True);\r
}\r
[Test]\r
-#if TARGET_JVM\r
- [Category ("NotWorking")] // defect 6145\r
-#endif\r
public void DrawImageInContainer2() {\r
t.Graphics.BeginContainer(new Rectangle(10, 10, 50, 50), new Rectangle(70, 70, 100, 100), GraphicsUnit.Pixel);\r
t.Graphics.DrawImage(bmp2, 0, 0);\r
unit.DefaultValues ();
}
-#if !TARGET_JVM
[Test]
[PermissionSet (SecurityAction.Deny, Unrestricted = true)]
public void UnitTests_PaintValue ()
unit.PaintValue_PaintValueEventArgs ();
unit.PaintValue ();
}
-#endif
// we use reflection to call UITypeEditor class as it's protected by a
// LinkDemand (which will be converted into full demand, i.e. a stack
#endif
}
-#if !TARGET_JVM
[Test]
public void PaintValue_PaintValueEventArgs_Null ()
{
{
editor.PaintValue (null, graphics, Rectangle.Empty);
}
-#endif
}
}
[Test]
[ExpectedException (typeof (OverflowException))]
-#if TARGET_JVM
- [Category ("NotWorking")] // defect 6364
-#endif
public void ColorBlend_Negative ()
{
ColorBlend cb = new ColorBlend (-1);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestDrawing ()
{
// create a bitmap with big enough dimensions
/* Checks bitmap features on a know 1bbp bitmap */
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap1bitFeatures ()
{
string sInFile = getInFile ("bitmaps/almogaver1bit.bmp");
/* Checks bitmap features on a know 8bbp bitmap */
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap8bitFeatures ()
{
string sInFile = getInFile ("bitmaps/almogaver8bits.bmp");
/* Checks bitmap features on a know 24-bits bitmap */
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[Test]
public void Bitmap24bitFeatures()
{
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap24bitData ()
{
}
}
}
-#endif
/* Checks bitmap features on a know 32-bits bitmap (codec)*/
[Test]
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_24bppRgb ()
{
Save (PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppRgb ()
{
Save (PixelFormat.Format32bppRgb, PixelFormat.Format32bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppArgb ()
{
Save (PixelFormat.Format32bppArgb, PixelFormat.Format32bppRgb, true);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppPArgb ()
{
Save (PixelFormat.Format32bppPArgb, PixelFormat.Format32bppRgb, true);
Assert.AreEqual (0, cm.Matrix41, "4,1");\r
Assert.AreEqual (0, cm.Matrix42, "4,2");\r
Assert.AreEqual (0, cm.Matrix43, "4,3");\r
-#if !TARGET_JVM\r
Assert.AreEqual (100, Marshal.SizeOf (cm), "object");\r
Assert.AreEqual (100, Marshal.SizeOf (typeof (ColorMatrix)), "type");\r
-#endif\r
}\r
\r
[Test]\r
// Text Color Matrix processing
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix1 ()
{
Color clr_src, clr_rslt;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix2 ()
{
Color clr_src, clr_rslt;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix_80323_UsingAlpha ()
{
Bug80323 (Color.FromArgb (100, 255, 0, 0));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ColorMatrix_80323_WithoutAlpha ()
{
// this color is identical, once drawn over the bitmap, to Color.FromArgb (100, 255, 0, 0)
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Null ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Default_Any ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_Default_Count ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Any ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Brush ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Count ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Default ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Pen ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_AltGrays_Text ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_SkipGrays_Any ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_SkipGrays_Count ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_InvalidFlag ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrix_InvalidType()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_Null_ColorMatrix ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_ColorMatrix_Null_AltGrays ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void SetColorMatrices_Gray ()
{
Color c = ProcessColorMatrices (Color.Gray, global_color_matrix, global_gray_matrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void SetColorMatrices_Color ()
{
Color c = ProcessColorMatrices (Color.MidnightBlue, global_color_matrix, global_gray_matrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_InvalidFlags ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
[ExpectedException (typeof (ArgumentException))]
public void SetColorMatrices_InvalidType ()
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("ImageAttributes is not supported in GH")]
-#endif
public void ColorMatrixAlpha ()
{
for (int i = 0; i < 256; i++) {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Decoders ()
{
Assert.AreEqual (8, decoders.Count, "Count");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Encoders ()
{
Assert.AreEqual (5, encoders.Count, "Count");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void BMPCodec()
{
Guid g = new Guid ("557cf400-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void GifCodec()
{
Guid g = new Guid ("557cf402-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void JpegCodec()
{
Guid g = new Guid ("557cf401-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void PngCodec()
{
Guid g = new Guid ("557cf406-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TiffCodec ()
{
Guid g = new Guid ("557cf405-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IconCodec_Encoder ()
{
Guid g = new Guid ("557cf407-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IconCodec_Decoder ()
{
Guid g = new Guid ("557cf407-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void EmfCodec_Encoder ()
{
Guid g = new Guid ("557cf403-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void EmfCodec_Decoder ()
{
Guid g = new Guid ("557cf403-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void WmfCodec_Encoder ()
{
Guid g = new Guid ("557cf404-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void WmfCodec_Decoder ()
{
Guid g = new Guid ("557cf404-1a04-11d3-9a73-0000f81ef32e");
}
[Test]
-#if TARGET_JVM
- [Ignore ("#8853")]
-#endif
public void Bitmap8bbpIndexedGreyscaleFeatures ()
{
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Bitmap8bbpIndexedGreyscalePixels ()
{
string sInFile = getInFile ("bitmaps/nature-greyscale.jpg");
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap8bbpIndexedGreyscaleData ()
{
}
}
}
-#endif
/* Checks bitmap features on a known 24-bits bitmap */
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Bitmap24bitFeatures ()
{
string sInFile = getInFile ("bitmaps/nature24bits.jpg");
}
}
-#if !TARGET_JVM
[Test]
public void Bitmap24bitData ()
{
}
}
}
-#endif
private void Save (PixelFormat original, PixelFormat expected)
{
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_24bppRgb ()
{
Save (PixelFormat.Format24bppRgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppRgb ()
{
Save (PixelFormat.Format32bppRgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppArgb ()
{
Save (PixelFormat.Format32bppArgb, PixelFormat.Format24bppRgb);
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Save_32bppPArgb ()
{
Save (PixelFormat.Format32bppPArgb, PixelFormat.Format24bppRgb);
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exocortex.DSP20.v1.J2EE", "DrawingTest\Exocortex.DSP\src\Exocortex.DSP20.v1.J2EE.csproj", "{995DE32D-06AB-4926-97FF-565B9205D5F8}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DrawingTestHelper20.J2EE", "DrawingTest\DrawingTestHelper\DrawingTestHelper20.J2EE.csproj", "{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test20.J2EE", "Test20.J2EE.csproj", "{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {995DE32D-06AB-4926-97FF-565B9205D5F8}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {995DE32D-06AB-4926-97FF-565B9205D5F8}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {995DE32D-06AB-4926-97FF-565B9205D5F8}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {995DE32D-06AB-4926-97FF-565B9205D5F8}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {995DE32D-06AB-4926-97FF-565B9205D5F8}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {995DE32D-06AB-4926-97FF-565B9205D5F8}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {995DE32D-06AB-4926-97FF-565B9205D5F8}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {995DE32D-06AB-4926-97FF-565B9205D5F8}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test20", "Test20.csproj", "{0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DrawingTestHelper20", "DrawingTest\DrawingTestHelper\DrawingTestHelper20.csproj", "{0E97F734-51B9-497B-9259-B6999FD87BDF}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exocortex.DSP20.v1", "DrawingTest\Exocortex.DSP\src\Exocortex.DSP20.v1.csproj", "{A9553E24-D07E-44FE-92FB-8C1D3D3C744E}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {0E97F734-51B9-497B-9259-B6999FD87BDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {0E97F734-51B9-497B-9259-B6999FD87BDF}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {0E97F734-51B9-497B-9259-B6999FD87BDF}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {0E97F734-51B9-497B-9259-B6999FD87BDF}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {A9553E24-D07E-44FE-92FB-8C1D3D3C744E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {A9553E24-D07E-44FE-92FB-8C1D3D3C744E}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {A9553E24-D07E-44FE-92FB-8C1D3D3C744E}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {A9553E24-D07E-44FE-92FB-8C1D3D3C744E}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void CanConvertFrom () {
Assert.IsTrue (colconv.CanConvertFrom (typeof (String)), "CCF#1");
Assert.IsTrue (colconv.CanConvertFrom (null, typeof (String)), "CCF#1a");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom ()
{
Color color = (Color) colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom_x4 ()
{
colconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_InvalidNumber ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_InvalidNumber ()
{
try {
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FromHtml_PoundNegative ()
{
ColorTranslator.FromHtml ("#-1");
[Test]
[ExpectedException (typeof (Exception))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FromHtml_Unknown ()
{
ColorTranslator.FromHtml ("unknown-color-test");
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public class TestBitmap {
[Test]
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_BitmapData_Null ()
{
-#if !TARGET_JVM
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
bmp.LockBits (rect, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb, null);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_32_32_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_32_24_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_24_24_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format24bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Bitmap.LockBits is not implemented")]
-#endif
public void LockBits_24_32_BitmapData ()
{
-#if !TARGET_JVM
BitmapData data = new BitmapData ();
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format24bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
Assert.AreEqual (100, data.Width, "Width");
bmp.UnlockBits (data);
}
-#endif
}
#endif
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void FileDoesNotExists ()
{
Bitmap bmp = new Bitmap ("FileDoesNotExists.jpg");
hash = new MD5CryptoServiceProvider().ComputeHash (pixels);
return ByteArrayToString (hash);
}
-#if !TARGET_JVM
public string RotateIndexedBmp (Bitmap src, RotateFlipType type)
{
int pixels_per_byte;
byte[] hash = new MD5CryptoServiceProvider().ComputeHash (pixel_data);
return ByteArrayToString (hash);
}
-#endif
/*
}
-#if !TARGET_JVM
/*
Rotate 1- and 4-bit bitmaps in different ways and check the
resulting pixels using MD5
}
}
}
-#endif
[Test]
public void DefaultFormat1 ()
{
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
public class BitmapFullTrustTest {
-#if !TARGET_JVM
[Test]
public void BitmapIntIntIntPixelFormatIntPtrCtor ()
{
Assert.IsTrue (image2.RawFormat.Equals (ImageFormat.MemoryBmp), "2.RawFormat");
}
}
-#endif
}
}
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Throws ArgumentException - Implementation specific")]
-#endif
public void Dispose ()
{
Brushes.YellowGreen.Dispose ();
0x01, 0x00, 0x0B };
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize ()
{
BinaryFormatter bf = new BinaryFormatter ();
67,111,108,111,114,5,115,116,97,116,101,1,0,0,0,9,7,7,2,0,0,0,10,0,0,0,0,0,0,0,0,37,0,1,0,11 };
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize2 ()
{
BinaryFormatter bf = new BinaryFormatter ();
67,111,108,111,114,5,115,116,97,116,101,1,0,0,0,9,7,7,2,0,0,0,10,255,0,0,255,0,0,0,0,0,0,2,0,11};
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Deserialize3 ()
{
BinaryFormatter bf = new BinaryFormatter ();
}
}
-#if !TARGET_JVM
private void Compare (KnownColor kc, GetSysColorIndex index)
{
// we get BGR than needs to be converted into ARGB
Compare (KnownColor.MenuHighlight, GetSysColorIndex.COLOR_MENUHIGHLIGHT);
#endif
}
-#endif // TARGET_JVM
}
}
public string lfFaceName;
}
-#if !TARGET_JVM
[Test]
[Category ("CAS")]
[ExpectedException (typeof (SecurityException))]
Font f = new Font ("Arial", 10);
f.ToLogFont (null);
}
-#endif
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentNullException))]
-#endif
-#if TARGET_JVM
- [Category ("NotWorking")]
#endif
public void Font_StringNull_Float ()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float ()
{
Font f = new Font (name, 12.5f);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle ()
{
Font f = new Font (name, 12.5f, FontStyle.Bold);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit ()
{
Font f = new Font (name, 12.5f, FontStyle.Italic, GraphicsUnit.Pixel);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Display ()
{
new Font (name, 12.5f, FontStyle.Italic, GraphicsUnit.Display);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Byte ()
{
Font f = new Font (name, 12.5f, FontStyle.Strikeout, GraphicsUnit.Inch, Byte.MaxValue);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_String_Float_FontStyle_GraphicsUnit_Byte_Bool ()
{
Font f = new Font (name, 12.5f, FontStyle.Underline, GraphicsUnit.Document, Byte.MinValue, true);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Bold);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Italic, GraphicsUnit.Millimeter);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Display ()
{
new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Italic, GraphicsUnit.Display);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Byte ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Strikeout, GraphicsUnit.Inch, Byte.MaxValue);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Font_FontFamily_Float_FontStyle_GraphicsUnit_Byte_Bool ()
{
Font f = new Font (FontFamily.GenericMonospace, 12.5f, FontStyle.Underline, GraphicsUnit.Document, Byte.MinValue, true);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_Height ()
{
Font f = new Font (name, 12.5f);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToLogFont ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
LOGFONT lf = new LOGFONT();
f.ToLogFont (lf);
-#endif
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToLogFont_LoopCharSet ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
LOGFONT lf = new LOGFONT ();
Assert.Fail ("Unexcepted exception {0} at iteration {1}", e, i);
}
}
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Dispose_ToHFont ()
{
-#if !TARGET_JVM
Font f = new Font (name, 12.5f);
f.Dispose ();
f.ToHfont ();
-#endif
}
[Test]
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_IconNull_Int_Int ()
{
new Icon ((Icon)null, 32, 32);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_IntNegative_Int Not Working")]
-#endif
public void Constructor_Icon_IntNegative_Int ()
{
Icon neg = new Icon (icon, -32, 32);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_IconNull_Size ()
{
new Icon ((Icon) null, new Size (32, 32));
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_Size_Negative Not Working")]
-#endif
public void Constructor_Icon_Size_Negative ()
{
Icon neg = new Icon (icon, new Size (-32, -32));
}
[Test]
-#if TARGET_JVM
- [Ignore ("Constructor_Icon_Int_Int_NonSquare Not Working")]
-#endif
public void Constructor_Icon_Int_Int_NonSquare ()
{
Icon non_square = new Icon (icon, 32, 16);
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Check parameters")]
-#endif
public void Constructor_Type_StringNull ()
{
new Icon (typeof (Icon), null);
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StreamNull_Size Not Implemented")]
-#endif
public void Constructor_StreamNull_Size ()
{
-#if !TARGET_JVM
new Icon ((Stream) null, new Size (32, 32));
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StringNull_Size Not Implemented")]
-#endif
public void Constructor_StringNull_Size ()
{
-#if !TARGET_JVM
new Icon ((string) null, new Size (32, 32));
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Ignore ("Constructor_StringNull_Int_Int Not Implemented")]
-#endif
public void Constructor_StringNull_Int_Int ()
{
-#if !TARGET_JVM
new Icon ((string) null, 32, 32);
-#endif
}
#endif
Assert.AreEqual (32, clone.Size.Height, "Size.Height");
}
-#if !TARGET_JVM
[Test]
public void CloneHandleIcon ()
{
Assert.AreEqual (SystemIcons.Hand.Size.Width, clone.Size.Width, "Size.Width");
Assert.AreEqual (SystemIcons.Hand.Size.Height, clone.Size.Height, "Size.Height");
}
-#endif
private void XPIcon (int size)
{
}
[Test]
-#if TARGET_JVM
- [Ignore ("SelectFromUnusualSize_Small16 Not Working")]
-#endif
public void SelectFromUnusualSize_Small16 ()
{
using (FileStream fs = File.OpenRead (TestBitmap.getInFile ("bitmaps/80509.ico"))) {
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [Ignore ("Throws NullReference, do we need to follow?")]
-#endif
public void Save_Null ()
{
icon.Save (null);
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon16ToBitmap Not Working")]
-#endif
public void Icon16ToBitmap ()
{
using (Bitmap b = icon16.ToBitmap ()) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon32ToBitmap Not Working")]
-#endif
public void Icon32ToBitmap ()
{
using (Bitmap b = icon32.ToBitmap ()) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon48ToBitmap Not Working")]
-#endif
public void Icon48ToBitmap ()
{
using (Bitmap b = icon48.ToBitmap ()) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon64ToBitmap Not Working")]
-#endif
public void Icon64ToBitmap ()
{
using (Bitmap b = icon64.ToBitmap ()) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("Icon96ToBitmap Not Working")]
-#endif
public void Icon96ToBitmap ()
{
using (Bitmap b = icon96.ToBitmap ()) {
}
[Test] // bug #415581
-#if TARGET_JVM
- [Ignore ("Icon256ToBitmap Not Working")]
-#endif
public void Icon256ToBitmap ()
{
using (FileStream fs = File.OpenRead (TestBitmap.getInFile ("bitmaps/415581.ico"))) {
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_Null ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon (null);
-#endif
}
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_Empty ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon (String.Empty);
-#endif
}
[Test]
[ExpectedException (typeof (FileNotFoundException))]
-#if TARGET_JVM
- [Ignore ("ExtractAssociatedIcon is not implemented")]
-#endif
public void ExtractAssociatedIcon_DoesNotExists ()
{
-#if !TARGET_JVM
Icon.ExtractAssociatedIcon ("does-not-exists.png");
-#endif
}
#endif
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
public class IconFullTrustTest {
-#if !TARGET_JVM
#if NET_2_0
[Test]
public void ExtractAssociatedIcon ()
IconTest.SaveAndCompare ("HICON", icon3, false);
}
}
-#endif
}
}
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (icoConv.CanConvertFrom (typeof (byte [])), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertTo ()
{
Assert.IsTrue (icoConv.CanConvertTo (typeof (String)), "CCT#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Icon newIcon = (Icon) icoConv.ConvertFrom (null, CultureInfo.InvariantCulture, iconBytes);
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertTo ()
{
Assert.AreEqual (iconStr, (String) icoConv.ConvertTo (null,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (imgConv.CanConvertFrom (typeof (byte [])), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertTo ()
{
Assert.IsTrue (imgConv.CanConvertTo (typeof (String)), "CCT#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFrom ()
{
Image newImage = (Image) imgConv.ConvertFrom (null, CultureInfo.InvariantCulture, imageBytes);
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_BadString ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_BadString_WithCulture ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Point ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_SizeF ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertFrom_Object ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_BadString ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_BadString_Culture ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Point ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_SizeF ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertFrom_Object ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertTo ()
{
Assert.AreEqual (imageStr, (String) imgConv.ConvertTo (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Rectangle ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Image ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Size ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Point ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Metafile ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Object ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void ConvertTo_Int ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Rectangle ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Image ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Size ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Bitmap ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Point ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Metafile ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Object ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
[ExpectedException (typeof (NotSupportedException))]
public void TypeDescriptor_ConvertTo_Int ()
{
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetPropertiesSupported ()
{
Assert.IsTrue (imgConv.GetPropertiesSupported (), "GPS#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
#if NET_2_0
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (ptconv.CanConvertFrom (typeof (String)), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (pt, (Point) ptconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (rconv.CanConvertFrom (typeof (String)), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (rect, (Rectangle) rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestCloneAndEquals()
{
Bitmap bmp = new Bitmap (600, 800);
/*Tests infinite, empty, etc*/
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestInfiniteAndEmpty()
{
Bitmap bmp = new Bitmap (600, 800);
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestUnionGroup1 ()
{
Bitmap bmp = new Bitmap (600, 800);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestUnionGroup2 ()
{
RectangleF[] rects;
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestComplementGroup1 ()
{
RectangleF[] rects;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestComplementGroup2 ()
{
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestExcludeGroup1 ()
{
RectangleF[] rects;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestExcludeGroup2 ()
{
Bitmap bmp = new Bitmap (600, 800);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void ExcludeBug402613 ()
{
Region r = new Region();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestIntersect()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestXor()
{
Bitmap bmp = new Bitmap (600, 800);
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void TestTranslate()
{
Region rgn1 = new Region (new RectangleF (10, 10, 120,120));
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Constructor_GraphicsPath_Null ()
{
GraphicsPath gp = null;
[Test]
[ExpectedException (typeof (ArgumentNullException))]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Constructor_RegionData_Null ()
{
RegionData rd = null;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_IntIntNull ()
{
Assert.IsTrue (new Region ().IsVisible (0, 0, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_IntIntIntIntNull ()
{
Assert.IsFalse (new Region ().IsVisible (0, 0, 0, 0, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_PointNull ()
{
Point p = new Point ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_PointFNull ()
{
PointF p = new PointF ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_RectangleNull ()
{
Rectangle r = new Rectangle ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_RectangleFNull ()
{
RectangleF r = new RectangleF ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_SingleSingleNull ()
{
Assert.IsTrue (new Region ().IsVisible (0f, 0f, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void IsVisible_SingleSingleSingleSingleNull ()
{
Assert.IsFalse (new Region ().IsVisible (0f, 0f, 0f, 0f, null));
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
[ExpectedException (typeof (ArgumentNullException))]
public void Equals_NullGraphics ()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
[ExpectedException (typeof (ArgumentNullException))]
public void GetRegionScans_Null ()
{
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Region_Empty ()
{
Region region = new Region ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void Rectangle_GetRegionScans ()
{
Matrix matrix = new Matrix ();
}
[TestFixture]
-#if TARGET_JVM
- [Ignore ("Unsafe code is not supported")]
-#endif
// the test cases in this fixture aren't restricted wrt running unmanaged code
public class RegionTestUnmanaged {
-#if !TARGET_JVM
private Bitmap bitmap;
private Graphics graphic;
Assert.IsFalse (IntPtr.Zero == ptr, "ptr");
r.ReleaseHrgn (ptr);
}
-#endif
#endif
}
}
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (szconv.CanConvertFrom (typeof (String)), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (sz, (Size) szconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestCanConvertFrom ()
{
Assert.IsTrue (szconv.CanConvertFrom (typeof (String)), "CCF#1");
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestConvertFrom ()
{
Assert.AreEqual (sz, (SizeF) szconv.ConvertFrom (null, CultureInfo.InvariantCulture,
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TestGetProperties ()
{
Attribute [] attrs;
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromInvariantString_string_exc_2 ()
{
try {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string ()
{
// save current culture
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ConvertFromString_string_exc_2 ()
{
try {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Default_Dispose ()
{
StringFormat sf = new StringFormat ();
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ctor_StringFormatFlags ()
{
using (StringFormat sf = new StringFormat ((StringFormatFlags)Int32.MinValue)) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void ctor_StringFormatFlags_Int32 ()
{
using (StringFormat sf = new StringFormat ((StringFormatFlags) Int32.MinValue, Int32.MinValue)) {
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void GenericDefault_Local_Dispose ()
{
StringFormat sf = StringFormat.GenericDefault;
[Test]
[ExpectedException (typeof (ArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void GenericTypographic_Local_Dispose ()
{
StringFormat sf = StringFormat.GenericTypographic;
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Alignment_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void HotkeyPrefix_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void LineAlignment_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (InvalidEnumArgumentException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Trimming_Invalid ()
{
using (StringFormat sf = new StringFormat ()) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void Clone_Complex ()
{
using (StringFormat sf = new StringFormat ()) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void TabsStops()
{
using (StringFormat smf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetTabStops_Null ()
{
using (StringFormat sf = new StringFormat ()) {
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetDigitSubstitution ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (NullReferenceException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetMeasurableCharacterRanges_Null ()
{
using (StringFormat sf = new StringFormat ()) {
[Test]
[ExpectedException (typeof (OverflowException))]
-#if TARGET_JVM
- [NUnit.Framework.Category ("NotWorking")]
-#endif
public void SetMeasurableCharacterRanges_TooBig ()
{
using (StringFormat sf = new StringFormat ()) {
+++ /dev/null
-<VisualStudioProject>\r
- <CSHARP\r
- ProjectType = "Local"\r
- ProductVersion = "7.10.3077"\r
- SchemaVersion = "2.0"\r
- ProjectGuid = "{DFE29E81-D6A8-45D4-A627-161F462BE767}"\r
- >\r
- <Build>\r
- <Settings\r
- ApplicationIcon = ""\r
- AssemblyKeyContainerName = ""\r
- AssemblyName = "Test.dotnet"\r
- AssemblyOriginatorKeyFile = ""\r
- DefaultClientScript = "JScript"\r
- DefaultHTMLPageLayout = "Grid"\r
- DefaultTargetSchema = "IE50"\r
- DelaySign = "false"\r
- OutputType = "Library"\r
- PreBuildEvent = ""\r
- PostBuildEvent = ""\r
- RootNamespace = "Test.dotnet"\r
- RunPostBuildEvent = "OnBuildSuccess"\r
- StartupObject = ""\r
- >\r
- <Config\r
- Name = "Debug"\r
- AllowUnsafeBlocks = "false"\r
- BaseAddress = "285212672"\r
- CheckForOverflowUnderflow = "false"\r
- ConfigurationOverrideFile = ""\r
- DefineConstants = "DEBUG;TRACE"\r
- DocumentationFile = ""\r
- DebugSymbols = "true"\r
- FileAlignment = "4096"\r
- IncrementalBuild = "false"\r
- NoStdLib = "false"\r
- NoWarn = ""\r
- Optimize = "false"\r
- OutputPath = "DrawingTest\Test\"\r
- RegisterForComInterop = "false"\r
- RemoveIntegerChecks = "false"\r
- TreatWarningsAsErrors = "false"\r
- WarningLevel = "4"\r
- />\r
- <Config\r
- Name = "Release"\r
- AllowUnsafeBlocks = "false"\r
- BaseAddress = "285212672"\r
- CheckForOverflowUnderflow = "false"\r
- ConfigurationOverrideFile = ""\r
- DefineConstants = "TRACE"\r
- DocumentationFile = ""\r
- DebugSymbols = "false"\r
- FileAlignment = "4096"\r
- IncrementalBuild = "false"\r
- NoStdLib = "false"\r
- NoWarn = ""\r
- Optimize = "true"\r
- OutputPath = "bin\Release\"\r
- RegisterForComInterop = "false"\r
- RemoveIntegerChecks = "false"\r
- TreatWarningsAsErrors = "false"\r
- WarningLevel = "4"\r
- />\r
- </Settings>\r
- <References>\r
- <Reference\r
- Name = "System"\r
- AssemblyName = "System"\r
- HintPath = "..\..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"\r
- />\r
- <Reference\r
- Name = "System.Drawing"\r
- AssemblyName = "System.Drawing"\r
- HintPath = "..\..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"\r
- />\r
- <Reference\r
- Name = "System.Data"\r
- AssemblyName = "System.Data"\r
- HintPath = "..\..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"\r
- />\r
- <Reference\r
- Name = "System.XML"\r
- AssemblyName = "System.Xml"\r
- HintPath = "..\..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"\r
- />\r
- <Reference\r
- Name = "DrawingTestHelper"\r
- Project = "{8EF9FC71-4D70-4F89-BF4D-B83EF37D4A0C}"\r
- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"\r
- />\r
- <Reference\r
- Name = "nunit.core.dll.J2EE"\r
- Project = "{7C52A6A5-71ED-4468-9564-2FF5CD6E6E6C}"\r
- Package = "{83B010C7-76FC-4FAD-A26C-00D7EFE60256}"\r
- />\r
- <Reference\r
- Name = "nunit.framework.dll.J2EE"\r
- Project = "{39CC8FF7-EF1A-41A1-B727-42684211ECD1}"\r
- Package = "{83B010C7-76FC-4FAD-A26C-00D7EFE60256}"\r
- />\r
- <Reference\r
- Name = "nunit.util.dll.J2EE"\r
- Project = "{36BE0465-4DE4-44CE-AF8D-6E50D0C40BC6}"\r
- Package = "{83B010C7-76FC-4FAD-A26C-00D7EFE60256}"\r
- />\r
- </References>\r
- </Build>\r
- <Files>\r
- <Include>\r
- <File\r
- RelPath = "DrawingTest\Test\AssemblyInfo.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\Bitmap.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\Bitmap1.png"\r
- BuildAction = "EmbeddedResource"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\Brush.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\Graphics.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\GraphicsPath.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\GraphicsPathIterator.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\Image.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\Pen.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\Region.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "DrawingTest\Test\SampIcon.ico"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\ColorConverter.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\ColorTranslator.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestBitmap.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestBrushes.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestColor.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestFont.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestIcon.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestIconConverter.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestImageConverter.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestImageFormatConverter.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestPens.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestPoint.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestPointConverter.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestPointF.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestRectangle.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestRectangleConverter.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestRectangleF.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestRegion.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestSize.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestSizeConverter.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestSizeF.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestStringFormat.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestSystemBrushes.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\TestSystemPens.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\almogaver1bit.bmp"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\almogaver24bits.bmp"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\almogaver24bits1.bmp"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\almogaver32bits.bmp"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\almogaver8bits.bmp"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\almogaver-os2.bmp"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\maketransparent.bmp"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\nature24bits.gif"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\nature24bits.jpg"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\smiley.ico"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\VisualPng.ico"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\VisualPng1.ico"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\empty-file"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\entries"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\format"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\README.txt"\r
- BuildAction = "Content"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\almogaver1bit.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\almogaver24bits.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\almogaver24bits1.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\almogaver32bits.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\almogaver8bits.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\almogaver-os2.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\maketransparent.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\nature24bits.gif.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\nature24bits.jpg.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\smiley.ico.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\VisualPng.ico.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\prop-base\VisualPng1.ico.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\almogaver1bit.bmp.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\almogaver24bits.bmp.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\almogaver24bits1.bmp.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\almogaver32bits.bmp.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\almogaver8bits.bmp.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\almogaver-os2.bmp.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\maketransparent.bmp.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\nature24bits.gif.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\nature24bits.jpg.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\smiley.ico.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\VisualPng.ico.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\props\VisualPng1.ico.svn-work"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\almogaver1bit.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\almogaver24bits.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\almogaver24bits1.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\almogaver32bits.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\almogaver8bits.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\almogaver-os2.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\maketransparent.bmp.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\nature24bits.gif.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\nature24bits.jpg.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\smiley.ico.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\VisualPng.ico.svn-base"\r
- BuildAction = "None"\r
- />\r
- <File\r
- RelPath = "System.Drawing\bitmaps\.svn\text-base\VisualPng1.ico.svn-base"\r
- BuildAction = "None"\r
- />\r
- <Folder RelPath = "System.Drawing\bitmaps\.svn\tmp\prop-base\" />\r
- <Folder RelPath = "System.Drawing\bitmaps\.svn\tmp\props\" />\r
- <Folder RelPath = "System.Drawing\bitmaps\.svn\tmp\text-base\" />\r
- <Folder RelPath = "System.Drawing\bitmaps\.svn\tmp\wcprops\" />\r
- <Folder RelPath = "System.Drawing\bitmaps\.svn\wcprops\" />\r
- <File\r
- RelPath = "System.Drawing.Drawing2D\TestBlend.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing.Drawing2D\TestColorBlend.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing.Drawing2D\TestHatchBrush.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing.Imaging\TestBmpCodec.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing.Imaging\TestColorMatrix.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing.Imaging\TestImageAttributes.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing.Imaging\TestImageCodecInfo.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- <File\r
- RelPath = "System.Drawing.Imaging\TestJpegCodec.cs"\r
- SubType = "Code"\r
- BuildAction = "Compile"\r
- />\r
- </Include>\r
- </Files>\r
- </CSHARP>\r
-</VisualStudioProject>\r
-\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>DrawingTest\Test\bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>DrawingTest\Test\bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{FD3F01E4-4F19-4124-BD9C-226C3E8D55B3}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Drawing.Test</RootNamespace>\r
- <AssemblyName>System.Drawing.Test20.J2EE</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <OldToolsVersion>2.0</OldToolsVersion>\r
- <jarserver>ip2</jarserver>\r
- <PublishUrl>publish\</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Disk</InstallFrom>\r
- <UpdateEnabled>false</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>false</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral">\r
- <HintPath>..\..\lib\J2SE.Helpers.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
- </Reference>\r
- <Reference Include="rt">\r
- <HintPath>..\..\lib\rt.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Runtime.Serialization.Formatters.Soap, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="DrawingTest\Test\Bitmap.cs" />\r
- <Compile Include="DrawingTest\Test\Brush.cs" />\r
- <Compile Include="DrawingTest\Test\Graphics.cs" />\r
- <Compile Include="DrawingTest\Test\GraphicsPath.cs" />\r
- <Compile Include="DrawingTest\Test\GraphicsPathIterator.cs" />\r
- <Compile Include="DrawingTest\Test\Image.cs" />\r
- <Compile Include="DrawingTest\Test\Pen.cs" />\r
- <Compile Include="DrawingTest\Test\Region.cs" />\r
- <Compile Include="System.Drawing.Drawing2D\TestBlend.cs" />\r
- <Compile Include="System.Drawing.Drawing2D\TestColorBlend.cs" />\r
- <Compile Include="System.Drawing.Drawing2D\TestHatchBrush.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestBmpCodec.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestColorMatrix.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestImageAttributes.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestImageCodecInfo.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestJpegCodec.cs" />\r
- <Compile Include="System.Drawing\ColorConverter.cs" />\r
- <Compile Include="System.Drawing\ColorTranslator.cs" />\r
- <Compile Include="System.Drawing\TestBitmap.cs" />\r
- <Compile Include="System.Drawing\TestBrushes.cs" />\r
- <Compile Include="System.Drawing\TestColor.cs" />\r
- <Compile Include="System.Drawing\TestFont.cs" />\r
- <Compile Include="System.Drawing\TestIcon.cs" />\r
- <Compile Include="System.Drawing\TestIconConverter.cs" />\r
- <Compile Include="System.Drawing\TestImageConverter.cs" />\r
- <Compile Include="System.Drawing\TestImageFormatConverter.cs" />\r
- <Compile Include="System.Drawing\TestPens.cs" />\r
- <Compile Include="System.Drawing\TestPoint.cs" />\r
- <Compile Include="System.Drawing\TestPointConverter.cs" />\r
- <Compile Include="System.Drawing\TestPointF.cs" />\r
- <Compile Include="System.Drawing\TestRectangle.cs" />\r
- <Compile Include="System.Drawing\TestRectangleConverter.cs" />\r
- <Compile Include="System.Drawing\TestRectangleF.cs" />\r
- <Compile Include="System.Drawing\TestRegion.cs" />\r
- <Compile Include="System.Drawing\TestSize.cs" />\r
- <Compile Include="System.Drawing\TestSizeConverter.cs" />\r
- <Compile Include="System.Drawing\TestSizeF.cs" />\r
- <Compile Include="System.Drawing\TestSizeFConverter.cs" />\r
- <Compile Include="System.Drawing\TestStringFormat.cs" />\r
- <Compile Include="System.Drawing\TestSystemBrushes.cs" />\r
- <Compile Include="System.Drawing\TestSystemPens.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="DrawingTest\Test\Bitmap1.bmp" />\r
- <Content Include="DrawingTest\Test\Bitmap1.png" />\r
- <Content Include="DrawingTest\Test\SampIcon.ico" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="DrawingTest\DrawingTestHelper\DrawingTestHelper20.J2EE.csproj">\r
- <Project>{C4329BA9-2E08-4EB3-B6ED-0FA3BB6285AF}</Project>\r
- <Name>DrawingTestHelper20.J2EE</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-system-runtime-serialization-formatters-soap="repository:vmw:framework:2.0" REFS-JarPath-system-runtime-serialization-formatters-soap="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-RefInfo-nunit-framework="j2il:" REFS-JarPath-system-drawing="" REFS-JarPath-j2se-helpers="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\J2SE.Helpers.jar" REFS-JarPath-rt="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\jre5\lib\rt.jar" REFS-JarPath-system-xml="" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Data.jar" REFS-JarPath-system="" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\mscorlib.jar" REFS-JarPath-nunit-framework="..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{0E95EEE1-AE3C-41E9-8A9C-0F0A05A594BE}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Drawing.Test</RootNamespace>\r
- <AssemblyName>System.Drawing.Test</AssemblyName>\r
- <StartupObject>\r
- </StartupObject>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>DrawingTest\Test\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_2_0;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>DrawingTest\Test\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="nunit.framework">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
- </Reference>\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Drawing" />\r
- <Reference Include="System.Xml" />\r
- <Reference Include="System.Runtime.Serialization.Formatters.Soap" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="DrawingTest\Test\AssemblyInfo.cs" />\r
- <Compile Include="DrawingTest\Test\Bitmap.cs" />\r
- <Compile Include="DrawingTest\Test\Brush.cs" />\r
- <Compile Include="DrawingTest\Test\Graphics.cs" />\r
- <Compile Include="DrawingTest\Test\GraphicsPath.cs" />\r
- <Compile Include="DrawingTest\Test\GraphicsPathIterator.cs" />\r
- <Compile Include="DrawingTest\Test\Image.cs" />\r
- <Compile Include="DrawingTest\Test\Pen.cs" />\r
- <Compile Include="DrawingTest\Test\Region.cs" />\r
- <Compile Include="System.Drawing.Drawing2D\TestBlend.cs" />\r
- <Compile Include="System.Drawing.Drawing2D\TestColorBlend.cs" />\r
- <Compile Include="System.Drawing.Drawing2D\TestHatchBrush.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestBmpCodec.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestColorMatrix.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestImageAttributes.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestImageCodecInfo.cs" />\r
- <Compile Include="System.Drawing.Imaging\TestJpegCodec.cs" />\r
- <Compile Include="System.Drawing\ColorConverter.cs" />\r
- <Compile Include="System.Drawing\ColorTranslator.cs" />\r
- <Compile Include="System.Drawing\TestBitmap.cs" />\r
- <Compile Include="System.Drawing\TestBrushes.cs" />\r
- <Compile Include="System.Drawing\TestColor.cs" />\r
- <Compile Include="System.Drawing\TestFont.cs" />\r
- <Compile Include="System.Drawing\TestIcon.cs" />\r
- <Compile Include="System.Drawing\TestIconConverter.cs" />\r
- <Compile Include="System.Drawing\TestImageConverter.cs" />\r
- <Compile Include="System.Drawing\TestImageFormatConverter.cs" />\r
- <Compile Include="System.Drawing\TestPens.cs" />\r
- <Compile Include="System.Drawing\TestPoint.cs" />\r
- <Compile Include="System.Drawing\TestPointConverter.cs" />\r
- <Compile Include="System.Drawing\TestPointF.cs" />\r
- <Compile Include="System.Drawing\TestRectangle.cs" />\r
- <Compile Include="System.Drawing\TestRectangleConverter.cs" />\r
- <Compile Include="System.Drawing\TestRectangleF.cs" />\r
- <Compile Include="System.Drawing\TestRegion.cs" />\r
- <Compile Include="System.Drawing\TestSize.cs" />\r
- <Compile Include="System.Drawing\TestSizeConverter.cs" />\r
- <Compile Include="System.Drawing\TestSizeF.cs" />\r
- <Compile Include="System.Drawing\TestStringFormat.cs" />\r
- <Compile Include="System.Drawing\TestSystemBrushes.cs" />\r
- <Compile Include="System.Drawing\TestSystemPens.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="DrawingTest\Test\Bitmap1.png" />\r
- <Content Include="DrawingTest\Test\SampIcon.ico" />\r
- <Content Include="System.Drawing\bitmaps\1bit.png" />\r
- <Content Include="System.Drawing\bitmaps\4bit.png" />\r
- <Content Include="System.Drawing\bitmaps\almogaver-os2.bmp" />\r
- <Content Include="System.Drawing\bitmaps\almogaver1bit.bmp" />\r
- <Content Include="System.Drawing\bitmaps\almogaver24bits.bmp" />\r
- <Content Include="System.Drawing\bitmaps\almogaver24bits1.bmp" />\r
- <Content Include="System.Drawing\bitmaps\almogaver32bits.bmp" />\r
- <Content Include="System.Drawing\bitmaps\almogaver8bits.bmp" />\r
- <Content Include="System.Drawing\bitmaps\maketransparent.bmp" />\r
- <Content Include="System.Drawing\bitmaps\nature24bits.gif" />\r
- <Content Include="System.Drawing\bitmaps\nature24bits.jpg" />\r
- <Content Include="System.Drawing\bitmaps\smiley.ico" />\r
- <Content Include="System.Drawing\bitmaps\VisualPng.ico" />\r
- <Content Include="System.Drawing\bitmaps\VisualPng1.ico" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="DrawingTest\DrawingTestHelper\DrawingTestHelper20.csproj">\r
- <Project>{0E97F734-51B9-497B-9259-B6999FD87BDF}</Project>\r
- <Name>DrawingTestHelper20</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>\r
+++ /dev/null
-##files existing in both profiles
-System.Drawing.Drawing2D/AdjustableArrowCap.cs
-System.Drawing.Drawing2D/CustomLineCap.cs
-System.Drawing.Drawing2D/GraphicsContainer.cs
-System.Drawing.Drawing2D/GraphicsPath.cs
-System.Drawing.Drawing2D/GraphicsPathIterator.cs
-System.Drawing.Drawing2D/GraphicsState.cs
-System.Drawing.Drawing2D/HatchBrush.cs
-System.Drawing.Drawing2D/LinearGradientBrush.cs
-System.Drawing.Drawing2D/Matrix.cs
-System.Drawing.Drawing2D/PathGradientBrush.cs
-System.Drawing.Imaging/EncoderParameter.cs
-System.Drawing.Imaging/ImageAttributes.cs
-System.Drawing.Imaging/ImageCodecInfo.cs
-System.Drawing.Imaging/Metafile.cs
-System.Drawing.Text/FontCollection.cs
-System.Drawing.Text/InstalledFontCollection.cs
-System.Drawing.Text/PrivateFontCollection.cs
-System.Drawing/Bitmap.cs
-System.Drawing/Brush.cs
-System.Drawing/Font.cs
-System.Drawing/FontFamily.cs
-System.Drawing/Graphics.cs
-System.Drawing/Icon.cs
-System.Drawing/Image.cs
-System.Drawing/Pen.cs
-System.Drawing/Region.cs
-System.Drawing/SolidBrush.cs
-System.Drawing/StringFormat.cs
-System.Drawing/SystemColors.cs
-System.Drawing/SystemIcons.cs
-System.Drawing/TextureBrush.cs
-
-##completely different files
-System.Drawing.Design/CategoryNameCollection.cs
-System.Drawing.Design/IPropertyValueUIService.cs
-System.Drawing.Design/IToolboxService.cs
-System.Drawing.Design/IToolboxUser.cs
-System.Drawing.Design/PaintValueEventArgs.cs
-System.Drawing.Design/PropertyValueItem.cs
-System.Drawing.Design/PropertyValueUIHandler.cs
-System.Drawing.Design/PropertyValueUIItemInvokeHandler.cs
-System.Drawing.Design/ToolboxItemCollection.cs
-System.Drawing.Design/ToolboxItemCreatorCallback.cs
-System.Drawing.Imaging/PlayRecordCallback.cs
-System.Drawing.Printing/Duplex.cs
-System.Drawing.Printing/InvalidPrinterException.cs
-System.Drawing.Printing/Margins.cs
-System.Drawing.Printing/MarginsConverter.cs
-System.Drawing.Printing/PageSettings.cs
-System.Drawing.Printing/PaperKind.cs
-System.Drawing.Printing/PaperSize.cs
-System.Drawing.Printing/PaperSource.cs
-System.Drawing.Printing/PaperSourceKind.cs
-System.Drawing.Printing/PreviewPageInfo.cs
-System.Drawing.Printing/PreviewPrintController.cs
-System.Drawing.Printing/PrintController.cs
-System.Drawing.Printing/PrintDocument.cs
-System.Drawing.Printing/PrintEventArgs.cs
-System.Drawing.Printing/PrintEventHandler.cs
-System.Drawing.Printing/PrintPageEventArgs.cs
-System.Drawing.Printing/PrintPageEventHandler.cs
-System.Drawing.Printing/PrintRange.cs
-System.Drawing.Printing/PrinterResolution.cs
-System.Drawing.Printing/PrinterResolutionKind.cs
-System.Drawing.Printing/PrinterSettings.cs
-System.Drawing.Printing/PrinterUnit.cs
-System.Drawing.Printing/PrinterUnitConvert.cs
-System.Drawing.Printing/PrintingPermission.cs
-System.Drawing.Printing/PrintingPermissionAttribute.cs
-System.Drawing.Printing/PrintingPermissionLevel.cs
-System.Drawing.Printing/QueryPageSettingsEventArgs.cs
-System.Drawing.Printing/QueryPageSettingsEventHandler.cs
-System.Drawing.Printing/StandardPrintController.cs
-System.Drawing/ComIStreamMarshaler.cs
-System.Drawing/ComIStreamWrapper.cs
-System.Drawing/SRDescriptionAttribute.cs
-System.Drawing/gdipEnums.cs
-System.Drawing/gdipFunctions.cs
-System.Drawing/gdipStructs.cs
-System.Drawing/carbonFunctions.cs
-
+++ /dev/null
-#include System.Drawing.dll.sources
-
-##files existing in both profiles
-System.Drawing.Drawing2D/AdjustableArrowCap.jvm.cs
-System.Drawing.Drawing2D/CustomLineCap.jvm.cs
-System.Drawing.Drawing2D/GraphicsContainer.jvm.cs
-System.Drawing.Drawing2D/GraphicsPath.jvm.cs
-System.Drawing.Drawing2D/GraphicsPathIterator.jvm.cs
-System.Drawing.Drawing2D/GraphicsState.jvm.cs
-System.Drawing.Drawing2D/HatchBrush.jvm.cs
-System.Drawing.Drawing2D/LinearGradientBrush.jvm.cs
-System.Drawing.Drawing2D/Matrix.jvm.cs
-System.Drawing.Drawing2D/PathGradientBrush.jvm.cs
-System.Drawing.Imaging/EncoderParameter.jvm.cs
-System.Drawing.Imaging/ImageAttributes.jvm.cs
-System.Drawing.Imaging/ImageCodecInfo.jvm.cs
-System.Drawing.Imaging/Metafile.jvm.cs
-System.Drawing.Text/FontCollection.jvm.cs
-System.Drawing.Text/InstalledFontCollection.jvm.cs
-System.Drawing.Text/PrivateFontCollection.jvm.cs
-System.Drawing/Bitmap.jvm.cs
-System.Drawing/Brush.jvm.cs
-System.Drawing/Font.jvm.cs
-System.Drawing/FontFamily.jvm.cs
-System.Drawing/Graphics.jvm.cs
-System.Drawing/Icon.jvm.cs
-System.Drawing/Image.jvm.cs
-System.Drawing/Pen.jvm.cs
-System.Drawing/Region.jvm.cs
-System.Drawing/SolidBrush.jvm.cs
-System.Drawing/StringFormat.jvm.cs
-System.Drawing/SystemColors.jvm.cs
-System.Drawing/SystemIcons.jvm.cs
-System.Drawing/TextureBrush.jvm.cs
-
-##completely different files
-System.Drawing.Drawing2D/ExtendedGeneralPath.jvm.cs
-System.Drawing.Drawing2D/GeneralPathIterator.jvm.cs
-System.Drawing.Imaging/ImageCodec.jvm.cs
-Mainsoft.Drawing.Configuration.jvm/ResolutionConfiguration.cs
-Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationCollection.cs
-Mainsoft.Drawing.Configuration.jvm/ResolutionConfigurationHandler.cs
-System.Drawing.Text/LineLayout.jvm.cs
-System.Drawing.Text/TextLineIterator.jvm.cs
-System.Drawing/AdvancedStroke.jvm.cs
-System.Drawing/BasicShape.jvm.cs
-System.Drawing/PlainImage.jvm.cs
-System.Drawing/PlainImageCollection.jvm.cs
-System.Drawing/StrokeFactory.jvm.cs
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <NoWarn>168,162</NoWarn>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="System"/>
- <Reference Include="System.Transactions"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
LIBRARY = System.IO.Compression.FileSystem.dll
LIB_MCS_FLAGS = /r:System /r:System.IO.Compression.dll
-
-NO_TEST = yes
+TEST_MCS_FLAGS = /r:System /r:System.Core /r:System.IO.Compression.dll
include ../../build/library.make
--- /dev/null
+System.IO.Compression.FileSystem/ZipTest.cs
--- /dev/null
+//
+// ZipTest.cs
+//
+// Author:
+// João Matos <joao.matos@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Security.Cryptography;
+using NUnit.Framework;
+
+namespace MonoTests.System.IO.Compression.FileSystem
+{
+ [TestFixture]
+ public class ZipArchiveTests
+ {
+ [TearDown]
+ public void Dispose()
+ {
+ File.Delete ("foo.zip");
+ }
+
+ [Test]
+ public void ZipCreateFromDirectory()
+ {
+ if (File.Exists ("foo.zip"))
+ File.Delete ("foo.zip");
+
+ ZipFile.CreateFromDirectory ("foo", "foo.zip");
+ Assert.IsTrue(File.Exists("foo.zip"));
+
+ using (var archive = new ZipArchive (File.Open ("foo.zip", FileMode.Open),
+ ZipArchiveMode.Read))
+ {
+ Assert.IsNotNull (archive.GetEntry ("foo.txt"));
+ Assert.IsNotNull (archive.GetEntry ("bar.txt"));
+
+ Assert.IsNotNull (archive.GetEntry ("foobar/foo.txt"));
+ Assert.IsNotNull (archive.GetEntry ("foobar/bar.txt"));
+ }
+ }
+
+ [Test]
+ public void ZipCreateFromDirectoryIncludeBase()
+ {
+ if (File.Exists ("foo.zip"))
+ File.Delete ("foo.zip");
+
+ ZipFile.CreateFromDirectory ("foo", "foo.zip", CompressionLevel.Fastest,
+ includeBaseDirectory: true);
+ Assert.IsTrue (File.Exists ("foo.zip"));
+
+ using (var archive = new ZipArchive (File.Open ("foo.zip", FileMode.Open),
+ ZipArchiveMode.Read))
+ {
+ Assert.IsNotNull (archive.GetEntry ("foo/foo.txt"));
+ Assert.IsNotNull (archive.GetEntry ("foo/bar.txt"));
+
+ Assert.IsNotNull (archive.GetEntry ("foo/foobar/foo.txt"));
+ Assert.IsNotNull (archive.GetEntry ("foo/foobar/bar.txt"));
+ }
+ }
+
+ [Test]
+ public void ZipExtractToDirectory()
+ {
+ if (Directory.Exists ("extract"))
+ Directory.Delete ("extract", true);
+
+ if (File.Exists ("foo.zip"))
+ File.Delete ("foo.zip");
+
+ ZipFile.CreateFromDirectory ("foo", "foo.zip");
+
+ ZipFile.ExtractToDirectory ("foo.zip", "extract");
+ Assert.IsTrue(Directory.Exists ("extract"));
+
+ Assert.IsTrue (File.Exists ("extract/foo.txt"));
+ Assert.IsTrue (File.Exists ("extract/bar.txt"));
+ Assert.IsTrue (Directory.Exists ("extract/foobar"));
+ Assert.IsTrue (File.Exists ("extract/foobar/foo.txt"));
+ Assert.IsTrue (File.Exists ("extract/foobar/bar.txt"));
+
+ Directory.Delete ("extract", true);
+ }
+ }
+}
// ZipFile.cs
//
// Author:
+// João Matos <joao.matos@xamarin.com>
// Martin Baulig <martin.baulig@xamarin.com>
//
// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
namespace System.IO.Compression
{
- [MonoTODO]
public static class ZipFile
{
public static void CreateFromDirectory (
string sourceDirectoryName, string destinationArchiveFileName)
{
- throw new NotImplementedException ();
+ CreateFromDirectory (sourceDirectoryName, destinationArchiveFileName,
+ CompressionLevel.Fastest, includeBaseDirectory: false);
}
public static void CreateFromDirectory (
string sourceDirectoryName, string destinationArchiveFileName,
CompressionLevel compressionLevel, bool includeBaseDirectory)
{
- throw new NotImplementedException ();
+ CreateFromDirectory (sourceDirectoryName, destinationArchiveFileName,
+ CompressionLevel.Fastest, includeBaseDirectory, Encoding.UTF8);
}
public static void CreateFromDirectory (
bool includeBaseDirectory,
Encoding entryNameEncoding)
{
- throw new NotImplementedException ();
+ if (sourceDirectoryName == null)
+ throw new ArgumentNullException ("sourceDirectoryName");
+
+ if (destinationArchiveFileName == null)
+ throw new ArgumentNullException ("destinationArchiveFileName");
+
+ if (string.IsNullOrWhiteSpace (sourceDirectoryName))
+ throw new ArgumentException ("sourceDirectoryName");
+
+ if (string.IsNullOrWhiteSpace (destinationArchiveFileName))
+ throw new ArgumentException ("destinationArchiveFileName");
+
+ if (entryNameEncoding == Encoding.Unicode ||
+ entryNameEncoding == Encoding.UTF32 ||
+ entryNameEncoding == Encoding.UTF7)
+ throw new ArgumentException ("entryNameEncoding");
+
+ if (entryNameEncoding == null)
+ entryNameEncoding = Encoding.UTF8;
+
+ if (!Directory.Exists (sourceDirectoryName))
+ throw new DirectoryNotFoundException ("sourceDirectoryName is invalid or does not exist");
+
+ var sourceDir = new DirectoryInfo (Path.GetFullPath (sourceDirectoryName));
+
+ string fullBaseName = sourceDir.FullName;
+ if (includeBaseDirectory && sourceDir.Parent != null)
+ fullBaseName = sourceDir.Parent.FullName;
+
+ bool hasEntries = false;
+ char[] separators = new char[] {
+ Path.DirectorySeparatorChar,
+ Path.AltDirectorySeparatorChar
+ };
+
+ using (var zipFile = ZipFile.Open (destinationArchiveFileName, ZipArchiveMode.Create,
+ entryNameEncoding)) {
+ var entries = sourceDir.EnumerateFileSystemInfos ("*", SearchOption.AllDirectories);
+ foreach (var entry in entries) {
+ hasEntries = true;
+
+ int length = entry.FullName.Length - fullBaseName.Length;
+ string entryName = entry.FullName.Substring(fullBaseName.Length, length);
+
+ entryName = entryName.TrimStart(separators);
+
+ if (entry is FileInfo)
+ zipFile.CreateEntryFromFile (entry.FullName, entryName, compressionLevel);
+ else
+ zipFile.CreateEntry (entryName + Path.DirectorySeparatorChar);
+ }
+
+ // Create the base directory even if we had no entries
+ if (includeBaseDirectory && !hasEntries)
+ zipFile.CreateEntry(sourceDir.Name + Path.DirectorySeparatorChar);
+ }
}
public static void ExtractToDirectory (
string sourceArchiveFileName, string destinationDirectoryName)
{
- throw new NotImplementedException ();
+ ExtractToDirectory (sourceArchiveFileName, destinationDirectoryName,
+ Encoding.UTF8);
}
public static void ExtractToDirectory (
string sourceArchiveFileName, string destinationDirectoryName,
Encoding entryNameEncoding)
{
- throw new NotImplementedException ();
+ if (sourceArchiveFileName == null)
+ throw new ArgumentNullException ("sourceArchiveFileName");
+
+ using (ZipArchive zipArchive = ZipFile.Open(sourceArchiveFileName,
+ ZipArchiveMode.Read, entryNameEncoding))
+ {
+ zipArchive.ExtractToDirectory(destinationDirectoryName);
+ }
}
public static ZipArchive Open (
string archiveFileName, ZipArchiveMode mode)
{
- throw new NotImplementedException ();
+ return Open (archiveFileName, mode);
}
public static ZipArchive Open (
string archiveFileName, ZipArchiveMode mode,
Encoding entryNameEncoding)
{
- throw new NotImplementedException ();
+ if (archiveFileName == null)
+ throw new ArgumentNullException ("archiveFileName");
+
+ if (string.IsNullOrWhiteSpace (archiveFileName))
+ throw new ArgumentException ("archiveFileName");
+
+ FileStream stream;
+
+ switch (mode) {
+ case ZipArchiveMode.Read:
+ if (!File.Exists (archiveFileName))
+ throw new FileNotFoundException ();
+ stream = new FileStream (archiveFileName, FileMode.Open, FileAccess.Read,
+ FileShare.Read);
+ break;
+ case ZipArchiveMode.Create:
+ if (File.Exists (archiveFileName))
+ throw new IOException ("mode is set to Create but the file already exists");
+ stream = new FileStream (archiveFileName, FileMode.CreateNew, FileAccess.Write);
+ break;
+ case ZipArchiveMode.Update:
+ stream = new FileStream (archiveFileName, FileMode.OpenOrCreate,
+ FileAccess.ReadWrite);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
+
+ return new ZipArchive (stream, mode, false, entryNameEncoding);
}
public static ZipArchive OpenRead (string archiveFileName)
{
- throw new NotImplementedException ();
+ return ZipFile.Open (archiveFileName, ZipArchiveMode.Read);
}
}
}
// ZipFileExtensions.cs
//
// Author:
+// João Matos <joao.matos@xamarin.com>
// Martin Baulig <martin.baulig@xamarin.com>
//
// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
namespace System.IO.Compression
{
- [MonoTODO]
public static class ZipFileExtensions
{
public static ZipArchiveEntry CreateEntryFromFile (
this ZipArchive destination, string sourceFileName,
string entryName)
{
- throw new NotImplementedException ();
+ return CreateEntryFromFile (destination, sourceFileName, entryName,
+ CompressionLevel.Fastest);
}
public static ZipArchiveEntry CreateEntryFromFile (
this ZipArchive destination, string sourceFileName,
- string entryName, CompressionLevel compressionLevel
- )
+ string entryName, CompressionLevel compressionLevel)
{
- throw new NotImplementedException ();
+ if (destination == null)
+ throw new ArgumentNullException ("destination");
+
+ if (sourceFileName == null)
+ throw new ArgumentNullException ("sourceFileName");
+
+ if (entryName == null)
+ throw new ArgumentNullException ("entryName");
+
+ ZipArchiveEntry entry;
+ using (Stream stream = File.Open (sourceFileName, FileMode.Open,
+ FileAccess.Read, FileShare.Read))
+ {
+ var zipArchiveEntry = destination.CreateEntry (entryName, compressionLevel);
+
+ using (Stream entryStream = zipArchiveEntry.Open ())
+ stream.CopyTo (entryStream);
+
+ entry = zipArchiveEntry;
+ }
+
+ return entry;
}
public static void ExtractToDirectory (
this ZipArchive source,
string destinationDirectoryName)
{
- throw new NotImplementedException ();
+ if (source == null)
+ throw new ArgumentNullException ("source");
+
+ if (destinationDirectoryName == null)
+ throw new ArgumentNullException ("destinationDirectoryName");
+
+ var destDirInfo = Directory.CreateDirectory (destinationDirectoryName);
+ string fullName = destDirInfo.FullName;
+
+ foreach (var zipEntry in source.Entries)
+ {
+ var fullPath = Path.GetFullPath (Path.Combine (fullName, zipEntry.FullName));
+
+ var isFileName = Path.GetFileName (fullPath).Length != 0;
+ var dirPath = isFileName ? Path.GetDirectoryName (fullPath) : fullPath;
+ Directory.CreateDirectory (dirPath);
+
+ if (isFileName)
+ zipEntry.ExtractToFile (fullPath, false);
+ }
}
public static void ExtractToFile (
this ZipArchiveEntry source,
string destinationFileName)
{
- throw new NotImplementedException ();
+ ExtractToFile (source, destinationFileName, overwrite: false);
}
public static void ExtractToFile (
this ZipArchiveEntry source, string destinationFileName,
bool overwrite)
{
- throw new NotImplementedException ();
+ if (source == null)
+ throw new ArgumentNullException ("source");
+
+ if (destinationFileName == null)
+ throw new ArgumentNullException ("destinationFileName");
+
+ var mode = overwrite ? FileMode.Create : FileMode.CreateNew;
+ using (var stream = File.Open (destinationFileName, mode, FileAccess.Write))
+ {
+ using (var stream2 = source.Open ())
+ stream2.CopyTo(stream);
+ }
+
+ File.SetLastWriteTime(destinationFileName, source.LastWriteTime.DateTime);
}
}
}
if (pos >= 0)
filename = filename.Remove(0, pos + 1);
- return filename.Trim('/');
+ return filename;
}
private int WriteHeader(string filename, DateTime? modificationTime)
using (var archive = new ZipArchive(File.Open("create.zip", FileMode.Create),
ZipArchiveMode.Create))
{
+ var dir = archive.CreateEntry("foobar/");
+
var entry = archive.CreateEntry("foo.txt");
using (var stream = entry.Open())
{
using (var archive = new ZipArchive(File.Open("create.zip", FileMode.Open),
ZipArchiveMode.Read))
{
+ Assert.IsNotNull(archive.GetEntry("foobar/"));
+
var entry = archive.GetEntry("foo.txt");
Assert.IsNotNull(entry);
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{F46BBFCE-C0DD-41EC-BD53-B1F4F312DE1A}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.IdentityModel.Selectors</RootNamespace>\r
- <AssemblyName>System.IdentityModel.Selectors</AssemblyName>\r
- <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_2_0,TARGET_DOTNET</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE;NET_2_0,TARGET_DOTNET</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.IdentityModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="System.IdentityModel.Selectors\CardSpaceException.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\CardSpacePolicyElement.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\CardSpaceSelector.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\IdentityValidationException.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\PolicyValidationException.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\ServiceBusyException.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\ServiceNotStartedException.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\StsCommunicationException.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\UnsupportedPolicyOptionsException.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\UntrustedRecipientException.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\UserCancellationException.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Consts.cs.in</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PostBuildEvent>@rem "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i "$(TargetPath)" /f\r
-@rem "C:\Program Files\Mono-1.2.6\bin\gacutil.bat" -i "$(TargetPath)"</PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>
\ No newline at end of file
<Compile Include="..\..\build\common\Consts.cs" />\r
<Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
<Compile Include="Assembly\AssemblyInfo.cs" />\r
+ <Compile Include="System.IdentityModel\CookieTransform.cs" />\r
+ <Compile Include="System.IdentityModel\OpenObject.cs" />\r
<Compile Include="System.IdentityModel.Claims\Claim.cs" />\r
<Compile Include="System.IdentityModel.Claims\ClaimSet.cs" />\r
<Compile Include="System.IdentityModel.Claims\ClaimTypes.cs" />\r
<Compile Include="System.IdentityModel.Claims\DefaultClaimSet.cs" />\r
<Compile Include="System.IdentityModel.Claims\Rights.cs" />\r
<Compile Include="System.IdentityModel.Claims\WindowsClaimSet.cs" />\r
+ <Compile Include="System.IdentityModel.Configuration\ICustomIdentityConfiguration.cs" />\r
+ <Compile Include="System.IdentityModel.Configuration\IdentityModelCaches.cs" />\r
<Compile Include="System.IdentityModel.Claims\X509CertificateClaimSet.cs" />\r
<Compile Include="System.IdentityModel.Policy\AuthorizationContext.cs" />\r
<Compile Include="System.IdentityModel.Policy\EvaluationContext.cs" />\r
<Compile Include="System.IdentityModel.Policy\IAuthorizationComponent.cs" />\r
<Compile Include="System.IdentityModel.Policy\IAuthorizationPolicy.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\BinaryExchange.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\EndpointReference.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\Entropy.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\Lifetime.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\ProtectedKey.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\RequestSecurityTokenResponse.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\RequestedProofToken.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\RequestedSecurityTOken.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\Status.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\UseKey.cs" />\r
+ <Compile Include="System.IdentityModel.Protocols\WSTrust\WSTrustMessage.cs" />\r
<Compile Include="System.IdentityModel.Selectors\AudienceUriMode.cs" />\r
<Compile Include="System.IdentityModel.Selectors\CustomUserNameSecurityTokenAuthenticator.cs" />\r
<Compile Include="System.IdentityModel.Selectors\KerberosSecurityTokenAuthenticator.cs" />\r
<Compile Include="System.IdentityModel.Selectors\X509SecurityTokenAuthenticator.cs" />\r
<Compile Include="System.IdentityModel.Selectors\X509SecurityTokenProvider.cs" />\r
<Compile Include="System.IdentityModel.Tokens\AsymmetricSecurityKey.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\AudienceRestriction.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\AuthenticationContext.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\AuthenticationInformation.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\AuthenticationContext.cs" />\r
<Compile Include="System.IdentityModel.Tokens\BinaryKeyIdentifierClause.cs" />\r
<Compile Include="System.IdentityModel.Tokens\EncryptedKeyIdentifierClause.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\EncryptingCredentials.cs" />\r
<Compile Include="System.IdentityModel.Tokens\GenericXmlSecurityToken.cs" />\r
<Compile Include="System.IdentityModel.Tokens\InMemorySymmetricSecurityKey.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\IssuerNameRegistry.cs" />\r
<Compile Include="System.IdentityModel.Tokens\KerberosReceiverSecurityToken.cs" />\r
<Compile Include="System.IdentityModel.Tokens\KerberosRequestorSecurityToken.cs" />\r
<Compile Include="System.IdentityModel.Tokens\LocalIdKeyIdentifierClause.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\ProofDescriptor.cs" />\r
<Compile Include="System.IdentityModel.Tokens\RsaKeyIdentifierClause.cs" />\r
<Compile Include="System.IdentityModel.Tokens\RsaSecurityKey.cs" />\r
<Compile Include="System.IdentityModel.Tokens\RsaSecurityToken.cs" />\r
<Compile Include="System.IdentityModel.Tokens\SecurityKeyType.cs" />\r
<Compile Include="System.IdentityModel.Tokens\SecurityKeyUsage.cs" />\r
<Compile Include="System.IdentityModel.Tokens\SecurityToken.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\SecurityTokenDescriptor.cs" />\r
<Compile Include="System.IdentityModel.Tokens\SecurityTokenException.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\SecurityTokenHandler.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\SecurityTokenHandlerCollection.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\SecurityTokenHandlerConfiguration.cs" />\r
<Compile Include="System.IdentityModel.Tokens\SecurityTokenTypes.cs" />\r
<Compile Include="System.IdentityModel.Tokens\SecurityTokenValidationException.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\SessionSecurityToken.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\SessionSecurityTokenCache.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\SessionSecurityTokenCacheKey.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\SessionSecurityTokenHandler.cs" />\r
<Compile Include="System.IdentityModel.Tokens\SigningCredentials.cs" />\r
<Compile Include="System.IdentityModel.Tokens\SymmetricSecurityKey.cs" />\r
<Compile Include="System.IdentityModel.Tokens\TlsHMAC.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\TokenReplayCache.cs" />\r
<Compile Include="System.IdentityModel.Tokens\UserNameSecurityToken.cs" />\r
<Compile Include="System.IdentityModel.Tokens\WindowsSecurityToken.cs" />\r
<Compile Include="System.IdentityModel.Tokens\X509AsymmetricSecurityKey.cs" />\r
<Compile Include="System.IdentityModel.Tokens\X509IssuerSerialKeyIdentifierClause.cs" />\r
<Compile Include="System.IdentityModel.Tokens\X509RawDataKeyIdentifierClause.cs" />\r
<Compile Include="System.IdentityModel.Tokens\X509SecurityToken.cs" />\r
+ <Compile Include="System.IdentityModel.Tokens\X509SigningCredentials.cs" />\r
<Compile Include="System.IdentityModel.Tokens\X509SubjectKeyIdentifierClause.cs" />\r
<Compile Include="System.IdentityModel.Tokens\X509ThumbprintKeyIdentifierClause.cs" />\r
<Compile Include="System.IdentityModel.Tokens\X509WindowsSecurityToken.cs" />\r
- <Compile Include="System.Security.Claims\AuthenticationTypes.cs" />\r </ItemGroup>\r
+ <Compile Include="System.Security.Claims\AuthenticationTypes.cs" />\r <Compile Include="System.ServiceModel.Security\X509CertificateValidationMode.cs" />\r
+ </ItemGroup>\r
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
Other similar extension points exist, see Microsoft.Common.targets.\r
<Target Name="BeforeBuild">\r
--- /dev/null
+//
+// ICustomIdentityConfiguration.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Xml;
+
+namespace System.IdentityModel.Configuration
+{
+ public interface ICustomIdentityConfiguration
+ {
+ void LoadCustomConfiguration(XmlNodeList nodeList);
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// IdentityModelCaches.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Configuration
+{
+ public sealed class IdentityModelCaches
+ {
+ public SessionSecurityTokenCache SessionSecurityTokenCache { get; set; }
+ public TokenReplayCache TokenReplayCache { get; set; }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// BinaryExchange.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class BinaryExchange
+ {
+ private const string defaultEncodingTypeUrl = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary";
+
+ public byte[] BinaryData { get; private set; }
+ public Uri EncodingType { get; private set; }
+ public Uri ValueType { get; private set; }
+
+ public BinaryExchange (byte[] binaryData, Uri valueType)
+ : this (binaryData, valueType, new Uri (defaultEncodingTypeUrl))
+ { }
+
+ public BinaryExchange (byte[] binaryData, Uri valueType, Uri encodingType) {
+ BinaryData = binaryData;
+ ValueType = valueType;
+ EncodingType = encodingType;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// EndpointReference.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.ObjectModel;
+using System.Xml;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class EndpointReference
+ {
+ private Collection<XmlElement> details = new Collection<XmlElement> ();
+ private Uri uri = null;
+
+ public Collection<XmlElement> Details { get { return details; } }
+ public Uri Uri { get { return uri; } }
+
+ public EndpointReference (string uri) {
+ this.uri = new Uri (uri);
+ }
+
+ [MonoTODO]
+ public static EndpointReference ReadFrom (XmlDictionaryReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static EndpointReference ReadFrom(Xml.XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void WriteTo (XmlWriter writer) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// Entropy.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Tokens;
+using System.Security.Cryptography;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class Entropy : ProtectedKey
+ {
+ public Entropy (ProtectedKey protectedKey) : base (protectedKey.GetKeyBytes (), protectedKey.WrappingCredentials)
+ { }
+
+ public Entropy (byte[] secret) : base (secret)
+ { }
+
+ public Entropy (int entropySizeInBits)
+ : this(Entropy.GetRandomByteArray(entropySizeInBits / 8))
+ { }
+
+ public Entropy (byte[] secret, EncryptingCredentials wrappingCredentials) : base (secret, wrappingCredentials)
+ { }
+
+ private static byte[] GetRandomByteArray (int arraySize) {
+ byte[] b = new byte[arraySize];
+
+ RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
+ rng.GetNonZeroBytes(b);
+
+ return b;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// Lifetime.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class Lifetime
+ {
+ public DateTime? Created { get; set; }
+ public DateTime? Expires { get; set; }
+
+ public Lifetime (DateTime created, DateTime expires)
+ : this ((DateTime?)created, (DateTime?)expires)
+ { }
+
+ public Lifetime (DateTime? created, DateTime? expires) {
+ if (created.HasValue) { Created = created.Value.ToUniversalTime (); }
+ if (expires.HasValue) { Expires = expires.Value.ToUniversalTime (); }
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// ProtectedKey.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class ProtectedKey
+ {
+ private byte[] secret;
+
+ public EncryptingCredentials WrappingCredentials { get; private set; }
+
+ public ProtectedKey (byte[] secret) {
+ this.secret = secret;
+ }
+
+ public ProtectedKey (byte[] secret, EncryptingCredentials wrappingCredentials) {
+ this.secret = secret;
+ WrappingCredentials = wrappingCredentials;
+ }
+
+ public byte[] GetKeyBytes () {
+ return secret;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// RequestSecurityTokenResponse.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class RequestSecurityTokenResponse : WSTrustMessage
+ {
+ public bool IsFinal { get; set; }
+ public SecurityKeyIdentifierClause RequestedAttachedReference { get; set; }
+ public RequestedProofToken RequestedProofToken { get; set; }
+ public RequestedSecurityToken RequestedSecurityToken { get; set; }
+ public bool RequestedTokenCancelled { get; set; }
+ public SecurityKeyIdentifierClause RequestedUnattachedReference { get; set; }
+ public Status Status { get; set; }
+
+ public RequestSecurityTokenResponse ()
+ { }
+
+ public RequestSecurityTokenResponse (WSTrustMessage message) {
+ Context = message.Context;
+ KeyType = message.KeyType;
+ KeySizeInBits = message.KeySizeInBits;
+ RequestType = message.RequestType;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// RequestedProofToken.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class RequestedProofToken
+ {
+ public string ComputedKeyAlgorithm { get; private set; }
+ public ProtectedKey ProtectedKey { get; private set; }
+
+ public RequestedProofToken (ProtectedKey protectedKey) {
+ ProtectedKey = protectedKey;
+ }
+
+ public RequestedProofToken (Byte[] secret) {
+ ProtectedKey = new ProtectedKey (secret);
+ }
+
+ public RequestedProofToken (string computedKeyAlgorithm) {
+ ComputedKeyAlgorithm = computedKeyAlgorithm;
+ }
+
+ public RequestedProofToken (Byte[] secret, EncryptingCredentials wrappingCredentials) {
+ ProtectedKey = new ProtectedKey (secret, wrappingCredentials);
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// RequestedSecurityToken.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Tokens;
+using System.Xml;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class RequestedSecurityToken
+ {
+ public SecurityToken SecurityToken { get; private set; }
+ public virtual XmlElement SecurityTokenXml { get; private set; }
+
+ public RequestedSecurityToken (SecurityToken token) {
+ SecurityToken = token;
+ }
+
+ public RequestedSecurityToken (XmlElement tokenAsXml) {
+ SecurityTokenXml = tokenAsXml;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// Status.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class Status
+ {
+ public string Code { get; set; }
+ public string Reason { get; set; }
+
+ public Status (string code, string reason) {
+ Code = code;
+ Reason = reason;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// UseKey.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Tokens;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public class UseKey
+ {
+ public SecurityKeyIdentifier SecurityKeyIdentifier { get; private set; }
+ public SecurityToken Token { get; private set; }
+
+ public UseKey () : this (null, null)
+ { }
+
+ public UseKey (SecurityKeyIdentifier ski)
+ : this (ski, null)
+ { }
+
+ public UseKey (SecurityToken token)
+ : this (null, token)
+ { }
+
+ public UseKey (SecurityKeyIdentifier ski, SecurityToken token) {
+ SecurityKeyIdentifier = ski;
+ Token = token;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// WSTrustMessage.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel;
+
+namespace System.IdentityModel.Protocols.WSTrust
+{
+ public abstract class WSTrustMessage : OpenObject
+ {
+ public bool AllowPostdating { get; set; }
+ public EndpointReference AppliesTo { get; set; }
+ public string AuthenticationType { get; set; }
+ public BinaryExchange BinaryExchange { get; set; }
+ public string CanonicalizationAlgorithm { get; set; }
+ public string Context { get; set; }
+ public string EncryptionAlgorithm { get; set; }
+ public string EncryptWith { get; set; }
+ public Entropy Entropy { get; set; }
+ public int? KeySizeInBits { get; set; }
+ public string KeyType { get; set; }
+ public string KeyWrapAlgorithm { get; set; }
+ public Lifetime Lifetime { get; set; }
+ public string ReplyTo { get; set; }
+ public string RequestType { get; set; }
+ public string SignatureAlgorithm { get; set; }
+ public string SignWith { get; set; }
+ public string TokenType { get; set; }
+ public UseKey UseKey { get; set; }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// AudienceRestriction.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+
+namespace System.IdentityModel.Tokens
+{
+ public class AudienceRestriction
+ {
+ public Collection<Uri> AllowedAudienceUris { get; private set; }
+ public AudienceUriMode AudienceMode { get; set; }
+
+ public AudienceRestriction () {
+ AllowedAudienceUris = new Collection<Uri>();
+ }
+
+ public AudienceRestriction (AudienceUriMode audienceMode)
+ : this ()
+ {
+ AudienceMode = audienceMode;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// AuthenticationContext.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.ObjectModel;
+
+namespace System.IdentityModel.Tokens
+{
+ public class AuthenticationContext
+ {
+ public Collection<string> Authorities { get; private set; }
+ public string ContextClass { get; set; }
+ public string ContextDeclaration { get; set; }
+
+ public AuthenticationContext () {
+ Authorities = new Collection<string> ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// AuthenticationInformation.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.ObjectModel;
+using System.IdentityModel.Tokens;
+
+namespace System.Security.Claims
+{
+ public class AuthenticationInformation
+ {
+ private Collection<AuthenticationContext> authorizationContexts = new Collection<AuthenticationContext> ();
+
+ public String Address { get; set; }
+ public Collection<AuthenticationContext> AuthorizationContexts { get { return authorizationContexts; } }
+ public String DnsName { get; set; }
+ public Nullable<DateTime> NotOnOrAfter { get; set; }
+ public String Session { get; set; }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// EncryptingCredentials.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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;
+
+namespace System.IdentityModel.Tokens
+{
+ public class EncryptingCredentials
+ {
+ public string Algorithm { get; set; }
+ public SecurityKey SecurityKey { get; set; }
+ public SecurityKeyIdentifier SecurityKeyIdentifier { get; set; }
+
+ public EncryptingCredentials ()
+ { }
+
+ public EncryptingCredentials (SecurityKey key, SecurityKeyIdentifier keyIdentifier, string algorithm) {
+ SecurityKey = key;
+ SecurityKeyIdentifier = keyIdentifier;
+ Algorithm = algorithm;
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// IssuerNameRegistry.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Configuration;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class IssuerNameRegistry : ICustomIdentityConfiguration
+ {
+ public abstract string GetIssuerName (SecurityToken securityToken);
+
+ [MonoTODO]
+ public virtual string GetIssuerName (SecurityToken securityToken, System.String requestedIssuerName) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual string GetWindowsIssuerName() {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual void LoadCustomConfiguration(XmlNodeList nodelist) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// ProofDescriptor.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Protocols.WSTrust;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class ProofDescriptor
+ {
+ public abstract SecurityKeyIdentifier KeyIdentifier { get; }
+
+ public abstract void ApplyTo (RequestSecurityTokenResponse response);
+ }
+}
+#endif
\ No newline at end of file
return nonce != null ? (byte []) nonce.Clone () : null;
}
+ public string Id { get; set; }
+
public virtual SecurityKey CreateKey ()
{
throw new NotSupportedException (String.Format ("This '{0}' identifier clause does not support key creation.", GetType ()));
--- /dev/null
+//
+// SecurityTokenDescriptor.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using System.IdentityModel.Protocols.WSTrust;
+using System.Security.Claims;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SecurityTokenDescriptor
+ {
+ private Dictionary<string, Object> properties = new Dictionary<string, object> ();
+
+ public string AppliesToAddress { get; set; }
+ public SecurityKeyIdentifierClause AttachedReference { get; set; }
+ public AuthenticationInformation AuthenticationInfo { get; set; }
+ public EncryptingCredentials EncryptingCredentials { get; set; }
+ public Lifetime Lifetime { get; set; }
+ public ProofDescriptor Proof { get; set; }
+ public Dictionary<string, Object> Properties { get { return properties; } }
+ public string ReplyToAddress { get; set; }
+ public SigningCredentials SigningCredentials { get; set; }
+ public ClaimsIdentity Subject { get; set; }
+ public SecurityToken Token { get; set; }
+ public string TokenIssuerName { get; set; }
+ public string TokenType { get; set; }
+ public SecurityKeyIdentifierClause UnattachedReference { get; set; }
+
+ [MonoTODO]
+ public void AddAuthenticationClaims (string authType) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void AddAuthenticationClaims (string authType, DateTime time) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual void ApplyTo (RequestSecurityTokenResponse response) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// SecurityTokenHandler.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.ObjectModel;
+using System.IdentityModel.Configuration;
+using System.IdentityModel.Selectors;
+using System.Security.Claims;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class SecurityTokenHandler : ICustomIdentityConfiguration
+ {
+ public virtual bool CanValidateToken { get { return false; } }
+ public virtual bool CanWriteToken { get { return false; } }
+ public SecurityTokenHandlerConfiguration Configuration { get; set; }
+ public SecurityTokenHandlerCollection ContainingCollection { get; internal set; }
+ public abstract Type TokenType { get; }
+
+ public virtual bool CanReadKeyIdentifierClause (XmlReader reader) {
+ return false;
+ }
+
+ public virtual bool CanReadToken (string tokenString) {
+ return false;
+ }
+
+ public virtual bool CanReadToken (XmlReader reader) {
+ return false;
+ }
+
+ public virtual bool CanWriteKeyIdentifierClause (SecurityKeyIdentifierClause securityKeyIdentifierClause) {
+ return false;
+ }
+
+ public virtual SecurityKeyIdentifierClause CreateSecurityTokenReference (SecurityToken token, bool attached) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual SecurityToken CreateToken (SecurityTokenDescriptor tokenDescriptor) {
+ throw new NotImplementedException ();
+ }
+
+ protected virtual void DetectReplayedToken (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ public abstract string[] GetTokenTypeIdentifiers ();
+
+ public virtual void LoadCustomConfiguration (XmlNodeList nodelist) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual SecurityKeyIdentifierClause ReadKeyIdentifierClause (XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+
+ public virtual SecurityToken ReadToken (string tokenString) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual SecurityToken ReadToken (XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual SecurityToken ReadToken (XmlReader reader, SecurityTokenResolver tokenResolver) {
+ return this.ReadToken (reader);
+ }
+
+ protected void TraceTokenValidationFailure (SecurityToken token, string errorMessage) {
+ throw new NotImplementedException ();
+ }
+
+ protected void TraceTokenValidationSuccess (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual ReadOnlyCollection<ClaimsIdentity> ValidateToken (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void WriteKeyIdentifierClause (XmlWriter writer, SecurityKeyIdentifierClause securityKeyIdentifierClause) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual string WriteToken (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void WriteToken (XmlWriter writer, SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// SecurityTokenHandlerCollection.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+using System.Security.Claims;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SecurityTokenHandlerCollection : Collection<SecurityTokenHandler>
+ {
+ private SecurityTokenHandlerConfiguration config;
+ private IEnumerable<string> tokenTypeIdentifiers = new List<string> ();
+ private IEnumerable<Type> tokenTypes = new List<Type> ();
+
+ public SecurityTokenHandlerConfiguration Configuration { get { return this.config; } }
+ public IEnumerable<string> TokenTypeIdentifiers { get { return tokenTypeIdentifiers; } }
+ public IEnumerable<Type> TokenTypes { get { return tokenTypes; } }
+ public SecurityTokenHandler this[SecurityToken token] {
+ get {
+ if (token == null) { return null; }
+
+ return this[token.GetType ()];
+ }
+ }
+ [MonoTODO]
+ public SecurityTokenHandler this[string tokenTypeIdentifier] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public SecurityTokenHandler this[Type tokenType] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public SecurityTokenHandlerCollection ()
+ : this(new SecurityTokenHandlerConfiguration ())
+ { }
+
+ public SecurityTokenHandlerCollection (SecurityTokenHandlerConfiguration configuration) {
+ config = configuration;
+ }
+
+ public SecurityTokenHandlerCollection (IEnumerable<SecurityTokenHandler> handlers)
+ : this (handlers, new SecurityTokenHandlerConfiguration ())
+ { }
+
+ public SecurityTokenHandlerCollection (IEnumerable<SecurityTokenHandler> handlers, SecurityTokenHandlerConfiguration configuration) : this (configuration) {
+ foreach (var handler in handlers) {
+ Add (handler);
+ }
+ }
+
+ [MonoTODO]
+ public void AddOrReplace(SecurityTokenHandler handler) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public bool CanReadKeyIdentifierClause(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual bool CanReadKeyIdentifierClauseCore(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public bool CanReadToken(string tokenString) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public bool CanReadToken(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public bool CanWriteToken(SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected override void ClearItems() {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static SecurityTokenHandlerCollection CreateDefaultSecurityTokenHandlerCollection() {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static SecurityTokenHandlerCollection CreateDefaultSecurityTokenHandlerCollection(SecurityTokenHandlerConfiguration configuration) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public SecurityToken CreateToken(SecurityTokenDescriptor tokenDescriptor) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected override void InsertItem(int index, SecurityTokenHandler item) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public SecurityKeyIdentifierClause ReadKeyIdentifierClause(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual SecurityKeyIdentifierClause ReadKeyIdentifierClauseCore(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public SecurityToken ReadToken(string tokenString) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public SecurityToken ReadToken(XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected override void RemoveItem(int index) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected override void SetItem(int index, SecurityTokenHandler item) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public ReadOnlyCollection<ClaimsIdentity> ValidateToken(SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void WriteKeyIdentifierClause(XmlWriter writer, SecurityKeyIdentifierClause keyIdentifierClause) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual void WriteKeyIdentifierClauseCore(XmlWriter writer, SecurityKeyIdentifierClause keyIdentifierClause) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public string WriteToken(SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void WriteToken(XmlWriter writer, SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// SecurityTokenHandlerConfiguration.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Configuration;
+using System.IdentityModel.Selectors;
+using System.Security.Cryptography.X509Certificates;
+using System.ServiceModel.Security;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SecurityTokenHandlerConfiguration
+ {
+ public static readonly X509CertificateValidationMode DefaultCertificateValidationMode;
+ public static readonly X509CertificateValidator DefaultCertificateValidator;
+ public static readonly bool DefaultDetectReplayedTokens;
+ public static readonly IssuerNameRegistry DefaultIssuerNameRegistry;
+ public static readonly SecurityTokenResolver DefaultIssuerTokenResolver;
+ public static readonly TimeSpan DefaultMaxClockSkew;
+ public static readonly X509RevocationMode DefaultRevocationMode;
+ public static readonly bool DefaultSaveBootstrapContext;
+ public static readonly TimeSpan DefaultTokenReplayCacheExpirationPeriod;
+ public static readonly StoreLocation DefaultTrustedStoreLocation;
+
+ public AudienceRestriction AudienceRestriction { get; set; }
+ public IdentityModelCaches Caches { get; set; }
+ public X509CertificateValidationMode CertificateValidationMode { get; set; }
+ public X509CertificateValidator CertificateValidator { get; set; }
+ public bool DetectReplayedTokens { get; set; }
+ public IssuerNameRegistry IssuerNameRegistry { get; set; }
+ public SecurityTokenResolver IssuerTokenResolver { get; set; }
+ public TimeSpan MaxClockSkew { get; set; }
+ public X509RevocationMode RevocationMode { get; set; }
+ public bool SaveBootstrapContext { get; set; }
+ public SecurityTokenResolver ServiceTokenResolver { get; set; }
+ public TimeSpan TokenReplayCacheExpirationPeriod { get; set; }
+ public StoreLocation TrustedStoreLocation { get; set; }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// SessionSecurityToken.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.ObjectModel;
+using System.Runtime.Serialization;
+using System.Security.Claims;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ [Serializable]
+ public class SessionSecurityToken : SecurityToken
+ {
+ private ReadOnlyCollection<SecurityKey> securityKeys;
+ private DateTime validFrom;
+ private DateTime validTo;
+
+ public ClaimsPrincipal ClaimsPrincipal { get; private set; }
+ public string Context { get; private set; }
+ public UniqueId ContextId { get; private set; }
+ public string EndpointId { get; private set; }
+ [MonoTODO]
+ public override string Id { get { throw new NotImplementedException (); } }
+ public bool IsPersistent { get; set; }
+ public bool IsReferenceMode { get; set; }
+ public DateTime KeyEffectiveTime { get; private set; }
+ public DateTime KeyExpirationTime { get; private set; }
+ public UniqueId KeyGeneration { get; private set; }
+ public Uri SecureConversationVersion { get; private set; }
+ public override ReadOnlyCollection<SecurityKey> SecurityKeys { get { return securityKeys; } }
+ public override DateTime ValidFrom { get { return validFrom; } }
+ public override DateTime ValidTo { get { return validTo; } }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal)
+ : this (claimsPrincipal, null)
+ { }
+
+ protected SessionSecurityToken (SerializationInfo info, StreamingContext context) {
+ throw new NotImplementedException ();
+ }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, string context)
+ : this (claimsPrincipal, context, DateTime.UtcNow, DateTime.UtcNow + SessionSecurityTokenHandler.DefaultTokenLifetime)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, TimeSpan lifetime)
+ : this (claimsPrincipal, null, DateTime.UtcNow, DateTime.UtcNow + lifetime)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, string context, DateTime? validFrom, DateTime? validTo)
+ : this (claimsPrincipal, new UniqueId (), context, String.Empty, validFrom, validTo, null)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, string context, string endpointId, DateTime? validFrom, DateTime? validTo)
+ : this(claimsPrincipal, new UniqueId (), context, endpointId, validFrom, validTo, null)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, UniqueId contextId, string context, string endpointId, TimeSpan lifetime, SymmetricSecurityKey key)
+ : this (claimsPrincipal, contextId, context, endpointId, DateTime.UtcNow, lifetime, key)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, UniqueId contextId, string context, string endpointId, DateTime validFrom, TimeSpan lifetime, SymmetricSecurityKey key)
+ : this (claimsPrincipal, contextId, context, endpointId, validFrom, validFrom + lifetime, key)
+ { }
+
+ public SessionSecurityToken (ClaimsPrincipal claimsPrincipal, UniqueId contextId, string context, string endpointId, DateTime? validFrom, DateTime? validTo, SymmetricSecurityKey key) {
+ ClaimsPrincipal = claimsPrincipal;
+ ContextId = contextId;
+ Context = context;
+ EndpointId = endpointId;
+ validFrom = (validFrom.HasValue) ? validFrom.Value.ToUniversalTime () : DateTime.UtcNow;
+ validTo = (validTo.HasValue) ? validTo.Value.ToUniversalTime () : ValidFrom + SessionSecurityTokenHandler.DefaultTokenLifetime;
+ securityKeys = new ReadOnlyCollection<SecurityKey> (new SecurityKey[] { new InMemorySymmetricSecurityKey ((key == null) ? null : key.GetSymmetricKey ()) });
+ }
+
+ [MonoTODO]
+ public virtual void GetObjectData (SerializationInfo info, StreamingContext context) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// SessionSecurityTokenCache.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.Generic;
+using System.IdentityModel.Configuration;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class SessionSecurityTokenCache : ICustomIdentityConfiguration
+ {
+ public abstract void AddOrUpdate (SessionSecurityTokenCacheKey key, SessionSecurityToken value, DateTime expiryTime);
+ public abstract SessionSecurityToken Get (SessionSecurityTokenCacheKey key);
+ public abstract IEnumerable<SessionSecurityToken> GetAll (string endpointId, UniqueId contextId);
+ [MonoTODO]
+ public virtual void LoadCustomConfiguration (XmlNodeList nodelist) {
+ throw new NotImplementedException ();
+ }
+ public abstract void Remove (SessionSecurityTokenCacheKey key);
+ public abstract void RemoveAll (string endpointId);
+ public abstract void RemoveAll (string endpointId, UniqueId contextId);
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// SessionSecurityTokenCacheKey.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SessionSecurityTokenCacheKey
+ {
+ [MonoTODO]
+ public static bool operator !=(SessionSecurityTokenCacheKey first, SessionSecurityTokenCacheKey second) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public static bool operator ==(SessionSecurityTokenCacheKey first, SessionSecurityTokenCacheKey second) {
+ throw new NotImplementedException ();
+ }
+
+ public UniqueId ContextId { get; private set; }
+ public string EndpointId { get; private set; }
+ public bool IgnoreKeyGeneration { get; set; }
+ public UniqueId KeyGeneration { get; private set; }
+
+ public SessionSecurityTokenCacheKey (string endpointId, UniqueId contextId, UniqueId keyGeneration) {
+ EndpointId = endpointId;
+ ContextId = contextId;
+ KeyGeneration = keyGeneration;
+ }
+
+ [MonoTODO]
+ public override bool Equals (System.Object obj) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override int GetHashCode () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override string ToString () {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// SessionSecurityTokenHandler.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IdentityModel.Selectors;
+using System.Security.Claims;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public class SessionSecurityTokenHandler : SecurityTokenHandler
+ {
+ public static readonly ReadOnlyCollection<CookieTransform> DefaultCookieTransforms;
+ public static readonly TimeSpan DefaultLifetime = TimeSpan.FromHours (10);
+
+ private bool canValidateToken;
+ private bool canWriteToken;
+ private string cookieElementName;
+ private string cookieNamespace;
+ private Type tokenType;
+
+ public override bool CanValidateToken { get { return canValidateToken; } }
+ public override bool CanWriteToken { get { return canWriteToken; } }
+ public virtual string CookieElementName { get { return cookieElementName; } }
+ public virtual string CookieNamespace { get { return cookieNamespace; } }
+ public static TimeSpan DefaultTokenLifetime { get { return SessionSecurityTokenHandler.DefaultLifetime; } }
+ public virtual TimeSpan TokenLifetime { get; set; }
+ public override Type TokenType { get { return tokenType; } }
+ public ReadOnlyCollection<CookieTransform> Transforms { get; private set; }
+
+ public SessionSecurityTokenHandler ()
+ : this (SessionSecurityTokenHandler.DefaultCookieTransforms)
+ { }
+
+ public SessionSecurityTokenHandler (ReadOnlyCollection<CookieTransform> transforms)
+ : this (transforms, SessionSecurityTokenHandler.DefaultLifetime)
+ { }
+
+ public SessionSecurityTokenHandler (ReadOnlyCollection<CookieTransform> transforms, TimeSpan tokenLifetime) {
+ Transforms = transforms;
+ TokenLifetime = tokenLifetime;
+ }
+
+ [MonoTODO]
+ protected virtual byte[] ApplyTransforms (byte[] cookie, bool outbound) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override bool CanReadToken (XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual SessionSecurityToken CreateSessionSecurityToken (ClaimsPrincipal principal, string context, string endpointId, DateTime validFrom, DateTime validTo) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override SecurityToken CreateToken (SecurityTokenDescriptor tokenDescriptor) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override string[] GetTokenTypeIdentifiers () {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override void LoadCustomConfiguration (XmlNodeList customConfigElements) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override SecurityToken ReadToken (XmlReader reader) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual SecurityToken ReadToken (byte[] token, SecurityTokenResolver tokenResolver) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override SecurityToken ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected void SetTransforms (IEnumerable<CookieTransform> transforms) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ protected virtual void ValidateSession (SessionSecurityToken securityToken) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override ReadOnlyCollection<ClaimsIdentity> ValidateToken (SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual ReadOnlyCollection<ClaimsIdentity> ValidateToken (SessionSecurityToken token, string endpointId) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual byte[] WriteToken (SessionSecurityToken sessionToken) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override void WriteToken (XmlWriter writer, SecurityToken token) {
+ throw new NotImplementedException ();
+ }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// TokenReplayCache.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.IdentityModel.Configuration;
+using System.Xml;
+
+namespace System.IdentityModel.Tokens
+{
+ public abstract class TokenReplayCache : ICustomIdentityConfiguration
+ {
+ public abstract void AddOrUpdate (string key, SecurityToken securityToken, DateTime expirationTime);
+
+ public abstract bool Contains (string key);
+
+ public abstract SecurityToken Get (string key);
+
+ [MonoTODO]
+ public virtual void LoadCustomConfiguration (XmlNodeList nodelist) {
+ throw new NotImplementedException ();
+ }
+
+ public abstract void Remove (string key);
+ }
+}
+#endif
\ No newline at end of file
switch (algorithm) {
//case SignedXml.XmlDsigDSAUrl: // it is documented as supported, but it isn't in reality and it wouldn't be possible.
case SignedXml.XmlDsigRSASHA1Url:
- return new HMACSHA1 ();
+ return new SHA1Managed ();
case SecurityAlgorithms.RsaSha256Signature:
- return new HMACSHA256 ();
+ return new SHA256Managed ();
default:
throw new NotSupportedException (String.Format ("'{0}' Hash algorithm is not supported in this security key.", algorithm));
}
}
- [MonoTODO]
public override AsymmetricSignatureDeformatter GetSignatureDeformatter (string algorithm)
{
- throw new NotImplementedException ();
+ switch (algorithm) {
+ //case SignedXml.XmlDsigDSAUrl:
+ // DSA dsa = (cert.PublicKey.Key as DSA);
+ // if (dsa == null) {
+ // throw new NotSupportedException (String.Format ("The certificate does not contain DSA public key while '{0}' requires it.", algorithm));
+ // }
+ // else {
+ // return new DSASignatureDeformatter(dsa);
+ // }
+ case SignedXml.XmlDsigRSASHA1Url:
+ case SecurityAlgorithms.RsaSha256Signature:
+ RSA rsa = (cert.PublicKey.Key as RSA);
+ if (rsa == null) {
+ throw new NotSupportedException (String.Format ("The certificate does not contain RSA public key while '{0}' requires it.", algorithm));
+ }
+ else {
+ return new RSAPKCS1SignatureDeformatter (rsa);
+ }
+ default:
+ throw new NotSupportedException (String.Format ("'{0}' Hash algorithm is not supported in this security key.", algorithm));
+ }
}
- [MonoTODO]
public override AsymmetricSignatureFormatter GetSignatureFormatter (string algorithm)
{
- throw new NotImplementedException ();
+ switch (algorithm) {
+ //case SignedXml.XmlDsigDSAUrl:
+ // DSA dsa = (cert.PrivateKey as DSA);
+ // if (dsa == null) {
+ // throw new NotSupportedException (String.Format ("The certificate does not contain DSA private key while '{0}' requires it.", algorithm));
+ // }
+ // else {
+ // return new DSASignatureFormatter(dsa);
+ // }
+ case SignedXml.XmlDsigRSASHA1Url:
+ case SecurityAlgorithms.RsaSha256Signature:
+ RSA rsa = (cert.PrivateKey as RSA);
+ if (rsa == null) {
+ throw new NotSupportedException (String.Format ("The certificate does not contain RSA private key while '{0}' requires it.", algorithm));
+ }
+ else {
+ return new RSAPKCS1SignatureFormatter (rsa);
+ }
+ default:
+ throw new NotSupportedException (String.Format ("'{0}' Hash algorithm is not supported in this security key.", algorithm));
+ }
}
public override bool HasPrivateKey ()
--- /dev/null
+//
+// X509SigningCredentials.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Security.Cryptography.X509Certificates;
+
+namespace System.IdentityModel.Tokens
+{
+ public class X509SigningCredentials : SigningCredentials
+ {
+ public X509Certificate2 Certificate { get; private set; }
+
+ public X509SigningCredentials (X509Certificate2 certificate)
+ : this (certificate, X509SigningCredentials.GetSecurityKeyIdentifier (certificate), SecurityAlgorithms.RsaSha256Signature, SecurityAlgorithms.Sha256Digest)
+ { }
+
+ public X509SigningCredentials (X509Certificate2 certificate, SecurityKeyIdentifier ski)
+ : this (certificate, ski, SecurityAlgorithms.RsaSha256Signature, SecurityAlgorithms.Sha256Digest)
+ { }
+
+ public X509SigningCredentials (X509Certificate2 certificate, string signatureAlgorithm, string digestAlgorithm)
+ : this (certificate, X509SigningCredentials.GetSecurityKeyIdentifier (certificate), signatureAlgorithm, digestAlgorithm)
+ { }
+
+ public X509SigningCredentials (X509Certificate2 certificate, SecurityKeyIdentifier ski, string signatureAlgorithm, string digestAlgorithm)
+ : base (new X509SecurityToken (certificate).SecurityKeys[0], signatureAlgorithm, digestAlgorithm, ski)
+ {
+ Certificate = certificate;
+ }
+
+ private static SecurityKeyIdentifier GetSecurityKeyIdentifier (X509Certificate2 certificate) {
+ return new SecurityKeyIdentifier (new X509SecurityToken (certificate).CreateKeyIdentifierClause<X509RawDataKeyIdentifierClause> ());
+ }
+ }
+}
+#endif
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{439D4BD2-AC46-4CE4-81DE-6AE171EC2D79}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.IdentityModel</RootNamespace>\r
- <AssemblyName>System.IdentityModel</AssemblyName>\r
- <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_2_0,TARGET_DOTNET</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE;NET_2_0,TARGET_DOTNET</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Runtime.Serialization">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Security" />\r
- <Reference Include="System.Web" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Consts.cs.in</Link>\r
- </Compile>\r
- <Compile Include="System.IdentityModel.Claims\Claim.cs" />\r
- <Compile Include="System.IdentityModel.Claims\ClaimSet.cs" />\r
- <Compile Include="System.IdentityModel.Claims\ClaimTypes.cs" />\r
- <Compile Include="System.IdentityModel.Claims\DefaultClaimSet.cs" />\r
- <Compile Include="System.IdentityModel.Claims\Rights.cs" />\r
- <Compile Include="System.IdentityModel.Claims\WindowsClaimSet.cs" />\r
- <Compile Include="System.IdentityModel.Claims\X509CertificateClaimSet.cs" />\r
- <Compile Include="System.IdentityModel.Policy\AuthorizationContext.cs" />\r
- <Compile Include="System.IdentityModel.Policy\EvaluationContext.cs" />\r
- <Compile Include="System.IdentityModel.Policy\IAuthorizationComponent.cs" />\r
- <Compile Include="System.IdentityModel.Policy\IAuthorizationPolicy.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\AudienceUriMode.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\CustomUserNameSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\KerberosSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\KerberosSecurityTokenProvider.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\RsaSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SamlSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SecurityTokenManager.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SecurityTokenProvider.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SecurityTokenRequirement.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SecurityTokenResolver.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SecurityTokenSerializer.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SecurityTokenVersion.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\SystemIdentityAuthorizationPolicy.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\UserNamePasswordValidator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\UserNameSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\UserNameSecurityTokenProvider.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\WindowsSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\WindowsUserNameSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\X509CertificateValidator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\X509SecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.IdentityModel.Selectors\X509SecurityTokenProvider.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\AsymmetricSecurityKey.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\BinaryKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\EncryptedKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\GenericXmlSecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\InMemorySymmetricSecurityKey.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\KerberosReceiverSecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\KerberosRequestorSecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\LocalIdKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\RsaKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\RsaSecurityKey.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\RsaSecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAccessDecision.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAction.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAdvice.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAssertion.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAssertionKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAttribute.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAttributeStatement.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAudienceRestrictionCondition.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAuthenticationClaimResource.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAuthenticationStatement.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAuthorityBinding.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAuthorizationDecisionClaimResource.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlAuthorizationDecisionStatement.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlCondition.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlConditions.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlConstants.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlDoNotCacheCondition.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlEvidence.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlNameIdentifierClaimResource.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlSecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlSerializer.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlStatement.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlSubject.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SamlSubjectStatement.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityAlgorithms.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityKey.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityKeyIdentifier.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityKeyType.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityKeyUsage.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityTokenException.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityTokenTypes.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SecurityTokenValidationException.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SigningCredentials.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\SymmetricSecurityKey.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\TlsHMAC.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\UserNameSecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\WindowsSecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\X509AsymmetricSecurityKey.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\X509IssuerSerialKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\X509RawDataKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\X509SecurityToken.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\X509SubjectKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\X509ThumbprintKeyIdentifierClause.cs" />\r
- <Compile Include="System.IdentityModel.Tokens\X509WindowsSecurityToken.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PostBuildEvent>\r
-@rem "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i "$(TargetPath)" /f\r
-@rem "C:\Program Files\Mono-1.2.6\bin\gacutil.bat" -i "$(TargetPath)"</PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>\r
../../build/common/Consts.cs
../../build/common/MonoTODOAttribute.cs
Assembly/AssemblyInfo.cs
+System.IdentityModel/CookieTransform.cs
+System.IdentityModel/OpenObject.cs
System.IdentityModel.Claims/Claim.cs
System.IdentityModel.Claims/ClaimSet.cs
System.IdentityModel.Claims/ClaimTypes.cs
System.IdentityModel.Claims/Rights.cs
System.IdentityModel.Claims/WindowsClaimSet.cs
System.IdentityModel.Claims/X509CertificateClaimSet.cs
+System.IdentityModel.Configuration/ICustomIdentityConfiguration.cs
+System.IdentityModel.Configuration/IdentityModelCaches.cs
System.IdentityModel.Policy/AuthorizationContext.cs
System.IdentityModel.Policy/EvaluationContext.cs
System.IdentityModel.Policy/IAuthorizationComponent.cs
System.IdentityModel.Policy/IAuthorizationPolicy.cs
+System.IdentityModel.Protocols/WSTrust/BinaryExchange.cs
+System.IdentityModel.Protocols/WSTrust/EndpointReference.cs
+System.IdentityModel.Protocols/WSTrust/Entropy.cs
+System.IdentityModel.Protocols/WSTrust/Lifetime.cs
+System.IdentityModel.Protocols/WSTrust/ProtectedKey.cs
+System.IdentityModel.Protocols/WSTrust/RequestSecurityTokenResponse.cs
+System.IdentityModel.Protocols/WSTrust/RequestedProofToken.cs
+System.IdentityModel.Protocols/WSTrust/RequestedSecurityToken.cs
+System.IdentityModel.Protocols/WSTrust/Status.cs
+System.IdentityModel.Protocols/WSTrust/UseKey.cs
+System.IdentityModel.Protocols/WSTrust/WSTrustMessage.cs
System.IdentityModel.Selectors/AudienceUriMode.cs
System.IdentityModel.Selectors/CustomUserNameSecurityTokenAuthenticator.cs
System.IdentityModel.Selectors/KerberosSecurityTokenAuthenticator.cs
System.IdentityModel.Selectors/X509SecurityTokenAuthenticator.cs
System.IdentityModel.Selectors/X509SecurityTokenProvider.cs
System.IdentityModel.Tokens/AsymmetricSecurityKey.cs
+System.IdentityModel.Tokens/AudienceRestriction.cs
+System.IdentityModel.Tokens/AuthenticationContext.cs
+System.IdentityModel.Tokens/AuthenticationInformation.cs
System.IdentityModel.Tokens/BinaryKeyIdentifierClause.cs
System.IdentityModel.Tokens/EncryptedKeyIdentifierClause.cs
+System.IdentityModel.Tokens/EncryptingCredentials.cs
System.IdentityModel.Tokens/GenericXmlSecurityToken.cs
System.IdentityModel.Tokens/InMemorySymmetricSecurityKey.cs
+System.IdentityModel.Tokens/IssuerNameRegistry.cs
System.IdentityModel.Tokens/KerberosReceiverSecurityToken.cs
System.IdentityModel.Tokens/KerberosRequestorSecurityToken.cs
System.IdentityModel.Tokens/LocalIdKeyIdentifierClause.cs
+System.IdentityModel.Tokens/ProofDescriptor.cs
System.IdentityModel.Tokens/RsaKeyIdentifierClause.cs
System.IdentityModel.Tokens/RsaSecurityKey.cs
System.IdentityModel.Tokens/RsaSecurityToken.cs
System.IdentityModel.Tokens/SecurityKeyType.cs
System.IdentityModel.Tokens/SecurityKeyUsage.cs
System.IdentityModel.Tokens/SecurityToken.cs
+System.IdentityModel.Tokens/SecurityTokenDescriptor.cs
System.IdentityModel.Tokens/SecurityTokenException.cs
+System.IdentityModel.Tokens/SecurityTokenHandler.cs
+System.IdentityModel.Tokens/SecurityTokenHandlerCollection.cs
+System.IdentityModel.Tokens/SecurityTokenHandlerConfiguration.cs
System.IdentityModel.Tokens/SecurityTokenTypes.cs
System.IdentityModel.Tokens/SecurityTokenValidationException.cs
+System.IdentityModel.Tokens/SessionSecurityToken.cs
+System.IdentityModel.Tokens/SessionSecurityTokenCache.cs
+System.IdentityModel.Tokens/SessionSecurityTokenCacheKey.cs
+System.IdentityModel.Tokens/SessionSecurityTokenHandler.cs
System.IdentityModel.Tokens/SigningCredentials.cs
System.IdentityModel.Tokens/SymmetricSecurityKey.cs
System.IdentityModel.Tokens/TlsHMAC.cs
+System.IdentityModel.Tokens/TokenReplayCache.cs
System.IdentityModel.Tokens/UserNameSecurityToken.cs
System.IdentityModel.Tokens/WindowsSecurityToken.cs
System.IdentityModel.Tokens/X509AsymmetricSecurityKey.cs
System.IdentityModel.Tokens/X509IssuerSerialKeyIdentifierClause.cs
System.IdentityModel.Tokens/X509RawDataKeyIdentifierClause.cs
System.IdentityModel.Tokens/X509SecurityToken.cs
+System.IdentityModel.Tokens/X509SigningCredentials.cs
System.IdentityModel.Tokens/X509SubjectKeyIdentifierClause.cs
System.IdentityModel.Tokens/X509ThumbprintKeyIdentifierClause.cs
System.IdentityModel.Tokens/X509WindowsSecurityToken.cs
-System.Security.Claims/AuthenticationTypes.cs
\ No newline at end of file
+System.Security.Claims/AuthenticationTypes.cs
+System.ServiceModel.Security/X509CertificateValidationMode.cs
\ No newline at end of file
--- /dev/null
+//
+// CookieTransform.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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;
+
+namespace System.IdentityModel
+{
+ public abstract class CookieTransform
+ {
+ public abstract byte[] Encode (byte[] value);
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// OpenObject.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.Collections.Generic;
+
+namespace System.IdentityModel
+{
+ public abstract class OpenObject
+ {
+ private Dictionary<string, object> properties = new Dictionary<string, object> ();
+
+ public Dictionary<string, object> Properties { get { return properties; } }
+ }
+}
+#endif
\ No newline at end of file
--- /dev/null
+//
+// X509CertificateValidationMode.cs
+//
+// Author:
+// Noesis Labs (Ryan.Melena@noesislabs.com)
+//
+// Copyright (C) 2014 Noesis Labs, LLC https://noesislabs.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.ServiceModel.Security
+{
+ public enum X509CertificateValidationMode
+ {
+ None,
+ PeerTrust,
+ ChainTrust,
+ PeerOrChainTrust,
+ Custom
+ }
+}
+#endif
EXTRA_DISTFILES = more_build_args
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid mobile mobile_static xammac net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Interactive.Async.dll
NO_SIGN_ASSEMBLY = yes
EXTRA_DISTFILES = more_build_args
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Interactive.Providers.dll
NO_SIGN_ASSEMBLY = yes
EXTRA_DISTFILES = more_build_args
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Interactive.dll
NO_SIGN_ASSEMBLY = yes
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.30703</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{1067A7EF-857F-4045-AB01-013CA131EA32}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>HtppLibrary</RootNamespace>\r
- <AssemblyName>HtppLibrary</AssemblyName>\r
- <FileAlignment>512</FileAlignment>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;NET_2_0;NET_4_0;NET_4_5;MOBILE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.Core" />\r
- <Reference Include="System.Xml.Linq" />\r
- <Reference Include="System.Data.DataSetExtensions" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
- <Compile Include="System.Net.Http.Headers\AuthenticationHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\CacheControlHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\CollectionExtensions.cs" />\r
- <Compile Include="System.Net.Http.Headers\ContentDispositionHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\ContentRangeHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\EntityTagHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\HashCodeCalculator.cs" />\r
- <Compile Include="System.Net.Http.Headers\HeaderInfo.cs" />\r
- <Compile Include="System.Net.Http.Headers\HttpContentHeaders.cs" />\r
- <Compile Include="System.Net.Http.Headers\HttpHeaderKind.cs" />\r
- <Compile Include="System.Net.Http.Headers\HttpHeaders.cs" />\r
- <Compile Include="System.Net.Http.Headers\HttpHeaderValueCollection.cs" />\r
- <Compile Include="System.Net.Http.Headers\HttpRequestHeaders.cs" />\r
- <Compile Include="System.Net.Http.Headers\HttpResponseHeaders.cs" />\r
- <Compile Include="System.Net.Http.Headers\Lexer.cs" />\r
- <Compile Include="System.Net.Http.Headers\MediaTypeHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\MediaTypeWithQualityHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\NameValueHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\NameValueWithParametersHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\Parser.cs" />\r
- <Compile Include="System.Net.Http.Headers\ProductHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\ProductInfoHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\QualityValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\RangeConditionHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\RangeHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\RangeItemHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\RetryConditionHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\StringWithQualityHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\TransferCodingHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\TransferCodingWithQualityHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\ViaHeaderValue.cs" />\r
- <Compile Include="System.Net.Http.Headers\WarningHeaderValue.cs" />\r
- <Compile Include="System.Net.Http\ByteArrayContent.cs" />\r
- <Compile Include="System.Net.Http\ClientCertificateOption.cs" />\r
- <Compile Include="System.Net.Http\DelegatingHandler.cs" />\r
- <Compile Include="System.Net.Http\FormUrlEncodedContent.cs" />\r
- <Compile Include="System.Net.Http\HttpClient.cs" />\r
- <Compile Include="System.Net.Http\HttpClientHandler.cs" />\r
- <Compile Include="System.Net.Http\HttpCompletionOption.cs" />\r
- <Compile Include="System.Net.Http\HttpContent.cs" />\r
- <Compile Include="System.Net.Http\HttpMessageHandler.cs" />\r
- <Compile Include="System.Net.Http\HttpMethod.cs" />\r
- <Compile Include="System.Net.Http\HttpRequestException.cs" />\r
- <Compile Include="System.Net.Http\HttpRequestMessage.cs" />\r
- <Compile Include="System.Net.Http\HttpResponseMessage.cs" />\r
- <Compile Include="System.Net.Http\MessageProcessingHandler.cs" />\r
- <Compile Include="System.Net.Http\MultipartContent.cs" />\r
- <Compile Include="System.Net.Http\StreamContent.cs" />\r
- <Compile Include="System.Net.Http\StringContent.cs" />\r
- <Compile Include="System.Net.Http\MultipartFormDataContent.cs" />\r
- </ItemGroup>\r
- <ItemGroup />\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>
\ No newline at end of file
public string Name {
get {
- return FindParameter ("name");
+ var value = FindParameter ("name");
+
+ if (value == null)
+ return null;
+
+ return DecodeValue (value, false);
}
set {
+ if (value != null)
+ value = EncodeBase64Value (value);
+
SetValue ("name", value);
}
}
static string EncodeBase64Value (string value)
{
+ bool quoted = value.Length > 1 && value [0] == '"' && value [value.Length - 1] == '"';
+ if (quoted)
+ value = value.Substring (1, value.Length - 2);
+
for (int i = 0; i < value.Length; ++i) {
var ch = value[i];
if (ch > 127) {
}
}
- if (!Lexer.IsValidToken (value))
+ if (quoted || !Lexer.IsValidToken (value))
return "\"" + value + "\"";
return value;
} else {
value.From = nvalue;
- t = lexer.Scan ();
+ t = lexer.Scan (recognizeDash: true);
if (t != Token.Type.SeparatorDash)
return false;
HeaderInfo.CreateSingle<AuthenticationHeaderValue> ("Authorization", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Request),
HeaderInfo.CreateSingle<CacheControlHeaderValue> ("Cache-Control", CacheControlHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response),
HeaderInfo.CreateMulti<string> ("Connection", CollectionParser.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response),
+ HeaderInfo.CreateSingle<ContentDispositionHeaderValue> ("Content-Disposition", ContentDispositionHeaderValue.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateMulti<string> ("Content-Encoding", CollectionParser.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateMulti<string> ("Content-Language", CollectionParser.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateSingle<long> ("Content-Length", Parser.Long.TryParse, HttpHeaderKind.Content),
return false;
}
- public Token Scan ()
+ public Token Scan (bool recognizeDash = false)
{
int start = pos;
if (s == null)
ttype = Token.Type.SeparatorSlash;
break;
case '-':
- ttype = Token.Type.SeparatorDash;
- break;
+ if (recognizeDash) {
+ ttype = Token.Type.SeparatorDash;
+ break;
+ }
+
+ goto default;
case ',':
ttype = Token.Type.SeparatorComma;
break;
int number;
token_read = false;
- t = lexer.Scan ();
+ t = lexer.Scan (recognizeDash: true);
switch (t.Kind) {
case Token.Type.SeparatorDash:
t = lexer.Scan ();
switch (values.Length) {
case 1:
- t = lexer.Scan ();
+ t = lexer.Scan (recognizeDash: true);
from = number;
switch (t.Kind) {
case Token.Type.SeparatorDash:
bool useProxy;
ClientCertificateOption certificate;
bool sentRequest;
- HttpWebRequest wrequest;
string connectionGroupName;
bool disposed;
protected override void Dispose (bool disposing)
{
- if (disposing) {
- if (wrequest != null) {
- wrequest.ServicePoint.CloseConnectionGroup (wrequest.ConnectionGroupName);
- Volatile.Write (ref wrequest, null);
- }
+ if (disposing && !disposed) {
Volatile.Write (ref disposed, true);
+ ServicePointManager.CloseConnectionGroup (connectionGroupName);
}
base.Dispose (disposing);
item_headers.TryAddWithoutValidation (key, value);
}
+ requestMessage.RequestUri = wr.ResponseUri;
+
return response;
}
throw new ObjectDisposedException (GetType ().ToString ());
Volatile.Write (ref sentRequest, true);
- wrequest = CreateWebRequest (request);
+ var wrequest = CreateWebRequest (request);
if (request.Content != null) {
var headers = wrequest.Headers;
[Test]
/*
- * This fails on Windows with the .NET runtime:
+ * .NET BUG
*
* Test Case Failures:
* 1) MonoTests.System.Net.Http.Headers.ContentDispositionHeaderValueTest.Equals : System.NullReferenceException : Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
* bei MonoTests.System.Net.Http.Headers.ContentDispositionHeaderValueTest.Equals()
*
*/
- [Category ("NotWorking")]
+ [Category ("NotDotNet")]
public void Equals ()
{
var value = new ContentDispositionHeaderValue ("x");
value.FileName = "(@)";
Assert.AreEqual ("\"(@)\"", value.FileName, "#21");
Assert.AreEqual (new NameValueHeaderValue ("filename", "\"(@)\""), value.Parameters.First (), "#22");
+
+ value.FileName = "\"č\"";
+ Assert.AreEqual ("č", value.FileName, "#31");
+ Assert.AreEqual (new NameValueHeaderValue ("filename", "\"=?utf-8?B?xI0=?=\""), value.Parameters.First (), "#32");
+
+ value.FileName = "\"quoted\"";
+ Assert.AreEqual ("\"quoted\"", value.FileName, "#41");
+ Assert.AreEqual (new NameValueHeaderValue ("filename", "\"quoted\""), value.Parameters.First (), "#42");
}
[Test]
Assert.AreEqual (new NameValueHeaderValue ("filename*", "utf-8''%C4%8D"), value.Parameters.First (), "#12");
}
+
+ [Test]
+ public void Properties_Name ()
+ {
+ var value = new ContentDispositionHeaderValue ("a");
+
+ value.Name = "aa";
+ Assert.AreEqual ("aa", value.Name, "#1");
+ Assert.AreEqual (new NameValueHeaderValue ("name", "aa"), value.Parameters.First (), "#2");
+
+ value.Name = "č";
+ Assert.AreEqual ("č", value.Name, "#11");
+ Assert.AreEqual (new NameValueHeaderValue ("name", "\"=?utf-8?B?xI0=?=\""), value.Parameters.First (), "#12");
+
+ value.Name = "(@)";
+ Assert.AreEqual ("\"(@)\"", value.Name, "#21");
+ Assert.AreEqual (new NameValueHeaderValue ("name", "\"(@)\""), value.Parameters.First (), "#22");
+
+ value.Name = "\"č\"";
+ Assert.AreEqual ("č", value.Name, "#31");
+ Assert.AreEqual (new NameValueHeaderValue ("name", "\"=?utf-8?B?xI0=?=\""), value.Parameters.First (), "#32");
+
+ value.Name = "\"quoted\"";
+ Assert.AreEqual ("\"quoted\"", value.Name, "#41");
+ Assert.AreEqual (new NameValueHeaderValue ("name", "\"quoted\""), value.Parameters.First (), "#42");
+ }
+
[Test]
public void Properties_ModificationDate ()
{
using System.Collections.Generic;
using NUnit.Framework;
using System.Net.Http.Headers;
+using System.Linq;
namespace MonoTests.System.Net.Http.Headers
{
Assert.AreEqual ("mu/m", res.MediaType, "#2");
Assert.AreEqual ("jj'", res.CharSet, "#2b");
Assert.AreEqual ("mu/m; CHarset=jj'", res.ToString (), "#2c");
+
+ res = MediaTypeHeaderValue.Parse ("multipart/form-data; boundary=----Wk");
+ Assert.AreEqual ("multipart/form-data", res.MediaType, "#3");
+ Assert.IsNull (res.CharSet, "#3b");
+ Assert.AreEqual (1, res.Parameters.Count, "#3c");
+ Assert.AreEqual (new NameValueHeaderValue ("boundary", "----Wk"), res.Parameters.First (), "#3d");
+ Assert.AreEqual ("multipart/form-data; boundary=----Wk", res.ToString (), "#3e");
}
[Test]
}
}
+ [Test]
+ public void RequestUriAfterRedirect ()
+ {
+ var listener = CreateListener (l => {
+ var request = l.Request;
+ var response = l.Response;
+
+ response.StatusCode = (int)HttpStatusCode.Moved;
+ response.RedirectLocation = "http://xamarin.com/";
+ });
+
+ try {
+ var chandler = new HttpClientHandler ();
+ chandler.AllowAutoRedirect = true;
+ var client = new HttpClient (chandler);
+
+ var resp = client.GetAsync (LocalServer).Result;
+ Assert.AreEqual ("http://xamarin.com/", resp.RequestMessage.RequestUri.AbsoluteUri, "#1");
+ } finally {
+ listener.Abort ();
+ listener.Close ();
+ }
+ }
+
[Test]
/*
* Properties may only be modified before sending the first request.
* The .NET runtime hits the "#9" assertion.
* The test succeeds with Mono.
*/
- [Category ("NotWorking")]
+ [Category ("NotDotNet")]
public void CopyToAsync ()
{
var ms = new MemoryStream ();
Assert.AreEqual (330, scm.Headers.ContentLength, "#2");
headers.Allow.Add ("a1");
+ headers.ContentDisposition = new ContentDispositionHeaderValue ("cd1");
headers.ContentEncoding.Add ("ce1");
headers.ContentLanguage.Add ("cl1");
headers.ContentLength = 23;
headers.Add ("allow", "a2");
+ try {
+ headers.Add ("content-disposition", "cd2");
+ Assert.Fail ("content-disposition");
+ } catch (FormatException) {
+ }
+
headers.Add ("content-encoding", "ce3");
headers.Add ("content-language", "cl2");
Assert.AreEqual (new MediaTypeHeaderValue ("multipart/*"), headers.ContentType);
Assert.AreEqual (new DateTimeOffset (DateTime.Today), headers.Expires);
Assert.AreEqual (new DateTimeOffset (DateTime.Today), headers.LastModified);
+ Assert.AreEqual (new ContentDispositionHeaderValue ("cd1"), headers.ContentDisposition);
}
[Test]
//
// System.Numerics.BigInteger
//
-// Rodrigo Kumpera (rkumpera@novell.com)
-
+// Authors:
+// Rodrigo Kumpera (rkumpera@novell.com)
+// Marek Safar <marek.safar@gmail.com>
//
// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2014 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
readonly uint[] data;
readonly short sign;
- static readonly uint[] ZERO = new uint [1];
static readonly uint[] ONE = new uint [1] { 1 };
BigInteger (short sign, uint[] data)
{
if (value == 0) {
sign = 0;
- data = ZERO;
+ data = null;
} else if (value > 0) {
sign = 1;
data = new uint[] { (uint) value };
{
if (value == 0) {
sign = 0;
- data = ZERO;
+ data = null;
} else {
sign = 1;
data = new uint [1] { value };
{
if (value == 0) {
sign = 0;
- data = ZERO;
+ data = null;
} else if (value > 0) {
sign = 1;
uint low = (uint)value;
{
if (value == 0) {
sign = 0;
- data = ZERO;
+ data = null;
} else {
sign = 1;
uint low = (uint)value;
int exponent = Exponent (bytes);
if (exponent == 0) {
sign = 0;
- data = ZERO;
+ data = null;
return;
}
if (size == 0) {
sign = 0;
- data = ZERO;
+ data = null;
return;
}
if (len == 0 || (len == 1 && value [0] == 0)) {
sign = 0;
- data = ZERO;
+ data = null;
return;
}
while (value [len - 1] == 0) {
if (--len == 0) {
sign = 0;
- data = ZERO;
+ data = null;
return;
}
}
}
public static BigInteger Zero {
- get { return new BigInteger (0, ZERO); }
+ get { return new BigInteger (0); }
}
public static explicit operator int (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return 0;
if (value.data.Length > 1)
throw new OverflowException ();
[CLSCompliantAttribute (false)]
public static explicit operator uint (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return 0;
if (value.data.Length > 1 || value.sign == -1)
throw new OverflowException ();
public static explicit operator long (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return 0;
if (value.data.Length > 2)
[CLSCompliantAttribute (false)]
public static explicit operator ulong (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return 0;
if (value.data.Length > 2 || value.sign == -1)
throw new OverflowException ();
public static explicit operator double (BigInteger value)
{
- switch (value.data.Length) {
- case 0:
+ if (value.data == null)
return 0.0;
+
+ switch (value.data.Length) {
case 1:
return BuildDouble (value.sign, value.data [0], 0);
case 2:
public static explicit operator decimal (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return Decimal.Zero;
uint[] data = value.data;
int r = CoreCompare (left.data, right.data);
if (r == 0)
- return new BigInteger (0, ZERO);
+ return Zero;
if (r > 0) //left > right
return new BigInteger (left.sign, CoreSub (left.data, right.data));
int r = CoreCompare (left.data, right.data);
if (r == 0)
- return new BigInteger (0, ZERO);
+ return Zero;
if (r > 0) //left > right
return new BigInteger (left.sign, CoreSub (left.data, right.data));
public static BigInteger operator* (BigInteger left, BigInteger right)
{
if (left.sign == 0 || right.sign == 0)
- return new BigInteger (0, ZERO);
+ return Zero;
if (left.data [0] == 1 && left.data.Length == 1) {
if (left.sign == 1)
int i;
for (i = quotient.Length - 1; i >= 0 && quotient [i] == 0; --i) ;
if (i == -1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (i < quotient.Length - 1)
quotient = Resize (quotient, i + 1);
int i;
for (i = remainder_value.Length - 1; i >= 0 && remainder_value [i] == 0; --i) ;
if (i == -1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (i < remainder_value.Length - 1)
remainder_value = Resize (remainder_value, i + 1);
public static BigInteger operator- (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return value;
return new BigInteger ((short)-value.sign, value.data);
}
public static BigInteger operator++ (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return One;
short sign = value.sign;
uint[] data = value.data;
if (data.Length == 1) {
if (sign == -1 && data [0] == 1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (sign == 0)
return new BigInteger (1, ONE);
}
public static BigInteger operator-- (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return MinusOne;
short sign = value.sign;
uint[] data = value.data;
if (data.Length == 1) {
if (sign == 1 && data [0] == 1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (sign == 0)
return new BigInteger (-1, ONE);
}
for (i = result.Length - 1; i >= 0 && result [i] == 0; --i) ;
if (i == -1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (i < result.Length - 1)
result = Resize (result, i + 1);
for (i = result.Length - 1; i >= 0 && result [i] == 0; --i) ;
if (i == -1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (i < result.Length - 1)
result = Resize (result, i + 1);
for (i = result.Length - 1; i >= 0 && result [i] == 0; --i) ;
if (i == -1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (i < result.Length - 1)
result = Resize (result, i + 1);
public static BigInteger operator~ (BigInteger value)
{
- if (value.sign == 0)
+ if (value.data == null)
return new BigInteger (-1, ONE);
uint[] data = value.data;
for (i = result.Length - 1; i >= 0 && result [i] == 0; --i) ;
if (i == -1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (i < result.Length - 1)
result = Resize (result, i + 1);
public static BigInteger operator<< (BigInteger value, int shift)
{
- if (shift == 0 || value.sign == 0)
+ if (shift == 0 || value.data == null)
return value;
if (shift < 0)
return value >> -shift;
if (size <= 0) {
if (sign == 1)
- return new BigInteger (0, ZERO);
+ return Zero;
return new BigInteger (-1, ONE);
}
int i;
for (i = remainder_value.Length - 1; i >= 0 && remainder_value [i] == 0; --i) ;
if (i == -1) {
- remainder = new BigInteger (0, ZERO);
+ remainder = Zero;
} else {
if (i < remainder_value.Length - 1)
remainder_value = Resize (remainder_value, i + 1);
for (i = quotient.Length - 1; i >= 0 && quotient [i] == 0; --i) ;
if (i == -1)
- return new BigInteger (0, ZERO);
+ return Zero;
if (i < quotient.Length - 1)
quotient = Resize (quotient, i + 1);
if (baseValue == 0.0d || baseValue == Double.PositiveInfinity)
return value.IsOne ? 0 : double.NaN;
- if (value.sign == 0)
+ if (value.data == null)
return double.NegativeInfinity;
int length = value.data.Length - 1;
NfiUser.PercentNegativePattern = 2;
NfiUser.PercentPositivePattern = 2;
NfiUser.PercentSymbol = "%%%";
+ NfiUser.NumberDecimalSeparator = ".";
}
[Test]
Assert.IsTrue (new BigInteger (1).IsOne, "#7");
Assert.IsTrue (new BigInteger (32).IsPowerOfTwo, "#8");
Assert.IsTrue (new BigInteger (0).IsZero, "#9");
+ Assert.IsTrue (new BigInteger ().IsZero, "#9b");
Assert.AreEqual (0, new BigInteger (0).Sign, "#10");
Assert.AreEqual (-1, new BigInteger (-99999).Sign, "#11");
Assert.IsFalse (new BigInteger (0).IsPowerOfTwo, "#12");
+ Assert.IsFalse (new BigInteger ().IsPowerOfTwo, "#12b");
Assert.IsFalse (new BigInteger (-16).IsPowerOfTwo, "#13");
Assert.IsTrue (new BigInteger (1).IsPowerOfTwo, "#14");
}
Assert.AreEqual ("0000000005", new BigInteger (5).ToString ("d10"), "#2");
Assert.AreEqual ("0A8", new BigInteger (168).ToString ("X"), "#3");
Assert.AreEqual ("0", new BigInteger (0).ToString ("X"), "#4");
+ Assert.AreEqual ("0", new BigInteger ().ToString ("X"), "#4b");
Assert.AreEqual ("1", new BigInteger (1).ToString ("X"), "#5");
Assert.AreEqual ("0A", new BigInteger (10).ToString ("X"), "#6");
Assert.AreEqual ("F6", new BigInteger (-10).ToString ("X"), "#7");
Assert.AreEqual (new byte[] { 0x7F }, new BigInteger (0x7F).ToByteArray (), "#10");
Assert.AreEqual (new byte[] { 0x45, 0xCC, 0xD0 }, new BigInteger (-0x2F33BB).ToByteArray (), "#11");
Assert.AreEqual (new byte[] { 0 }, new BigInteger (0).ToByteArray (), "#12");
+ Assert.AreEqual (new byte[] { 0 }, new BigInteger ().ToByteArray (), "#13");
}
[Test]
Assert.AreEqual (-1m, (decimal)new BigInteger (-1), "#6");
Assert.AreEqual (9999999999999999999999999999m,
(decimal)new BigInteger (9999999999999999999999999999m), "#7");
+ Assert.AreEqual (0m, (decimal)new BigInteger (), "#8");
+ }
+
+ [SetCulture ("pt-BR")]
+ [Test]
+ public void Parse_pt_BR ()
+ {
+ Parse ();
}
[Test]
Assert.AreEqual (-23, (int)BigInteger.Parse(" -23 ", NumberStyles.AllowLeadingSign | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite), "#19");
Assert.AreEqual (300000, (int)BigInteger.Parse("3E5", NumberStyles.AllowExponent), "#20");
- Assert.AreEqual (250, (int)BigInteger.Parse("2"+Nfi.NumberDecimalSeparator+"5E2", NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint), "#21");//2.5E2 = 250
+ var dsep = NumberFormatInfo.CurrentInfo.NumberDecimalSeparator;
+ Assert.AreEqual (250, (int)BigInteger.Parse("2" + dsep + "5E2", NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint), "#21");//2.5E2 = 250
Assert.AreEqual (25, (int)BigInteger.Parse("2500E-2", NumberStyles.AllowExponent), "#22");
Assert.AreEqual ("136236974127783066520110477975349088954559032721408", BigInteger.Parse("136236974127783066520110477975349088954559032721408", NumberStyles.None).ToString(), "#23");
}
try {
- Int32.Parse ("2.09E1", NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent);
+ Int32.Parse ("2" + dsep + "09E1", NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent);
Assert.Fail ("#26");
} catch (OverflowException) {
}
a = new BigInteger ();
Assert.AreEqual (BigInteger.Zero.GetHashCode (), a.GetHashCode (), "#15");
+
+ a = new BigInteger ();
+ Assert.AreEqual (BigInteger.Zero, a, "#16");
}
[Test]
EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Core.dll
NO_SIGN_ASSEMBLY = yes
EXTRA_DISTFILES = more_build_args
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Debugger.dll
NO_SIGN_ASSEMBLY = yes
EXTRA_DISTFILES = more_build_args
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Experimental.dll
NO_SIGN_ASSEMBLY = yes
EXTRA_DISTFILES = more_build_args
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Interfaces.dll
NO_SIGN_ASSEMBLY = yes
EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.Linq.dll
NO_SIGN_ASSEMBLY = yes
EXTRA_DISTFILES = more_build_args $(RESX_RESOURCES:.resources=.resx) $(PREBUILT)
-VALID_PROFILE := $(filter monotouch monodroid xammac net_4_0 net_4_5, $(PROFILE))
+VALID_PROFILE := $(filter monotouch monodroid xammac mobile mobile_static net_4_0 net_4_5, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.System.Reactive.PlatformServices.dll
NO_SIGN_ASSEMBLY = yes
/makefile.build -crlf
-/net_1_1_java_System.Runtime.Remoting.dll.exclude.sources -crlf
-/net_1_1_java_System.Runtime.Remoting.dll.sources -crlf
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
-#if !TARGET_JVM
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CLSCompliant (false)]
+++ /dev/null
-//
-// System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory
-//
-// Authors:
-// Martin Willemoes Hansen (mwh@sysrq.dk)
-// Lluis Sanchez Gual (lluis@ximian.com)
-//
-// (C) 2003 Martin Willemoes Hansen
-//
-
-//
-// 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.Web;
-using System.IO;
-using System.Runtime.Remoting;
-using System.Runtime.Remoting.Channels;
-
-namespace System.Runtime.Remoting.Channels.Http
-{
- public class HttpRemotingHandlerFactory : IHttpHandlerFactory
- {
- public HttpRemotingHandlerFactory ()
- {
- }
-
- private static HttpRemotingHandlerFactoryData CurrentHttpRemotingHandlerFactoryData
- {
- get
- {
- HttpRemotingHandlerFactoryData res = (HttpRemotingHandlerFactoryData)AppDomain.CurrentDomain.GetData("HttpRemotingHandlerFactory");
- if (res == null)
- {
- res = new HttpRemotingHandlerFactoryData();
- AppDomain.CurrentDomain.SetData("HttpRemotingHandlerFactory", res);
- }
- return res;
- }
- }
-
- public IHttpHandler GetHandler (HttpContext context,
- string verb,
- string url,
- string filePath)
- {
- if (!CurrentHttpRemotingHandlerFactoryData.webConfigLoaded)
- ConfigureHttpChannel (context);
-
- return new HttpRemotingHandler (CurrentHttpRemotingHandlerFactoryData.transportSink);
- }
-
- void ConfigureHttpChannel (HttpContext context)
- {
- lock (GetType())
- {
- if (CurrentHttpRemotingHandlerFactoryData.webConfigLoaded) return;
-
- // Look for a channel that wants to receive http request
- IChannelReceiverHook chook = null;
- foreach (IChannel channel in ChannelServices.RegisteredChannels)
- {
- chook = channel as IChannelReceiverHook;
- if (chook == null) continue;
-
- if (chook.ChannelScheme != "http")
- throw new RemotingException ("Only http channels are allowed when hosting remoting objects in a web server");
-
- if (!chook.WantsToListen)
- {
- chook = null;
- continue;
- }
-
- //found chook
- break;
- }
-
- if (chook == null)
- {
- HttpChannel chan = new HttpChannel();
- ChannelServices.RegisterChannel(chan);
- chook = chan;
- }
-
- // Register the uri for the channel. The channel uri includes the scheme, the
- // host and the application path
-
- string channelUrl = context.Request.Url.GetLeftPart(UriPartial.Authority);
- channelUrl += context.Request.ApplicationPath;
- chook.AddHookChannelUri (channelUrl);
-
- CurrentHttpRemotingHandlerFactoryData.transportSink = new HttpServerTransportSink (chook.ChannelSinkChain, null);
-
- CurrentHttpRemotingHandlerFactoryData.webConfigLoaded = true;
- }
- }
-
- public void ReleaseHandler (IHttpHandler handler)
- {
- }
- }
-
- internal class HttpRemotingHandlerFactoryData
- {
-
- internal bool webConfigLoaded = false;
- internal HttpServerTransportSink transportSink = null;
-
- }
-}
\r
public static void Shutdown ()\r
{\r
-#if !TARGET_JVM\r
if (_poolThread != null)\r
_poolThread.Abort();\r
-#endif\r
}\r
\r
public static int MaxOpenConnections\r
RemotingThreadPool threadPool;
-#if TARGET_JVM
- private volatile bool stopped = false;
-#endif
void Init (IServerChannelSinkProvider serverSinkProvider)
{
{
try
{
-#if !TARGET_JVM
while(true)
-#else
- while(!stopped)
-#endif
{
Socket socket = listener.AcceptSocket ();
ClientConnection reader = new ClientConnection (this, socket, sink);
public void StartListening (object data)
{
-#if TARGET_JVM
- stopped = false;
-#endif
listener = new TcpListener (bindAddress, port);
if (server_thread == null)
{
public void StopListening (object data)
{
-#if TARGET_JVM
- stopped = true;
-#endif
if (server_thread == null) return;
-#if !TARGET_JVM
server_thread.Abort ();
-#else
- server_thread.Interrupt ();
-#endif
listener.Stop ();
threadPool.Free ();
server_thread.Join ();
RemotingSurrogateSelector surrogateSelector = new RemotingSurrogateSelector ();
StreamingContext context = new StreamingContext (StreamingContextStates.Remoting, null);
-#if !TARGET_JVM
_serializationFormatter = new BinaryFormatter (surrogateSelector, context);
_deserializationFormatter = new BinaryFormatter (null, context);
-#else
- _serializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (surrogateSelector, context, false);
- _deserializationFormatter = (BinaryFormatter) vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (null, context, false);
-#endif
_serializationFormatter.FilterLevel = _filterLevel;
_deserializationFormatter.FilterLevel = _filterLevel;
AutoResetEvent threadDone = new AutoResetEvent (false);
ArrayList runningThreads = new ArrayList ();
-#if TARGET_JVM
- volatile
-#endif
bool stopped = false;
static object globalLock = new object ();
threadDone.Set ();
workItems.Clear ();
foreach (Thread t in runningThreads)
-#if !TARGET_JVM
t.Abort ();
-#else
- t.Interrupt();
-#endif
runningThreads.Clear ();
}
if (this == sharedPool)
void PoolThread ()
{
-#if !TARGET_JVM
while (true) {
-#else
- while (!stopped)
- {
-#endif
ThreadStart work = null;
do {
lock (workItems) {
if (sf != null) {\r
if(_serverFaultExceptionField != null)\r
e = (Exception) _serverFaultExceptionField.GetValue(sf);\r
-#if TARGET_JVM \r
- if (e == null && sf.ExceptionType != null)\r
- {\r
- try\r
- {\r
- Type te = Type.GetType(sf.ExceptionType);\r
- if (te != null)\r
- {\r
- ConstructorInfo ce = te.GetConstructor(\r
- BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance,\r
- null, new Type[] {typeof(string)}, null);\r
-\r
- if (ce != null)\r
- {\r
- e = (Exception) ce.Invoke(new object[] {sf.ExceptionMessage});\r
- }\r
- else\r
- {\r
- e = (Exception) Activator.CreateInstance(te);\r
- }\r
- }\r
- }\r
- catch\r
- {\r
- e = null;\r
- }\r
- }\r
-#endif\r
}\r
if (e == null)\r
e = new RemotingException (fault.FaultString);\r
\r
object GetNullValue (Type paramType)\r
{\r
-#if TARGET_JVM \r
- if (paramType.IsEnum)\r
- {\r
- return Activator.CreateInstance(paramType);\r
- }\r
-#endif\r
switch (Type.GetTypeCode (paramType))\r
{\r
case TypeCode.Boolean: return false;\r
case TypeCode.UInt32: return (uint)0;\r
case TypeCode.UInt64: return (ulong)0;\r
default: \r
-#if TARGET_JVM \r
- if (paramType.IsValueType)\r
- {\r
- return Activator.CreateInstance(paramType);\r
- }\r
-#endif \r
return null;\r
}\r
}\r
using System.Xml;
using System.Reflection;
using System.Net;
-#if !TARGET_JVM
using System.CodeDom.Compiler;
using Microsoft.CSharp;
-#endif
namespace System.Runtime.Remoting.MetadataServices
{
{
}
-#if !TARGET_JVM
[MonoTODO ("strong name")]
public static void ConvertCodeSourceFileToAssemblyFile (
string codePath,
memStream.Position = 0;
cg.GenerateCode (clientProxy, outputDirectory, memStream, outCodeStreamList, proxyUrl, proxyNamespace);
}
-#endif
public static void ConvertTypesToSchemaToFile (ServiceType [] types, SdlType sdlType, string path)
{
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{C4523363-42B4-486B-9422-B52B7D4CA3CF}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Runtime.Remoting</RootNamespace>\r
- <AssemblyName>System.Runtime.Remoting</AssemblyName>\r
- <JDKName>1.4.2</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <GHProjectKind>framework</GHProjectKind>\r
- <Version>2.0</Version>\r
- <jarserver>ipa</jarserver>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;NET_1_1;TARGET_JVM;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <jarserver>ipa</jarserver>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE;JAVA;NET_1_1;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;NET_1_1;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE;JAVA;NET_1_1;TARGET_JVM;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>true</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <jarserver>ipa</jarserver>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs">\r
- <Link>Consts.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Http\AggregateDictionary.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Http\HttpChannel.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Http\HttpClientChannel.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Http\HttpHelper.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Http\HttpRemotingHandler.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Http\HttpRemotingHandlerFactory.jvm.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Http\HttpServer.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Http\HttpServerChannel.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Tcp\TcpChannel.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Tcp\TcpClientChannel.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Tcp\TcpClientTransportSink.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Tcp\TcpClientTransportSinkProvider.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Tcp\TcpConnectionPool.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Tcp\TcpMessageIO.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Tcp\TcpServerChannel.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels.Tcp\TcpServerTransportSink.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\BinaryClientFormatterSink.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\BinaryClientFormatterSinkProvider.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\BinaryCore.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\BinaryServerFormatterSink.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\BinaryServerFormatterSinkProvider.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\ChannelCore.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\CommonTransportKeys.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\IAuthorizeRemotingConnection.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\RemotingThreadPool.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\SoapClientFormatterSink.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\SoapClientFormatterSinkProvider.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\SoapCore.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\SoapMessageFormatter.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\SoapServerFormatterSink.cs" />\r
- <Compile Include="System.Runtime.Remoting.Channels\SoapServerFormatterSinkProvider.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\MetaData.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\MetaDataCodeGenerator.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\MetaDataExporter.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\SdlChannelSink.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\SdlChannelSinkProvider.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\SdlType.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\ServiceType.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\SUDSGeneratorException.cs" />\r
- <Compile Include="System.Runtime.Remoting.MetadataServices\SUDSParserException.cs" />\r
- <Compile Include="System.Runtime.Remoting.Services\RemotingClientProxy.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Runtime.Remoting.Services\RemotingService.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\lib\J2SE.Helpers.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Runtime.Serialization.Formatters.Soap">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System.Web">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(GHROOT)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-j2se-helpers="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\J2SE.Helpers.jar" REFS-JarPath-system-web="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Web.jar" REFS-JarPath-system-runtime-serialization-formatters-soap="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Runtime.Serialization.Formatters.Soap.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-system-data="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Data.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.4.2" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Remoting_2_0", "System.Runtime.Remoting_2_0.csproj", "{C4523363-42B4-486B-9422-B52B7D4CA3CF}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {C4523363-42B4-486B-9422-B52B7D4CA3CF}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {C4523363-42B4-486B-9422-B52B7D4CA3CF}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {C4523363-42B4-486B-9422-B52B7D4CA3CF}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {C4523363-42B4-486B-9422-B52B7D4CA3CF}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {C4523363-42B4-486B-9422-B52B7D4CA3CF}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {C4523363-42B4-486B-9422-B52B7D4CA3CF}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {C4523363-42B4-486B-9422-B52B7D4CA3CF}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {C4523363-42B4-486B-9422-B52B7D4CA3CF}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.cs\r
-System.Runtime.Remoting.Channels.Ipc/*.cs\r
-System.Runtime.Remoting.Channels.Ipc.Unix/*.cs\r
-System.Runtime.Remoting.Channels.Ipc.Win32/*.cs\r
+++ /dev/null
-#include System.Runtime.Remoting.dll.sources\r
-\r
-System.Runtime.Remoting.Channels.Http/HttpRemotingHandlerFactory.jvm.cs\r
/README -crlf
/Sample.txt -crlf
/makefile.build -crlf
-/net_1_1_java_System.Runtime.Serialization.Formatters.Soap.dll.sources -crlf
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: ComVisible (true)]
object objReturn = \r
FormatterServices.GetUninitializedObject(type);\r
\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
objMgr.RaiseOnDeserializingEvent (objReturn);\r
#endif\r
if(objReturn is ISerializable)\r
private FormatterAssemblyStyle _assemblyFormat = FormatterAssemblyStyle.Full;\r
private FormatterTypeStyle _typeFormat = FormatterTypeStyle.TypesWhenNeeded;\r
private static string defaultMessageNamespace;\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
SerializationObjectManager _manager;\r
#endif\r
\r
_xmlWriter.Formatting = Formatting.Indented;\r
_surrogateSelector = selector;\r
_context = context;\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
_manager = new SerializationObjectManager (_context);\r
#endif\r
}\r
Thread.CurrentThread.CurrentCulture = savedCi;\r
}\r
\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
_manager.RaiseOnSerializedEvent ();\r
#endif\r
}\r
}\r
if(currentObject is ISerializable || surrogate != null) needsSerializationInfo = true;\r
\r
-#if NET_2_0 && !TARGET_JVM\r
+#if NET_2_0\r
_manager.RegisterObject (currentObject);\r
#endif\r
\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{3D1A5F49-3717-4D6B-BD34-10F30CB6DC4F}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Runtime.Serialization.Formatters.Soap</RootNamespace>\r
- <AssemblyName>System.Runtime.Serialization.Formatters.Soap</AssemblyName>\r
- <JDKName>1.4.2</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <GHProjectKind>framework</GHProjectKind>\r
- <Version>2.0</Version>\r
- <jarserver>ipa</jarserver>\r
- <StartupObject>\r
- </StartupObject>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_2_0;NET_1_1</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>true</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <jarserver>iap2</jarserver>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>true</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TARGET_JVM;NET_2_0;NET_1_1</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>true</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <DeploymentMethod>0</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <jarserver>iap2</jarserver>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(GHROOT)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-system-xml="..\lib\System.Xml.jar" REFS-JarPath-system-data="..\lib\System.Data.jar" REFS-JarPath-system="..\lib\System.jar" REFS-JarPath-mscorlib="..\lib\mscorlib.jar" REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.4.2" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs">\r
- <Link>Consts.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Runtime.Serialization.Formatters.Soap\SoapFormatter.cs" />\r
- <Compile Include="System.Runtime.Serialization.Formatters.Soap\SoapReader.cs" />\r
- <Compile Include="System.Runtime.Serialization.Formatters.Soap\SoapTypeMapper.cs" />\r
- <Compile Include="System.Runtime.Serialization.Formatters.Soap\SoapWriter.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Serialization.Formatters.Soap20", "System.Runtime.Serialization.Formatters.Soap20.csproj", "{3D1A5F49-3717-4D6B-BD34-10F30CB6DC4F}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {3D1A5F49-3717-4D6B-BD34-10F30CB6DC4F}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {3D1A5F49-3717-4D6B-BD34-10F30CB6DC4F}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {3D1A5F49-3717-4D6B-BD34-10F30CB6DC4F}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {3D1A5F49-3717-4D6B-BD34-10F30CB6DC4F}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {3D1A5F49-3717-4D6B-BD34-10F30CB6DC4F}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {3D1A5F49-3717-4D6B-BD34-10F30CB6DC4F}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-#include System.Runtime.Serialization.Formatters.Soap.dll.sources\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{A9DA8BA0-BEE0-4C51-AE51-BC67583337A9}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Runtime.Serialization</RootNamespace>\r
- <AssemblyName>System.Runtime.Serialization</AssemblyName>\r
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>\r
- <SignAssembly>false</SignAssembly>\r
- <AssemblyOriginatorKeyFile>\r
- </AssemblyOriginatorKeyFile>\r
- <DelaySign>false</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_2_0,TARGET_DOTNET</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE;NET_2_0,TARGET_DOTNET</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Runtime.Serialization.Configuration\DeclaredTypeElement.cs" />\r
- <Compile Include="System.Runtime.Serialization.Configuration\DeclaredTypeElementCollection.cs" />\r
- <Compile Include="System.Runtime.Serialization.Configuration\ParameterElement.cs" />\r
- <Compile Include="System.Runtime.Serialization.Configuration\ParameterElementCollection.cs" />\r
- <Compile Include="System.Runtime.Serialization.Configuration\SerializationSectionGroup.cs" />\r
- <Compile Include="System.Runtime.Serialization.Configuration\TypeElement.cs" />\r
- <Compile Include="System.Runtime.Serialization.Configuration\TypeElementCollection.cs" />\r
- <Compile Include="System.Runtime.Serialization.Configuration\XmlFormatterSection.cs" />\r
- <Compile Include="System.Runtime.Serialization\CollectionDataContractAttribute.cs" />\r
- <Compile Include="System.Runtime.Serialization\ContractNamespaceAttribute.cs" />\r
- <Compile Include="System.Runtime.Serialization\DataContractAttribute.cs" />\r
- <Compile Include="System.Runtime.Serialization\DataContractSerializer.cs" />\r
- <Compile Include="System.Runtime.Serialization\DataMemberAttribute.cs" />\r
- <Compile Include="System.Runtime.Serialization\EnumMemberAttribute.cs" />\r
- <Compile Include="System.Runtime.Serialization\ExportOptions.cs" />\r
- <Compile Include="System.Runtime.Serialization\ExtensionDataObject.cs" />\r
- <Compile Include="System.Runtime.Serialization\IDataContractSurrogate.cs" />\r
- <Compile Include="System.Runtime.Serialization\IExtensibleDataObject.cs" />\r
- <Compile Include="System.Runtime.Serialization\ImportOptions.cs" />\r
- <Compile Include="System.Runtime.Serialization\InvalidDataContractException.cs" />\r
- <Compile Include="System.Runtime.Serialization\KnownTypeAttribute.cs" />\r
- <Compile Include="System.Runtime.Serialization\KnownTypeCollection.cs" />\r
- <Compile Include="System.Runtime.Serialization\NetDataContractSerializer.cs" />\r
- <Compile Include="System.Runtime.Serialization\SerializationMap.cs" />\r
- <Compile Include="System.Runtime.Serialization\XmlFormatterDeserializer.cs" />\r
- <Compile Include="System.Runtime.Serialization\XmlFormatterSerializer.cs" />\r
- <Compile Include="System.Runtime.Serialization\XmlObjectSerializer.cs" />\r
- <Compile Include="System.Runtime.Serialization\XmlSerializableServices.cs" />\r
- <Compile Include="System.Runtime.Serialization\XsdDataContractExporter.cs" />\r
- <Compile Include="System.Runtime.Serialization\XsdDataContractImporter.cs" />\r
- <Compile Include="System.Xml\IStreamProvider.cs" />\r
- <Compile Include="System.Xml\IXmlBinaryReaderInitializer.cs" />\r
- <Compile Include="System.Xml\IXmlBinaryWriterInitializer.cs" />\r
- <Compile Include="System.Xml\IXmlDictionary.cs" />\r
- <Compile Include="System.Xml\IXmlMtomReaderInitializer.cs" />\r
- <Compile Include="System.Xml\IXmlMtomWriterInitializer.cs" />\r
- <Compile Include="System.Xml\IXmlUTF8ReaderInitializer.cs" />\r
- <Compile Include="System.Xml\IXmlUTF8WriterInitializer.cs" />\r
- <Compile Include="System.Xml\OnXmlDictionaryReaderClose.cs" />\r
- <Compile Include="System.Xml\UniqueId.cs" />\r
- <Compile Include="System.Xml\XmlBinaryDictionaryReader.cs" />\r
- <Compile Include="System.Xml\XmlBinaryDictionaryWriter.cs" />\r
- <Compile Include="System.Xml\XmlBinaryFormat.cs" />\r
- <Compile Include="System.Xml\XmlBinaryReaderSession.cs" />\r
- <Compile Include="System.Xml\XmlBinaryWriterSession.cs" />\r
- <Compile Include="System.Xml\XmlC14NWriter.cs" />\r
- <Compile Include="System.Xml\XmlCanonicalWriter.cs" />\r
- <Compile Include="System.Xml\XmlDictionary.cs" />\r
- <Compile Include="System.Xml\XmlDictionaryReader.cs" />\r
- <Compile Include="System.Xml\XmlDictionaryReaderAutoGen.cs" />\r
- <Compile Include="System.Xml\XmlDictionaryReaderQuotas.cs" />\r
- <Compile Include="System.Xml\XmlDictionaryString.cs" />\r
- <Compile Include="System.Xml\XmlDictionaryWriter.cs" />\r
- <Compile Include="System.Xml\XmlDictionaryWriterAutoGen.cs" />\r
- <Compile Include="System.Xml\XmlSimpleDictionaryReader.cs" />\r
- <Compile Include="System.Xml\XmlSimpleDictionaryWriter.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Consts.cs.in</Link>\r
- </Compile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="resources\mstypes.schema" >\r
- <LogicalName>mstypes.schema</LogicalName>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PostBuildEvent>@rem "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i "$(TargetPath)" /f\r
-@rem "C:\Program Files\Mono-1.2.6\bin\gacutil.bat" -i "$(TargetPath)"</PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <OutputType>Library</OutputType>\r
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>\r
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r
- <NoConfig>true</NoConfig>\r
- <CodePage>65001</CodePage>\r
- <NoWarn>414</NoWarn>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">\r
- <DefineConstants>NET_1_1,NET_2_0,SECURITY_DEP</DefineConstants>\r
- </PropertyGroup>\r
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">\r
- <Reference Include="System.Xml"/>\r
- <Reference Include="System"/>\r
- <Reference Include="Mono.Security">\r
- <HintPath>..\lib\net_2_0\Mono.Security.dll</HintPath>\r
- </Reference>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">\r
- </Target>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{9B58C41D-B301-4136-8694-E4585BCC01A6}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.ServiceModel.Web</RootNamespace>\r
- <AssemblyName>System.ServiceModel.Web</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_3_5</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE;NET_3_5</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Core">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.IdentityModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Runtime.Serialization">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.ServiceModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Xml.Linq">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data.DataSetExtensions">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs">\r
- <Link>Consts.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\DataContractJsonSerializer.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\IXmlJsonReaderInitializer.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\IXmlJsonWriterInitializer.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\JsonReader.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\JsonReaderWriterFactory.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\JsonSerializationReader.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\JsonSerializationWriter.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\JsonWriter.cs" />\r
- <Compile Include="System.Runtime.Serialization.Json\TypeMap.cs" />\r
- <Compile Include="System.ServiceModel.Activation\WebScriptServiceHostFactory.cs" />\r
- <Compile Include="System.ServiceModel.Activation\WebServiceHostFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WebBodyFormatMessageProperty.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WebContentFormat.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WebContentTypeMapper.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WebMessageEncoder.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WebMessageEncoderFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WebMessageEncodingBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WebHttpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WebHttpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WebHttpElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WebHttpSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WebMessageEncodingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WebScriptEnablingElement.cs" />\r
- <Compile Include="System.ServiceModel.Description\WebHttpBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\WebScriptEnablingBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\JsonQueryStringConverter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\QueryStringConverter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\WebHttpDispatchOperationSelector.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\WebMessageFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\Atom10FeedFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\Atom10FeedFormatter_1.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\Atom10ItemFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\Atom10ItemFormatter_1.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\ISyndicationElement.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\Rss20FeedFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\Rss20FeedFormatter_1.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\Rss20ItemFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\Rss20ItemFormatter_1.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationCategory.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationContent.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationElementExtension.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationElementExtensionCollection.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationExtensions.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationFeed.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationFeedFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationItem.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationItemFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationLink.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationPerson.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\SyndicationVersions.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\TextSyndicationContent.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\TextSyndicationContentKind.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\UrlSyndicationContent.cs" />\r
- <Compile Include="System.ServiceModel.Syndication\XmlSyndicationContent.cs" />\r
- <Compile Include="System.ServiceModel.Web\IncomingWebRequestContext.cs" />\r
- <Compile Include="System.ServiceModel.Web\IncomingWebResponseContext.cs" />\r
- <Compile Include="System.ServiceModel.Web\OutgoingWebRequestContext.cs" />\r
- <Compile Include="System.ServiceModel.Web\OutgoingWebResponseContext.cs" />\r
- <Compile Include="System.ServiceModel.Web\WebAttributeInfo.cs" />\r
- <Compile Include="System.ServiceModel.Web\WebChannelFactory.cs" />\r
- <Compile Include="System.ServiceModel.Web\WebGetAttribute.cs" />\r
- <Compile Include="System.ServiceModel.Web\WebInvokeAttribute.cs" />\r
- <Compile Include="System.ServiceModel.Web\WebMessageBodyStyle.cs" />\r
- <Compile Include="System.ServiceModel.Web\WebMessageFormat.cs" />\r
- <Compile Include="System.ServiceModel.Web\WebOperationContext.cs" />\r
- <Compile Include="System.ServiceModel.Web\WebServiceHost.cs" />\r
- <Compile Include="System.ServiceModel\WebHttpBinding.cs" />\r
- <Compile Include="System.ServiceModel\WebHttpSecurity.cs" />\r
- <Compile Include="System.ServiceModel\WebHttpSecurityMode.cs" />\r
- <Compile Include="System\UriTemplate.cs" />\r
- <Compile Include="System\UriTemplateEquivalenceComparer.cs" />\r
- <Compile Include="System\UriTemplateMatch.cs" />\r
- <Compile Include="System\UriTemplateMatchException.cs" />\r
- <Compile Include="System\UriTemplateTable.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PostBuildEvent>@rem "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i "$(TargetPath)" /f\r
-@rem "C:\Program Files\Mono-1.2.6\bin\gacutil.bat" -i "$(TargetPath)"</PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{05A2DAF1-316D-4350-B07B-B73BE591DE57}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>MonoTests.System.ServiceModel.Web</RootNamespace>\r
- <AssemblyName>System.ServiceModel.Web_test_net_3_5</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>.\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_3_5</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Core">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Drawing" />\r
- <Reference Include="System.IdentityModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.IdentityModel.Selectors">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Messaging" />\r
- <Reference Include="System.Runtime.Serialization">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Security" />\r
- <Reference Include="System.ServiceModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.ServiceModel.Web">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Transactions" />\r
- <Reference Include="System.Web" />\r
- <Reference Include="System.Web.Services" />\r
- <Reference Include="System.Windows.Forms" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="Test\System.Runtime.Serialization.Json\DataContractJsonSerializerTest.cs" />\r
- <Compile Include="Test\System.Runtime.Serialization.Json\JsonReaderTest.cs" />\r
- <Compile Include="Test\System.Runtime.Serialization.Json\JsonWriterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\WebBodyFormatMessagePropertyTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\WebMessageEncodingBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\WebHttpBehaviorTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\JsonQueryStringConverterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\QueryStringConverterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\WebHttpDispatchOperationSelectorTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\Atom10FeedFormatterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\Atom10ItemFormatterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\Rss20FeedFormatterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\Rss20ItemFormatterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\SyndicationElementExtensionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\SyndicationFeedTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\SyndicationItemTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\SyndicationLinkTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\TextSyndicationContentTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\UrlSyndicationContentTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Syndication\XmlSyndicationContentTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Web\WebGetAttributeTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Web\WebInvokeAttributeTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Web\WebServiceHostTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\WebHttpBindingTest.cs" />\r
- <Compile Include="Test\System\UriTemplateTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\nunit20\framework\nunit.framework.dll20.csproj">\r
- <Project>{83DD7E12-A705-4DBA-9D71-09C8973D9382}</Project>\r
- <Name>nunit.framework.dll20</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PostBuildEvent>copy $(TargetDir)..\..\nunit20\nunit-console\bin\$(ConfigurationName)\*.exe $(TargetDir)\r
-copy $(TargetDir)..\..\nunit20\nunit-console\bin\$(ConfigurationName)\*.dll $(TargetDir)</PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ServiceModel.Web_Test", "System.ServiceModel.Web_Test.csproj", "{05A2DAF1-316D-4350-B07B-B73BE591DE57}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll20", "..\..\nunit20\framework\nunit.framework.dll20.csproj", "{83DD7E12-A705-4DBA-9D71-09C8973D9382}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Debug-Strong|Any CPU = Debug-Strong|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Debug-Strong|Any CPU.ActiveCfg = Debug|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Debug-Strong|Any CPU.Build.0 = Debug|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Debug-Strong|Any CPU.ActiveCfg = Debug-Strong|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Debug-Strong|Any CPU.Build.0 = Debug-Strong|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
foreach (var fd in od.Faults)
o.FaultContractInfos.Add (new FaultContractInfo (fd.Action, fd.DetailType));
+ o.BeginMethod = od.BeginMethod;
+ o.EndMethod = od.EndMethod;
+
// FIXME: at initialization time it does not seem to
// fill default formatter. It should be filled after
// applying all behaviors. (Tthat causes regression, so
for (int i = 0; i < contractMethods.Length; ++i)
{
-
MethodInfo mi = contractMethods [i];
OperationContractAttribute oca = GetOperationContractAttribute (mi);
if (oca == null)
if (GetOperationContractAttribute (end) != null)
throw new InvalidOperationException ("Async 'End' method must not have OperationContractAttribute. It is automatically treated as the EndMethod of the corresponding 'Begin' method.");
}
- OperationDescription od = GetOrCreateOperation (cd, mi, serviceMethods [i], oca, end != null ? end.ReturnType : null, isCallback, givenServiceType);
+ OperationDescription od = GetOrCreateOperation (cd, mi, serviceMethods [i], oca, end, isCallback, givenServiceType);
if (end != null)
od.EndMethod = end;
}
static OperationDescription GetOrCreateOperation (
ContractDescription cd, MethodInfo mi, MethodInfo serviceMethod,
OperationContractAttribute oca,
- Type asyncReturnType,
+ MethodInfo endMethod,
bool isCallback,
Type givenServiceType)
{
od.Messages.Add (GetMessage (od, mi, oca, true, isCallback, null));
if (!od.IsOneWay) {
- var md = GetMessage (od, mi, oca, false, isCallback, asyncReturnType);
+ var asyncReturnType = endMethod != null ? endMethod.ReturnType : null;
+ var md = GetMessage (od, endMethod ?? mi, oca, false, isCallback, asyncReturnType);
od.Messages.Add (md);
var mpa = mi.ReturnParameter.GetCustomAttribute<MessageParameterAttribute> (true);
if (mpa != null) {
int index = 0;
foreach (ParameterInfo pi in plist) {
// AsyncCallback and state are extraneous.
- if (oca.AsyncPattern && pi.Position == plist.Length - 2)
- break;
+ if (oca.AsyncPattern) {
+ if (isRequest && pi.Position == plist.Length - 2)
+ break;
+ if (!isRequest && pi.Position == plist.Length - 1)
+ break;
+ }
// They are ignored:
// - out parameter in request
}
else {
int index = ParamsOffset (md.Body);
- foreach (ParameterInfo pi in requestMethodParams)
+ foreach (ParameterInfo pi in replyMethodParams) {
if (pi.IsOut || pi.ParameterType.IsByRef)
parameters [pi.Position] = parts [index++];
+ }
return HasReturnValue (md.Body) ? parts [0] : null;
}
}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{0CD5DD13-89FF-4710-BAE2-4957418F4251}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.ServiceModel</RootNamespace>\r
- <AssemblyName>System.ServiceModel</AssemblyName>\r
- <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- <SignAssembly>true</SignAssembly>\r
- <AssemblyOriginatorKeyFile>\r
- </AssemblyOriginatorKeyFile>\r
- <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_2_0,TARGET_DOTNET</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE;NET_2_0,TARGET_DOTNET</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Drawing" />\r
- <Reference Include="System.IdentityModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.IdentityModel.Selectors">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Messaging" />\r
- <Reference Include="System.Runtime.Serialization">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Security" />\r
- <Reference Include="System.Transactions" />\r
- <Reference Include="System.Web" />\r
- <Reference Include="System.Web.Services" />\r
- <Reference Include="System.Windows.Forms" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Math.Prime.Generator\NextPrimeFinder.cs">\r
- <Link>Mono.Math.Prime.Generator\NextPrimeFinder.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Math.Prime.Generator\PrimeGeneratorBase.cs">\r
- <Link>Mono.Math.Prime.Generator\PrimeGeneratorBase.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Math.Prime.Generator\SequentialSearchPrimeGeneratorBase.cs">\r
- <Link>Mono.Math.Prime.Generator\SequentialSearchPrimeGeneratorBase.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Math.Prime\ConfidenceFactor.cs">\r
- <Link>Mono.Math.Prime\ConfidenceFactor.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Math.Prime\PrimalityTests.cs">\r
- <Link>Mono.Math.Prime\PrimalityTests.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Math\BigInteger.cs">\r
- <Link>Mono.Math\BigInteger.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\ARC4Managed.cs">\r
- <Link>Mono.Security.Cryptography\ARC4Managed.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\CryptoConvert.cs">\r
- <Link>Mono.Security.Cryptography\CryptoConvert.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\CryptoTools.cs">\r
- <Link>Mono.Security.Cryptography\CryptoTools.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\MD2.cs">\r
- <Link>Mono.Security.Cryptography\MD2.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\MD2Managed.cs">\r
- <Link>Mono.Security.Cryptography\MD2Managed.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\MD4.cs">\r
- <Link>Mono.Security.Cryptography\MD4.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\MD4Managed.cs">\r
- <Link>Mono.Security.Cryptography\MD4Managed.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\PKCS1.cs">\r
- <Link>Mono.Security.Cryptography\PKCS1.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\PKCS8.cs">\r
- <Link>Mono.Security.Cryptography\PKCS8.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\RC4.cs">\r
- <Link>Mono.Security.Cryptography\RC4.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.Cryptography\RSAManaged.cs">\r
- <Link>Mono.Security.Cryptography\RSAManaged.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\AuthorityKeyIdentifierExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\AuthorityKeyIdentifierExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\BasicConstraintsExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\BasicConstraintsExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\CertificatePoliciesExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\CertificatePoliciesExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\CRLDistributionPointsExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\CRLDistributionPointsExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\ExtendedKeyUsageExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\ExtendedKeyUsageExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\GeneralNames.cs">\r
- <Link>Mono.Security.X509.Extensions\GeneralNames.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\KeyAttributesExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\KeyAttributesExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\KeyUsageExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\KeyUsageExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\NetscapeCertTypeExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\NetscapeCertTypeExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\PrivateKeyUsagePeriodExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\PrivateKeyUsagePeriodExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\SubjectAltNameExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\SubjectAltNameExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509.Extensions\SubjectKeyIdentifierExtension.cs">\r
- <Link>Mono.Security.X509.Extensions\SubjectKeyIdentifierExtension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\ITrustAnchors.cs">\r
- <Link>Mono.Security.X509\ITrustAnchors.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\PKCS12.cs">\r
- <Link>Mono.Security.X509\PKCS12.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\TrustAnchors.cs">\r
- <Link>Mono.Security.X509\TrustAnchors.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X501Name.cs">\r
- <Link>Mono.Security.X509\X501Name.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509Builder.cs">\r
- <Link>Mono.Security.X509\X509Builder.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509Certificate.cs">\r
- <Link>Mono.Security.X509\X509Certificate.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509CertificateBuilder.cs">\r
- <Link>Mono.Security.X509\X509CertificateBuilder.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509CertificateCollection.cs">\r
- <Link>Mono.Security.X509\X509CertificateCollection.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509Chain.cs">\r
- <Link>Mono.Security.X509\X509Chain.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509ChainStatusFlags.cs">\r
- <Link>Mono.Security.X509\X509ChainStatusFlags.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509CRL.cs">\r
- <Link>Mono.Security.X509\X509CRL.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509Extension.cs">\r
- <Link>Mono.Security.X509\X509Extension.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509Extensions.cs">\r
- <Link>Mono.Security.X509\X509Extensions.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509Store.cs">\r
- <Link>Mono.Security.X509\X509Store.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509StoreManager.cs">\r
- <Link>Mono.Security.X509\X509StoreManager.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X509Stores.cs">\r
- <Link>Mono.Security.X509\X509Stores.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security.X509\X520Attributes.cs">\r
- <Link>Mono.Security.X509\X520Attributes.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security\ASN1.cs">\r
- <Link>Mono.Security\ASN1.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security\ASN1Convert.cs">\r
- <Link>Mono.Security\ASN1Convert.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security\PKCS7.cs">\r
- <Link>Mono.Security\PKCS7.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\mcs\class\Mono.Security\Mono.Security\StrongName.cs">\r
- <Link>Mono.Security\StrongName.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Consts.cs.in</Link>\r
- </Compile>\r
- <Compile Include="Mono.CodeGeneration\CodeAdd.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeAnd.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeArgument.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeArgumentReference.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeArithmeticOperation.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeArrayItem.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeArrayLength.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeAssignment.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeBinaryComparison.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeBinaryOperation.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeBlock.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeBuilder.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeCast.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeClass.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeCustomAttribute.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeDecrement.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeEquals.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeExpression.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeFieldReference.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeFor.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeForeach.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeGenerationHelper.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeIf.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeIncrement.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeIs.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeItem.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeLiteral.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeMethod.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeMethodCall.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeModule.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeNew.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeNewArray.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeNotEquals.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeOr.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeProperty.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodePropertyReference.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeReturn.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeSelect.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeSelfIncrement.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeUnaryOperation.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeValueReference.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeVariableDeclaration.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeVariableReference.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeWhen.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeWhile.cs" />\r
- <Compile Include="Mono.CodeGeneration\CodeWriter.cs" />\r
- <Compile Include="Mono.CodeGeneration\Exp.cs" />\r
- <Compile Include="Mono.Security.Cryptography\MD5SHA1.cs" />\r
- <Compile Include="Mono.Security.Cryptography\TlsHMAC.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\BitConverterLE.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\ChallengeResponse.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\MessageBase.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\NtlmFlags.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\NtlmTargetInformation.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\NtlmVersion.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\Type1Message.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\Type2Message.cs" />\r
- <Compile Include="Mono.Security.Protocol.Ntlm\Type3Message.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsClientCertificate.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsClientCertificateVerify.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsClientFinished.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsClientHello.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsClientKeyExchange.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsServerCertificate.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsServerCertificateRequest.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsServerFinished.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsServerHello.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsServerHelloDone.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Client\TlsServerKeyExchange.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsClientCertificate.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsClientCertificateVerify.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsClientFinished.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsClientHello.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsClientKeyExchange.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsServerCertificate.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsServerCertificateRequest.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsServerFinished.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsServerHello.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsServerHelloDone.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake.Server\TlsServerKeyExchange.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake\ClientCertificateType.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake\HandshakeMessage.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls.Handshake\HandshakeType.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\Alert.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\CipherAlgorithmType.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\CipherSuite.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\CipherSuiteCollection.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\CipherSuiteFactory.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\ClientContext.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\ClientRecordProtocol.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\ClientSessionCache.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\ContentType.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\Context.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\DebugHelper.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\ExchangeAlgorithmType.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\HandshakeState.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\HashAlgorithmType.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\HttpsClientStream.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\RecordProtocol.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\RSASslSignatureDeformatter.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\RSASslSignatureFormatter.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\SecurityCompressionType.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\SecurityParameters.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\SecurityProtocolType.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\ServerContext.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\ServerRecordProtocol.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\SslCipherSuite.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\SslClientStream.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\SslHandshakeHash.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\SslServerStream.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\SslStreamBase.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\TlsCipherSuite.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\TlsClientSettings.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\TlsException.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\TlsServerSettings.cs" />\r
- <Compile Include="Mono.Security.Protocol.Tls\TlsStream.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocument2.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocumentBuilder2.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocumentWriter2.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathNavigator2.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathNode2.cs" />\r
- <Compile Include="System.Collections.Generic\KeyedByTypeCollection.cs" />\r
- <Compile Include="System.Collections.Generic\SynchronizedCollection.cs" />\r
- <Compile Include="System.Collections.Generic\SynchronizedKeyedCollection.cs" />\r
- <Compile Include="System.Collections.Generic\SynchronizedReadOnlyCollection.cs" />\r
- <Compile Include="System.ServiceModel.Activation\AspNetIntegrationRequirementsAttribute.cs" />\r
- <Compile Include="System.ServiceModel.Activation\HttpHandler.cs" />\r
- <Compile Include="System.ServiceModel.Activation\HttpModule.cs" />\r
- <Compile Include="System.ServiceModel.Activation\IServiceHostFactory.cs" />\r
- <Compile Include="System.ServiceModel.Activation\ServiceHostFactory.cs" />\r
- <Compile Include="System.ServiceModel.Activation\ServiceHostFactoryBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\AddressHeader.cs" />\r
- <Compile Include="System.ServiceModel.Channels\AddressHeaderCollection.cs" />\r
- <Compile Include="System.ServiceModel.Channels\AddressingVersion.cs" />\r
- <Compile Include="System.ServiceModel.Channels\AspNetReplyChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\AspNetRequestContext.cs" />\r
- <Compile Include="System.ServiceModel.Channels\AsymmetricSecurityBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BinaryMessageEncoder.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BinaryMessageEncoderFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BinaryMessageEncodingBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\Binding.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BindingContext.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BindingElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BindingParameterCollection.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BodyWriter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\BufferManager.cs" />\r
- <Compile Include="System.ServiceModel.Channels\CachingCompiler.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ChannelBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ChannelFactoryBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ChannelListenerBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ChannelListenerBase_1.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ChannelManagerBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ChannelParameterCollection.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ChannelPoolSettings.cs" />\r
- <Compile Include="System.ServiceModel.Channels\CommunicationObject.cs" />\r
- <Compile Include="System.ServiceModel.Channels\CompilationException.cs" />\r
- <Compile Include="System.ServiceModel.Channels\CompositeDuplexBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\CompositeDuplexBindingElementImporter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ConnectionOrientedTransportBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\CustomBinding.cs" />\r
- <Compile Include="System.ServiceModel.Channels\DeliveryFailure.cs" />\r
- <Compile Include="System.ServiceModel.Channels\DeliveryStatus.cs" />\r
- <Compile Include="System.ServiceModel.Channels\DirectionalAction.cs" />\r
- <Compile Include="System.ServiceModel.Channels\DuplexSessionChannelBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\FaultConverter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HostedTransportConfiguration.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HtmlizedException.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpChannelFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpChannelListener.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpChannelManager.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpReplyChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpRequestChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpRequestContext.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpRequestMessageProperty.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpResponseMessageProperty.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpsTransportBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\HttpTransportBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IBindingDeliveryCapabilities.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IBindingMulticastCapabilities.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IBindingRuntimePreferences.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IChannelFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IChannelListener.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IDuplexChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IDuplexSession.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IDuplexSessionChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IInputChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IInputSession.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IInputSessionChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IMessageProperty.cs" />\r
- <Compile Include="System.ServiceModel.Channels\InputChannelBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\InvalidChannelBindingException.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IOutputChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IOutputSession.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IOutputSessionChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IReplyChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IReplySessionChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IRequestChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\IRequestSessionChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ISecurityCapabilities.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ISession.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ISessionChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ITransactedBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ITransportTokenAssertionProvider.cs" />\r
- <Compile Include="System.ServiceModel.Channels\LayeredCommunicationObject.cs" />\r
- <Compile Include="System.ServiceModel.Channels\LayeredOutputChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\LayeredReplyChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\LayeredRequestChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\LocalClientSecuritySettings.cs" />\r
- <Compile Include="System.ServiceModel.Channels\Message.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageBuffer.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageBufferImpl.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageEncoder.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageEncoderFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageEncodingBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageEncodingBindingElementImporter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageFault.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageFaultBodyWriter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageHeader.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageHeaderInfo.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageHeaders.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageImpl.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageProperties.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageSecurityBindingSupport.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MessageVersion.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MsmqBindingElementBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MsmqChannelFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MsmqChannelListener.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MsmqInputChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MsmqMessageProperty.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MsmqOutputChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MsmqTransportBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MtomMessageEncoder.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MtomMessageEncoderFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\MtomMessageEncodingBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\NamedPipeConnectionPoolSettings.cs" />\r
- <Compile Include="System.ServiceModel.Channels\NamedPipetransportBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\OneWayBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\OneWayBindingElementImporter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\OutputChannelBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\PeerResolverBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\PeerTransportBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\PnrpPeerResolverBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ReliableSessionBindingElementImporter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ReplyChannelBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\RequestChannelBase.cs" />\r
- <Compile Include="System.ServiceModel.Channels\RequestContext.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecureMessageDecryptor.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecureMessageGenerator.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecurityBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecurityBindingElementImporter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecurityChannelFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecurityChannelListener.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecurityOutputChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecurityRequestChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SecurityRequestContext.cs" />\r
- <Compile Include="System.ServiceModel.Channels\ServiceHostParser.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SslStreamSecurityBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SslStreamSecurityUpgradeAcceptor.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SslStreamSecurityUpgradeProvider.cs" />\r
- <Compile Include="System.ServiceModel.Channels\StandardBindingImporter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\StreamSecurityUpgradeAcceptor.cs" />\r
- <Compile Include="System.ServiceModel.Channels\StreamSecurityUpgradeInitiator.cs" />\r
- <Compile Include="System.ServiceModel.Channels\StreamSecurityUpgradeProvider.cs" />\r
- <Compile Include="System.ServiceModel.Channels\StreamUpgradeAcceptor.cs" />\r
- <Compile Include="System.ServiceModel.Channels\StreamUpgradeBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\StreamUpgradeInitiator.cs" />\r
- <Compile Include="System.ServiceModel.Channels\StreamUpgradeProvider.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SvcHttpHandler.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SvcHttpHandlerFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\SymmetricSecurityBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TcpChannelFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TcpChannelListener.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TcpConnectionPoolSettings.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TcpDuplexSessionChannel.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TcpTransportBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TextMessageEncoder.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TextMessageEncoderFactory.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TextMessageEncodingBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TransactionFlowBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TransactionFlowBindingElementImporter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TransactionMessageProperty.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TransportBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TransportBindingElementImporter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\TransportSecurityBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\UnderstoodHeaders.cs" />\r
- <Compile Include="System.ServiceModel.Channels\UseManagedPresentationBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WindowsStreamSecurityBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WSEncryptedXml.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WSSecurityMessageHeader.cs" />\r
- <Compile Include="System.ServiceModel.Channels\WSSignedXml.cs" />\r
- <Compile Include="System.ServiceModel.Channels\XmlObjectSerializerBodyWriter.cs" />\r
- <Compile Include="System.ServiceModel.Channels\XmlReaderBodyWriter.cs" />\r
- <Compile Include="System.ServiceModel.ComIntegration\Dummy.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\AddressHeaderCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\AllowedAudienceUriElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\AllowedAudienceUriElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\AuthenticationMode.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\AuthorizationPolicyTypeElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\AuthorizationPolicyTypeElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BaseAddressElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BaseAddressElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BasicHttpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BasicHttpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BasicHttpMessageSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BasicHttpSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BehaviorExtensionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BehaviorsSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BinaryMessageEncodingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BindingElementExtensionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\BindingsSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CallbackDebugElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CallbackTimeoutsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CertificateElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CertificateReferenceElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ChannelEndpointElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ChannelEndpointElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ChannelPoolSettingsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ClaimTypeElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ClaimTypeElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ClientCredentialsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ClientSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ClientViaElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComContractElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComContractElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComContractsSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComMethodElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComMethodElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CommonBehaviorsSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CommonEndpointBehaviorElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CommonServiceBehaviorElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComPersistableTypeElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComPersistableTypeElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CompositeDuplexElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComUdtElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ComUdtElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ConfigUtil.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ConnectionOrientedTransportElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CustomBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CustomBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\CustomBindingElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\DataContractSerializerElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\DiagnosticSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\DnsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\EncodingConverter.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\EndpointAddressElementBase.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\EndpointBehaviorElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\EndpointBehaviorElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ExtensionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ExtensionElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ExtensionsSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\FederatedMessageSecurityOverHttpElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\HostElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\HostTimeoutsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\HttpDigestClientElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\HttpsTransportElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\HttpTransportElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\HttpTransportSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IBindingConfigurationElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IdentityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IPAddressConverter.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IssuedTokenClientBehaviorsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IssuedTokenClientBehaviorsElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IssuedTokenClientElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IssuedTokenParametersElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IssuedTokenParametersEndpointAddressElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\IssuedTokenServiceElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\LocalClientSecuritySettingsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\LocalServiceSecuritySettingsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MessageLoggingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MessageSecurityOverHttpElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MessageSecurityOverMsmqElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MessageSecurityOverTcpElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MessageSecurityVersionConverter.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MessageVersionConverter.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MetadataElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MethodStubs.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexBindingBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexHttpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexHttpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexHttpsBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexHttpsBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexNamedPipeBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexNamedPipeBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexTcpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MexTcpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MsmqBindingElementBase.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MsmqElementBase.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MsmqIntegrationBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MsmqIntegrationBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MsmqIntegrationElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MsmqIntegrationSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MsmqTransportElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MsmqTransportSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\MtomMessageEncodingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NamedPipeConnectionPoolSettingsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NamedPipeTransportElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NamedPipeTransportSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NamedServiceModelExtensionCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetMsmqBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetMsmqBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetMsmqSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetNamedPipeBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetNamedPipeBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetNamedPipeSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetPeerTcpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetPeerTcpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetTcpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetTcpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NetTcpSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\NonDualMessageSecurityOverHttpElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\OneWayElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PeerCredentialElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PeerCustomResolverElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PeerResolverElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PeerSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PeerTransportElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PeerTransportSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PnrpPeerResolverElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PolicyImporterElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PolicyImporterElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PolicyVersionConverter.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\PrivacyNoticeElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ReliableMessagingVersionConverter.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ReliableSessionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\RsaElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\SecureConversationServiceElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\SecurityAlgorithmSuiteConverter.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\SecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\SecurityElementBase.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceAuthorizationElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceBehaviorElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceBehaviorElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceCredentialsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceDebugElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceEndpointElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceEndpointElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceHostingEnvironmentSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceMetadataPublishingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceModelConfigurationElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceModelEnhancedConfigurationElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceModelExtensionCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceModelExtensionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceModelSectionGroup.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServicePrincipalNameElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceSecurityAuditElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServicesSection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceThrottlingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\ServiceTimeoutsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\SslStreamSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\StandardBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\StandardBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\StandardBindingElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\StandardBindingOptionalReliableSessionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\StandardBindingReliableSessionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\SynchronousReceiveElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TcpConnectionPoolSettingsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TcpTransportElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TcpTransportSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TextMessageEncodingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TransactedBatchingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TransactionFlowElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TransactionProtocolConverter.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TransportConfigurationTypeElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TransportConfigurationTypeElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\TransportElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\UseManagedPresentationElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\UserNameServiceElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\UserPrincipalNameElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WindowsClientElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WindowsServiceElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WindowsStreamSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WS2007FederationHttpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WS2007FederationHttpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WS2007HttpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WS2007HttpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WsdlImporterElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WsdlImporterElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSDualHttpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSDualHttpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSDualHttpSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSFederationHttpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSFederationHttpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSFederationHttpSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSHttpBindingBaseElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSHttpBindingCollectionElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSHttpBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSHttpSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\WSHttpTransportSecurityElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509CertificateTrustedIssuerElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509CertificateTrustedIssuerElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509ClientCertificateAuthenticationElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509ClientCertificateCredentialsElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509DefaultServiceCertificateElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509InitiatorCertificateClientElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509InitiatorCertificateServiceElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509PeerCertificateAuthenticationElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509PeerCertificateElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509RecipientCertificateClientElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509RecipientCertificateServiceElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509ScopedServiceCertificateElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509ScopedServiceCertificateElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\X509ServiceCertificateAuthenticationElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\XmlDictionaryReaderQuotasElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\XmlElementElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\XmlElementElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\XPathMessageFilterElement.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\XPathMessageFilterElementCollection.cs" />\r
- <Compile Include="System.ServiceModel.Configuration\XPathMessageFilterElementComparer.cs" />\r
- <Compile Include="System.ServiceModel.Description\CallbackDebugBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\CallbackTimeoutsBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\ClientCredentials.cs" />\r
- <Compile Include="System.ServiceModel.Description\ClientViaBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\ContractDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\ContractDescriptionGenerator.cs" />\r
- <Compile Include="System.ServiceModel.Description\DataContractSerializerMessageContractImporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\DataContractSerializerOperationBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\FaultDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\FaultDescriptionCollection.cs" />\r
- <Compile Include="System.ServiceModel.Description\HostedBindingBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\IContractBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\IContractBehaviorAttribute.cs" />\r
- <Compile Include="System.ServiceModel.Description\IEndpointBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\IMetadataExchange.cs" />\r
- <Compile Include="System.ServiceModel.Description\IOperationBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\IOperationContractGenerationExtension.cs" />\r
- <Compile Include="System.ServiceModel.Description\IpolicyExporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\IPolicyImporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\IServiceBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\IServiceContractGenerationExtension.cs" />\r
- <Compile Include="System.ServiceModel.Description\IWsdlExporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\IWsdlImporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\LocalServiceSecuritySettings.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessageBodyDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessageDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessageDescriptionCollection.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessageHeaderDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessageHeaderDescriptionCollection.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessagePartDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessagePartDescriptionCollection.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessagePropertyDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\MessagePropertyDescriptionCollection.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataBundle.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataConversionError.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataExchangeBindings.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataExchangeClient.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataExporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataImporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataLocation.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataReference.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataResolver.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataSection.cs" />\r
- <Compile Include="System.ServiceModel.Description\MetadataSectionSerializerBase.cs" />\r
- <Compile Include="System.ServiceModel.Description\MustUnderstandBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\OperationContractGenerationContext.cs" />\r
- <Compile Include="System.ServiceModel.Description\OperationDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\OperationDescriptionCollection.cs" />\r
- <Compile Include="System.ServiceModel.Description\PolicyAssertionCollection.cs" />\r
- <Compile Include="System.ServiceModel.Description\PolicyConversionContext.cs" />\r
- <Compile Include="System.ServiceModel.Description\PolicyVersion.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceAuthorizationBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceContractGenerationContext.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceContractGenerator.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceCredentials.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceDebugBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceDescription.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceEndpoint.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceEndpointCollection.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceMetadataBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceMetadataExtension.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceSecurityAuditBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceThrottlingBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\ServiceTimeoutsBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\SynchronousReceiveBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\TransactedBatchingBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Description\TypedMessageConverter.cs" />\r
- <Compile Include="System.ServiceModel.Description\WebServiceHelper.cs" />\r
- <Compile Include="System.ServiceModel.Description\WsdlContractConversionContext.cs" />\r
- <Compile Include="System.ServiceModel.Description\WsdlEndpointConversionContext.cs" />\r
- <Compile Include="System.ServiceModel.Description\WsdlExporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\WsdlImporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\WSTrustMessageConverters.cs" />\r
- <Compile Include="System.ServiceModel.Description\WSTrustSTSContract.cs" />\r
- <Compile Include="System.ServiceModel.Description\XmlSerializerMessageContractImporter.cs" />\r
- <Compile Include="System.ServiceModel.Description\XmlSerializerOperationBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Diagnostics\PerformanceCounterScope.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ActionMessageFilter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ActionMessageFilterTable.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\InputOrReplyRequestProcessor.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\OperationContextScopeHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\PostReceiveRequestHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\BaseMessagesFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ChannelDispatcher.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ChannelDispatcherBase.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ChannelDispatcherCollection.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ClientOperation.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ClientRuntime.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\DataContractSerializerServiceBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\DefaultInstanceContextProvider.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\DispatchOperation.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\DispatchRuntime.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\EndpointAddressMessageFilter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\EndpointAddressMessageFilterTable.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\EndpointDispatcher.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ErrorProcessingHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ExceptionHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\FaultContractInfo.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\FilterInvalidBodyAccessException.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\FinalizeProcessingHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ICallContextInitializer.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IChannelInitializer.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IClientMessageFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IClientMessageInspector.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IClientOperationSelector.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IDispatchMessageFormatter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IDispatchMessageInspector.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IDispatchOperationSelector.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IErrorHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IInputSessionShutdown.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IInstanceContextInitializer.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IInstanceContextProvider.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IInstanceProvider.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IInteractiveChannelInitializer.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IMessageFilterTable.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\BaseRequestProcessorHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\InstanceBehavior.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\InitializingHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\InstanceContextIdleCallback.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\InvalidBodyAccessException.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IOperationInvoker.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\IParameterInspector.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\MatchAllMessageFilter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\MatchNoneMessageFilter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\MessageFilter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\MessageFilterNodeQuotaExceededException.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\MessageFilterTable.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\MessageProcessingContext.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\BaseRequestProcessor.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\MexInstanceContextProvider.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\MultipleMessageFilterMatchesException.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\NavigatorInvalidBodyAccessException.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\OperationInvokerHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\PrefixEndpointAddressMessageFilter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ReplyHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\SecurityHandler.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\SeekableXPathNavigator.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\ServiceThrottle.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\SingletonInstanceContextProvider.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\XPathMessageContext.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\XPathMessageFilter.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\XPathMessageFilterTable.cs" />\r
- <Compile Include="System.ServiceModel.Dispatcher\XPathNavigatorException.cs" />\r
- <Compile Include="System.ServiceModel.MsmqIntegration\MsmqIntegrationBinding.cs" />\r
- <Compile Include="System.ServiceModel.MsmqIntegration\MsmqIntegrationBindingElement.cs" />\r
- <Compile Include="System.ServiceModel.MsmqIntegration\MsmqIntegrationMessageProperty.cs" />\r
- <Compile Include="System.ServiceModel.MsmqIntegration\MsmqIntegrationSecurity.cs" />\r
- <Compile Include="System.ServiceModel.MsmqIntegration\MsmqMessage.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\CustomPeerResolverService.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\IPeerResolverContract.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\PeerCustomResolverSettings.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\PeerReferralPolicy.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\PeerResolverMode.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\PeerResolverSettings.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\RefreshInfo.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\RefreshResponseInfo.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\RefreshResult.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\RegisterInfo.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\RegisterResponseInfo.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\ResolveInfo.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\ResolveResponseInfo.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\ServiceSettingsResponseInfo.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\UnregisterInfo.cs" />\r
- <Compile Include="System.ServiceModel.PeerResolvers\UpdateInfo.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\AuthenticatorCommunicationObject.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\BinarySecretSecurityToken.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\ClaimTypeRequirement.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\CommunicationSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\CommunicationSecurityTokenProvider.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\DerivedKeySecurityToken.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\IIssuanceSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\InitiatorServiceModelSecurityTokenRequirement.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\InternalEncryptedKeyIdentifierClause.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\ISecurityContextSecurityTokenCache.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\IssuedSecurityTokenHandler.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\IssuedSecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\IssuedSecurityTokenProvider.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\IssuedTokenCommunicationObject.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\KerberosSecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\ProviderCommunicationObject.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\RecipientServiceModelSecurityTokenRequirement.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\RenewedSecurityTokenHandler.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\RsaSecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SecureConversationSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SecureConversationSecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SecurityContextSecurityToken.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SecurityContextSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SecurityContextSecurityTokenResolver.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SecurityTokenReferenceStyle.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\ServiceModelSecurityTokenRequirement.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\ServiceModelSecurityTokenTypes.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SpnegoSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SpnegoSecurityTokenProvider.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SslnegoCookieResolver.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SslSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SslSecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SslSecurityTokenProvider.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SspiClientSecurityTokenAuthenticator.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SspiSecurityToken.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SspiSecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SspiSession.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\SupportingTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\TlsClientSession.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\TlsServerSession.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\UserNameSecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\WrappedKeySecurityToken.cs" />\r
- <Compile Include="System.ServiceModel.Security.Tokens\X509SecurityTokenParameters.cs" />\r
- <Compile Include="System.ServiceModel.Security\BasicSecurityProfileVersion.cs" />\r
- <Compile Include="System.ServiceModel.Security\BinarySecretKeyIdentifierClause.cs" />\r
- <Compile Include="System.ServiceModel.Security\ChannelProtectionRequirements.cs" />\r
- <Compile Include="System.ServiceModel.Security\DataProtectionSecurityStateEncoder.cs" />\r
- <Compile Include="System.ServiceModel.Security\ExpiredSecurityTokenException.cs" />\r
- <Compile Include="System.ServiceModel.Security\HttpDigestClientCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\IdentityVerifier.cs" />\r
- <Compile Include="System.ServiceModel.Security\IEndpointIdentityProvider.cs" />\r
- <Compile Include="System.ServiceModel.Security\InfocardInteractiveChannelInitializer.cs" />\r
- <Compile Include="System.ServiceModel.Security\ISecureConversationSession.cs" />\r
- <Compile Include="System.ServiceModel.Security\ISecuritySession.cs" />\r
- <Compile Include="System.ServiceModel.Security\IssuedTokenClientCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\IssuedTokenServiceCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\KeyEntropyMode.cs" />\r
- <Compile Include="System.ServiceModel.Security\KeyNameIdentifierClause.cs" />\r
- <Compile Include="System.ServiceModel.Security\MessagePartSpecification.cs" />\r
- <Compile Include="System.ServiceModel.Security\MessageProtectionOrder.cs" />\r
- <Compile Include="System.ServiceModel.Security\MessageSecurityException.cs" />\r
- <Compile Include="System.ServiceModel.Security\PeerCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\ScopedMessagePartSpecification.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecureConversationServiceCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityAccessDeniedException.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityAlgorithmSuite.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityContextKeyIdentifierClause.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityCredentialsManager.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityMessageProperty.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityNegotiationException.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityStateEncoder.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityTokenAttachmentMode.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityTokenSpecification.cs" />\r
- <Compile Include="System.ServiceModel.Security\SecurityVersion.cs" />\r
- <Compile Include="System.ServiceModel.Security\ServiceCredentialsSecurityTokenManager.cs" />\r
- <Compile Include="System.ServiceModel.Security\SspiSecurityTokenProvider.cs" />\r
- <Compile Include="System.ServiceModel.Security\SupportingTokenSpecification.cs" />\r
- <Compile Include="System.ServiceModel.Security\UnionSecurityTokenResolver.cs" />\r
- <Compile Include="System.ServiceModel.Security\UserNamePasswordClientCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\UserNamePasswordServiceCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\WindowsClientCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\WindowsServiceCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\WSSecurityTokenSerializer.cs" />\r
- <Compile Include="System.ServiceModel.Security\X509CertificateInitiatorClientCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\X509CertificateInitiatorServiceCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\X509CertificateRecipientClientCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\X509CertificateRecipientServiceCredential.cs" />\r
- <Compile Include="System.ServiceModel.Security\X509ClientCertificateAuthentication.cs" />\r
- <Compile Include="System.ServiceModel.Security\X509PeerCertificateAuthentication.cs" />\r
- <Compile Include="System.ServiceModel.Security\X509ServiceCertificateAuthentication.cs" />\r
- <Compile Include="System.ServiceModel\ActionNotSupportedException.cs" />\r
- <Compile Include="System.ServiceModel\AddressAccessDeniedException.cs" />\r
- <Compile Include="System.ServiceModel\AddressAlreadyInUseException.cs" />\r
- <Compile Include="System.ServiceModel\AllEnums.cs" />\r
- <Compile Include="System.ServiceModel\BasicHttpBinding.cs" />\r
- <Compile Include="System.ServiceModel\BasicHttpMessageSecurity.cs" />\r
- <Compile Include="System.ServiceModel\BasicHttpSecurity.cs" />\r
- <Compile Include="System.ServiceModel\CallbackBehaviorAttribute.cs" />\r
- <Compile Include="System.ServiceModel\ChannelFactory.cs" />\r
- <Compile Include="System.ServiceModel\ChannelFactory_1.cs" />\r
- <Compile Include="System.ServiceModel\ClientBase.cs" />\r
- <Compile Include="System.ServiceModel\ClientCredentialsSecurityTokenManager.cs" />\r
- <Compile Include="System.ServiceModel\ClientProxyGenerator.cs" />\r
- <Compile Include="System.ServiceModel\ClientRuntimeChannel.cs" />\r
- <Compile Include="System.ServiceModel\CommunicationException.cs" />\r
- <Compile Include="System.ServiceModel\CommunicationObjectFaultedException.cs" />\r
- <Compile Include="System.ServiceModel\Constants.cs" />\r
- <Compile Include="System.ServiceModel\DataContractFormatAttribute.cs" />\r
- <Compile Include="System.ServiceModel\DefaultCommunicationTimeouts.cs" />\r
- <Compile Include="System.ServiceModel\DeliveryRequirementsAttribute.cs" />\r
- <Compile Include="System.ServiceModel\DnsEndpointIdentity.cs" />\r
- <Compile Include="System.ServiceModel\Dummy.cs" />\r
- <Compile Include="System.ServiceModel\DuplexChannelFactory.cs" />\r
- <Compile Include="System.ServiceModel\DuplexClientBase.cs" />\r
- <Compile Include="System.ServiceModel\EndpointAddress.cs" />\r
- <Compile Include="System.ServiceModel\EndpointAddress10.cs" />\r
- <Compile Include="System.ServiceModel\EndpointAddressAugust2004.cs" />\r
- <Compile Include="System.ServiceModel\EndpointAddressBuilder.cs" />\r
- <Compile Include="System.ServiceModel\EndpointIdentity.cs" />\r
- <Compile Include="System.ServiceModel\EndpointNotFoundException.cs" />\r
- <Compile Include="System.ServiceModel\EnvelopeVersion.cs" />\r
- <Compile Include="System.ServiceModel\ExceptionDetail.cs" />\r
- <Compile Include="System.ServiceModel\ExtensionCollection.cs" />\r
- <Compile Include="System.ServiceModel\FaultCode.cs" />\r
- <Compile Include="System.ServiceModel\FaultContractAttribute.cs" />\r
- <Compile Include="System.ServiceModel\FaultException.cs" />\r
- <Compile Include="System.ServiceModel\FaultException_1.cs" />\r
- <Compile Include="System.ServiceModel\FaultReason.cs" />\r
- <Compile Include="System.ServiceModel\FaultReasonText.cs" />\r
- <Compile Include="System.ServiceModel\FederatedMessageSecurityOverHttp.cs" />\r
- <Compile Include="System.ServiceModel\HttpTransportSecurity.cs" />\r
- <Compile Include="System.ServiceModel\IClientChannel.cs" />\r
- <Compile Include="System.ServiceModel\ICommunicationObject.cs" />\r
- <Compile Include="System.ServiceModel\IContextChannel.cs" />\r
- <Compile Include="System.ServiceModel\IDefaultCommunicationTimeouts.cs" />\r
- <Compile Include="System.ServiceModel\IDuplexClientChannel.cs" />\r
- <Compile Include="System.ServiceModel\IExtensibleObject.cs" />\r
- <Compile Include="System.ServiceModel\IExtension.cs" />\r
- <Compile Include="System.ServiceModel\IExtensionCollection.cs" />\r
- <Compile Include="System.ServiceModel\InstanceContext.cs" />\r
- <Compile Include="System.ServiceModel\InvalidMessageContractException.cs" />\r
- <Compile Include="System.ServiceModel\IServiceChannel.cs" />\r
- <Compile Include="System.ServiceModel\MessageBodyAttribute.cs" />\r
- <Compile Include="System.ServiceModel\MessageContractAttribute.cs" />\r
- <Compile Include="System.ServiceModel\MessageContractMemberAttribute.cs" />\r
- <Compile Include="System.ServiceModel\MessageHeaderArrayAttribute.cs" />\r
- <Compile Include="System.ServiceModel\MessageHeaderAttribute.cs" />\r
- <Compile Include="System.ServiceModel\MessageHeaderException.cs" />\r
- <Compile Include="System.ServiceModel\MessageHeader_1.cs" />\r
- <Compile Include="System.ServiceModel\MessageParameterAttribute.cs" />\r
- <Compile Include="System.ServiceModel\MessagePropertyAttribute.cs" />\r
- <Compile Include="System.ServiceModel\MessageSecurityOverHttp.cs" />\r
- <Compile Include="System.ServiceModel\MessageSecurityOverMsmq.cs" />\r
- <Compile Include="System.ServiceModel\MessageSecurityOverTcp.cs" />\r
- <Compile Include="System.ServiceModel\MessageSecurityVersion.cs" />\r
- <Compile Include="System.ServiceModel\MsmqBindingBase.cs" />\r
- <Compile Include="System.ServiceModel\MsmqException.cs" />\r
- <Compile Include="System.ServiceModel\MsmqPoisonMessageException.cs" />\r
- <Compile Include="System.ServiceModel\MsmqTransportSecurity.cs" />\r
- <Compile Include="System.ServiceModel\NetMsmqBinding.cs" />\r
- <Compile Include="System.ServiceModel\NetMsmqSecurity.cs" />\r
- <Compile Include="System.ServiceModel\NetPeerTcpBinding.cs" />\r
- <Compile Include="System.ServiceModel\NetTcpBinding.cs" />\r
- <Compile Include="System.ServiceModel\NetTcpSecurity.cs" />\r
- <Compile Include="System.ServiceModel\NonDualMessageSecurityOverHttp.cs" />\r
- <Compile Include="System.ServiceModel\OperationBehaviorAttribute.cs" />\r
- <Compile Include="System.ServiceModel\OperationContext.cs" />\r
- <Compile Include="System.ServiceModel\OperationContextScope.cs" />\r
- <Compile Include="System.ServiceModel\OperationContractAttribute.cs" />\r
- <Compile Include="System.ServiceModel\OptionalReliableSession.cs" />\r
- <Compile Include="System.ServiceModel\PeerMessagePropagationMessageFilter.cs" />\r
- <Compile Include="System.ServiceModel\PeerNode.cs" />\r
- <Compile Include="System.ServiceModel\PeerNodeAddress.cs" />\r
- <Compile Include="System.ServiceModel\PeerResolver.cs" />\r
- <Compile Include="System.ServiceModel\PeerResolverImpl.cs" />\r
- <Compile Include="System.ServiceModel\PeerSecuritySettings.cs" />\r
- <Compile Include="System.ServiceModel\PoisonMessageException.cs" />\r
- <Compile Include="System.ServiceModel\ProtocolException.cs" />\r
- <Compile Include="System.ServiceModel\QuotaExceededException.cs" />\r
- <Compile Include="System.ServiceModel\ReliableMessagingVersion.cs" />\r
- <Compile Include="System.ServiceModel\ReliableSession.cs" />\r
- <Compile Include="System.ServiceModel\RsaEndpointIdentity.cs" />\r
- <Compile Include="System.ServiceModel\ServiceAuthorizationManager.cs" />\r
- <Compile Include="System.ServiceModel\ServiceBehaviorAttribute.cs" />\r
- <Compile Include="System.ServiceModel\ServiceContractAttribute.cs" />\r
- <Compile Include="System.ServiceModel\ServiceHost.cs" />\r
- <Compile Include="System.ServiceModel\ServiceHostBase.cs" />\r
- <Compile Include="System.ServiceModel\ServiceHostingEnvironment.cs" />\r
- <Compile Include="System.ServiceModel\ServiceKnownTypeAttribute.cs" />\r
- <Compile Include="System.ServiceModel\ServiceRuntimeChannel.cs" />\r
- <Compile Include="System.ServiceModel\ServiceSecurityContext.cs" />\r
- <Compile Include="System.ServiceModel\SpnEndpointIdentity.cs" />\r
- <Compile Include="System.ServiceModel\TcpTransportSecurity.cs" />\r
- <Compile Include="System.ServiceModel\TransactionProtocol.cs" />\r
- <Compile Include="System.ServiceModel\TransferMode.cs" />\r
- <Compile Include="System.ServiceModel\UnknownMessageReceivedEventArgs.cs" />\r
- <Compile Include="System.ServiceModel\UpnEndpointIdentity.cs" />\r
- <Compile Include="System.ServiceModel\UriSchemeKeyedCollection.cs" />\r
- <Compile Include="System.ServiceModel\WS2007FederationHttpBinding.cs" />\r
- <Compile Include="System.ServiceModel\WS2007HttpBinding.cs" />\r
- <Compile Include="System.ServiceModel\WSDualHttpBinding.cs" />\r
- <Compile Include="System.ServiceModel\WSDualHttpSecurity.cs" />\r
- <Compile Include="System.ServiceModel\WSFederationHttpBinding.cs" />\r
- <Compile Include="System.ServiceModel\WSFederationHttpSecurity.cs" />\r
- <Compile Include="System.ServiceModel\WSHttpBinding.cs" />\r
- <Compile Include="System.ServiceModel\WSHttpBindingBase.cs" />\r
- <Compile Include="System.ServiceModel\WSHttpSecurity.cs" />\r
- <Compile Include="System.ServiceModel\X509CertificateEndpointIdentity.cs" />\r
- <Compile Include="System.ServiceModel\XmlSerializerFormatAttribute.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- <Folder Include="Test\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PostBuildEvent>"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i "$(TargetPath)" /f\r
-"C:\Program Files\Mono-1.2.6\bin\gacutil.bat" -i "$(TargetPath)"</PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>\r
Custom,
}
+#if !NET_4_5
+
public enum X509CertificateValidationMode
{
None,
PeerOrChainTrust,
Custom,
}
+#endif
}
namespace System.ServiceModel.Security.Tokens
var od = cd.Operations.Find (methodName);
if (od == null)
throw new ArgumentException (String.Format ("Operation '{0}' not found in the service contract '{1}' in namespace '{2}'", methodName, cd.Name, cd.Namespace));
- return Inner.Process (od.SyncMethod, methodName, args);
+ return Inner.Process (od.SyncMethod, methodName, args, OperationContext.Current);
}
protected IAsyncResult BeginInvoke (string methodName, object [] args, AsyncCallback callback, object state)
// sync invocation
pl = new object [inmsg.MethodBase.GetParameters ().Length];
Array.Copy (inmsg.Args, pl, inmsg.ArgCount);
- channel.Context = OperationContext.Current;
- ret = channel.Process (inmsg.MethodBase, od.Name, pl);
+ ret = channel.Process (inmsg.MethodBase, od.Name, pl, OperationContext.Current);
method = od.SyncMethod;
} else if (inmsg.MethodBase.Equals (od.BeginMethod)) {
// async invocation
{
ContractDescription Contract { get; }
- OperationContext Context { set; }
-
- object Process (MethodBase method, string operationName, object [] parameters);
+ object Process (MethodBase method, string operationName, object [] parameters, OperationContext context);
IAsyncResult BeginProcess (MethodBase method, string operationName, object [] parameters, AsyncCallback callback, object asyncState);
TimeSpan default_open_timeout, default_close_timeout;
IChannel channel;
IChannelFactory factory;
- OperationContext context;
#region delegates
readonly ProcessDelegate _processDelegate;
- delegate object ProcessDelegate (MethodBase method, string operationName, object [] parameters);
+ delegate object ProcessDelegate (MethodBase method, string operationName, bool isAsync, ref object [] parameters, OperationContext context);
readonly RequestDelegate requestDelegate;
get { return channel as IDuplexChannel; }
}
- public OperationContext Context {
- set { context = value; }
- }
-
#region IClientChannel
bool did_interactive_initialization;
public IAsyncResult BeginProcess (MethodBase method, string operationName, object [] parameters, AsyncCallback callback, object asyncState)
{
- if (context != null)
- throw new InvalidOperationException ("another operation is in progress");
- context = OperationContext.Current;
-
- return _processDelegate.BeginInvoke (method, operationName, parameters, callback, asyncState);
+ var p = parameters;
+ var retval = _processDelegate.BeginInvoke (method, operationName, true, ref p, OperationContext.Current, callback, asyncState);
+ if (p != parameters)
+ throw new InvalidOperationException ();
+ return retval;
}
public object EndProcess (MethodBase method, string operationName, object [] parameters, IAsyncResult result)
{
-
if (result == null)
throw new ArgumentNullException ("result");
if (parameters == null)
throw new ArgumentNullException ("parameters");
- // FIXME: the method arguments should be verified to be
- // identical to the arguments in the corresponding begin method.
- object asyncResult = _processDelegate.EndInvoke (result);
- context = null;
- return asyncResult;
+
+ object[] p = parameters;
+ var retval = _processDelegate.EndInvoke (ref p, result);
+ if (p == parameters)
+ return retval;
+
+ if (p.Length != parameters.Length)
+ throw new InvalidOperationException ();
+ Array.Copy (p, parameters, p.Length);
+ return retval;
}
- public object Process (MethodBase method, string operationName, object [] parameters)
+ public object Process (MethodBase method, string operationName, object [] parameters, OperationContext context)
+ {
+ var p = parameters;
+ var retval = Process (method, operationName, false, ref p, context);
+ if (p != parameters)
+ throw new InvalidOperationException ();
+ return retval;
+ }
+
+ object Process (MethodBase method, string operationName, bool isAsync, ref object [] parameters, OperationContext context)
{
var previousContext = OperationContext.Current;
try {
// Inherit the context from the calling thread
- if (this.context != null)
- OperationContext.Current = this.context;
+ OperationContext.Current = context;
- return DoProcess (method, operationName, parameters);
+ return DoProcess (method, operationName, isAsync, ref parameters, context);
} catch (Exception ex) {
throw;
} finally {
}
}
- object DoProcess (MethodBase method, string operationName, object [] parameters)
+ object DoProcess (MethodBase method, string operationName, bool isAsync, ref object [] parameters, OperationContext context)
{
if (AllowInitializationUI)
DisplayInitializationUI ();
Open ();
if (!od.IsOneWay)
- return Request (od, parameters);
+ return Request (od, isAsync, ref parameters, context);
else {
- Output (od, parameters);
+ Output (od, parameters, context);
return null;
}
}
return od;
}
- void Output (OperationDescription od, object [] parameters)
+ void Output (OperationDescription od, object [] parameters, OperationContext context)
{
ClientOperation op = runtime.Operations [od.Name];
- Send (CreateRequest (op, parameters), OperationTimeout);
+ Send (CreateRequest (op, parameters, context), OperationTimeout);
}
- object Request (OperationDescription od, object [] parameters)
+ object Request (OperationDescription od, bool isAsync, ref object [] parameters, OperationContext context)
{
ClientOperation op = runtime.Operations [od.Name];
object [] inspections = new object [runtime.MessageInspectors.Count];
- Message req = CreateRequest (op, parameters);
+ Message req = CreateRequest (op, parameters, context);
for (int i = 0; i < inspections.Length; i++)
inspections [i] = runtime.MessageInspectors [i].BeforeSendRequest (ref req, this);
for (int i = 0; i < inspections.Length; i++)
runtime.MessageInspectors [i].AfterReceiveReply (ref res, inspections [i]);
- if (op.DeserializeReply)
- return op.Formatter.DeserializeReply (res, parameters);
- else
+ if (!op.DeserializeReply)
return res;
+
+ if (isAsync && od.EndMethod != null) {
+ var endParams = od.EndMethod.GetParameters ();
+ parameters = new object [endParams.Length - 1];
+ }
+
+ return op.Formatter.DeserializeReply (res, parameters);
}
#region Message-based Request() and Send()
}
#endregion
- Message CreateRequest (ClientOperation op, object [] parameters)
+ Message CreateRequest (ClientOperation op, object [] parameters, OperationContext context)
{
MessageVersion version = message_version;
if (version == null)
return client.EndProcess (method, operationName, parameters, result);
}
- public object Process (MethodBase method, string operationName, object [] parameters)
+ public object Process (MethodBase method, string operationName, object [] parameters, OperationContext context)
{
- return client.Process (method, operationName, parameters);
+ return client.Process (method, operationName, parameters, context);
}
}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{05A2DAF1-316D-4350-B07B-B73BE591DE57}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>MonoTests.System.ServiceModel</RootNamespace>\r
- <AssemblyName>System.ServiceModel_test_net_3_0</AssemblyName>\r
- <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>.\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_3_5</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Drawing" />\r
- <Reference Include="System.IdentityModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.IdentityModel.Selectors">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Messaging" />\r
- <Reference Include="System.Runtime.Serialization">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Security" />\r
- <Reference Include="System.ServiceModel">\r
- <RequiredTargetFramework>3.0</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Transactions" />\r
- <Reference Include="System.Web" />\r
- <Reference Include="System.Web.Services" />\r
- <Reference Include="System.Windows.Forms" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="System.ServiceModel_test_net_3_0.dll.config" />\r
- <None Include="Test\config\basicHttpBinding" />\r
- <None Include="Test\config\basicHttpBinding.config" />\r
- <None Include="Test\config\ChangeLog" />\r
- <None Include="Test\config\client.endpoint" />\r
- <None Include="Test\config\client.endpoint.config" />\r
- <None Include="Test\config\client.metadata" />\r
- <None Include="Test\config\client.metadata.config" />\r
- <None Include="Test\config\customBinding" />\r
- <None Include="Test\config\customBinding.config" />\r
- <None Include="Test\config\empty" />\r
- <None Include="Test\config\empty.config" />\r
- <None Include="Test\config\endpointBehaviors" />\r
- <None Include="Test\config\endpointBehaviors.config" />\r
- <None Include="Test\config\extensions" />\r
- <None Include="Test\config\extensions.config" />\r
- <None Include="Test\config\netTcpBinding" />\r
- <None Include="Test\config\netTcpBinding.config" />\r
- <None Include="Test\config\service" />\r
- <None Include="Test\config\service.config" />\r
- <None Include="Test\config\serviceBehaviors" />\r
- <None Include="Test\config\serviceBehaviors.config" />\r
- <None Include="Test\config\test1" />\r
- <None Include="Test\config\test1.config" />\r
- <None Include="Test\config\userBinding" />\r
- <None Include="Test\config\userBinding.config" />\r
- <None Include="Test\config\wsHttpBinding" />\r
- <None Include="Test\config\wsHttpBinding.config" />\r
- <None Include="Test\Resources\test.cer" />\r
- <None Include="Test\Resources\test.pfx" />\r
- <None Include="Test\Resources\test2.pfx" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="Test\FeatureBased\Features.Contracts\OperationContractServer.xml" />\r
- <Content Include="Test\System.ServiceModel.Description\dump.xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="Test\FeatureBased\Features.Client\AsyncCallTesterProxy.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\AsyncPatternServer.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\DataContractTesterProxy.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\ExitProcessHelperServer.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\FaultsTesterProxy.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\KnownTypeTesterProxy.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\MessageContractTesterProxy.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\OperationContractServer.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\PrimitiveTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Client\UntypedMessageTesterProxy.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\AsyncCallTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\AsyncPatternContract.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\DualContract.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\DataContractTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\ExitpProcessHelper.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\FaultsTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\KnownTypeTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\MessageContractTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\OperationContract.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\PrimitiveTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Contracts\UntypedMessageTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\AsyncCallTest.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="Test\FeatureBased\Features.Serialization\AsyncPatternTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\DataContractSerializerTest.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\DualContractTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\ExitProcessHelper.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\FaultsTest.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\KnownTypeTest.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\MessageContractTest.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\OperationContractTester.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\PrimitiveTesterTest.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\UntypedMessageTest.cs" />\r
- <Compile Include="Test\FeatureBased\Features.Serialization\XmlComparer.cs" />\r
- <Compile Include="Test\FeatureBased\TestFixtureBase.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\AddressHeaderTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\AddressingVersionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\AsymmetricSecurityBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\BindingContextTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\BindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\CalcSampleProxy.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\CommunicationObjectTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\CustomBindingTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\DebugBindingElement.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\EmptyFaultExceptionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\EnvelopeVersionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\FaultConverterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\FaultExceptionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\HandlerBodyWriter.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\HandlerTransportBindingElement.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\HttpTransportBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\InterceptorBindingElement.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\InvalidBindingElement.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\LocalClientSecuritySettingsTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\MessageBufferTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\MessageEncoderTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\MessageEncodingBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\MessageHeadersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\MessageHeaderTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\MessageTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\MessageVersionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\MsmqTransportBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\NamedPipeTransportBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\OneWayBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\OutputChannelBase.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\ReplyChannelBase.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\RequestChannelBase.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\SecurityAssert.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\SecurityBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\SslStreamSecurityBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\SymmetricSecurityBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\TcpTransportBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\TextMessageEncodingBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Channels\TransactionFlowBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\AddressHeaderCollectionElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\BasicHttpBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\BehaviorsSectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\BindingsSectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\ChannelEndpointElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\CustomBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\EndpointBehaviorElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\ExtensionsSectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\MetadataElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\MexBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\NetNamedPipeBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\NetPeerTcpBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\NetTcpBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\ServiceBehaviorElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\ServiceElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\ServiceModelConfigurationElementCollectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\ServiceModelSectionGroupTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\StandardBindingCollectionElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\StandardBindingElementCollectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\StandardBindingElementTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Configuration\UserBinding.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\ClientCredentialsTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\ContractDescriptionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\MetadataResolverTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\OperationDescriptionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\ServiceAuthorizationBehaviorTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\ServiceCredentialsTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\ServiceDebugBehaviorTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\ServiceMetadataBehaviorTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\TypedMessageConverterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\WsdlExporterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Description\WsdlImporterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\ActionFilterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\DispatchOperationTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\DispatchRuntimeTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\EndpointAddressMessageFilterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\EndpointDispatcherTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\ExceptionHandlerTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\FilterTableTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\InvalidBodyAccessExceptionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Dispatcher\PrefixEndpointAddressMessageFilterTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.PeerResolvers\CustomPeerResolverServiceTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\IssuedSecurityTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\IssuedSecurityTokenProviderTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\RsaSecurityTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\SecureConversationSecurityTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\SecurityContextSecurityTokenTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\SecurityTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\ServiceModelSecurityTokenTypesTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\SslSecurityTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\SspiSecurityTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\UserNameSecurityTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\WrappedKeySecurityTokenTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\X509ListedCertificateValidator.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security.Tokens\X509SecurityTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\ChannelProtectionRequirementsTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\MessagePartSpecificationTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\ScopedMessagePartSpecificationTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\SecurityAlgorithmSuiteTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\SecurityMessagePropertyTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\SecurityTokenSpeficicationTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\ServiceCredentialsSecurityTokenManagerTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\ServiceSecurityContextTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\SupportingTokenParametersTest.cs" />\r
- <Compile Include="Test\System.ServiceModel.Security\WSSecurityTokenSerializerTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\BasicHttpBindingTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\ChannelFactoryTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\ChannelFactory_1Test.cs" />\r
- <Compile Include="Test\System.ServiceModel\ClientBaseTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\ClientCredentialsSecurityTokenManagerTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\CommonUseCases.cs" />\r
- <Compile Include="Test\System.ServiceModel\EndpointAddress10Test.cs" />\r
- <Compile Include="Test\System.ServiceModel\EndpointAddressBuilderTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\EndpointAddressTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\EndpointBehaviorCollectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\EndpointIdentityTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\FaultCodeTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\FaultReasonTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\IntegratedConnectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\MessageSecurityVersionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\NetMsmqBindingTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\ServiceAssert.cs" />\r
- <Compile Include="Test\System.ServiceModel\ServiceEndpointCollectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\ServiceEndpointTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\ServiceHostBaseTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\ServiceHostTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\SynchronizedReadOnlyCollectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\TransactionProtocolTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\UriSchemeKeyedCollectionTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\WSFederationHttpBindingTest.cs" />\r
- <Compile Include="Test\System.ServiceModel\WSHttpBindingTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\nunit20\framework\nunit.framework.dll20.csproj">\r
- <Project>{83DD7E12-A705-4DBA-9D71-09C8973D9382}</Project>\r
- <Name>nunit.framework.dll20</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\..\nunit20\nunit-console\nunit-console20.csproj">\r
- <Project>{9367EC89-6A38-42BA-9607-0DC288E4BC3A}</Project>\r
- <Name>nunit-console20</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- <Folder Include="Test\FeatureBased\Features.Binding\" />\r
- <Folder Include="Test\FeatureBased\Features.Metadata\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PostBuildEvent>copy $(TargetDir)..\..\nunit20\nunit-console\bin\$(ConfigurationName)\*.exe $(TargetDir)\r
-copy $(TargetDir)..\..\nunit20\nunit-console\bin\$(ConfigurationName)\*.dll $(TargetDir)</PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <ProjectView>ShowAllFiles</ProjectView>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <StartAction>Program</StartAction>\r
- <StartProgram>nunit-console.exe</StartProgram>\r
- <StartArguments>System.ServiceModel_test_net_3_0.dll /out:TestResults.txt</StartArguments>\r
- </PropertyGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.ServiceModel_Test", "System.ServiceModel_Test.csproj", "{05A2DAF1-316D-4350-B07B-B73BE591DE57}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll20", "..\..\nunit20\framework\nunit.framework.dll20.csproj", "{83DD7E12-A705-4DBA-9D71-09C8973D9382}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.dll20", "..\..\nunit20\core\nunit.core.dll20.csproj", "{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.util.dll20", "..\..\nunit20\util\nunit.util.dll20.csproj", "{61CE9CE5-943E-44D4-A381-814DC1406767}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-console20", "..\..\nunit20\nunit-console\nunit-console20.csproj", "{9367EC89-6A38-42BA-9607-0DC288E4BC3A}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwitchMode", "Test\SwitchMode\SwitchMode.csproj", "{59F7BE17-5E8C-4FA3-BC04-56604E2F00F1}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WCFServers", "Test\WCFServers\WCFServers.csproj", "{88AB909A-C341-4639-B99C-729AC1581E7D}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Debug-Strong|Any CPU = Debug-Strong|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Debug-Strong|Any CPU.ActiveCfg = Debug|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Debug-Strong|Any CPU.Build.0 = Debug|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {05A2DAF1-316D-4350-B07B-B73BE591DE57}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Debug-Strong|Any CPU.ActiveCfg = Debug-Strong|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Debug-Strong|Any CPU.Build.0 = Debug-Strong|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {83DD7E12-A705-4DBA-9D71-09C8973D9382}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}.Debug-Strong|Any CPU.ActiveCfg = Debug-Strong|Any CPU\r
- {EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}.Debug-Strong|Any CPU.Build.0 = Debug-Strong|Any CPU\r
- {EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {61CE9CE5-943E-44D4-A381-814DC1406767}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {61CE9CE5-943E-44D4-A381-814DC1406767}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {61CE9CE5-943E-44D4-A381-814DC1406767}.Debug-Strong|Any CPU.ActiveCfg = Debug|Any CPU\r
- {61CE9CE5-943E-44D4-A381-814DC1406767}.Debug-Strong|Any CPU.Build.0 = Debug|Any CPU\r
- {61CE9CE5-943E-44D4-A381-814DC1406767}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {61CE9CE5-943E-44D4-A381-814DC1406767}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {9367EC89-6A38-42BA-9607-0DC288E4BC3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {9367EC89-6A38-42BA-9607-0DC288E4BC3A}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {9367EC89-6A38-42BA-9607-0DC288E4BC3A}.Debug-Strong|Any CPU.ActiveCfg = Debug|Any CPU\r
- {9367EC89-6A38-42BA-9607-0DC288E4BC3A}.Debug-Strong|Any CPU.Build.0 = Debug|Any CPU\r
- {9367EC89-6A38-42BA-9607-0DC288E4BC3A}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {9367EC89-6A38-42BA-9607-0DC288E4BC3A}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {59F7BE17-5E8C-4FA3-BC04-56604E2F00F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {59F7BE17-5E8C-4FA3-BC04-56604E2F00F1}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {59F7BE17-5E8C-4FA3-BC04-56604E2F00F1}.Debug-Strong|Any CPU.ActiveCfg = Debug|Any CPU\r
- {59F7BE17-5E8C-4FA3-BC04-56604E2F00F1}.Debug-Strong|Any CPU.Build.0 = Debug|Any CPU\r
- {59F7BE17-5E8C-4FA3-BC04-56604E2F00F1}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {59F7BE17-5E8C-4FA3-BC04-56604E2F00F1}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {88AB909A-C341-4639-B99C-729AC1581E7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {88AB909A-C341-4639-B99C-729AC1581E7D}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {88AB909A-C341-4639-B99C-729AC1581E7D}.Debug-Strong|Any CPU.ActiveCfg = Debug|Any CPU\r
- {88AB909A-C341-4639-B99C-729AC1581E7D}.Debug-Strong|Any CPU.Build.0 = Debug|Any CPU\r
- {88AB909A-C341-4639-B99C-729AC1581E7D}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {88AB909A-C341-4639-B99C-729AC1581E7D}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Mono.Moonlight.UnitTesting;
-namespace MoonTest.ServiceModel {
+namespace MonoTests.System.ServiceModel.Channels {
[TestClass]
public class CommunicationObjectSyncTest {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.ComponentModel;
using System.ServiceProcess;
using NUnit.Framework;
-namespace Test
+namespace MonoTests.System.ServiceProcess
{
[TestFixture]
public class ServiceBaseTest
/// <summary>
/// Required designer variable.
/// </summary>
- private System.ComponentModel.IContainer components = null;
+ private IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
private void InitializeComponent()
{
- components = new System.ComponentModel.Container();
+ components = new Container();
this.ServiceName = "ServiceFoo";
}
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../ecma.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: BestFitMapping (false)]
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="System"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
{
}
- [MonoTODO ("No TimeoutException is thrown")]
public TransactionScope (TransactionScopeOption option,
TimeSpan timeout)
{
completed = false;
isRoot = false;
nested = 0;
+
+ if (timeout < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException ("timeout");
+
this.timeout = timeout;
oldTransaction = Transaction.CurrentInternal;
public class TransactionScopeTest
{
+ [Test]
+ public void TransactionScopeWithInvalidTimeSpanThrows ()
+ {
+ try {
+ TransactionScope scope = new TransactionScope (TransactionScopeOption.Required, TimeSpan.FromSeconds (-1));
+ Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
+ } catch (ArgumentOutOfRangeException ex) {
+ Assert.AreEqual (ex.ParamName, "timeout");
+ }
+
+ try {
+ TransactionScope scope = new TransactionScope (null, TimeSpan.FromSeconds (-1));
+ Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
+ } catch (ArgumentOutOfRangeException ex) {
+ Assert.AreEqual (ex.ParamName, "timeout");
+ }
+ }
+
[Test]
public void TransactionScopeCommit ()
{
[assembly: NeutralResourcesLanguage ("en-US")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java20</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{54EEEB65-F3A8-4D10-B916-B76A0BDD66CF}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Web.Extensions.Design</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <RootNamespace>System.Web.Extensions.Design</RootNamespace>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;NET_2_0;NET_1_1;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;NET_2_0;NET_1_1;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Consts.cs.in</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="System.Web.Extensions.Design\AsyncPostBackTriggerControlIDConverter.cs" />\r
- <Compile Include="System.Web.Extensions.Design\AsyncPostBackTriggerEventNameConverter.cs" />\r
- <Compile Include="System.Web.Extensions.Design\CollectionEditorBase.cs" />\r
- <Compile Include="System.Web.Extensions.Design\ExtenderControlDesigner.cs" />\r
- <Compile Include="System.Web.Extensions.Design\PostBackTriggerControlIDConverter.cs" />\r
- <Compile Include="System.Web.Extensions.Design\ScriptManagerDesigner.cs" />\r
- <Compile Include="System.Web.Extensions.Design\ScriptManagerProxyDesigner.cs" />\r
- <Compile Include="System.Web.Extensions.Design\TimerDesigner.cs" />\r
- <Compile Include="System.Web.Extensions.Design\UpdatePanelDesigner.cs" />\r
- <Compile Include="System.Web.Extensions.Design\UpdatePanelTriggerCollectionEditor.cs" />\r
- <Compile Include="System.Web.Extensions.Design\UpdateProgressAssociatedUpdatePanelIDConverter.cs" />\r
- <Compile Include="System.Web.Extensions.Design\UpdateProgressDesigner.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86" />\r
- <Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-rt="repository:jre:sun:1.6.0" REFS-JarPath-rt="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system="" REFS-JarPath-system-design="" REFS-RefInfo-system-design="repository:vmw:framework:2.0" REFS-JarPath-system-drawing="" REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-JarPath-system-windows-forms="" REFS-RefInfo-system-windows-forms="repository:vmw:framework:2.0" REFS-JarPath-system-web="" REFS-RefInfo-system-web="repository:vmw:framework:2.0" REFS-JarPath-system-configuration="" REFS-RefInfo-system-configuration="repository:vmw:framework:2.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>\r
[assembly: NeutralResourcesLanguage ("en-US")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{39836A5C-64D0-4801-9493-DEF694338EF5}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Web.Extensions</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <RootNamespace>System.Web.Extensions</RootNamespace>\r
- <StartupObject>\r
- </StartupObject>\r
- <jarserver>ip2</jarserver>\r
- <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <OldToolsVersion>3.5</OldToolsVersion>\r
- <PublishUrl>publish\</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Disk</InstallFrom>\r
- <UpdateEnabled>false</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>false</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA,NET_2_0,TARGET_JVM, TARGET_J2EE,SYSTEM_WEB_EXTENSIONS</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>4194304</BaseAddress>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA,NET_2_0,TARGET_JVM, TARGET_J2EE,SYSTEM_WEB_EXTENSIONS</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>4194304</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-myfaces="repository:vmw:framework:2.0" REFS-JarPath-myfaces="" REFS-RefInfo-rt="repository:jre:sun:1.6.0" REFS-JarPath-rt="" REFS-JarPath-system="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system-configuration="" REFS-RefInfo-system-configuration="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-drawing="" REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-JarPath-system-web="" REFS-RefInfo-system-web="repository:vmw:framework:2.0" REFS-JarPath-system-web-services="" REFS-RefInfo-system-web-services="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <ItemGroup>\r
- <Reference Include="J2SE.Helpers">\r
- <Private>False</Private>\r
- <HintPath>..\lib\J2SE.Helpers.dll</HintPath>\r
- </Reference>\r
- <Reference Include="Mainsoft.Configuration, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">\r
- <HintPath>..\lib\Mainsoft.Configuration.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="myfaces, Version=1.6.65535.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86" />\r
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Assembly\Consts.cs.in</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Assembly\Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>Assembly\MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="..\System.Web\System.Web.Configuration_2.0\MachineKeySectionUtils.cs">\r
- <Link>System.Web.Handlers\MachineKeySectionUtils.cs</Link>\r
- </Compile>\r
- <Compile Include="..\System.Web\System.Web.Handlers\AssemblyResourceLoader.cs">\r
- <Link>System.Web.Handlers\AssemblyResourceLoader.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Web.Configuration\Converter.cs" />\r
- <Compile Include="System.Web.Configuration\ConvertersCollection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingAuthenticationServiceSection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingJsonSerializationSection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingProfileServiceSection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingScriptResourceHandlerSection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingSectionGroup.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingWebServicesSectionGroup.cs" />\r
- <Compile Include="System.Web.Configuration\SystemWebExtensionsSectionGroup.cs" />\r
- <Compile Include="System.Web.Handlers\ScriptModule.cs" />\r
- <Compile Include="System.Web.Handlers\ScriptResourceHandler.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JavaScriptConverter.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JavaScriptSerializer.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JavaScriptTypeResolver.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\CountingTextWriter.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JavaScriptConstructor.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JavaScriptConvert.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JavaScriptParameters.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JavaScriptUtils.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonReader.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonReaderException.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonSerializationException.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonSerializer.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonToken.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonWriter.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonWriterException.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\ReflectionUtils.cs" />\r
- <Compile Include="System.Web.Script.Serialization\ScriptIgnoreAttribute.cs" />\r
- <Compile Include="System.Web.Script.Serialization\SimpleTypeResolver.cs" />\r
- <Compile Include="System.Web.Script.Services\AuthenticationService.cs" />\r
- <Compile Include="System.Web.Script.Services\ClientProxyHandler.cs" />\r
- <Compile Include="System.Web.Script.Services\GenerateScriptTypeAttribute.cs" />\r
- <Compile Include="System.Web.Script.Services\LogicalTypeInfo.cs" />\r
- <Compile Include="System.Web.Script.Services\ProfileService.cs" />\r
- <Compile Include="System.Web.Script.Services\ProxyGenerator.cs" />\r
- <Compile Include="System.Web.Script.Services\ResponseFormat.cs" />\r
- <Compile Include="System.Web.Script.Services\RestHandler.cs" />\r
- <Compile Include="System.Web.Script.Services\ScriptHandlerFactory.cs" />\r
- <Compile Include="System.Web.Script.Services\ScriptMethodAttribute.cs" />\r
- <Compile Include="System.Web.Script.Services\ScriptServiceAttribute.cs" />\r
- <Compile Include="System.Web.UI\AsyncPostBackErrorEventArgs.cs" />\r
- <Compile Include="System.Web.UI\AsyncPostBackTrigger.cs" />\r
- <Compile Include="System.Web.UI\AuthenticationServiceManager.cs" />\r
- <Compile Include="System.Web.UI\ExtenderControl.cs" />\r
- <Compile Include="System.Web.UI\IExtenderControl.cs" />\r
- <Compile Include="System.Web.UI\IScriptControl.cs" />\r
- <Compile Include="System.Web.UI\PostBackTrigger.cs" />\r
- <Compile Include="System.Web.UI\ProfileServiceManager.cs" />\r
- <Compile Include="System.Web.UI\ScriptBehaviorDescriptor.cs" />\r
- <Compile Include="System.Web.UI\ScriptComponentDescriptor.cs" />\r
- <Compile Include="System.Web.UI\ScriptControl.cs" />\r
- <Compile Include="System.Web.UI\ScriptControlDescriptor.cs" />\r
- <Compile Include="System.Web.UI\ScriptDescriptor.cs" />\r
- <Compile Include="System.Web.UI\ScriptManager.cs" />\r
- <Compile Include="System.Web.UI\ScriptManagerProxy.cs" />\r
- <Compile Include="System.Web.UI\ScriptMode.cs" />\r
- <Compile Include="System.Web.UI\ScriptReference.cs" />\r
- <Compile Include="System.Web.UI\ScriptReferenceCollection.cs" />\r
- <Compile Include="System.Web.UI\ScriptReferenceEventArgs.cs" />\r
- <Compile Include="System.Web.UI\ScriptResourceAttribute.cs" />\r
- <Compile Include="System.Web.UI\ServiceReference.cs" />\r
- <Compile Include="System.Web.UI\ServiceReferenceCollection.cs" />\r
- <Compile Include="System.Web.UI\TargetControlTypeAttribute.cs" />\r
- <Compile Include="System.Web.UI\Timer.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanel.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelControlTrigger.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelRenderMode.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelTrigger.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelTriggerCollection.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelUpdateMode.cs" />\r
- <Compile Include="System.Web.UI\UpdateProgress.cs" />\r
- <Compile Include="System.Web.UI\RegisteredArrayDeclaration.cs" />\r
- <Compile Include="System.Web.UI\RegisteredDisposeScript.cs" />\r
- <Compile Include="System.Web.UI\RegisteredExpandoAttribute.cs" />\r
- <Compile Include="System.Web.UI\RegisteredHiddenField.cs" />\r
- <Compile Include="System.Web.UI\RegisteredScript.cs" />\r
- <Compile Include="System.Web.UI\RegisteredScriptType.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\3.5.0.0\3.5.21022.8\MicrosoftAjax.debug.jvm.js">\r
- <Link>Resources\MicrosoftAjax.debug.jvm.js</Link>\r
- <LogicalName>MicrosoftAjax.debug.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\3.5.0.0\3.5.21022.8\MicrosoftAjax.jvm.js">\r
- <Link>Resources\MicrosoftAjax.jvm.js</Link>\r
- <LogicalName>MicrosoftAjax.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\3.5.0.0\3.5.21022.8\MicrosoftAjaxTimer.debug.js">\r
- <Link>Resources\MicrosoftAjaxTimer.debug.js</Link>\r
- <LogicalName>MicrosoftAjaxTimer.debug.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\3.5.0.0\3.5.21022.8\MicrosoftAjaxTimer.js">\r
- <Link>Resources\MicrosoftAjaxTimer.js</Link>\r
- <LogicalName>MicrosoftAjaxTimer.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\3.5.0.0\3.5.21022.8\MicrosoftAjaxWebForms.debug.js">\r
- <Link>Resources\MicrosoftAjaxWebForms.debug.js</Link>\r
- <LogicalName>MicrosoftAjaxWebForms.debug.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\3.5.0.0\3.5.21022.8\MicrosoftAjaxWebForms.js">\r
- <Link>Resources\MicrosoftAjaxWebForms.js</Link>\r
- <LogicalName>MicrosoftAjaxWebForms.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="Resources\MicrosoftAjaxExtension.js">\r
- <LogicalName>MicrosoftAjaxExtension.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="Resources\MicrosoftAjaxWebFormsExtension.js">\r
- <LogicalName>MicrosoftAjaxWebFormsExtension.js</LogicalName>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <PropertyGroup>\r
- <PostBuildEvent></PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\System.Web.Services\System.Web.Services20.csproj">\r
- <Project>{B37A8704-33AB-48D9-B0C2-1D919755B69A}</Project>\r
- <Name>System.Web.Services20</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="..\System.Web\System.Web20.csproj">\r
- <Project>{0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}</Project>\r
- <Name>System.Web20</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Extensions.JavaEE", "System.Web.Extensions.JavaEE.csproj", "{39836A5C-64D0-4801-9493-DEF694338EF5}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web20", "..\System.Web\System.Web20.csproj", "{0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Services20", "..\System.Web.Services\System.Web.Services20.csproj", "{B37A8704-33AB-48D9-B0C2-1D919755B69A}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20_prepare|Any CPU = Debug_Java20_prepare|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20_prepare|Any CPU = Release_Java20_prepare|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Debug_Java20_prepare|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Debug_Java20_prepare|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Debug_Java20|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Release_Java20_prepare|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Release_Java20_prepare|Any CPU.Build.0 = Release_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Release_Java20|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {39836A5C-64D0-4801-9493-DEF694338EF5}.Release_Java20|Any CPU.Build.0 = Release_Java|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java20_prepare|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java20_prepare|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java20_prepare|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java20_prepare|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java20_prepare|Any CPU.ActiveCfg = Debug_Java20_prepare|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java20_prepare|Any CPU.Build.0 = Debug_Java20_prepare|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java20_prepare|Any CPU.ActiveCfg = Release_Java20_prepare|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java20_prepare|Any CPU.Build.0 = Release_Java20_prepare|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{3D36DB5F-6DBC-4B95-8CA0-9B627357C7BD}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Web.Extensions</RootNamespace>\r
- <AssemblyName>System.Web.Extensions</AssemblyName>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;SYSTEM_WEB_EXTENSIONS;NET_2_0;NET_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE;SYSTEM_WEB_EXTENSIONS;NET_2_0;NET_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Drawing" />\r
- <Reference Include="System.Web" />\r
- <Reference Include="System.Web.Services" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs">\r
- <Link>Assembly\Consts.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Assembly\Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>Assembly\MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="..\System.Web\System.Web.Handlers\AssemblyResourceLoader.cs">\r
- <Link>System.Web.Handlers\AssemblyResourceLoader.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Web.Configuration\Converter.cs" />\r
- <Compile Include="System.Web.Configuration\ConvertersCollection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingAuthenticationServiceSection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingJsonSerializationSection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingProfileServiceSection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingScriptResourceHandlerSection.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingSectionGroup.cs" />\r
- <Compile Include="System.Web.Configuration\ScriptingWebServicesSectionGroup.cs" />\r
- <Compile Include="System.Web.Configuration\SystemWebExtensionsSectionGroup.cs" />\r
- <Compile Include="System.Web.Handlers\ScriptModule.cs" />\r
- <Compile Include="System.Web.Handlers\ScriptResourceHandler.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\CountingTextWriter.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JavaScriptConstructor.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Script.Serialization\JSON\JavaScriptConvert.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JavaScriptConverter.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JavaScriptParameters.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JavaScriptSerializer.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JavaScriptTypeResolver.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JavaScriptUtils.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonReader.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonReaderException.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonSerializationException.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonSerializer.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonToken.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonWriter.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\JsonWriterException.cs" />\r
- <Compile Include="System.Web.Script.Serialization\JSON\ReflectionUtils.cs" />\r
- <Compile Include="System.Web.Script.Serialization\ScriptIgnoreAttribute.cs" />\r
- <Compile Include="System.Web.Script.Serialization\SimpleTypeResolver.cs" />\r
- <Compile Include="System.Web.Script.Services\ClientProxyHandler.cs" />\r
- <Compile Include="System.Web.Script.Services\GenerateScriptTypeAttribute.cs" />\r
- <Compile Include="System.Web.Script.Services\LogicalTypeInfo.cs" />\r
- <Compile Include="System.Web.Script.Services\ProfileService.cs" />\r
- <Compile Include="System.Web.Script.Services\ResponseFormat.cs" />\r
- <Compile Include="System.Web.Script.Services\RestHandler.cs" />\r
- <Compile Include="System.Web.Script.Services\ScriptHandlerFactory.cs" />\r
- <Compile Include="System.Web.Script.Services\ScriptMethodAttribute.cs" />\r
- <Compile Include="System.Web.Script.Services\ScriptServiceAttribute.cs" />\r
- <Compile Include="System.Web.UI\AsyncPostBackErrorEventArgs.cs" />\r
- <Compile Include="System.Web.UI\AsyncPostBackTrigger.cs" />\r
- <Compile Include="System.Web.UI\AuthenticationServiceManager.cs" />\r
- <Compile Include="System.Web.UI\ExtenderControl.cs" />\r
- <Compile Include="System.Web.UI\IExtenderControl.cs" />\r
- <Compile Include="System.Web.UI\IScriptControl.cs" />\r
- <Compile Include="System.Web.UI\PostBackTrigger.cs" />\r
- <Compile Include="System.Web.UI\ProfileServiceManager.cs" />\r
- <Compile Include="System.Web.UI\ScriptBehaviorDescriptor.cs" />\r
- <Compile Include="System.Web.UI\ScriptComponentDescriptor.cs" />\r
- <Compile Include="System.Web.UI\ScriptControl.cs" />\r
- <Compile Include="System.Web.UI\ScriptControlDescriptor.cs" />\r
- <Compile Include="System.Web.UI\ScriptDescriptor.cs" />\r
- <Compile Include="System.Web.UI\ScriptManager.cs" />\r
- <Compile Include="System.Web.UI\ScriptManagerProxy.cs" />\r
- <Compile Include="System.Web.UI\ScriptMode.cs" />\r
- <Compile Include="System.Web.UI\ScriptReference.cs" />\r
- <Compile Include="System.Web.UI\ScriptReferenceCollection.cs" />\r
- <Compile Include="System.Web.UI\ScriptReferenceEventArgs.cs" />\r
- <Compile Include="System.Web.UI\ScriptResourceAttribute.cs" />\r
- <Compile Include="System.Web.UI\ServiceReference.cs" />\r
- <Compile Include="System.Web.UI\ServiceReferenceCollection.cs" />\r
- <Compile Include="System.Web.UI\TargetControlTypeAttribute.cs" />\r
- <Compile Include="System.Web.UI\Timer.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanel.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelControlTrigger.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelRenderMode.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelTrigger.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelTriggerCollection.cs" />\r
- <Compile Include="System.Web.UI\UpdatePanelUpdateMode.cs" />\r
- <Compile Include="System.Web.UI\UpdateProgress.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\1.0.61025.0\MicrosoftAjax.debug.js">\r
- <Link>Resources\MicrosoftAjax.debug.js</Link>\r
- <LogicalName>MicrosoftAjax.debug.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\1.0.61025.0\MicrosoftAjax.js">\r
- <Link>Resources\MicrosoftAjax.js</Link>\r
- <LogicalName>MicrosoftAjax.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\1.0.61025.0\MicrosoftAjaxTimer.debug.js">\r
- <Link>Resources\MicrosoftAjaxTimer.debug.js</Link>\r
- <LogicalName>MicrosoftAjaxTimer.debug.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\1.0.61025.0\MicrosoftAjaxTimer.js">\r
- <Link>Resources\MicrosoftAjaxTimer.js</Link>\r
- <LogicalName>MicrosoftAjaxTimer.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\1.0.61025.0\MicrosoftAjaxWebForms.debug.js">\r
- <Link>Resources\MicrosoftAjaxWebForms.debug.js</Link>\r
- <LogicalName>MicrosoftAjaxWebForms.debug.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="..\MicrosoftAjaxLibrary\System.Web.Extensions\1.0.61025.0\MicrosoftAjaxWebForms.js">\r
- <Link>Resources\MicrosoftAjaxWebForms.js</Link>\r
- <LogicalName>MicrosoftAjaxWebForms.js</LogicalName>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>
\ No newline at end of file
rset = new ResourceManager (scriptResourceName, assembly).GetResourceSet (Threading.Thread.CurrentThread.CurrentUICulture, true, true);\r
}\r
catch (MissingManifestResourceException) {\r
-#if TARGET_JVM // GetResourceSet does not throw MissingManifestResourceException if ressource is not exists\r
- }\r
- if (rset == null) {\r
-#endif\r
if (scriptResourceName.EndsWith (".resources", RuntimeHelpers.StringComparison)) {\r
scriptResourceName = scriptResourceName.Substring (0, scriptResourceName.Length - 10);\r
rset = new ResourceManager (scriptResourceName, assembly).GetResourceSet (Threading.Thread.CurrentThread.CurrentUICulture, true, true);\r
}\r
-#if !TARGET_JVM\r
else\r
throw;\r
-#endif\r
}\r
if (rset == null)\r
break;\r
return ConvertToType<T> (DeserializeObjectInternal(input));
}
+ public object Deserialize (string input, Type targetType) {
+ return DeserializeObjectInternal (input);
+ }
+
static object Evaluate (object value) {
return Evaluate (value, false);
}
var ret = new Dictionary <string, object> ();
for (int i = nvc.Count - 1; i >= 0; i--)
- ret.Add (nvc.GetKey (i), JavaScriptSerializer.DefaultSerializer.DeserializeObjectInternal (nvc.Get (i)));
+ ret.Add (nvc.GetKey (i), nvc.Get (i));
return ret;
}
if (url.EndsWith (AuthenticationService.DefaultWebServicePath, StringComparison.Ordinal))
handlerType = typeof(AuthenticationService);
else {
-#if !TARGET_JVM
handlerType = BuildManager.GetCompiledType (url);
-#endif
if (handlerType == null)
handlerType = WebServiceParser.GetCompiledType (url, context);
}
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{ED1876F0-1796-408A-B6B9-1BAAB80FA083}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>SystemWebExtensionsAUT</AssemblyName>\r
- <JDKName>1.6.0</JDKName>\r
- <GHProjectType>3</GHProjectType>\r
- <Version>2.0</Version>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <RootNamespace>SystemWebExtensionsAUT</RootNamespace>\r
- <jarserver>ipa</jarserver>\r
- <ApplicationServerType>tomcat</ApplicationServerType>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin_Java\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>4194304</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <PreCompile>false</PreCompile>\r
- <DeploymentMethod>0</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>4194304</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <PreCompile>true</PreCompile>\r
- <DeploymentMethod>1</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">\r
- <WebProjectProperties>\r
- <UseIIS>True</UseIIS>\r
- <AutoAssignPort>True</AutoAssignPort>\r
- <DevelopmentServerPort>0</DevelopmentServerPort>\r
- <DevelopmentServerVPath>/SystemWebExtensionsAUT</DevelopmentServerVPath>\r
- <IISUrl>\r
- </IISUrl>\r
- <NTLMAuthentication>False</NTLMAuthentication>\r
- </WebProjectProperties>\r
- </FlavorProperties>\r
- <UserProperties REFS-RefInfo-myfaces="repository:vmw:framework:2.0" REFS-JarPath-myfaces="" REFS-RefInfo-System-Web-Extensions="repository:vmw:framework:2.0" REFS-JarPath-System-Web-Extensions="" REFS-RefInfo-system-web-mobile="repository:vmw:framework:2.0" REFS-JarPath-system-web-mobile="" REFS-RefInfo-system-enterpriseservices="repository:vmw:framework:2.0" REFS-JarPath-system-enterpriseservices="" REFS-RefInfo-system-web-services="repository:vmw:framework:2.0" REFS-JarPath-system-web-services="" REFS-RefInfo-system-configuration="repository:vmw:framework:2.0" REFS-JarPath-system-configuration="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-web="repository:vmw:framework:2.0" REFS-JarPath-system-web="" REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-JarPath-system-drawing="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system="" REFS-JarPath-mainsoft-web-aspnetconfig="..\..\..\..\..\..\..\..\Program Files\Mainsoft for Java EE\java_refs\framework\WSAT\Mainsoft.Web.AspnetConfig.jar" REFS-RefInfo-mainsoft-web-aspnetconfig="repository:vmw:framework:2.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <ItemGroup>\r
- <Reference Include="Mainsoft.Web.AspnetConfig, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="myfaces, Version=1.6.65535.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86" />\r
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86" />\r
- <Reference Include="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86" />\r
- <Reference Include="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />\r
- <Reference Include="System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="AjaxClientApp\AjaxScript.aspx" />\r
- <Content Include="AjaxClientApp\AjaxScriptComplete.aspx" />\r
- <Content Include="AjaxClientApp\HelloWorldService.asmx" />\r
- <Content Include="App_Data\Contacts.xml" />\r
- <Content Include="App_Data\SurveyQuestions.xml" />\r
- <Content Include="ArrayTypeExtensions\ArrayMembersSampleCSharp.aspx" />\r
- <Content Include="BooleanTypeExtensions\BooleanParseSampleCSharp.aspx" />\r
- <Content Include="CalendarInCalendarOut.aspx" />\r
- <Content Include="CancelPostback.js" />\r
- <Content Include="ClientEventExample1\ClientEventTest.js" />\r
- <Content Include="ClientEventExample1\default.aspx" />\r
- <Content Include="ClientEventExample2\default.aspx" />\r
- <Content Include="ClientEventExample2\EventSyntax.js" />\r
- <Content Include="ClientPageLifecycleEvents.aspx" />\r
- <Content Include="CustomEvents2\Default.aspx" />\r
- <Content Include="CustomEvents2\Question.js" />\r
- <Content Include="CustomEvents2\Section.js" />\r
- <Content Include="CustomEvents\Default.aspx" />\r
- <Content Include="CustomEvents\Question.js" />\r
- <Content Include="CustomEvents\Section.js" />\r
- <Content Include="EnhancingJavaScript\Enumeration.aspx" />\r
- <Content Include="EnhancingJavaScript\Enumeration.js" />\r
- <Content Include="EnhancingJavaScript\Inheritance.aspx" />\r
- <Content Include="EnhancingJavaScript\Inheritance.js" />\r
- <Content Include="EnhancingJavaScript\Interface.aspx" />\r
- <Content Include="EnhancingJavaScript\Interface.js" />\r
- <Content Include="EnhancingJavaScript\Namespace.aspx" />\r
- <Content Include="EnhancingJavaScript\Namespace.js" />\r
- <Content Include="EnhancingJavaScript\Reflection.aspx" />\r
- <Content Include="ErrorTypeExtensions\ErrorArgumentNullSampleCSharp.aspx" />\r
- <Content Include="ErrorTypeExtensions\ErrorCreateSampleCSharp.aspx" />\r
- <Content Include="ExtenderControlTutorial1\Default.aspx" />\r
- <Content Include="ExtenderControlTutorial1\FocusBehavior.js" />\r
- <Content Include="LocalizingDateTutorial1\localeFormat.aspx" />\r
- <Content Include="NoScriptManager.aspx" />\r
- <Content Include="StopAsynchronousPostback.aspx" />\r
- <Content Include="TwoPanelsProgress.aspx" />\r
- <Content Include="TwoScriptManagers.aspx" />\r
- <Content Include="TwoUpdatePanels.aspx" />\r
- <Content Include="UpdateButtonInside.aspx" />\r
- <Content Include="UpdateButtonOutside.aspx" />\r
- <Content Include="WEB-INF\web.xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="ExtenderControlTutorial1\FocusExtender.cs" />\r
- <Compile Include="IScriptControlTutorial1\SampleTextBox.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="LocalizingClientResourcesWalkthrough\ClientVerification.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
- <Compile Include="System.Web.Configuration\ConfigSectionSample.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Script.Serialization.ScriptIgnoreAttribute\ScriptIgnoreSample.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Script.Serialization.TypeResolver\TypeResolver.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Script.Serialization\ListItemCollectionConverter.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.Controls.Timer.Walkthrough2Panels\Default.aspx.cs">\r
- <DependentUpon>Default.aspx</DependentUpon>\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.Controls.Timer.Walkthrough2Panels\Default.aspx.designer.cs">\r
- <DependentUpon>Default.aspx</DependentUpon>\r
- </Compile>\r
- <Compile Include="System.Web.UI.Controls.Timer.Walkthrough\Default.aspx.cs">\r
- <DependentUpon>Default.aspx</DependentUpon>\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.Controls.Timer.Walkthrough\Default.aspx.designer.cs">\r
- <DependentUpon>Default.aspx</DependentUpon>\r
- </Compile>\r
- <Compile Include="System.Web.UI.ScriptReference\customcontrol.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.UpdatePanel.ContentTemplate\CustomContentTemplate.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.UpdatePanel.CreateContentTemplateContainer\CustomUpdatePanel.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="UpdatePanelTutorialCustom\ProductsView.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="UpdatePanelUserControlTutorial1\Default.aspx.cs">\r
- <DependentUpon>Default.aspx</DependentUpon>\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="UpdatePanelUserControlTutorial1\Default.aspx.designer.cs">\r
- <DependentUpon>Default.aspx</DependentUpon>\r
- </Compile>\r
- <Compile Include="UpdatePanelUserControlTutorial1\EmployeeInfo.ascx.cs">\r
- <DependentUpon>EmployeeInfo.ascx</DependentUpon>\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="UpdatePanelUserControlTutorial1\EmployeeInfo.ascx.designer.cs">\r
- <DependentUpon>EmployeeInfo.ascx</DependentUpon>\r
- </Compile>\r
- <Compile Include="UpdatePanelUserControlTutorial1\EmployeeList.ascx.cs">\r
- <DependentUpon>EmployeeList.ascx</DependentUpon>\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="UpdatePanelUserControlTutorial1\EmployeeList.ascx.designer.cs">\r
- <DependentUpon>EmployeeList.ascx</DependentUpon>\r
- </Compile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="Web.config" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="LocalizingDateTutorial1\web.config" />\r
- <Content Include="LocalizingDateTutorial2\localeFormat.aspx" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="LocalizingDateTutorial2\web.config" />\r
- <Content Include="LocalizingDateTutorial3\localeFormat.aspx" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="LocalizingDateTutorial3\web.config" />\r
- <Content Include="LocalizingDateTutorial4\localeFormat.aspx" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="LocalizingDateTutorial4\web.config" />\r
- <Content Include="MyAuthenticationService\MyAuthenticationService.asmx" />\r
- <Content Include="MyProfileService\MyProfileService.asmx" />\r
- <Content Include="NumberTypeExtensions\NumberParseSampleCSharp.aspx" />\r
- <Content Include="PageRequestManagerOverview1\images\calendar.gif" />\r
- <Content Include="PageRequestManagerOverview1\TicketExampleCS.aspx" />\r
- <Content Include="PartialPageRenderingOverview\PartialPageRenderingOverviewCS.aspx" />\r
- <Content Include="PartialPageRenderingOverview\PartialPageRenderingOverviewSyntaxCS.aspx" />\r
- <Content Include="ResourcesInScriptFile\Default.aspx" />\r
- <Content Include="ResourcesInScriptFile\scripts\CheckAnswer.it-IT.js" />\r
- <Content Include="ResourcesInScriptFile\scripts\CheckAnswer.js" />\r
- <Content Include="SampleAJAXApplication\Employees.aspx" />\r
- <Content Include="StringBuilder\js\JavaScript\StringBuilderOverviewSample.aspx" />\r
- <Content Include="Sys.Application\Default.aspx" />\r
- <Content Include="Sys.Application\HighVis.js" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="System.Web.UI.ScriptReference.Path\Default.aspx" />\r
- <Content Include="System.Web.UI.ScriptReferenceEventArgs\Default.aspx" />\r
- <Content Include="System.Web.UI.ScriptReferenceEventArgs\scripts\CustomScript.js" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="IScriptControlTutorial1\Default.aspx" />\r
- <Content Include="IScriptControlTutorial1\SampleTextBox.js" />\r
- <Content Include="LocalizingClientResourcesWalkthrough\CheckAnswer.js" />\r
- <Content Include="LocalizingClientResourcesWalkthrough\Default.aspx" />\r
- <Content Include="Sys.CultureInfo.CurrentCulture.dateTimeFormat\default.aspx" />\r
- <Content Include="Sys.CultureInfo.CurrentCulture.dateTimeFormat\web.config" />\r
- <Content Include="Sys.CultureInfo.CurrentCulture.numberFormat\default.aspx" />\r
- <Content Include="Sys.CultureInfo.CurrentCulture.numberFormat\web.config" />\r
- <Content Include="Sys.Debug\Default.aspx" />\r
- <Content Include="Sys.EventHandlerList\Default.aspx" />\r
- <Content Include="Sys.EventHandlerList\HoverButton.js" />\r
- <Content Include="Sys.Net.CallWebServiceMethods\CallWebServiceMethods.aspx" />\r
- <Content Include="Sys.Net.CallWebServiceMethods\CallWebServiceMethods.js" />\r
- <Content Include="Sys.Net.CallWebServiceMethods\WebService.asmx" />\r
- <Content Include="Sys.Net.ConnectingEndPoints\ConnectingEndPoints.aspx" />\r
- <Content Include="Sys.Net.ConnectingEndPoints\ConnectingEndPoints.js" />\r
- <Content Include="Sys.Net.ConnectingEndPoints\getTarget.htm" />\r
- <Content Include="Sys.Net.ConnectingEndPoints\postTarget.aspx" />\r
- <Content Include="Sys.Net.ErrorHandlingTutorial\WebService.asmx" />\r
- <Content Include="Sys.Net.ErrorHandlingTutorial\WebServiceMethodError.aspx" />\r
- <Content Include="Sys.Net.ErrorHandlingTutorial\WebServiceMethodError.js" />\r
- <Content Include="Sys.Net.ExchangeComplexTypes\default.aspx" />\r
- <Content Include="Sys.Net.ExchangeComplexTypes\HandleColor.asmx" />\r
- <Content Include="Sys.Net.ExchangeComplexTypes\HandleColor.js" />\r
- <Content Include="Sys.Net.JsonSerialization\ClientDeserializeServerSerialize.aspx" />\r
- <Content Include="Sys.Net.JsonSerialization\ClientSerializeServerDeserialize.aspx" />\r
- <Content Include="Sys.Net.MultipleCallers\multiplecallers.aspx" />\r
- <Content Include="Sys.Net.MultipleCallers\WebService.asmx" />\r
- <Content Include="Sys.Net.MultipleCallers\WebServiceMultipleCallers.js" />\r
- <Content Include="Sys.Net.PageMethod\PageMethod.aspx" />\r
- <Content Include="Sys.Net.PageMethod\PageMethod.js" />\r
- <Content Include="Sys.Net.PassComplexType\default.aspx" />\r
- <Content Include="Sys.Net.PassComplexType\HandleColor.asmx" />\r
- <Content Include="Sys.Net.PassComplexType\HandleColor.js" />\r
- <Content Include="Sys.Net.ReturnComplexType\default.aspx" />\r
- <Content Include="Sys.Net.ReturnComplexType\HandleColor.asmx" />\r
- <Content Include="Sys.Net.ReturnComplexType\HandleColor.js" />\r
- <Content Include="Sys.Net.ServerSupport\default.aspx" />\r
- <Content Include="Sys.Net.ServerSupport\ServerTypes.asmx" />\r
- <Content Include="Sys.Net.ServerSupport\ServerTypes.js" />\r
- <Content Include="Sys.Net.ServerTime\ServerTime.asmx" />\r
- <Content Include="Sys.Net.ServerTime\ServerTime.aspx" />\r
- <Content Include="Sys.Net.SimpleWebService\SimpleWebService.asmx" />\r
- <Content Include="Sys.Net.SimpleWebService\SimpleWebService.aspx" />\r
- <Content Include="Sys.Net.UsingProxyClass\default.aspx" />\r
- <Content Include="Sys.Net.UsingProxyClass\UsingProxyClass.asmx" />\r
- <Content Include="Sys.Net.UsingProxyClass\UsingProxyClass.js" />\r
- <Content Include="Sys.Net.WebRequestManager\getTarget.htm" />\r
- <Content Include="Sys.Net.WebRequestManager\WebRequestManager.aspx" />\r
- <Content Include="Sys.Net.WebRequestManager\WebRequestManager.js" />\r
- <Content Include="Sys.Net.WebRequest\getTarget.htm" />\r
- <Content Include="Sys.Net.WebRequest\postTarget.aspx" />\r
- <Content Include="Sys.Net.WebRequest\webrequest.aspx" />\r
- <Content Include="Sys.Net.WebRequest\WebRequest.js" />\r
- <Content Include="Sys.Net.WebServiceGenerics\default.aspx" />\r
- <Content Include="Sys.Net.WebServiceGenerics\generics.js" />\r
- <Content Include="Sys.Net.WebServiceGenerics\WebService.asmx" />\r
- <Content Include="Sys.Net.WebServiceProxy\WebService.asmx" />\r
- <Content Include="Sys.Net.WebServiceProxy\WebServiceProxy.aspx" />\r
- <Content Include="Sys.Net.WebServiceProxy\WebServiceProxy.js" />\r
- <Content Include="Sys.Net.XmlHttpExecutor\getTarget.htm" />\r
- <Content Include="Sys.Net.XmlHttpExecutor\getTarget.xml" />\r
- <Content Include="Sys.Net.XmlHttpExecutor\XmlHttpExecutor.aspx" />\r
- <Content Include="Sys.Net.XmlHttpExecutor\XmlHttpExecutor.js" />\r
- <Content Include="Sys.Services.AuthenticationServiceTutorial\Authentication.js" />\r
- <Content Include="Sys.Services.AuthenticationServiceTutorial\CreateNewUser.aspx" />\r
- <Content Include="Sys.Services.AuthenticationServiceTutorial\login.aspx" />\r
- <Content Include="Sys.Services.AuthenticationServiceTutorial\secured\Default.aspx" />\r
- <Content Include="Sys.Services.AuthenticationServiceTutorial\secured\Web.config.txt" />\r
- <Content Include="Sys.Services.AuthenticationUserControl\Login.aspx" />\r
- <Content Include="Sys.Services.AuthenticationUserControl\LoginControl.ascx" />\r
- <Content Include="Sys.Services.AuthenticationUserControl\secured\Default.aspx" />\r
- <Content Include="Sys.Services.AuthenticationUserControl\secured\Web.config" />\r
- <Content Include="Sys.Services.ProfileServiceTutorial\login.aspx" />\r
- <Content Include="Sys.Services.ProfileServiceTutorial\Profile.js" />\r
- <Content Include="Sys.Services.ProfileUserControl\LoginProfileControl.ascx" />\r
- <Content Include="Sys.Services.ProfileUserControl\Profile.aspx" />\r
- <Content Include="Sys.UI.DomElement\default.aspx" />\r
- <Content Include="Sys.UI.DomEvent.addHandlers\default.aspx" />\r
- <Content Include="Sys.UI.DomEvent2\default.aspx" />\r
- <Content Include="Sys.UI.DomEvent\default.aspx" />\r
- <Content Include="Sys.WebForms.EndRequestEventArgs\default.aspx" />\r
- <Content Include="Sys.WebForms.PageRequestManager.abortPostBack\PageRequestManager_AbortPostBackCS.aspx" />\r
- <Content Include="Sys.WebForms.PageRequestManager.beginRequest\default.aspx" />\r
- <Content Include="Sys.WebForms.PageRequestManager.endRequest\default.aspx" />\r
- <Content Include="Sys.WebForms.PageRequestManager.initializeRequest\default.aspx" />\r
- <Content Include="Sys.WebForms.PageRequestManager.isInAsyncPostBack\PageRequestManager_isInAsyncPostBack.aspx" />\r
- <Content Include="Sys.WebForms.PageRequestManager.pageLoaded\default.aspx" />\r
- <Content Include="System.Web.Configuration\DefaultDummy.aspx" />\r
- <Content Include="System.Web.Script.Serialization.ScriptIgnoreAttribute\DefaultDummy.aspx" />\r
- <Content Include="System.Web.Script.Serialization.TypeResolver\Default.aspx" />\r
- <Content Include="System.Web.Script.Serialization\Default.aspx" />\r
- <Content Include="System.Web.Script.Serialization\images\spinner.gif" />\r
- <Content Include="System.Web.Script.Services.GenerateScriptTypeAttribute\GenerateScriptTypeSample.asmx" />\r
- <Content Include="System.Web.Script.Services.ScriptMethodAttribute\WebService.asmx" />\r
- <Content Include="System.Web.Script.Services.ScriptServiceAttribute\ScriptServiceSample.asmx" />\r
- <Content Include="System.Web.UI.AsyncPostBackTrigger\AsyncPostBackTriggerCS.aspx" />\r
- <Content Include="System.Web.UI.CompareValidator\UpdatePanelWizardValidatorsCS.aspx" />\r
- <Content Include="System.Web.UI.Controls.Timer.Interval\Default.aspx" />\r
- <Content Include="System.Web.UI.Controls.Timer.Tick\Default.aspx" />\r
- <Content Include="System.Web.UI.Controls.Timer.Walkthrough2Panels\Default.aspx" />\r
- <Content Include="System.Web.UI.Controls.Timer.Walkthrough\Default.aspx" />\r
- <Content Include="System.Web.UI.Controls.Timer\Default.aspx" />\r
- <Content Include="System.WEb.UI.PostBackTrigger\PostBackTriggerCS.aspx" />\r
- <Content Include="System.Web.UI.ScriptManager.AsyncPostBackErrorMessage\ScriptManager_AsyncPostBackErrorMessageCS.aspx" />\r
- <Content Include="System.Web.UI.ScriptManager.EnableScriptGlobalization\default.aspx" />\r
- <Content Include="System.Web.UI.ScriptManager.OnAsyncPostBackError\default.aspx" />\r
- <Content Include="System.Web.UI.ScriptManager.OnAsyncPostBackError\ErrorHandling.js" />\r
- <Content Include="System.Web.UI.ScriptManager.RegisterAsyncPostBackControl\Controls\WebUserControl.ascx" />\r
- <Content Include="System.Web.UI.ScriptManager.RegisterAsyncPostBackControl\ScriptManager1CS.aspx" />\r
- <Content Include="System.Web.UI.ScriptManager.RegisterAsyncPostBackControl\ScriptManager2CS.aspx" />\r
- <Content Include="System.Web.UI.ScriptManager.RegisterClientScriptBlock\App_Data\Contacts.xml" />\r
- <Content Include="System.Web.UI.ScriptManager.RegisterClientScriptBlock\ScriptManager_RegisterClientScriptBlockCS.aspx" />\r
- <Content Include="System.Web.UI.ScriptManager.RegisterClientScriptInclude\ScriptManager_RegisterClientScriptIncludeCS.aspx" />\r
- <Content Include="System.Web.UI.ScriptManager.RegisterClientScriptInclude\scripts\script_alertdiv.js" />\r
- <Content Include="System.Web.UI.ScriptManager.RegisterDataItem\ScriptManagerRegisterDataItemCS.aspx" />\r
- <Content Include="System.Web.UI.ScriptMode\CustomClient.js" />\r
- <Content Include="System.Web.UI.ScriptMode\Default.aspx" />\r
- <Content Include="System.Web.UI.ScriptReference.Path\scripts\UpdatePanelAnimation.js" />\r
- <Content Include="System.Web.UI.ScriptReference\Default.aspx" />\r
- <EmbeddedResource Include="System.Web.UI.ScriptReference\UpdatePanelAnimation.js" />\r
- <Content Include="System.Web.UI.UpdatePanel.Constructor\UpdatePanelConstructorCS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel.ContentTemplate\UpdatePanelContentTemplateCS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel.ContentTemplate\UpdatePanelContentTemplateDynamicCS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel.CreateContentTemplateContainer\UpdatePanelCreateContentTemplateContainerCS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel.RenderMode\UpdatePanelRenderModeCS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel.UpdateMode\UpdatePanelUpdateMode2CS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel.UpdateMode\UpdatePanelUpdateMode3CS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel.UpdateMode\UpdatePanelUpdateModeCS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel\UpdatePanelExample1CS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel\UpdatePanelExample2CS.aspx" />\r
- <Content Include="System.Web.UI.UpdatePanel\UpdatePanelExample3CS.aspx" />\r
- <Content Include="System.Web.UI.UpdateProgress1\default.aspx" />\r
- <Content Include="System.Web.UI.UpdateProgress2\default.aspx" />\r
- <Content Include="System.Web.UI.UpdateProgress3\default.aspx" />\r
- <Content Include="System.Web.UI.UpdateProgress4\default.aspx" />\r
- <Content Include="System.Web.UI.UpdateProgress5\default.aspx" />\r
- <Content Include="System.Web.UI.ValidationSummary2\WizardValidationSummaryCS.aspx" />\r
- <Content Include="System.Web.UI.ValidationSummary\ValidationSummaryCS.aspx" />\r
- <Content Include="UpdatePanelApplicationSample1\images\calendar.gif" />\r
- <Content Include="UpdatePanelApplicationSample1\UpdatePanel1CS.aspx" />\r
- <Content Include="UpdatePanelApplicationSample1\UpdatePanel2CS.aspx" />\r
- <Content Include="UpdatePanelApplicationSample1\UpdatePanel3CS.aspx" />\r
- <Content Include="UpdatePanelApplicationSample1\UpdatePanel4CS.aspx" />\r
- <Content Include="UpdatePanelHowTo10\ErrorHandlingBasicsCS.aspx" />\r
- <Content Include="UpdatePanelHowTo10\ErrorHandlingExampleCS.aspx" />\r
- <Content Include="UpdatePanelHowTo1\UpdatePanelHowToNoUpdatePanel.aspx" />\r
- <Content Include="UpdatePanelHowTo1\UpdatePanelHowToWithUpdatePanel.aspx" />\r
- <Content Include="UpdatePanelHowTo2\Controls\WebUserControl.ascx" />\r
- <Content Include="UpdatePanelHowTo2\UpdatePanelHowTo1CS.aspx" />\r
- <Content Include="UpdatePanelHowTo2\UpdatePanelHowTo2CS.aspx" />\r
- <Content Include="UpdatePanelHowTo3\MasterPageCS.master" />\r
- <Content Include="UpdatePanelHowTo3\UpdatePanelContentPage2CS.aspx" />\r
- <Content Include="UpdatePanelHowTo3\UpdatePanelContentPage3CS.aspx" />\r
- <Content Include="UpdatePanelHowTo3\UpdatePanelContentPageCS.aspx" />\r
- <Content Include="UpdatePanelHowTo3\UpdatePanelContentPageDisablePartialRenderingCS.aspx" />\r
- <Content Include="UpdatePanelHowTo4\UpdatePanelDynamicallyUpdatedCS1.aspx" />\r
- <Content Include="UpdatePanelHowTo4\UpdatePanelDynamicallyUpdatedCS2.aspx" />\r
- <Content Include="UpdatePanelHowTo4\UpdatePanelDynamicallyUpdatedCS3.aspx" />\r
- <Content Include="UpdatePanelHowTo5\UpdatePanelTriggerBasicsCS.aspx" />\r
- <Content Include="UpdatePanelHowTo5\UpdatePanelTriggerExampleCS.aspx" />\r
- <Content Include="UpdatePanelHowTo6\SurveyQuestionsExample.aspx" />\r
- <Content Include="UpdatePanelHowTo7\NewsHeadLineExampleCS.aspx" />\r
- <Content Include="UpdatePanelHowTo7\SimpleExample1CS.aspx" />\r
- <Content Include="UpdatePanelHowTo7\SimpleExample2CS.aspx" />\r
- <Content Include="UpdatePanelHowTo8\SimpleExample1CS.aspx" />\r
- <Content Include="UpdatePanelHowTo8\SimpleExample2CS.aspx" />\r
- <Content Include="UpdatePanelHowTo8\SimpleExample3CS.aspx" />\r
- <Content Include="UpdatePanelHowTo9\ExclusivePostBackBasicsCS.aspx" />\r
- <Content Include="UpdatePanelHowTo9\ExclusivePostBackCS.aspx" />\r
- <Content Include="UpdatePanelTechnologyOverview1\MasterCS.master" />\r
- <Content Include="UpdatePanelTechnologyOverview1\UpdatePanelContentPageCS.aspx" />\r
- <Content Include="UpdatePanelTechnologyOverview1\UpdatePanelCS.aspx" />\r
- <Content Include="UpdatePanelTechnologyOverview1\UpdatePanelNestedCS.aspx" />\r
- <Content Include="UpdatePanelTechnologyOverview1\UpdatePanelProgrammaticallyCS.aspx" />\r
- <Content Include="UpdatePanelTutorial12\default.aspx" />\r
- <Content Include="UpdatePanelTutorial13\default.aspx" />\r
- <Content Include="UpdatePanelTutorial14\default.aspx" />\r
- <Content Include="UpdatePanelTutorial14\ProductQueryScript.js" />\r
- <Content Include="UpdatePanelTutorial14\ProductQueryService.asmx" />\r
- <Content Include="UpdatePanelTutorial15\default.aspx" />\r
- <Content Include="UpdatePanelTutorial15\ProductQueryScript.js" />\r
- <Content Include="UpdatePanelTutorial15\ProductQueryService.asmx" />\r
- <Content Include="UpdatePanelTutorial16\default.aspx" />\r
- <Content Include="UpdatePanelTutorial16\UpdatePanelAnimation.js" />\r
- <Content Include="UpdatePanelTutorial17\CancelPostback.js" />\r
- <Content Include="UpdatePanelTutorial17\default.aspx" />\r
- <Content Include="UpdatePanelTutorial18\default.aspx" />\r
- <Content Include="UpdatePanelTutorial18\PostbackPrecedence.js" />\r
- <Content Include="UpdatePanelTutorial19\default.aspx" />\r
- <Content Include="UpdatePanelTutorial20\default.aspx" />\r
- <Content Include="UpdatePanelTutorialChildTriggers\ChildTriggers.aspx" />\r
- <Content Include="UpdatePanelTutorialCustom\images\awc_jersey_female_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\awc_jersey_male_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\awc_tee_female_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\awc_tee_male_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\awc_tee_male_yellow_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\bikepump_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\bike_lock_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\bike_shoes_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\bike_shorts_female_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\bike_shorts_male_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\chain_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\chain_lube_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\clipless_pedals_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\co2_4tire_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\double_headlight_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\fork_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\frame_black_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\frame_blue_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\frame_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\frame_red_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\frame_silver_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\frame_yellow_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\handlebar_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\handpump_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\hotrodbike_black_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\hotrodbike_blue_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\hotrodbike_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\hotrodbike_f_silver_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\hotrodbike_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\hotrodbike_red_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\hotrodbike_silver_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\hotrodbike_yellow_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\innertube_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_black_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_blue_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_f_black_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_f_blue_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_f_gold_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_f_green_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_f_red_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_gold_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_green_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_red_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_silver_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\julianax_r_02_yellow_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\mb_shoes_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\mb_tires_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\no_image_available_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\pedal_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_black_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_black_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_blue_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_blue_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_green_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_green_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_red_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_silver_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer02_yellow_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer_black_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer_blue_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer_red_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer_silver_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\racer_yellow_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_black_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_blue_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_green_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_green_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_purple_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_purple_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_red_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_red_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_silver_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_yellow_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\roadster_yellow_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\saddle_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\shorts_female_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\shorts_male_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\silver_chain_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\silver_pedal_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\silver_sprocket_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\single_headlight_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\sprocket_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\street_tires_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_black_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_black_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_blue_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_blue_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_metalicgreen_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_metalicgreen_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_red_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_red_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_silver_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_silver_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_yellow_f_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\superlight_yellow_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\tail_lights_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\awc_jersey_female_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\awc_jersey_male_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\awc_tee_female_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\awc_tee_male_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\awc_tee_male_yellow_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\bikepump_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\bike_lock_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\bike_shoes_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\bike_shorts_female_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\bike_shorts_male_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\chain_lube_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\chain_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\clipless_pedals_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\co2_4tire_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\double_headlight_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\fork_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\frame_black_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\frame_blue_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\frame_red_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\frame_silver_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\frame_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\frame_yellow_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\handlebar_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\handpump_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\hotrodbike_black_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\hotrodbike_blue_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\hotrodbike_f_silver_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\hotrodbike_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\hotrodbike_red_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\hotrodbike_silver_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\hotrodbike_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\hotrodbike_yellow_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\innertube_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_black_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_blue_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_f_black_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_f_blue_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_f_gold_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_f_green_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_f_red_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_gold_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_green_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_red_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_silver_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\julianax_r_02_yellow_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\mb_shoes_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\mb_tires_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\no_image_available_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\pedal_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_black_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_black_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_blue_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_blue_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_green_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_green_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_red_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_silver_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer02_yellow_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer_black_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer_blue_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer_red_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer_silver_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\racer_yellow_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_black_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_blue_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_green_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_green_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_purple_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_purple_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_red_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_red_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_silver_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_yellow_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\roadster_yellow_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\saddle_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\shorts_female_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\shorts_male_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\silver_chain_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\silver_pedal_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\silver_sprocket_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\single_headlight_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\sprocket_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\street_tires_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_black_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_black_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_blue_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_blue_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_metalicgreen_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_metalicgreen_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_red_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_red_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_silver_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_silver_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_yellow_f_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\superlight_yellow_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\tail_lights_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\tirepatch_kit_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\water_bottle_cage_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\water_bottle_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\thumbnails\wheel_small.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\tirepatch_kit_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\water_bottle_cage_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\water_bottle_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\images\wheel_large.gif" />\r
- <Content Include="UpdatePanelTutorialCustom\ShowProducts.aspx" />\r
- <Content Include="UpdatePanelTutorialIntro1\default.aspx" />\r
- <Content Include="UpdatePanelTutorialIntro2\default.aspx" />\r
- <Content Include="UpdatePanelTutorialIntro3\default.aspx" />\r
- <Content Include="UpdatePanelTutorialIntro4\default.aspx" />\r
- <Content Include="UpdatePanelTutorialIntro5\default.aspx" />\r
- <Content Include="UpdatePanelTutorialIntro8\default.aspx" />\r
- <Content Include="UpdatePanelTutorialIntro9\default.aspx" />\r
- <Content Include="UpdatePanelTutorialNested\NestedPanels.aspx" />\r
- <Content Include="UpdatePanelTutorialSibling\DataEntry.aspx" />\r
- <Content Include="UpdatePanelUserControlTutorial1\Default.aspx" />\r
- <Content Include="UpdatePanelUserControlTutorial1\EmployeeInfo.ascx" />\r
- <Content Include="UpdatePanelUserControlTutorial1\EmployeeList.ascx" />\r
- <Content Include="UpdatePanelWalkthrough1\DeclarativeMarkupCS.aspx" />\r
- <Content Include="UpdatePanelWalkthrough1\WizardWithoutUpdatePanelCS.aspx" />\r
- <Content Include="UpdatePanelWalkthrough1\WizardWithUpdatePanelCS.aspx" />\r
- <Content Include="UpdatePanelWalkthrough2\SearchResultsWithoutUpdatePanelCS.aspx" />\r
- <Content Include="UpdatePanelWalkthrough2\SearchResultsWithUpdatePanelCS.aspx" />\r
- <Content Include="UpdatePanelWalkthrough2\TriggersDeclarativeMarkupCS.aspx" />\r
- <Content Include="UpdatePanelWalkthrough3\DeclarativeMasterPageCS.master" />\r
- <Content Include="UpdatePanelWalkthrough3\DelcarativeContentPageCS.aspx" />\r
- <Content Include="UpdatePanelWalkthrough3\NorthwindTradersContentPageCS.aspx" />\r
- <Content Include="UpdatePanelWalkthrough3\NorthwindTradersMasterPageCS.master" />\r
- <Content Include="UpdatePanelWalkthrough4\SurveyExampleCS.aspx" />\r
- <Content Include="UpdateProgressOverview1\default.aspx" />\r
- <Content Include="UpdateProgressOverview2\default.aspx" />\r
- <Content Include="UpdateProgressTutorialIntro10\default.aspx" />\r
- <Content Include="UpdateProgressTutorialIntro11\default.aspx" />\r
- <Content Include="UpdateProgressTutorialIntro6\default.aspx" />\r
- <Content Include="UpdateProgressTutorialIntro7\default.aspx" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="LocalizingClientResourcesWalkthrough\VerificationResources.it.resx">\r
- <SubType>Designer</SubType>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="LocalizingClientResourcesWalkthrough\VerificationResources.resx">\r
- <SubType>Designer</SubType>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Content Include="DynamicScriptReferencesHowTo\DynamicScriptReferences1.aspx" />\r
- <Content Include="DynamicScriptReferencesHowTo\DynamicScriptReferences2.aspx" />\r
- <EmbeddedResource Include="DynamicScriptReferencesHowTo\Scripts\Scripts.debug.js" />\r
- <EmbeddedResource Include="DynamicScriptReferencesHowTo\Scripts\Scripts.js" />\r
- <Content Include="Selenium\QuickStarts\DynamicScriptReferencesHowTo\DynamicScriptReferences1.html" />\r
- <Content Include="Selenium\QuickStarts\DynamicScriptReferencesHowTo\DynamicScriptReferences2.html" />\r
- <Content Include="Selenium\QuickStarts\EnhancingJavaScript\Enumeration.html" />\r
- <Content Include="Selenium\QuickStarts\EnhancingJavaScript\Inheritance.html" />\r
- <Content Include="Selenium\QuickStarts\EnhancingJavaScript\Interface.html" />\r
- <Content Include="Selenium\QuickStarts\EnhancingJavaScript\Namespace.html" />\r
- <Content Include="Selenium\QuickStarts\EnhancingJavaScript\Reflection.html" />\r
- <Content Include="Selenium\QuickStarts\ErrorTypeExtensions\ErrorArgumentNullSampleCSharp.html" />\r
- <Content Include="Selenium\QuickStarts\ErrorTypeExtensions\ErrorCreateSampleCSharp.html" />\r
- <Content Include="Selenium\QuickStarts\ExtenderControlTutorial1\Default.html" />\r
- <Content Include="Selenium\QuickStarts\IScriptControlTutorial1\Default.html" />\r
- <Content Include="Selenium\QuickStarts\LocalizingClientResourcesWalkthrough\Default.html" />\r
- <Content Include="Selenium\QuickStarts\LocalizingDateTutorial1\localeFormat.html" />\r
- <Content Include="Selenium\QuickStarts\LocalizingDateTutorial2\localeFormat.html" />\r
- <Content Include="Selenium\QuickStarts\LocalizingDateTutorial3\localeFormat.html" />\r
- <Content Include="Selenium\QuickStarts\LocalizingDateTutorial4\localeFormat.html" />\r
- <Content Include="Selenium\QuickStarts\PartialPageRenderingOverview\PartialPageRenderingOverviewCS.html" />\r
- <Content Include="Selenium\QuickStarts\PartialPageRenderingOverview\PartialPageRenderingOverviewSyntaxCS.html" />\r
- <Content Include="Selenium\QuickStarts\QuickStartTestSuite.html" />\r
- <Content Include="Selenium\QuickStarts\ResourcesInScriptFile\Default.html" />\r
- <Content Include="Selenium\QuickStarts\StringBuilder\StringBuilderOverviewSample.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Application\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.CultureInfo.CurrentCulture.dateTimeFormat\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.CultureInfo.CurrentCulture.numberFormat\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Debug\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.EventHandlerList\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.CallWebServiceMethods\CallWebServiceMethods.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.ConnectingEndPoints\ConnectingEndPoints.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.ErrorHandlingTutorial\WebServiceMethodError.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.ExchangeComplexTypes\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.JsonSerialization\ClientDeserializeServerSerialize.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.JsonSerialization\ClientSerializeServerDeserialize.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.MultipleCallers\multiplecallers.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.PageMethod\PageMethod.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.PassComplexType\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.ReturnComplexType\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.ServerSupport\Default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.ServerTime\ServerTime.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.SimpleWebService\SimpleWebService.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.UsingProxyClass\default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.WebRequestManager\WebRequestManager.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.WebRequest\webrequest.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.WebServiceGenerics\default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.WebServiceProxy\WebServiceProxy.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.Net.XmlHttpExecutor\XmlHttpExecutor.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.UI.DomElement\default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.UI.DomEvent.addHandlers\default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.UI.DomEvent2\default.html" />\r
- <Content Include="Selenium\QuickStarts\Sys.UI.DomEvent\default.html" />\r
- <Content Include="Selenium\Sys.WebForms\PageRequestManager\PageRequestManagerTestSuite.html" />\r
- <Content Include="Selenium\Sys.WebForms\PageRequestManager\TestClientPageLifecycleEvents.html" />\r
- <Content Include="Selenium\Sys.WebForms\PageRequestManager\TestStopAsynchronousPostback.html" />\r
- <Content Include="Selenium\System.Web.UI\UpdatePanel\CallCloseExplorer.html" />\r
- <Content Include="Selenium\System.Web.UI\UpdatePanel\TestCalendarInCalendarOut.html" />\r
- <Content Include="Selenium\System.Web.UI\UpdatePanel\TestNoScriptManager.html" />\r
- <Content Include="Selenium\System.Web.UI\UpdatePanel\TestTwoScriptManagers.html" />\r
- <Content Include="Selenium\System.Web.UI\UpdatePanel\TestUpdateButtonInside.html" />\r
- <Content Include="Selenium\System.Web.UI\UpdatePanel\TestUpdateButtonOutside.html" />\r
- <Content Include="Selenium\System.Web.UI\UpdatePanel\UpdatePanelTestSuite.html" />\r
- <Content Include="Sys.Application\HoverButton.js" />\r
- <Content Include="Sys.Net.XmlHttpExecutor\getTarget.aspx" />\r
- <Content Include="UpdatePanelTutorialIntro8\MasterPage.master" />\r
- <Content Include="UpdatePanelTutorialIntro9\MasterPage.master" />\r
- <Content Include="WEB-INF\faces-config.xml" />\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Web.Extensions.Test</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <RootNamespace>System.Web.Extensions.Test</RootNamespace>\r
- <jarserver>ipa</jarserver>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=1.6.0.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />\r
- <Reference Include="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86" />\r
- <Reference Include="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="System.Web.Script.Serialization\JavaScriptSerializerTest.cs" />\r
- <Compile Include="System.Web.UI\ScriptBehaviorDescriptorTest.cs" />\r
- <Compile Include="System.Web.UI\ScriptComponentDescriptorTest.cs" />\r
- <Compile Include="System.Web.UI\ScriptControlDescriptorTest.cs" />\r
- <Compile Include="System.Web.UI\UpdateProgressTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj">\r
- <Project>{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}</Project>\r
- <Name>nunit.framework.dll20.J2EE</Name>\r
- <Private>False</Private>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-JarPath-system-drawing="" REFS-RefInfo-system-web-extensions="repository:vmw:framework:2.0" REFS-JarPath-system-web-extensions="" REFS-RefInfo-system-web="repository:vmw:framework:2.0" REFS-JarPath-system-web="" REFS-JarPath-system="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.6.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Extensions.Test", "System.Web.Extensions.Test.csproj", "{B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll20.J2EE", "..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj", "{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}.Debug_Java20|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}.Release_Java20|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {B05A102E-5F7E-4DE6-AFAF-B04CA363FD6C}.Release_Java20|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"}, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"}, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Test]
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"});", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"});", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null);", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null);", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null);", script);
-#endif
}
[Test]
scd.AddComponentProperty ("myName2", "myCompId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"}, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"}, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddElementProperty ("myName2", "myElemId2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", "myValue2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":\"myValue2\",\"myName1\":\"myValue1\"}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":\"myValue1\",\"myName2\":\"myValue2\"}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddProperty ("myName2", null);
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddEvent ("myName2", "myHandler2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, null, {\"myName2\":myHandler2,\"myName1\":myHandler1}, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null, $get(\"Element1\"));", script);
-#endif
}
[Category("NotWorking")] // One must not depend on the order of keys in dictionary
scd.AddScriptProperty ("myName2", "myScript2");
string script = scd.DoGetScript ();
-#if TARGET_JVM
- Assert.AreEqual ("$create(My.Type, {\"myName2\":myScript2,\"myName1\":myScript1}, null, null, $get(\"Element1\"));", script);
-#else
Assert.AreEqual ("$create(My.Type, {\"myName1\":myScript1,\"myName2\":myScript2}, null, null, $get(\"Element1\"));", script);
-#endif
}
[Test]
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
-#endif
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
class WSConfig
{
-#if !TARGET_JVM
volatile static WSConfig instance;
-#else
- static WSConfig instance {
- get {
- return (WSConfig)AppDomain.CurrentDomain.GetData("WSConfig.instance");
- }
- set {
- AppDomain.CurrentDomain.SetData("WSConfig.instance", value);
- }
- }
-
-#endif
WSProtocol protocols;
string wsdlHelpPage;
string filePath;
namespace System.Web.Services.Description {
public sealed class ServiceDescriptionCollection : ServiceDescriptionBaseCollection {
-#if !TARGET_JVM //code generation is not supported
ServiceDescriptionImporter importer;
-#endif
#region Constructors
#endregion // Properties
#region Methods
-#if !TARGET_JVM //code generation is not supported
internal void SetImporter (ServiceDescriptionImporter i)
{
importer = i;
}
-#endif
public int Add (ServiceDescription serviceDescription)
{
Insert (Count, serviceDescription);
}
}
- #if !TARGET_JVM
internal class XmlSerializerContract : System.Xml.Serialization.XmlSerializerImplementation
{
System.Collections.Hashtable readMethods = null;
}
}
- #endif
}
#endif
public abstract class SoapTransportImporter {
#region Fields
-#if !TARGET_JVM
static ArrayList transportImporters;
-#else
- static ArrayList transportImporters {
- get {
- return (ArrayList)AppDomain.CurrentDomain.GetData("SoapTransportImporter.transportImporters");
- }
- set {
- AppDomain.CurrentDomain.SetData("SoapTransportImporter.transportImporters", value);
- }
- }
-#endif
SoapProtocolImporter importContext;
#endregion // Fields
string physPath = Path.Combine (path, help);
-#if !TARGET_JVM
if (!File.Exists (physPath))
throw new InvalidOperationException ("Documentation page '" + physPath + "' not found");
-#endif
_pageHandler = PageParser.GetCompiledPageInstance (vpath, physPath, context);
}
if (key == "wsdl") GenerateWsdlDocument (context, req.QueryString ["wsdl"]);
else if (key == "schema") GenerateSchema (context, req.QueryString ["schema"]);
-#if !TARGET_JVM //code generation is not supported
else if (key == "code") GenerateCode (context, req.QueryString ["code"]);
-#else
- else if (key == "code") throw new Exception("Code generation is not supported.");
-#endif
else if (key == "disco") GenerateDiscoDocument (context);
else throw new Exception ("This should never happen");
}
GetSchemas() [di].Write (xtw);
}
-#if !TARGET_JVM
void GenerateCode (HttpContext context, string langId)
{
context.Response.ContentType = "text/plain; charset=utf-8";
return provider;
}
-#endif
internal ServiceDescriptionCollection GetDescriptions ()
{
public abstract void ProcessMessage (SoapMessage message);
-#if !TARGET_JVM
static ArrayList[] globalExtensions;
-#else
- static ArrayList[] globalExtensions {
- get {
- return (ArrayList[])AppDomain.CurrentDomain.GetData("SoapExtension.globalExtensions");
- }
- set {
- AppDomain.CurrentDomain.SetData("SoapExtension.globalExtensions", value);
- }
- }
-#endif
internal static SoapExtension[] CreateExtensionChain (SoapExtensionRuntimeConfig[] extensionConfigs)
{
//
internal class TypeStubManager
{
-#if !TARGET_JVM
static Hashtable type_to_manager;
-#else
- const string type_to_manager_key = "TypeStubManager.type_to_manager";
- static Hashtable type_to_manager {
- get {
- Hashtable hash = (Hashtable)AppDomain.CurrentDomain.GetData(type_to_manager_key);
-
- if (hash != null)
- return hash;
-
- lock(type_to_manager_key) {
- AppDomain.CurrentDomain.SetData(type_to_manager_key, new Hashtable());
- }
-
- return (Hashtable)AppDomain.CurrentDomain.GetData(type_to_manager_key);
- }
- set {
- //do nothing: we manage our type_to_manager per domain
- }
- }
-#endif
static TypeStubManager ()
{
//
WebRequest current_request;
-#if !TARGET_JVM
static HybridDictionary cache;
-#else
- static HybridDictionary cache {
- get {
- return (HybridDictionary)AppDomain.CurrentDomain.GetData("WebClientProtocol.cache");
- }
- set {
- AppDomain.CurrentDomain.SetData("WebClientProtocol.cache", value);
- }
- }
-#endif
#endregion
#region Constructors
#endif
Type type;
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
type = BuildManager.GetCompiledType (url);
#else
type = WebServiceParser.GetCompiledType (fp, context);
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20_prepare|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20_prepare\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;TARGET_JVM;TARGET_J2EE;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <PreCompile>false</PreCompile>\r
- <DeploymentMethod>0</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <UseTestingPage>true</UseTestingPage>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{B37A8704-33AB-48D9-B0C2-1D919755B69A}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Web.Services</RootNamespace>\r
- <AssemblyName>System.Web.Services</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <GHProjectKind>framework</GHProjectKind>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- <jarserver>ip2</jarserver>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <OldToolsVersion>2.0</OldToolsVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;NET_1_1;TARGET_JVM;TARGET_J2EE;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- <MergeExternal>DefaultWsdlHelpGenerator\bin\DefaultWsdlHelpGenerator.jar</MergeExternal>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;TARGET_JVM;TARGET_J2EE;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- <MergeExternal>DefaultWsdlHelpGenerator\bin\DefaultWsdlHelpGenerator.jar</MergeExternal>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;TARGET_JVM;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;NET_1_1;TARGET_JVM;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20_prepare|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20_prepare\</OutputPath>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <PreCompile>false</PreCompile>\r
- <DeploymentMethod>0</DeploymentMethod>\r
- <CompressionLevel>1</CompressionLevel>\r
- <UseTestingPage>true</UseTestingPage>\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>TRACE;NET_1_1;TARGET_JVM;TARGET_J2EE;NET_2_0</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <BaseAddress>285212672</BaseAddress>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.Configuration" />\r
- <Reference Include="System.Xml" />\r
- <Reference Include="J2EE.Helpers">\r
- <Private>False</Private>\r
- <HintPath>..\lib\J2EE.Helpers.dll</HintPath>\r
- </Reference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="System.Web.Services.Configuration\DiagnosticsElement.cs" />\r
- <Compile Include="System.Web.Services.Configuration\PriorityGroup.cs" />\r
- <Compile Include="System.Web.Services.Configuration\ProtocolElement.cs" />\r
- <Compile Include="System.Web.Services.Configuration\ProtocolElementCollection.cs" />\r
- <Compile Include="System.Web.Services.Configuration\SoapEnvelopeProcessingElement.cs" />\r
- <Compile Include="System.Web.Services.Configuration\SoapExtensionTypeElement.cs" />\r
- <Compile Include="System.Web.Services.Configuration\SoapExtensionTypeElementCollection.cs" />\r
- <Compile Include="System.Web.Services.Configuration\TypeElement.cs" />\r
- <Compile Include="System.Web.Services.Configuration\TypeElementCollection.cs" />\r
- <Compile Include="System.Web.Services.Configuration\TypeTypeConverter.cs" />\r
- <Compile Include="System.Web.Services.Configuration\WebServiceProtocols.cs" />\r
- <Compile Include="System.Web.Services.Configuration\WebServicesConfigurationSectionHandler.cs" />\r
- <Compile Include="System.Web.Services.Configuration\WebServicesSection.cs" />\r
- <Compile Include="System.Web.Services.Configuration\WsdlHelpGeneratorElement.cs" />\r
- <Compile Include="System.Web.Services.Configuration\WsiProfilesElement.cs" />\r
- <Compile Include="System.Web.Services.Configuration\WsiProfilesElementCollection.cs" />\r
- <Compile Include="System.Web.Services.Configuration\XmlFormatExtensionAttribute.cs" />\r
- <Compile Include="System.Web.Services.Configuration\XmlFormatExtensionPointAttribute.cs" />\r
- <Compile Include="System.Web.Services.Configuration\XmlFormatExtensionPrefixAttribute.cs" />\r
- <Compile Include="System.Web.Services.Description\BasicProfileChecker.cs" />\r
- <Compile Include="System.Web.Services.Description\BasicProfileViolation.cs" />\r
- <Compile Include="System.Web.Services.Description\BasicProfileViolationCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\BasicProfileViolationEnumerator.cs" />\r
- <Compile Include="System.Web.Services.Description\Binding.cs" />\r
- <Compile Include="System.Web.Services.Description\BindingCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\ConformanceChecker.cs" />\r
- <Compile Include="System.Web.Services.Description\DocumentableItem.cs" />\r
- <Compile Include="System.Web.Services.Description\ExtensionManager.cs" />\r
- <Compile Include="System.Web.Services.Description\FaultBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\FaultBindingCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\HttpAddressBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\HttpBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\HttpGetProtocolReflector.cs" />\r
- <Compile Include="System.Web.Services.Description\HttpOperationBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\HttpPostProtocolReflector.cs" />\r
- <Compile Include="System.Web.Services.Description\HttpSimpleProtocolReflector.cs" />\r
- <Compile Include="System.Web.Services.Description\HttpUrlEncodedBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\HttpUrlReplacementBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\Import.cs" />\r
- <Compile Include="System.Web.Services.Description\ImportCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\InputBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\Message.cs" />\r
- <Compile Include="System.Web.Services.Description\MessageBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\MessageCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\MessagePart.cs" />\r
- <Compile Include="System.Web.Services.Description\MessagePartCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\MimeContentBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\MimeMultipartRelatedBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\MimePart.cs" />\r
- <Compile Include="System.Web.Services.Description\MimePartCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\MimeTextBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\MimeTextMatch.cs" />\r
- <Compile Include="System.Web.Services.Description\MimeTextMatchCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\MimeXmlBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\NamedItem.cs" />\r
- <Compile Include="System.Web.Services.Description\Operation.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationBindingCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationFault.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationFaultCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationFlow.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationInput.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationMessage.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationMessageCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\OperationOutput.cs" />\r
- <Compile Include="System.Web.Services.Description\OutputBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\Port.cs" />\r
- <Compile Include="System.Web.Services.Description\PortCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\PortType.cs" />\r
- <Compile Include="System.Web.Services.Description\PortTypeCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\ProtocolReflector.cs" />\r
- <Compile Include="System.Web.Services.Description\Service.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescription.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionBaseCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionFormatExtension.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionFormatExtensionCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionImportStyle.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionImportWarnings.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionReflector.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionSerializerBase.cs" />\r
- <Compile Include="System.Web.Services.Description\ServiceDescriptionSerializerBase2.cs" />\r
- <Compile Include="System.Web.Services.Description\Soap12AddressBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\Soap12Binding.cs" />\r
- <Compile Include="System.Web.Services.Description\Soap12BodyBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\Soap12FaultBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\Soap12HeaderBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\Soap12OperationBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapAddressBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapBindingStyle.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapBindingUse.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapBodyBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapExtensionReflector.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapFaultBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapHeaderBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapHeaderFaultBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapOperationBinding.cs" />\r
- <Compile Include="System.Web.Services.Description\SoapProtocolReflector.cs" />\r
- <Compile Include="System.Web.Services.Description\Types.cs" />\r
- <Compile Include="System.Web.Services.Description\WebReference.cs" />\r
- <Compile Include="System.Web.Services.Description\WebReferenceCollection.cs" />\r
- <Compile Include="System.Web.Services.Description\WebReferenceOptions.cs" />\r
- <Compile Include="System.Web.Services.Description\WebReferenceOptionsSerializer.cs" />\r
- <Compile Include="System.Web.Services.Description\WebServicesInteroperability.cs" />\r
- <Compile Include="System.Web.Services.Discovery\ContractReference.cs" />\r
- <Compile Include="System.Web.Services.Discovery\ContractSearchPattern.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryClientDocumentCollection.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryClientProtocol.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryClientReferenceCollection.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryClientResult.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryClientResultCollection.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryDocument.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryDocumentLinksPattern.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryDocumentReference.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryDocumentSearchPattern.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryDocumentSerializer.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryExceptionDictionary.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryReference.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryReferenceCollection.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoveryRequestHandler.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DiscoverySearchPattern.cs" />\r
- <Compile Include="System.Web.Services.Discovery\DynamicDiscoveryDocument.cs" />\r
- <Compile Include="System.Web.Services.Discovery\ExcludePathInfo.cs" />\r
- <Compile Include="System.Web.Services.Discovery\SchemaReference.cs" />\r
- <Compile Include="System.Web.Services.Discovery\SoapBinding.cs" />\r
- <Compile Include="System.Web.Services.Discovery\XmlSchemaSearchPattern.cs" />\r
- <Compile Include="System.Web.Services.Protocols\AnyReturnReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\Fault.cs" />\r
- <Compile Include="System.Web.Services.Protocols\Fault12.cs" />\r
- <Compile Include="System.Web.Services.Protocols\Fault12Serializer.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HtmlFormParameterReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HtmlFormParameterWriter.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HttpGetClientProtocol.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Services.Protocols\HttpGetTypeStubInfo.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HttpMethodAttribute.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HttpPostClientProtocol.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Services.Protocols\HttpPostTypeStubInfo.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HttpSimpleClientProtocol.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Services.Protocols\HttpSimpleTypeStubInfo.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HttpSimpleWebServiceHandler.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HttpSoapWebServiceHandler.cs" />\r
- <Compile Include="System.Web.Services.Protocols\HttpWebClientProtocol.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Services.Protocols\InvokeCompletedEventArgs.cs" />\r
- <Compile Include="System.Web.Services.Protocols\InvokeCompletedEventHandler.cs" />\r
- <Compile Include="System.Web.Services.Protocols\LogicalMethodInfo.cs" />\r
- <Compile Include="System.Web.Services.Protocols\LogicalMethodTypes.cs" />\r
- <Compile Include="System.Web.Services.Protocols\MatchAttribute.cs" />\r
- <Compile Include="System.Web.Services.Protocols\Methods.cs" />\r
- <Compile Include="System.Web.Services.Protocols\MimeFormatter.cs" />\r
- <Compile Include="System.Web.Services.Protocols\MimeParameterReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\MimeParameterWriter.cs" />\r
- <Compile Include="System.Web.Services.Protocols\MimeReturnReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\MimeReturnWriter.cs" />\r
- <Compile Include="System.Web.Services.Protocols\NopReturnReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\PatternMatcher.cs" />\r
- <Compile Include="System.Web.Services.Protocols\ServerProtocol.cs" />\r
- <Compile Include="System.Web.Services.Protocols\ServerProtocolFactory.cs" />\r
- <Compile Include="System.Web.Services.Protocols\ServerType.cs" />\r
- <Compile Include="System.Web.Services.Protocols\Soap12FaultCodes.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapClientMessage.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapClientMethod.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapDocumentationHandler.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapDocumentMethodAttribute.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapDocumentServiceAttribute.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapException.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapExtension.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapExtensionAttribute.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapFaultSubcode.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapHeader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapHeaderAttribute.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapHeaderCollection.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapHeaderDirection.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapHeaderException.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapHeaderHandling.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapHeaderMapping.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapHttpClientProtocol.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Services.Protocols\SoapMessage.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapMessageStage.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapParameterStyle.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapProtocolVersion.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapRpcMethodAttribute.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapRpcServiceAttribute.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapServerMessage.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapServerMethod.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapServerProtocol.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapServerProtocolFactory.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapServerType.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapServiceRoutingStyle.cs" />\r
- <Compile Include="System.Web.Services.Protocols\SoapUnknownHeader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\TextReturnReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\TypeStubManager.cs" />\r
- <Compile Include="System.Web.Services.Protocols\UrlEncodedParameterWriter.cs" />\r
- <Compile Include="System.Web.Services.Protocols\UrlParameterReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\UrlParameterWriter.cs" />\r
- <Compile Include="System.Web.Services.Protocols\ValueCollectionParameterReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\WebClientAsyncResult.cs" />\r
- <Compile Include="System.Web.Services.Protocols\WebClientProtocol.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Services.Protocols\WebServiceHandler.cs" />\r
- <Compile Include="System.Web.Services.Protocols\WebServiceHandlerFactory.cs" />\r
- <Compile Include="System.Web.Services.Protocols\WebServiceHelper.cs" />\r
- <Compile Include="System.Web.Services.Protocols\XmlReturnReader.cs" />\r
- <Compile Include="System.Web.Services.Protocols\XmlReturnWriter.cs" />\r
- <Compile Include="System.Web.Services\WebMethodAttribute.cs" />\r
- <Compile Include="System.Web.Services\WebService.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.Services\WebServiceAttribute.cs" />\r
- <Compile Include="System.Web.Services\WebServiceBindingAttribute.cs" />\r
- <Compile Include="System.Web.Services\WebServicesDescriptionAttribute.cs" />\r
- <Compile Include="System.Web.Services\WsiProfiles.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="..\..\build\common\Consts.cs.in">\r
- <Link>Consts.cs.in</Link>\r
- </None>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="System.Web.Services.Description\wsdl-1.1.xsd">\r
- <LogicalName>wsdl-1.1.xsd</LogicalName>\r
- <SubType>Designer</SubType>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="System.Web.Services.Description\web-reference.xsd">\r
- <LogicalName>web-reference.xsd</LogicalName>\r
- <SubType>Designer</SubType>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\System.Web\System.Web20.csproj">\r
- <Project>{0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}</Project>\r
- <Name>System.Web20</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-system-xml="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-system-configuration="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Configuration.jar" REFS-JarPath-system-web="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Web.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <PropertyGroup>\r
- <PostBuildEvent>\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Services20", "System.Web.Services20.csproj", "{B37A8704-33AB-48D9-B0C2-1D919755B69A}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851} = {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}\r
- EndProjectSection\r
-EndProject\r
-Project("{00000000-0000-0000-0000-000000000000}") = "DefaultWsdlHelpGenerator", "DefaultWsdlHelpGenerator\DefaultWsdlHelpGenerator.csproj", "{BC1CF9B3-F696-4988-A4D1-E190CB6D2851}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web20", "..\System.Web\System.Web20.csproj", "{0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20_prepare|Any CPU = Debug_Java20_prepare|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20_prepare|Any CPU = Release_Java20_prepare|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java20_prepare|Any CPU.ActiveCfg = Debug_Java20_prepare|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java20_prepare|Any CPU.Build.0 = Debug_Java20_prepare|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java20_prepare|Any CPU.ActiveCfg = Release_Java20_prepare|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java20_prepare|Any CPU.Build.0 = Release_Java20_prepare|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {B37A8704-33AB-48D9-B0C2-1D919755B69A}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Debug_Java20_prepare|Any CPU.ActiveCfg = Debug_Java20_prepare|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Release_Java20_prepare|Any CPU.ActiveCfg = Release_Java20_prepare|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {BC1CF9B3-F696-4988-A4D1-E190CB6D2851}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java20_prepare|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java20_prepare|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java20_prepare|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java20_prepare|Any CPU.Build.0 = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
#if !NET_4_0
[assembly: AssemblyTrademark("")]
#endif
-#if TARGET_JVM
-[assembly: CLSCompliant(false)]
-#else
[assembly: CLSCompliant(true)]
-#endif
[assembly: ComVisible(false)]
[assembly: AssemblyDefaultAlias("System.Web.dll")]
[assembly: AssemblyInformationalVersion("0.0.0.1")]
[assembly: AllowPartiallyTrustedCallers()]
[assembly: TagPrefix("System.Web.UI.WebControls", "asp")]
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
+++ /dev/null
-//
-// System.Web.Compilation.AppResourceFilesCollection
-//
-// Authors:
-// Marek Habersack (grendello@gmail.com)
-//
-// (C) 2006 Marek Habersack
-//
-
-//
-// 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;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Reflection;
-using System.Resources;
-using System.Web;
-using System.Web.Caching;
-using System.Web.Configuration;
-using System.Web.Util;
-
-namespace System.Web.Compilation
-{
- internal class AppResourcesCompiler
- {
- public AppResourcesCompiler (string path) { }
- public Assembly Compile () { return null; }
- internal static Assembly GetCachedLocalResourcesAssembly (string path)
- {
- string localResourcesPath = UrlUtils.Combine (path, "App_LocalResources");
- return System.Web.J2EE.PageMapper.GetObjectAssembly (HttpContext.Current, localResourcesPath);
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.Compilation.BuildManager
-//
-
-//
-// 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;
-using System.CodeDom;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Web;
-using System.Web.Configuration;
-using System.Web.Hosting;
-
-namespace System.Web.Compilation {
- public sealed class BuildManager {
- // Assemblies built from the App_Code directory
- public static IList CodeAssemblies {
- get { return null; }
- }
-
- internal static IList TopLevelAssemblies {
- get { return null; }
- }
- }
-}
-
-#endif
-
+++ /dev/null
-//
-// System.Web.UI.ThemeDirectoryCompiler
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-// (C) 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.
-//
-
-#if NET_2_0
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Web;
-using System.Web.Compilation;
-using System.Web.Util;
-using System.Web.J2EE;
-
-namespace System.Web.UI
-{
- internal sealed class ThemeDirectoryCompiler
- {
- public static PageTheme GetCompiledInstance (string virtualPath, HttpContext context)
- {
- virtualPath = "~/App_Themes/" + virtualPath + "/";
- string resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPath).TrimEnd('/');
- Type tmpType = PageMapper.GetObjectType (context, resolvedUrl);
- if (tmpType == null)
- throw new InvalidOperationException("ThemeDirectoryCompiler '" + virtualPath + "' not found");
-
- Object obj = Activator.CreateInstance(tmpType);
- return (PageTheme)obj;
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Web.Configuration.AppSettings.jvm.cs
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.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.
-//
-// Copyright (C) 2008 Mainsoft corp. (http://www.mainsoft.com)
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Collections.Specialized;
-using javax.servlet;
-
-namespace System.Web.Configuration
-{
- sealed class KeyValueMergedCollection : NameValueCollection
- {
- readonly NameValueCollection _wrapped;
- public KeyValueMergedCollection (HttpContext hc, NameValueCollection wrapped)
- : base (wrapped) {
- _wrapped = wrapped;
-
- ServletConfig config = (ServletConfig) AppDomain.CurrentDomain.GetData (vmw.common.IAppDomainConfig.SERVLET_CONFIG);
- if (config != null) {
-
- ServletContext context = config.getServletContext ();
-
- for (java.util.Enumeration e = context.getInitParameterNames (); e.hasMoreElements (); ) {
- string key = (string) e.nextElement ();
- Set (key, context.getInitParameter (key));
- }
-
- for (java.util.Enumeration e = config.getInitParameterNames (); e.hasMoreElements (); ) {
- string key = (string) e.nextElement ();
- Set (key, config.getInitParameter (key));
- }
- }
- }
-
- public override void Add (string name, string val) {
- Set (name, val);
- }
-
- public override void Remove (string name) {
- _wrapped.Remove (name);
- base.Remove (name);
- }
-
- public override void Clear () {
- _wrapped.Clear ();
- base.Clear ();
- }
-
- public override void Set (string name, string value) {
- _wrapped.Set (name, value);
- base.Set (name, value);
- }
- }
-}
ConfigurationPropertyOptions.None);
assemblyPostProcessorTypeProp = new ConfigurationProperty ("assemblyPostProcessorType", typeof (string), "");
batchProp = new ConfigurationProperty ("batch", typeof (bool), true);
-#if !TARGET_JVM
buildProvidersProp = new ConfigurationProperty ("buildProviders", typeof (BuildProviderCollection), null,
null, PropertyHelper.DefaultValidator,
ConfigurationPropertyOptions.None);
-#endif
batchTimeoutProp = new ConfigurationProperty ("batchTimeout", typeof (TimeSpan), new TimeSpan (0, 15, 0),
PropertyHelper.TimeSpanSecondsOrInfiniteConverter,
PropertyHelper.PositiveTimeSpanValidator,
properties.Add (assembliesProp);
properties.Add (assemblyPostProcessorTypeProp);
properties.Add (batchProp);
-#if !TARGET_JVM
properties.Add (buildProvidersProp);
-#endif
properties.Add (batchTimeoutProp);
properties.Add (codeSubDirectoriesProp);
properties.Add (compilersProp);
set { base [batchTimeoutProp] = value; }
}
-#if !TARGET_JVM
[ConfigurationProperty ("buildProviders")]
public BuildProviderCollection BuildProviders {
get { return (BuildProviderCollection) base [buildProvidersProp]; }
}
-#endif
[ConfigurationProperty ("codeSubDirectories")]
public CodeSubDirectoriesCollection CodeSubDirectories {
get { return (ClientTargetSection)Sections ["clientTarget"]; }
}
-#if !TARGET_JVM
[ConfigurationProperty ("compilation")]
public CompilationSection Compilation {
get { return (CompilationSection)Sections ["compilation"]; }
}
-#endif
[ConfigurationProperty ("customErrors")]
public CustomErrorsSection CustomErrors {
extra = QueryParamSeparator + "n=" + (notifyScriptLoaded ? "t" : "f");
#endif
-#if TARGET_JVM
- atime = QueryParamSeparator + "t=" + assemblyName.GetHashCode ();
-#else
if (includeTimeStamp) {
if (!String.IsNullOrEmpty (assemblyPath) && File.Exists (assemblyPath))
atime = QueryParamSeparator + "t=" + File.GetLastWriteTimeUtc (assemblyPath).Ticks;
else
atime = QueryParamSeparator + "t=" + DateTime.UtcNow.Ticks;
}
-#endif
string d = HttpUtility.UrlEncode (assemblyNameHash + "_" + resourceNameHash + (debug ? "_t" : "_f"));
string href = HandlerFileName + "?d=" + d + atime + extra;
HttpContext ctx = HttpContext.Current;
//
// http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime.asp
//
-#if TARGET_JVM
- [MonoNotSupported ("")]
-#endif
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static object CreateApplicationHost (Type hostType, string virtualDir, string physicalDir)
{
+++ /dev/null
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Web.J2EE
-{
- internal sealed class J2EEConsts
- {
- public const string SESSION_STATE = "GH_SESSION_STATE";
-
- public const string CLASS_LOADER = "GH_ContextClassLoader";
- public const string SERVLET_CONFIG = "GH_ServletConfig";
- public const string RESOURCE_LOADER = "GH_ResourceLoader";
-
- public const string APP_DOMAIN = "AppDomain";
-
- public const string Enable_Session_Persistency = "EnableSessionPersistency";
-
- //Used to save assemblies.xml file per application.
- public const string ASSEMBLIES_FILE = "AssembliesXml";
-
- //Used to save FileList.xml file per application.
- public const string FILE_LIST_FILE = "FileListXml";
-
- public const string MAP_PATH_CACHE = "MapPathCache";
-
- //Used to save servlet request of current Servlet.
- public const string SERVLET_REQUEST = "GH_ServletRequest";
- //Used to save servlet response of current Servlet.
- public const string SERVLET_RESPONSE = "GH_ServletResponse";
- //Used to save current Servlet.
- public const string CURRENT_SERVLET = "GH_Servlet";
-
- public const string DESERIALIZER_CONST = "GH_DeserializeWorkAround";
- //Used to control file system access in web app context
- public const string FILESYSTEM_ACCESS = "WebFileSystemAccess";
- public const string ACCESS_FULL = "Full";
- public const string ACCESS_VIRTUAL = "Virtual";
-
- public const string ACTION_URL_PREFIX = "ActionURL:";
- public const string RENDER_URL_PREFIX = "RenderURL:";
- }
-}
+++ /dev/null
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Web.Util;
-using System.IO;
-using vmw.@internal.io;
-using vmw.common;
-using System.ComponentModel;
-using System.Threading;
-using javax.servlet;
-using System.Diagnostics;
-
-namespace System.Web.J2EE
-{
- internal static class J2EEUtils
- {
- #region InputStreamWrapper
-
- public sealed class InputStreamWrapper : Stream
- {
- readonly java.io.InputStream _ins;
-
- public InputStreamWrapper (java.io.InputStream ins) {
- _ins = ins;
- }
-
- public override bool CanRead {
- get { return true; }
- }
-
- public override bool CanSeek {
- get { return _ins.markSupported (); }
- }
-
- public override bool CanWrite {
- get { return false; }
- }
-
- public override void Flush () {
- }
-
- public override long Length {
- get { return _ins.available (); }
- }
-
- public override long Position {
- get {
- throw new NotSupportedException ();
- }
- set {
- throw new NotSupportedException ();
- }
- }
-
- public override int Read (byte [] buffer, int offset, int count) {
- int r = _ins.read (TypeUtils.ToSByteArray (buffer), offset, count);
- return r < 0 ? 0 : r;
- }
-
- public override long Seek (long offset, SeekOrigin origin) {
- throw new NotImplementedException ();
- }
-
- public override void SetLength (long value) {
- throw new NotSupportedException ();
- }
-
- public override void Write (byte [] buffer, int offset, int count) {
- throw new NotSupportedException ();
- }
-
- public override void Close () {
- _ins.close ();
- }
- }
-
- #endregion
-
- public static int RunProc(string[] cmd)
- {
- java.lang.Runtime rt = java.lang.Runtime.getRuntime();
- java.lang.Process proc = rt.exec(cmd);
-
- StreamGobbler errorGobbler = new
- StreamGobbler(proc.getErrorStream(), "ERROR");
-
- StreamGobbler outputGobbler = new
- StreamGobbler(proc.getInputStream(), "OUTPUT");
-
- errorGobbler.start();
- outputGobbler.start();
-
- int exitVal = proc.waitFor();
- return exitVal;
- }
- }
-
- public class StreamGobbler : java.lang.Thread
- {
- java.io.InputStream _is;
- String _type;
-
- public StreamGobbler(java.io.InputStream ins, String type)
- {
- this._is = ins;
- this._type = type;
- }
-
- public override void run()
- {
- try
- {
- java.io.InputStreamReader isr = new java.io.InputStreamReader(_is);
- java.io.BufferedReader br = new java.io.BufferedReader(isr);
- String line=null;
- while ( (line = br.readLine()) != null)
- {
- Debug.WriteLine(_type + ">" + line);
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine (ex);
- }
- }
- }
-}
-
-#region FileSystemWatcher Stub
-
-namespace System.IO
-{
- [DefaultEvent ("Changed")]
-#if NET_2_0
- [IODescription ("")]
-#endif
- public class FileSystemWatcher : Component, ISupportInitialize
- {
- public FileSystemWatcher ()
- : this (String.Empty) {
- }
-
- public FileSystemWatcher (string path)
- : this (path, "*.*") {
- }
-
- public FileSystemWatcher (string path, string filter) {
- }
-
- #region Properties
-
- [DefaultValue (false)]
- [IODescription ("Flag to indicate if this instance is active")]
- public bool EnableRaisingEvents {
- get { return false; }
- set { }
- }
-
- [DefaultValue ("*.*")]
- [IODescription ("File name filter pattern")]
- [RecommendedAsConfigurable (true)]
- [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
- public string Filter {
- get { return "*.*"; }
- set { }
- }
-
- [DefaultValue (false)]
- [IODescription ("Flag to indicate we want to watch subdirectories")]
- public bool IncludeSubdirectories {
- get { return false; }
- set { }
- }
-
- [Browsable (false)]
- [DefaultValue (8192)]
- public int InternalBufferSize {
- get { return 8192; }
- set { }
- }
-
- [DefaultValue (NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.LastWrite)]
- [IODescription ("Flag to indicate which change event we want to monitor")]
- public NotifyFilters NotifyFilter {
- get { return NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.LastWrite; }
- set { }
- }
-
- [DefaultValue ("")]
- [IODescription ("The directory to monitor")]
- [RecommendedAsConfigurable (true)]
- [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
- [Editor ("System.Diagnostics.Design.FSWPathEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
- public string Path {
- get { return String.Empty; }
- set { }
- }
-
- [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 null; }
- set { }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override void Dispose (bool disposing) {
- base.Dispose (disposing);
- }
-
- enum EventType
- {
- FileSystemEvent,
- ErrorEvent,
- RenameEvent
- }
-
- void RaiseEvent (Delegate ev, EventArgs arg, EventType evtype) {
- if (ev == null)
- return;
-
- if (SynchronizingObject == null) {
- Delegate [] delegates = ev.GetInvocationList ();
- if (evtype == EventType.RenameEvent) {
- foreach (RenamedEventHandler d in delegates) {
- d.BeginInvoke (this, (RenamedEventArgs) arg, null, null);
- }
- }
- else if (evtype == EventType.ErrorEvent) {
- foreach (ErrorEventHandler d in delegates) {
- d.BeginInvoke (this, (ErrorEventArgs) arg, null, null);
- }
- }
- else {
- foreach (FileSystemEventHandler d in delegates) {
- d.BeginInvoke (this, (FileSystemEventArgs) arg, null, null);
- }
- }
- return;
- }
-
- SynchronizingObject.BeginInvoke (ev, new object [] { this, arg });
- }
-
- protected void OnChanged (FileSystemEventArgs e) {
- RaiseEvent (Changed, e, EventType.FileSystemEvent);
- }
-
- protected void OnCreated (FileSystemEventArgs e) {
- RaiseEvent (Created, e, EventType.FileSystemEvent);
- }
-
- protected void OnDeleted (FileSystemEventArgs e) {
- RaiseEvent (Deleted, e, EventType.FileSystemEvent);
- }
-
- protected void OnError (ErrorEventArgs e) {
- RaiseEvent (Error, e, EventType.ErrorEvent);
- }
-
- protected void OnRenamed (RenamedEventArgs e) {
- RaiseEvent (Renamed, e, EventType.RenameEvent);
- }
-
- public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType) {
- return WaitForChanged (changeType, Timeout.Infinite);
- }
-
- public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType, int timeout) {
- return new WaitForChangedResult ();
- }
-
- #endregion
-
- #region Events and Delegates
-
- [IODescription ("Occurs when a file/directory change matches the filter")]
- public event FileSystemEventHandler Changed;
-
- [IODescription ("Occurs when a file/directory creation matches the filter")]
- public event FileSystemEventHandler Created;
-
- [IODescription ("Occurs when a file/directory deletion matches the filter")]
- public event FileSystemEventHandler Deleted;
-
- [Browsable (false)]
- public event ErrorEventHandler Error;
-
- [IODescription ("Occurs when a file/directory rename matches the filter")]
- public event RenamedEventHandler Renamed;
-
- #endregion // Events and Delegates
-
- #region ISupportInitialize Members
-
- public void BeginInit () {
- }
-
- public void EndInit () {
- }
-
- #endregion
- }
-}
-#endregion
+++ /dev/null
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-// Authors:
-// Vladimir Krasnov <vladimirk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using java.io;
-
-namespace Mainsoft.Web.Hosting
-{
- public sealed class ObjectInputStream : System.IO.Stream, ObjectInput
- {
- readonly ObjectInput _javaObjectInput;
-
- public ObjectInputStream (ObjectInput stream)
- {
- _javaObjectInput = stream;
- }
-
- public override bool CanRead
- {
- get
- {
- return true;
- }
- }
-
- public override bool CanWrite
- {
- get
- {
- return false;
- }
- }
-
- public override bool CanSeek
- {
- get
- {
- return true;
- }
- }
-
- public override long Length
- {
- get
- {
- throw new NotSupportedException ();
- }
- }
-
- public override long Position
- {
- get
- {
- throw new NotSupportedException ();
- }
- set
- {
- throw new NotSupportedException ();
- }
- }
-
- public override void Flush ()
- {
- throw new NotSupportedException ();
- }
-
- public override long Seek (long offset, System.IO.SeekOrigin origin)
- {
- if (origin == System.IO.SeekOrigin.Current)
- return _javaObjectInput.skip (offset);
-
- throw new NotSupportedException ();
- }
-
- public override void SetLength (long value)
- {
- throw new NotSupportedException ();
- }
-
- public override int Read (byte [] buffer, int offset, int count)
- {
- int rv = _javaObjectInput.read (vmw.common.TypeUtils.ToSByteArray (buffer), offset, count);
- return rv > 0 ? rv : 0;
- }
-
- public override void Write (byte [] buffer, int offset, int count)
- {
- throw new NotSupportedException ();
- }
-
- public override int ReadByte ()
- {
- return _javaObjectInput.read ();
- }
-
- public override void Close ()
- {
- _javaObjectInput.close ();
- }
-
- #region ObjectInput Members
-
- public int available ()
- {
- return _javaObjectInput.available ();
- }
-
- public void close ()
- {
- _javaObjectInput.close ();
- }
-
- public int read (sbyte [] __p1, int __p2, int __p3)
- {
- return _javaObjectInput.read (__p1, __p2, __p3);
- }
-
- public int read (sbyte [] __p1)
- {
- return _javaObjectInput.read (__p1);
- }
-
- public int read ()
- {
- return _javaObjectInput.read ();
- }
-
- public object readObject ()
- {
- return _javaObjectInput.readObject ();
- }
-
- public long skip (long __p1)
- {
- return _javaObjectInput.skip (__p1);
- }
-
- #endregion
-
- #region DataInput Members
-
- public bool readBoolean ()
- {
- return _javaObjectInput.readBoolean ();
- }
-
- public sbyte readByte ()
- {
- return _javaObjectInput.readByte ();
- }
-
- public char readChar ()
- {
- return _javaObjectInput.readChar ();
- }
-
- public double readDouble ()
- {
- return _javaObjectInput.readDouble ();
- }
-
- public float readFloat ()
- {
- return _javaObjectInput.readFloat ();
- }
-
- public void readFully (sbyte [] __p1, int __p2, int __p3)
- {
- _javaObjectInput.readFully (__p1, __p2, __p3);
- }
-
- public void readFully (sbyte [] __p1)
- {
- _javaObjectInput.readFully (__p1);
- }
-
- public int readInt ()
- {
- return _javaObjectInput.readInt ();
- }
-
- public string readLine ()
- {
- return _javaObjectInput.readLine ();
- }
-
- public long readLong ()
- {
- return _javaObjectInput.readLong ();
- }
-
- public short readShort ()
- {
- return _javaObjectInput.readShort ();
- }
-
- public string readUTF ()
- {
- return _javaObjectInput.readUTF ();
- }
-
- public int readUnsignedByte ()
- {
- return _javaObjectInput.readUnsignedByte ();
- }
-
- public int readUnsignedShort ()
- {
- return _javaObjectInput.readUnsignedShort ();
- }
-
- public int skipBytes (int __p1)
- {
- return _javaObjectInput.skipBytes (__p1);
- }
-
- #endregion
- }
-
-}
+++ /dev/null
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-// Authors:
-// Vladimir Krasnov <vladimirk@mainsoft.com>
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using java.io;
-
-namespace Mainsoft.Web.Hosting
-{
- public sealed class ObjectOutputStream : System.IO.Stream, ObjectOutput
- {
- readonly ObjectOutput _javaObjectOutput;
-
- public ObjectOutputStream (ObjectOutput stream)
- {
- _javaObjectOutput = stream;
- }
-
- public override bool CanRead
- {
- get
- {
- return false;
- }
- }
-
- public override bool CanSeek
- {
- get
- {
- return false;
- }
- }
-
- public override bool CanWrite
- {
- get
- {
- return true;
- }
- }
-
- public override void Close ()
- {
- _javaObjectOutput.close ();
- }
-
- public override void Flush ()
- {
- _javaObjectOutput.flush ();
- }
-
- public override long Length
- {
- get
- {
- throw new NotSupportedException ();
- }
- }
-
- public override long Position
- {
- get
- {
- throw new NotSupportedException ();
- }
- set
- {
- throw new NotSupportedException ();
- }
- }
-
- public override long Seek (long offset, System.IO.SeekOrigin origin)
- {
- throw new NotSupportedException ();
- }
-
- public override void SetLength (long value)
- {
- throw new NotSupportedException ();
- }
-
- public override int Read (byte [] buffer, int offset, int count)
- {
- throw new NotSupportedException ();
- }
-
- public override void Write (byte [] buffer, int offset, int count)
- {
- _javaObjectOutput.write (vmw.common.TypeUtils.ToSByteArray (buffer), offset, count);
- }
-
- public override void WriteByte (byte value)
- {
- _javaObjectOutput.write (value);
- }
-
- public ObjectOutput NativeStream
- {
- get { return _javaObjectOutput; }
- }
-
- #region ObjectOutput Members
-
- public void close ()
- {
- _javaObjectOutput.close ();
- }
-
- public void flush ()
- {
- _javaObjectOutput.flush ();
- }
-
- public void write (sbyte [] __p1, int __p2, int __p3)
- {
- _javaObjectOutput.write (__p1, __p2, __p3);
- }
-
- public void write (sbyte [] __p1)
- {
- _javaObjectOutput.write (__p1);
- }
-
- public void write (int __p1)
- {
- _javaObjectOutput.write (__p1);
- }
-
- public void writeObject (object __p1)
- {
- _javaObjectOutput.writeObject (__p1);
- }
-
- #endregion
-
- #region DataOutput Members
-
-
- public void writeBoolean (bool __p1)
- {
- _javaObjectOutput.writeBoolean (__p1);
- }
-
- public void writeByte (int __p1)
- {
- _javaObjectOutput.writeByte (__p1);
- }
-
- public void writeBytes (string __p1)
- {
- _javaObjectOutput.writeBytes (__p1);
- }
-
- public void writeChar (int __p1)
- {
- _javaObjectOutput.writeChar (__p1);
- }
-
- public void writeChars (string __p1)
- {
- _javaObjectOutput.writeChars (__p1);
- }
-
- public void writeDouble (double __p1)
- {
- _javaObjectOutput.writeDouble (__p1);
- }
-
- public void writeFloat (float __p1)
- {
- _javaObjectOutput.writeFloat (__p1);
- }
-
- public void writeInt (int __p1)
- {
- _javaObjectOutput.writeInt (__p1);
- }
-
- public void writeLong (long __p1)
- {
- _javaObjectOutput.writeLong (__p1);
- }
-
- public void writeShort (int __p1)
- {
- _javaObjectOutput.writeShort (__p1);
- }
-
- public void writeUTF (string __p1)
- {
- _javaObjectOutput.writeUTF (__p1);
- }
-
- #endregion
- }
-}
+++ /dev/null
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Xml;
-using System.IO;
-using System.Collections;
-using System.Web.Compilation;
-using System.Collections.Specialized;
-using System.Threading;
-using vmw.common;
-using System.Reflection;
-using System.Diagnostics;
-
-namespace System.Web.J2EE
-{
- /// <summary>
- /// Class that allows reading assemblies.xml file for getting information about different types.
- /// </summary>
- public class PageMapper
- {
- //private static readonly string _fileListName = "/filelist.xml";
- static readonly object LOCK_GETASSEMBLIESCACHEDDOCUMENT = new object();
- //private static readonly object LOCK_GETFROMMAPPATHCACHE = new object();
-
-
- static Assembly CurrentDomain_AssemblyResolve (object sender, ResolveEventArgs args)
- {
- Assembly resolvedAssembly = null;
- try
- {
- resolvedAssembly = GetCachedAssembly (HttpContext.Current, String.Concat (HttpContext.Current.Request.ApplicationPath, "/", args.Name));
- }
- catch (Exception ex)
- {
- Debug.WriteLine (ex.ToString ());
- resolvedAssembly = null;
- }
-
- return resolvedAssembly;
- }
-
-#if UNUSED
-
- public static string GetFromMapPathCache(string key)
- {
- Hashtable answer = null;
- lock(LOCK_GETFROMMAPPATHCACHE)
- {
- answer = (Hashtable) AppDomain.CurrentDomain.GetData(J2EEConsts.MAP_PATH_CACHE);
- if (answer == null)
- {
- answer = new Hashtable();
- CachedDocumentTypeStorage storage = (CachedDocumentTypeStorage)GetAssembliesCachedDocument();
- IDictionaryEnumerator e = storage.GetEnumerator();
- e.Reset();
- while (e.MoveNext())
- {
- string currentFile = (string)((DictionaryEntry)e.Current).Key;
- answer[currentFile]= IAppDomainConfig.WAR_ROOT_SYMBOL + currentFile;
- }
- AppDomain.CurrentDomain.SetData(J2EEConsts.MAP_PATH_CACHE,answer);
- }
- }
- return (string)answer[key];
- }
-
- // UNUSED METHOD
- //The method was used by runtime to force file names casesensitivity
- // problem. The filelist.xml file should contain correct file names,
- // but currently it is unused
- public static void LoadFileList()
- {
- Hashtable hashTable = (Hashtable) AppDomain.CurrentDomain.GetData(J2EEConsts.FILE_LIST_FILE);
- if (hashTable == null)
- {
- XmlDocument doc;
- try
- {
- Stream fs = (Stream)IOUtils.getStream(_fileListName);
- if (fs == null)
- {
- AppDomain.CurrentDomain.SetData(J2EEConsts.FILE_LIST_FILE, new Hashtable());
- return;
- }
-
- doc = new XmlDocument();
- doc.Load(fs);
- }
- catch (Exception)
- {
-// Console.WriteLine("filelist.xml was not found!!!");
- AppDomain.CurrentDomain.SetData(J2EEConsts.FILE_LIST_FILE, new Hashtable());
- return;
- }
-// Console.WriteLine("filelist.xml was found!!!");
- if (doc != null && doc.DocumentElement.HasChildNodes)
- {
- hashTable = CollectionsUtil.CreateCaseInsensitiveHashtable();
- XmlNodeList nodeList = doc.DocumentElement.ChildNodes;
- for (int i = 0;i < nodeList.Count ; i++)
- {
- string fileName = nodeList.Item(i).InnerText;
- hashTable.Add(fileName,fileName);
- }
- AppDomain.CurrentDomain.SetData(J2EEConsts.FILE_LIST_FILE, hashTable);
- }
- }
-
- }
-#endif
- static ICachedXmlDoc GetAssembliesCachedDocument(HttpContext context)
- {
- ICachedXmlDoc doc = (ICachedXmlDoc) AppDomain.CurrentDomain.GetData (J2EEConsts.ASSEMBLIES_FILE);
-
- if (doc == null) {
- lock (LOCK_GETASSEMBLIESCACHEDDOCUMENT) {
- doc = (ICachedXmlDoc) AppDomain.CurrentDomain.GetData (J2EEConsts.ASSEMBLIES_FILE);
- if (doc == null) {
- doc = CreateDocument ();
- if (doc != null) {
- AppDomain.CurrentDomain.SetData (J2EEConsts.ASSEMBLIES_FILE, doc);
-
- AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler (CurrentDomain_AssemblyResolve);
- try {
- //Try to load the global resources
- HttpContext.AppGlobalResourcesAssembly = GetCachedAssembly (context, context.Request.ApplicationPath + "/app_globalresources");
- }
- catch (Exception ex) {
- Debug.WriteLine (ex.ToString ());
- }
- }
- }
- }
- }
-
- return doc;
- }
-
- static String NormalizeName(string url)
- {
-#if NET_2_0
- url = System.Web.Util.UrlUtils.RemoveDoubleSlashes(url);
-#endif
- if (url.StartsWith(IAppDomainConfig.WAR_ROOT_SYMBOL, StringComparison.Ordinal))
- url = url.Substring(IAppDomainConfig.WAR_ROOT_SYMBOL.Length);
- return url;
- }
- static ICachedXmlDoc CreateDocument()
- {
- return new CachedDocumentTypeStorage();
- }
-
- public static Type GetObjectType (HttpContext context, string url)
- {
- return GetCachedType(context, NormalizeName(url), true);
- }
-
- public static Type GetObjectType (HttpContext context, string url, bool throwException) {
- return GetCachedType (context, NormalizeName (url), throwException);
- }
-
- public static Assembly GetObjectAssembly (HttpContext context, string url)
- {
- return GetCachedAssembly (context, NormalizeName (url));
- }
- public static string GetAssemblyResource (HttpContext context, string url)
- {
- return GetCachedResource (context, NormalizeName (url));
- }
- static string GetCachedResource (HttpContext context, string url)
- {
- ICachedXmlDoc doc = PageMapper.GetAssembliesCachedDocument(context);
- return doc.GetAssemblyResourceName (context, url);
- }
- static Assembly GetCachedAssembly (HttpContext context, string url)
- {
- ICachedXmlDoc doc = PageMapper.GetAssembliesCachedDocument(context);
- return doc.GetAssembly (context, url);
- }
- static Type GetCachedType (HttpContext context, string url) {
- return GetCachedType (context, url, true);
- }
- static Type GetCachedType (HttpContext context, string url, bool throwException)
- {
- ICachedXmlDoc doc = PageMapper.GetAssembliesCachedDocument(context);
- Type t = doc.GetType(context, url);
- if (t == null && throwException)
- throw new HttpException(404,"The requested resource (" + url + ") is not available.");
-
- return t;
- }
-
- #region ICachedXmlDoc interface
- interface ICachedXmlDoc
- {
- Type GetType (HttpContext context, string key);
- Assembly GetAssembly (HttpContext context, string key);
- string GetAssemblyResourceName (HttpContext context, string key);
- }
- #endregion
-
- #region CachedDocumentTypeStorage class
- class CachedDocumentTypeStorage : ICachedXmlDoc
- {
- static readonly object _fuse = new object();
- public static readonly ICachedXmlDoc DEFAULT_DOC =
- new CachedDocumentTypeStorage(0);
-
- static readonly int DEFAULT_PAGES_NUMBER = 25;
-
- Hashtable _table;
-
- CachedDocumentTypeStorage(int initTableSize)
- {
- _table = Hashtable.Synchronized(new Hashtable(initTableSize));
- }
-
- public CachedDocumentTypeStorage() :
- this(DEFAULT_PAGES_NUMBER)
- {}
-
- string ICachedXmlDoc.GetAssemblyResourceName (HttpContext context, string o)
- {
- MetaProvider p = GetMetaByURL (context, o);
- if (p == null)
- return null;
- return p.Resource;
- }
- Type ICachedXmlDoc.GetType (HttpContext context, string o)
- {
- MetaProvider p = GetMetaByURL (context, o);
- if (p == null)
- return null;
- return p.Type;
- }
- Assembly ICachedXmlDoc.GetAssembly (HttpContext context, string o)
- {
- MetaProvider p = GetMetaByURL (context, o);
- if (p == null)
- return null;
- return p.Assembly;
- }
-
- internal IDictionaryEnumerator GetEnumerator()
- {
- return _table.GetEnumerator();
- }
-
- //rewamped for perfomance reasons
- //It looks like issue is not important in development mode,
- //but only will became important in production mode when dynamyc compilation will be enabled
- //Anyway, locking whole table and compiling under lock looks odd
- //spivak.December 07 2006
- //
- //prevent DOS attack. dont cache MetaProvider for not valid resource
- //igorz. May 16 2007
- public MetaProvider GetMetaByURL(HttpContext context, string url)
- {
- string lwUrl = url.ToLowerInvariant ();
- MetaProvider retVal = (MetaProvider) _table [lwUrl];
- if (retVal == null) {
- retVal = PageCompiler.GetCompiler (context, url);
- if (retVal.Type == null && retVal.Assembly == null)
- return null;
- _table [lwUrl] = retVal;
- }
-
- return retVal;
- }
- }
-
-
- #endregion
- }
-
- public interface MetaProvider
- {
- Type Type { get;}
- Assembly Assembly {get;}
- string Resource { get;}
- }
- public class PageCompiler : MetaProvider
- {
- static readonly string PAGE_XPATH = "preserve";
- static readonly string ASSEM_ATTRIB_NAME = "assem";
- static readonly string TYPE_ATTRIB_NAME = "type";
- static string _parser = null;
-
- Type _type = null;
- string _typeName = null;
- Assembly _assembly = null;
- string _origAssemblyName = null;
- string _xmlDescriptor = null;
- string _url = null;
- string _session = null;
- readonly HttpContext _context;
-
- PageCompiler(HttpContext context, string url)
- {
- _url = url;
- _context = context;
- _xmlDescriptor = GetDescFromUrl();
- _session = DateTime.Now.Ticks.ToString();
- LoadTypeAndAssem();
- }
-
- public static PageCompiler GetCompiler(HttpContext context, string url)
- {
- return new PageCompiler(context, url);
- }
-
- Type MetaProvider.Type
- {
- get{
- return _type;
- }
- }
- Assembly MetaProvider.Assembly
- {
- get{
- return _assembly;
- }
- }
- string MetaProvider.Resource
- {
- get
- {
- return _origAssemblyName != null ? _origAssemblyName + ".ghres" : "dll.ghres";
- }
- }
- void LoadTypeAndAssem()
- {
- if (_assembly == null)
- {
- string typeName = GetCachedTypeName();
- Debug.WriteLine ("Loading type:" + typeName);
- if (typeName != null)
- {
- if ((_type = Type.GetType (typeName)) != null)
- _assembly = _type.Assembly;
- else {
- if (_origAssemblyName == null)
- throw new TypeLoadException ("Cannot load type '" + typeName + "'");
- _assembly = Assembly.Load (_origAssemblyName);
- }
- }
-
- Debug.WriteLine ("Loaded type:" + _type);
- Debug.WriteLine ("Loaded assembly:" + _assembly);
- }
- }
- bool InternalCompile()
- {
- string fileName = VirtualPathUtility.GetFileName (_url);
-
- string fullFileName = (fileName.ToLower () == "global.asax") ? _url : _context.Request.MapPath (_url);
- Debug.WriteLine ("fullFileName=" + fullFileName);
- //type not found - run aspxparser
- if (false/*File.Exists(fullFileName) || Directory.Exists(fullFileName)*/) //dynamic compilation currently is not supported
- {
- string[] command = GetParserCmd(fileName.ToLower() == "global.asax");
- if (J2EEUtils.RunProc(command) != 0)
- throw GetCompilerError();
-
- return true;
- }
- else
- {
- return false;
- //string message = "The requested resource (" + _url + ") is not available.";
- //throw new HttpException(404, message);
- }
- }
- string GetDescriptorPath()
- {
- return String.Join("/", new string[] { "assemblies", _xmlDescriptor });
- }
- string GetTypeNameFromAppFolder()
- {
- try
- {
- using (StreamReader sr = new StreamReader(_context.Request.MapPath("~/" + GetDescriptorPath())))
- {
- return GetTypeFromDescStream(sr.BaseStream);
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex);
- throw ex;
- }
- }
- internal string GetTypeFromResources()
- {
- string typeName = null;
-
- //if the desciptor exists in the war - get the type
- string descPath = GetDescriptorPath();
-
- try
- {
- Debug.WriteLine(descPath);
- using (Stream fs = (Stream)IOUtils.getStreamRecursive("/" + descPath))
- {
- if (fs != null)
- {
- return GetTypeFromDescStream(fs);
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex);
- }
- return null;
- }
- internal string GetCachedTypeName()
- {
- string typeName = GetTypeFromResources();
- if (typeName == null)
- {
- //spawn dynamic compilation and lookup typename from created folder
- if (InternalCompile())
- typeName = GetTypeNameFromAppFolder();
- }
- return typeName;
- }
- string GetTypeName()
- {
- return String.Format("{0}, {1}", _typeName, _origAssemblyName);
- }
- bool LoadMetaFromXmlStream(Stream fs)
- {
- if (fs != null)
- {
- try
- {
- XmlDocument descXml = new XmlDocument();
- descXml.Load(fs);
- _origAssemblyName = descXml.SelectSingleNode(PAGE_XPATH).Attributes[ASSEM_ATTRIB_NAME].Value;
- _typeName = descXml.SelectSingleNode(PAGE_XPATH).Attributes[TYPE_ATTRIB_NAME].Value;
- return true;
- }
- catch
- {
- Debug.WriteLine("Failed to load typename from stream");
- }
- }
- return false;
- }
-
- string GetTypeFromDescStream(Stream fs)
- {
- if (LoadMetaFromXmlStream(fs))
- return GetTypeName();
- return null;
- }
-
- string[] GetParserCmd(bool globalAsax)
- {
- string[] cmd = null;
- if (globalAsax)
- {
- cmd = new string[4];
- cmd[3] = "/buildglobalasax";
- }
- else
- {
- cmd = new string[5];
- cmd[3] = "/aspxFiles:" + _url;
- cmd[4] = "/compilepages";
- }
- cmd[0] = GetParser();
- cmd[1] = "/session:" + _session;
- cmd[2] = "/appDir:" + (string)AppDomain.CurrentDomain.GetData(IAppDomainConfig.APP_PHYS_DIR);
- return cmd;
- }
-
- string GetParser()
- {
- if (_parser == null)
- {
- StreamReader sr =
- File.OpenText (_context.Request.MapPath ("~/AspxParser.params"));
- _parser = sr.ReadLine();
- sr.Close();
- }
-
- return _parser;
- }
-
- string GetDescFromUrl()
- {
- string fileName = VirtualPathUtility.GetFileName (_url);
-
- if (fileName.ToLower() == "global.asax")
- return "global.asax.xml";
-
- string id = GetIdFromUrl(_url);
- string[] descName = new string[3] {fileName, id, ".xml"} ;
- return string.Concat(descName).ToLowerInvariant();
- }
-
- string GetIdFromUrl(string path)
- {
- string fileName = VirtualPathUtility.GetFileName(path);
- string id = string.Empty;
-
- if (VirtualPathUtility.IsAbsolute (path))
- path = path.Substring (_context.Request.ApplicationPath.Length + 1);
-
- if (path.Length > fileName.Length)
- id = "." + path.Substring(0,path.Length - fileName.Length).Replace('/','_');
- return id;
- }
-
- Exception GetCompilerError()
- {
- string _errFile = _context.Request.MapPath ("~/" + _session + ".vmwerr");
-
- if (!File.Exists(_errFile))
- throw new FileNotFoundException("Internal Error",_errFile);
-
- StreamReader sr = new StreamReader(_errFile);
- string message = string.Empty, line = null, file = null, lineInFile = "0";
-
- while ((line = sr.ReadLine()) != null)
- {
- if (line.StartsWith("Message: "))
- message = line.Substring("Message: ".Length);
- else if (line.StartsWith("File: "))
- file = line.Substring("File: ".Length);
- else if (line.StartsWith("Line: "))
- lineInFile = line.Substring("Line: ".Length);
- }
-
- sr.Close();
-
- if (file != null)
- {
- Location loc = new Location(null);
- loc.Filename = file;
- loc.BeginLine = int.Parse(lineInFile);
- return new ParseException(loc,message);
- }
-
- if (message.IndexOf(typeof(FileNotFoundException).Name) != -1 &&
- message.IndexOf(_url.Trim('\\','/').Replace('/','\\')) != -1)
- message = "The requested resource (" + _url + ") is not available.";
- return new HttpException(404,(message != null ? message : string.Empty));
- }
- }
-}
void ChangeToSSLSocket ()
{
-#if TARGET_JVM
- java.lang.Class c = vmw.common.TypeUtils.ToClass (smtp.Stream);
- java.lang.reflect.Method m = c.getMethod ("ChangeToSSLSocket", null);
- m.invoke (smtp.Stream, new object[]{});
-#else
// Load Mono.Security.dll
Assembly a;
try {
if (objSslClientStream != null)
smtp = new SmtpStream ((Stream)objSslClientStream);
-#endif
}
void ReadFields (MailMessageWrapper msg)
+++ /dev/null
-//
-// System.Web.UI.MasterPageParser
-//
-// Authors:
-// Vladimir Krasnov (vladimirk@mainsoft.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_2_0
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Web;
-using System.Web.Compilation;
-using System.Web.Util;
-using System.Web.J2EE;
-
-namespace System.Web.Profile
-{
- internal sealed class ProfileParser
- {
- const string virtualPathCommon = "~/App_Code/ProfileCommon";
- const string virtualPathGroup = "~/App_Code/ProfileGroup";
-
- internal ProfileParser (HttpContext context)
- {
- }
-
- public static Type GetProfileCommonType (HttpContext context)
- {
- if (!ProfileCommonTypeExists)
- return null;
-
- string resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPathCommon).TrimEnd ('/');
- Type profileBaseType = PageMapper.GetObjectType (context, resolvedUrl, false);
-
- ProfileCommonTypeExists = profileBaseType != null;
- return profileBaseType;
- }
-
- public static Type GetProfileGroupType (HttpContext context, string groupName)
- {
- if (!ProfileGroupTypeExists)
- return null;
-
- string resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPathGroup + groupName).TrimEnd ('/');
- Type profileGroupType = PageMapper.GetObjectType (context, resolvedUrl, false);
-
- ProfileGroupTypeExists = profileGroupType != null;
- return profileGroupType;
- }
-
- const string profileKey = "Profile.ProfileCommonType";
- static bool ProfileCommonTypeExists
- {
- get
- {
- object o = AppDomain.CurrentDomain.GetData (profileKey);
- if (o == null)
- return true;
- return (bool) o;
- }
- set { AppDomain.CurrentDomain.SetData (profileKey, value); }
- }
-
- const string groupKey = "Profile.ProfileGroupType";
- static bool ProfileGroupTypeExists
- {
- get
- {
- object o = AppDomain.CurrentDomain.GetData (groupKey);
- if (o == null)
- return true;
- return (bool) o;
- }
- set { AppDomain.CurrentDomain.SetData (groupKey, value); }
- }
- }
-}
-
-#endif
\ No newline at end of file
}
}
-#if TARGET_JVM
- static AnonymousIdentificationSection Config
- {
- get
- {
- AnonymousIdentificationSection config = (AnonymousIdentificationSection) AppDomain.CurrentDomain.GetData ("Anonymous.Config");
- if (config == null) {
- lock (typeof (AnonymousIdentificationModule)) {
- config = (AnonymousIdentificationSection) AppDomain.CurrentDomain.GetData ("Anonymous.Config");
- if (config == null)
- config = (AnonymousIdentificationSection) WebConfigurationManager.GetSection ("system.web/anonymousIdentification");
- AppDomain.CurrentDomain.SetData ("Anonymous.Config", config);
- }
- }
- return config;
- }
- }
-#else
static AnonymousIdentificationSection Config = (AnonymousIdentificationSection) WebConfigurationManager.GetSection ("system.web/anonymousIdentification");
-#endif
}
}
#endif
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{BB170E99-8793-4179-A19B-440539F6879F}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Web</RootNamespace>\r
- <AssemblyName>System.Web.Testing</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- <SignAssembly>true</SignAssembly>\r
- <AssemblyOriginatorKeyFile>mono.snk</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;NET_2_0;TARGET_DOTNET;VISUAL_STUDIO</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Core">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.EnterpriseServices" />\r
- <Reference Include="System.Web" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\..\build\common\Consts.cs">\r
- <Link>Consts.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\build\common\Locale.cs">\r
- <Link>Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Web.Util\AltSerialization.cs" />\r
- <Compile Include="System.Web.Util\DataSourceHelper.cs" />\r
- <Compile Include="System.Web.Util\DataSourceResolver.cs" />\r
- <Compile Include="System.Web.Util\FileUtils.cs" />\r
- <Compile Include="System.Web.Util\ICalls.cs" />\r
- <Compile Include="System.Web.Util\IWebObjectFactory.cs" />\r
- <Compile Include="System.Web.Util\IWebPropertyAccessor.cs" />\r
- <Compile Include="System.Web.Util\SearchPattern.cs" />\r
- <Compile Include="System.Web.Util\SerializationHelper.cs" />\r
- <Compile Include="System.Web.Util\StrUtils.cs" />\r
- <Compile Include="System.Web.Util\TimeUtil.cs" />\r
- <Compile Include="System.Web.Util\TransactedCallback.cs" />\r
- <Compile Include="System.Web.Util\Transactions.cs" />\r
- <Compile Include="System.Web.Util\UrlUtils.cs" />\r
- <Compile Include="System.Web.Util\WebEncoding.cs" />\r
- <Compile Include="System.Web.Util\WebTrace.cs" />\r
- <Compile Include="System.Web.Util\WorkItem.cs" />\r
- <Compile Include="System.Web.Util\WorkItemCallback.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <None Include="mono.snk" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>
\ No newline at end of file
{
[ToolboxItem (false)]
[DesignerAttribute ("System.Web.UI.Design.WebControls.ContentDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
-#if !TARGET_JVM
[ControlBuilder(typeof(ContentBuilderInternal))]
-#endif
public class Content: Control, INamingContainer, INonBindingContainer
{
[ThemeableAttribute (false)]
public void ToggleExpandState ()
{
-#if TARGET_JVM //No support for Nullable<bool>.GetValueOrDefault() yet
- bool? value = Expanded;
- Expanded = value.HasValue ? !value.Value : true;
-#else
Expanded = !Expanded.GetValueOrDefault(false);
-#endif
}
void IStateManager.LoadViewState (object savedState)
+++ /dev/null
-//
-// System.Web.UI.WebControls.XmlBuilder.cs
-//
-// Author:
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-// Gonzalo Paniagua Javier (gonzalo@novell.com)
-//
-// Copyright (c) 2004 Novell, Inc. (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Web.Compilation;
-using System.Web.UI;
-using System.Xml;
-
-namespace System.Web.UI.WebControls
-{
- class XmlBuilder : ControlBuilder
- {
- }
-}
-
+++ /dev/null
-//
-// System.Web.UI.BaseParser.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc. (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.IO;
-using System.Security.Permissions;
-using System.Web.Compilation;
-using System.Web.Configuration;
-using System.Web.Util;
-
-namespace System.Web.UI
-{
- public class BaseParser
- {
- public BaseParser () {
- throw new NotImplementedException ();
- }
- }
-}
-
+++ /dev/null
-//
-// System.Web.UI.BaseTemplateParser
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-// Copyright (C) 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.
-//
-
-#if NET_2_0
-using System;
-
-namespace System.Web.UI {
- public abstract class BaseTemplateParser : TemplateParser
- {
- protected BaseTemplateParser ()
- {
- throw new NotImplementedException ();
- }
-
- protected Type GetReferenceType ()
- {
- throw new NotImplementedException ();
- }
-
- protected internal Type GetUserControlType (string virtualPath)
- {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.BuilderPropertyEntry.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-using System.Web.UI;
-
-namespace System.Web.UI
-{
- public abstract class BuilderPropertyEntry : PropertyEntry
- {
- public ControlBuilder Builder {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- }
-}
-#endif
+++ /dev/null
-//
-// (C) 2007 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Web.UI;
-using System.Collections.Specialized;
-using System.Collections;
-
-namespace System.Web.UI
-{
- partial class ClientScriptManager : IStateManager
- {
- #region IStateManager Members
-
- void IStateManager.LoadViewState (object state) {
- throw new NotSupportedException ();
- }
-
- object IStateManager.SaveViewState () {
- if (hiddenFields != null) {
- Hashtable clone = (Hashtable) hiddenFields.Clone ();
- clone.Remove ("__VIEWSTATE");
- clone.Remove (Page.postEventArgumentID);
- clone.Remove (Page.postEventSourceID);
- clone.Remove (Page.CallbackArgumentID);
- clone.Remove (Page.CallbackSourceID);
- if (clone.Keys.Count > 0)
- return clone;
- }
- return null;
- }
-
- void IStateManager.TrackViewState () {
- throw new NotSupportedException ();
- }
-
- bool IStateManager.IsTrackingViewState {
- get { throw new NotSupportedException (); }
- }
-
- #endregion
- }
-}
+++ /dev/null
-//
-// System.Web.UI.ComplexPropertyEntry.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-namespace System.Web.UI
-{
- public class ComplexPropertyEntry : BuilderPropertyEntry
- {
- public bool IsCollectionItem {
- get { throw new NotImplementedException (); }
- }
-
- public bool ReadOnly {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.ControlS.jvm.cs
-//
-// Authors:
-// Eyal Alaluf (eyala@mainsoft.com)
-//
-// (C) 2006 Mainsoft Co. (http://www.mainsoft.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.Web.Hosting;
-using System.Text;
-using javax.faces.component;
-using java.util;
-using javax.faces.el;
-using javax.faces.@event;
-using javax.faces.context;
-
-namespace System.Web.UI
-{
- public partial class Control : UIComponent, StateHolder
- {
- ComponentChildrenList _childrenList;
- HashMap _attributes;
- HashMap _facets;
-
- protected override void addFacesListener (FacesListener __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void broadcast (FacesEvent __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void decode (FacesContext context) {
- // do nothing
- }
-
- public override void encodeBegin (FacesContext __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void encodeChildren (FacesContext __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void encodeEnd (FacesContext __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override UIComponent findComponent (string __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override Map getAttributes () {
- return _attributes ?? (_attributes = new HashMap ());
- }
-
- public override int getChildCount () {
- return HasControls () ? Controls.Count : 0;
- }
-
- public override List getChildren () {
- if (_childrenList == null)
- _childrenList = new ComponentChildrenList (this);
- return _childrenList;
- }
-
- public override string getClientId (FacesContext __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- protected override FacesContext getFacesContext () {
- Control nc = NamingContainer;
- if (nc != null)
- return nc.getFacesContext ();
- return FacesContext.getCurrentInstance ();
- }
-
- protected override FacesListener [] getFacesListeners (java.lang.Class __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override UIComponent getFacet (string __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override Map getFacets () {
- return _facets ?? (_facets = new HashMap ());
- }
-
- public override Iterator getFacetsAndChildren () {
- // TODO: consider facets.
- return getChildren ().iterator ();
- }
-
- public override string getFamily () {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override string getId () {
- return ID;
- }
-
- public override UIComponent getParent () {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- protected override javax.faces.render.Renderer getRenderer (FacesContext __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override string getRendererType () {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override bool getRendersChildren () {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override ValueBinding getValueBinding (string name) {
- return null;
- }
-
- public override bool isRendered () {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- // TODO: implement
- public override void processDecodes (FacesContext context) {
- // call processDecodes for all jsf children
- }
-
- public override void processRestoreState (FacesContext context, object state) {
- throw new NotSupportedException ();
- }
-
- public override object processSaveState (FacesContext context) {
- throw new NotSupportedException ();
- }
-
- // TODO: implement
- public override void processUpdates (FacesContext context) {
- // call processUpdates for all jsf children
- }
-
- // TODO: implement
- public override void processValidators (FacesContext context) {
- // call processValidators for all jsf children
- }
-
- public override void queueEvent (FacesEvent __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- protected override void removeFacesListener (FacesListener __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void setId (string __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void setParent (UIComponent __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void setRendered (bool __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void setRendererType (string __p1) {
- throw new Exception ("The method or operation is not implemented.");
- }
-
- public override void setValueBinding (string name, ValueBinding binding) {
- throw new NotSupportedException ();
- }
-
- #region StateHolder Members
-
- bool StateHolder.isTransient () {
- return !EnableViewState;
- }
-
- void StateHolder.restoreState (FacesContext context, object state) {
- LoadViewState (state);
- }
-
- object StateHolder.saveState (FacesContext context) {
- return SaveViewState ();
- }
-
- void StateHolder.setTransient (bool newTransientValue) {
- EnableViewState = !newTransientValue;
- }
-
- #endregion
-
- class ComponentChildrenList : AbstractList
- {
- Control _owner;
-
- public ComponentChildrenList (Control owner) {
- _owner = owner;
- }
-
- public override object get (int index) {
- return _owner.Controls [index];
- }
-
- public override int size () {
- return _owner.Controls.Count;
- }
- }
-
- public virtual string TemplateSourceDirectory
- {
- get
- {
- if (_templateSourceDirectory == null) {
- _templateSourceDirectory = VirtualPathUtility.ToAbsolute (AppRelativeTemplateSourceDirectory, false);
-
- if (_templateSourceDirectory.Length > 1 &&
- _templateSourceDirectory [_templateSourceDirectory.Length - 1] == '/')
- _templateSourceDirectory = _templateSourceDirectory.Substring (0, _templateSourceDirectory.Length - 1);
- }
-
- return _templateSourceDirectory;
- }
- }
-
- string ResolveAppRelativeFromFullPath (string url) {
- try {
- Uri uri = new Uri (url);
- if (String.Compare (uri.Scheme, Page.Request.Url.Scheme, StringComparison.OrdinalIgnoreCase) == 0 &&
- String.Compare (uri.Host, Page.Request.Url.Host, StringComparison.OrdinalIgnoreCase) == 0 &&
- uri.Port == Page.Request.Url.Port)
- return VirtualPathUtility.ToAppRelative (uri.PathAndQuery);
- }
- catch (Exception e) {
- //don't care
-#if DEBUG
- Console.WriteLine (e.ToString ());
-#endif
- }
- return url;
- }
-
- internal string CreateActionUrl (string relativeUrl) {
- relativeUrl = ResolveClientUrlInternal (relativeUrl);
-
- FacesContext faces = getFacesContext ();
- if (faces == null)
- return relativeUrl;
-
- string url;
- if (relativeUrl.IndexOf (':') >= 0)
- url = ResolveAppRelativeFromFullPath (relativeUrl);
- else if (VirtualPathUtility.IsAbsolute (relativeUrl))
- url = VirtualPathUtility.ToAppRelative (relativeUrl);
- else
- return faces.getApplication ().getViewHandler ().getActionURL (faces, relativeUrl);
-
-
- if (VirtualPathUtility.IsAppRelative (url)) {
- url = url.Substring (1);
- url = url.Length == 0 ? "/" : url;
- return faces.getApplication ().getViewHandler ().getActionURL (faces, url);
- }
- return relativeUrl;
- }
-
- internal string ResolveClientUrl (string relativeUrl, bool usePortletRenderResolve) {
- if (usePortletRenderResolve)
- return ResolveClientUrl (relativeUrl);
- else
- return ResolveUrl (relativeUrl);
- }
- }
-}
+++ /dev/null
-//
-// System.Web.UI/ControlBuilder.jvm.cs
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Web.UI
-{
- public class ControlBuilder
- {
- public virtual bool AllowWhitespaceLiterals ()
- {
- return true;
- }
-
- public virtual bool HasBody ()
- {
- return true;
- }
-
- public virtual Type GetChildControlType (string tagName, IDictionary attribs)
- {
- return null;
- }
-
- public virtual bool HtmlDecodeLiterals ()
- {
- return false;
- }
- public virtual void AppendSubBuilder (ControlBuilder subBuilder)
- {
- }
- public virtual bool NeedsTagInnerText ()
- {
- return false;
- }
- public virtual void SetTagInnerText (string text)
- {
- }
- public virtual void AppendLiteralString (string s)
- {
- }
- internal virtual object CreateInstance ()
- {
- return null;
- }
-#if NET_2_0
- public virtual object BuildObject ()
- {
- return CreateInstance ();
- }
-#endif
- public virtual void Init (
- TemplateParser parser,
- ControlBuilder parentBuilder,
- Type type,
- string tagName,
- string id,
- IDictionary attribs
- )
- {
- throw new NotImplementedException ();
- }
- }
-}
+++ /dev/null
-//
-// System.Web.UI.DataSourceCacheDurationConverter.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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;
-using System.ComponentModel;
-using System.Globalization;
-
-#if NET_2_0
-namespace System.Web.UI
-{
- public class DataSourceCacheDurationConverter : Int32Converter
- {
- public DataSourceCacheDurationConverter () {
- throw new NotImplementedException ();
- }
- public bool CanConvertFrom (Type sourceType) {
- throw new NotImplementedException ();
- }
- public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) {
- throw new NotImplementedException ();
- }
- public bool CanConvertTo (Type destinationType) {
- throw new NotImplementedException ();
- }
- public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) {
- throw new NotImplementedException ();
- }
- public Object ConvertFrom (Object value) {
- throw new NotImplementedException ();
- }
- public override Object ConvertFrom (ITypeDescriptorContext context,
- CultureInfo culture,
- Object value) {
- throw new NotImplementedException ();
- }
- public Object ConvertTo (Object value, Type destinationType) {
- throw new NotImplementedException ();
- }
- public override Object ConvertTo (ITypeDescriptorContext context,
- CultureInfo culture,
- Object value,
- Type destinationType) {
- throw new NotImplementedException ();
- }
- public ICollection GetStandardValues () {
- throw new NotImplementedException ();
- }
- public override StandardValuesCollection GetStandardValues (ITypeDescriptorContext context) {
- throw new NotImplementedException ();
- }
- public bool GetStandardValuesExclusive () {
- throw new NotImplementedException ();
- }
- public override bool GetStandardValuesExclusive (ITypeDescriptorContext context) {
- throw new NotImplementedException ();
- }
- public bool GetStandardValuesSupported () {
- throw new NotImplementedException ();
- }
- public override bool GetStandardValuesSupported (ITypeDescriptorContext context) {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.DesignTimeParseData class
-//
-//
-// Author:
-// Miguel de Icaza (miguel@novell.com)
-//
-
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.ComponentModel.Design;
-using System.Security.Permissions;
-
-namespace System.Web.UI {
-
- public sealed class DesignTimeParseData {
-
- public DesignTimeParseData (IDesignerHost designerHost, string parseText)
- {
- throw new NotImplementedException ();
-
- }
-#if NET_2_0
- public DesignTimeParseData (IDesignerHost designerHost, string parseText, string filter)
- : this (designerHost, parseText)
- {
- throw new NotImplementedException ();
- }
-#endif
-
- public EventHandler DataBindingHandler {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- public IDesignerHost DesignerHost {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string DocumentUrl {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- public string ParseText {
- get {
- throw new NotImplementedException ();
- }
- }
-#if NET_2_0
- public string Filter {
- get {throw new NotImplementedException (); }
- }
-
- public bool ShouldApplyTheme {
- get {throw new NotImplementedException (); }
- set {throw new NotImplementedException (); }
- }
-
- // FIXME: there's probably a way to set this somewhere...
- public ICollection UserControlRegisterEntries {
- get { throw new NotImplementedException (); }
- }
-#endif
- }
-}
+++ /dev/null
-//
-// System.Web.UI.EventEntry.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-namespace System.Web.UI
-{
- public class EventEntry
- {
- public EventEntry () { throw new NotImplementedException (); }
- public string HandlerMethodName {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- public Type HandlerType {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- public string Name {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- }
-}
-#endif
\ No newline at end of file
+++ /dev/null
-//
-// System.Web.UI.FileLevelControlBuilderAttribute.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-namespace System.Web.UI
-{
- [AttributeUsageAttribute (AttributeTargets.Class)]
- public sealed class FileLevelControlBuilderAttribute : Attribute
- {
- public FileLevelControlBuilderAttribute (Type builderType)
- {}
-
- public static readonly FileLevelControlBuilderAttribute Default;
-
- public Type BuilderType { get { throw new NotImplementedException (); } }
-
- public override bool Equals (Object obj)
- {
- throw new NotImplementedException ();
- }
- public static bool Equals (Object objA, Object objB)
- {
- throw new NotImplementedException ();
- }
- public override int GetHashCode ()
- {
- throw new NotImplementedException ();
- }
- public override bool IsDefaultAttribute ()
- {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.FileLevelControlBuilderAttribute.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-using System.Web.UI;
-
-namespace System.Web.UI
-{
- public class FileLevelPageControlBuilder : RootBuilder
- {
- public FileLevelPageControlBuilder ()
- {
- throw new NotImplementedException ();
- }
- public override void AppendLiteralString (string text)
- {
- throw new NotImplementedException ();
- }
- public override void AppendSubBuilder (ControlBuilder subBuilder)
- {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
-
+++ /dev/null
-//
-// System.Web.UI.FileLevelControlBuilderAttribute.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-using System.Web.UI;
-
-namespace System.Web.UI
-{
- public class FileLevelUserControlBuilder : RootBuilder
- {
- public FileLevelUserControlBuilder ()
- {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
protected virtual void AddAttribute (string name, string value, HtmlTextWriterAttribute key)
{
NextAttrStack ();
-#if TARGET_JVM
- if (attrs [attrs_pos] == null)
- attrs [attrs_pos] = new AddedAttr ();
-#endif
attrs [attrs_pos].name = name;
attrs [attrs_pos].value = value;
attrs [attrs_pos].key = key;
protected virtual void AddStyleAttribute (string name, string value, HtmlTextWriterStyle key)
{
NextStyleStack ();
-#if TARGET_JVM
- if (styles [styles_pos] == null)
- styles [styles_pos] = new AddedStyle ();
-#endif
styles [styles_pos].name = name;
value = HttpUtility.HtmlAttributeEncode (value);
styles [styles_pos].value = value;
return tagstack [tagstack_pos].key;
}
set {
-#if TARGET_JVM
- if (tagstack [tagstack_pos] == null)
- tagstack [tagstack_pos] = new AddedTag ();
-#endif
tagstack [tagstack_pos].key = value;
tagstack [tagstack_pos].name = GetTagName (value);
}
return tagstack [tagstack_pos].name;
}
set {
-#if TARGET_JVM
- if (tagstack [tagstack_pos] == null)
- tagstack [tagstack_pos] = new AddedTag ();
-#endif
tagstack [tagstack_pos].name = value;
tagstack [tagstack_pos].key = GetTagKey (value);
if (tagstack [tagstack_pos].key != HtmlTextWriterTag.Unknown)
int styles_pos = -1, attrs_pos = -1, tagstack_pos = -1;
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedTag {
public string name;
public HtmlTextWriterTag key;
public bool ignore;
}
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedStyle {
public string name;
public HtmlTextWriterStyle key;
public string value;
}
-#if TARGET_JVM
- class
-#else
struct
-#endif
AddedAttr {
public string name;
public HtmlTextWriterAttribute key;
namespace System.Web.UI
{
-#if (TARGET_JVM || TARGET_DOTNET)
+#if (TARGET_DOTNET)
public
#endif
interface IScriptManager
+++ /dev/null
-//
-// System.Web.UI.IndexedString.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-namespace System.Web.UI
-{
- [SerializableAttribute]
- public sealed class IndexedString
- {
- public IndexedString (string s)
- {
- throw new NotImplementedException ();
- }
-
- public string Value { get { throw new NotImplementedException (); } }
- }
-}
-#endif
var req = context.Request;
if (req != null)
masterPageFile = HostingEnvironment.VirtualPathProvider.CombineVirtualPaths (req.CurrentExecutionFilePath, masterPageFile);
-#if TARGET_JVM
- MasterPage masterPage = MasterPageParser.GetCompiledMasterInstance (masterPageFile,
- owner.Page.MapPath (masterPageFile),
- context);
-#else
MasterPage masterPage = BuildManager.CreateInstanceFromVirtualPath (masterPageFile, typeof (MasterPage)) as MasterPage;
-#endif
if (masterPage == null)
throw new HttpException ("Failed to create MasterPage instance for '" + masterPageFile + "'.");
+++ /dev/null
-//
-// System.Web.UI.MasterPageParser
-//
-// Authors:
-// Lluis Sanchez Gual (lluis@novell.com)
-//
-// (C) 2005 Novell, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Web;
-using System.Web.Compilation;
-using System.Web.Util;
-using System.Web.J2EE;
-
-namespace System.Web.UI
-{
- internal sealed class MasterPageParser
- {
- internal MasterPageParser (string virtualPath, string inputFile, HttpContext context)
- {
- }
-
- public static MasterPage GetCompiledMasterInstance (string virtualPath, string inputFile, HttpContext context)
- {
- string resolvedUrl;
- if (VirtualPathUtility.IsAbsolute (virtualPath))
- resolvedUrl = virtualPath;
- else if (VirtualPathUtility.IsAppRelative (virtualPath))
- resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPath);
- else
- resolvedUrl = VirtualPathUtility.Combine (VirtualPathUtility.GetDirectory (context.Request.FilePath, false), virtualPath);
- Type tmpType = PageMapper.GetObjectType (context, resolvedUrl);
- if (tmpType == null)
- throw new InvalidOperationException ("Master page '" + virtualPath + "' not found");
-
- Object obj = Activator.CreateInstance (tmpType);
- return (MasterPage) obj;
- }
-
- public static Type GetCompiledMasterType (string virtualPath, string inputFile, HttpContext context)
- {
- return null;
- }
- }
-}
-
-#endif
+++ /dev/null
-//
-// System.Web.UI.ObjectPersistData.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-using System.Collections;
-using System.Web.UI;
-
-namespace System.Web.UI
-{
- public class ObjectPersistData
- {
- public ObjectPersistData (ControlBuilder builder, IDictionary builtObjects) {
- throw new NotImplementedException ();
- }
- public ICollection AllPropertyEntries { get { throw new NotImplementedException (); } }
- public IDictionary BuiltObjects { get { throw new NotImplementedException (); } }
- public ICollection CollectionItems { get { throw new NotImplementedException (); } }
- public ICollection EventEntries { get { throw new NotImplementedException (); } }
- public bool IsCollection { get { throw new NotImplementedException (); } }
- public bool Localize { get { throw new NotImplementedException (); } }
- public Type ObjectType { get { throw new NotImplementedException (); } }
- public string ResourceKey { get { throw new NotImplementedException (); } }
- public void AddToObjectControlBuilderTable (IDictionary table) {
- throw new NotImplementedException ();
- }
- public IDictionary GetFilteredProperties (string filter) {
- throw new NotImplementedException ();
- }
- public PropertyEntry GetFilteredProperty (string filter, string name) {
- throw new NotImplementedException ();
- }
- public ICollection GetPropertyAllFilters (string name) {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI/ObjectTagBuilder.jvm.cs
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Web.UI
-{
- public sealed class ObjectTagBuilder : ControlBuilder
- {
- internal Type Type
- {
- get { return null; }
- }
-
- internal string ObjectID
- {
- get { return string.Empty; }
- }
- }
-}
if (ps != null)
_styleSheetTheme = ps.StyleSheetTheme;
}
-#if TARGET_JVM
- if (_styleSheetTheme != null && _styleSheetTheme != "")
- _styleSheetPageTheme = ThemeDirectoryCompiler.GetCompiledInstance (_styleSheetTheme, Context);
-#else
+
if (!String.IsNullOrEmpty (_styleSheetTheme)) {
string virtualPath = "~/App_Themes/" + _styleSheetTheme;
_styleSheetPageTheme = BuildManager.CreateInstanceFromVirtualPath (virtualPath, typeof (PageTheme)) as PageTheme;
}
-#endif
}
void InitializeTheme ()
if (ps != null)
_theme = ps.Theme;
}
-#if TARGET_JVM
- if (_theme != null && _theme != "") {
- _pageTheme = ThemeDirectoryCompiler.GetCompiledInstance (_theme, Context);
- _pageTheme.SetPage (this);
- }
-#else
+
if (!String.IsNullOrEmpty (_theme)) {
string virtualPath = "~/App_Themes/" + _theme;
_pageTheme = BuildManager.CreateInstanceFromVirtualPath (virtualPath, typeof (PageTheme)) as PageTheme;
if (_pageTheme != null)
_pageTheme.SetPage (this);
}
-#endif
}
#if NET_4_0
public Control AutoPostBackControl {
OnError (EventArgs.Empty);
if (_context.HasError (e)) {
_context.ClearError (e);
-#if TARGET_JVM
- vmw.common.TypeUtils.Throw (e);
-#else
throw new HttpUnhandledException (null, e);
-#endif
}
}
}
if (asyncResults.Count > 0) {
-#if TARGET_JVM
- TimeSpan timeout = AsyncTimeout;
- long t1 = DateTime.Now.Ticks;
- bool signalled = true;
- for (int i = 0; i < asyncResults.Count; i++) {
- if (asyncResults [i].IsCompleted)
- continue;
-
- if (signalled)
- signalled = asyncResults [i].AsyncWaitHandle.WaitOne (timeout, false);
-
- if (signalled) {
- long t2 = DateTime.Now.Ticks;
- timeout = AsyncTimeout - TimeSpan.FromTicks (t2 - t1);
- if (timeout.Ticks <= 0)
- signalled = false;
- } else
- localParallelTasks [i].TimeoutHandler (asyncResults [i]);
- }
-#else
WaitHandle [] waitArray = new WaitHandle [asyncResults.Count];
int i = 0;
for (i = 0; i < asyncResults.Count; i++) {
}
}
}
-#endif
}
DateTime endWait = DateTime.Now;
TimeSpan elapsed = endWait - startExecution;
+++ /dev/null
-//
-// System.Web.UI.Page.jvm.cs
-//
-// Authors:
-// Eyal Alaluf (eyala@mainsoft.com)
-//
-// (C) 2006 Mainsoft Co. (http://www.mainsoft.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 javax.servlet.http;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web.Hosting;
-using System.Web.J2EE;
-using System.ComponentModel;
-using System.IO;
-using javax.faces.context;
-using javax.faces.render;
-using javax.servlet;
-using javax.faces;
-using javax.faces.application;
-using javax.faces.@event;
-using javax.faces.el;
-using javax.faces.component;
-using System.Threading;
-using System.Web.Configuration;
-using Mainsoft.Web.Hosting;
-
-namespace System.Web.UI
-{
- public partial class Page
- {
- string _namespace = null;
- StateManager.SerializedView _facesSerializedView;
- MethodBinding _action;
- MethodBinding _actionListener;
- bool _immediate;
- bool [] _validatorsState;
- ICallbackEventHandler _callbackTarget;
- string _callbackEventError = String.Empty;
- static readonly object CrossPagePostBack = new object ();
- FacesContext _facesContext;
- const string RenderBodyContentOnlyKey = "mainsoft.render.body.content.only";
-
- static readonly java.util.List emptyList = java.util.Collections.unmodifiableList (new java.util.ArrayList ());
-
- bool _isMultiForm = false;
- bool _isMultiFormInited = false;
-
- internal string Namespace
- {
- get {
- if (_namespace == null) {
-
- if (getFacesContext () != null) {
- _namespace = getFacesContext ().getExternalContext ().encodeNamespace (String.Empty);
- }
-
- _namespace = _namespace ?? String.Empty;
- }
- return _namespace;
- }
- }
-
- internal Pair PageState { get; set; }
-
- internal string theForm {
- get {
- return "theForm" + Namespace;
- }
- }
-
- internal bool IsMultiForm {
- get {
- if (!_isMultiFormInited) {
- string isMultiForm = WebConfigurationManager.AppSettings ["mainsoft.use.portlet.namespace"];
- _isMultiForm = isMultiForm != null ? Boolean.Parse(isMultiForm) : false;
-
- _isMultiFormInited = true;
- }
- return _isMultiForm;
- }
- }
-
- IHttpHandler EnterThread () {
-
- IHttpHandler jsfHandler = _context.CurrentHandler;
- _context.PopHandler ();
- _context.PushHandler (this);
- if (jsfHandler == _context.Handler)
- _context.Handler = this;
-
- _context.CurrentHandlerInternal = this;
-
- return jsfHandler;
- }
-
- void ExitThread (IHttpHandler jsfHandler) {
- // TODO
- //if (context.getResponseComplete ())
- // Response.End ();
-
- _context.PopHandler ();
- _context.PushHandler (jsfHandler);
- if (this == _context.Handler)
- _context.Handler = jsfHandler;
-
- }
-
- public override void encodeBegin (FacesContext context) {
- // do nothing
- }
-
- public override void encodeChildren (FacesContext context) {
- System.Diagnostics.Trace.WriteLine ("encodeChildren");
-
- // reset _facesContext if changed between action and render phases (such portal).
- _facesContext = null;
-
- IHttpHandler jsfHandler = EnterThread ();
- bool wasException = false;
- try {
- if (!context.getResponseComplete ()) {
-
- if (IsCallback) {
- string result = ProcessGetCallbackResult (_callbackTarget, _callbackEventError);
- HtmlTextWriter callbackOutput = new HtmlTextWriter (Response.Output);
- callbackOutput.Write (result);
- callbackOutput.Flush ();
- return;
- }
-
- // ensure lifecycle complete.
- if (!IsLoaded) {
- ProcessLoad ();
- RestoreValidatorsState (_validatorsState);
- }
- if (!IsPrerendered)
- ProcessLoadComplete ();
-
- RenderPage ();
- }
- }
- catch (Exception ex) {
- wasException = true;
- HandleException (ex);
- }
- finally {
- try {
- if (!wasException)
- ProcessUnload ();
- }
- finally {
- ExitThread (jsfHandler);
- }
- }
- }
-
- public override void encodeEnd (FacesContext context) {
- // do nothing
- }
-
- // BUGBUG: must return correct value. Currently returns 0 as performance optimization.
- public override int getChildCount ()
- {
- return 0;
- }
-
- // BUGBUG: must return correct value. Currently returns empty list as performance optimization.
- public override java.util.List getChildren ()
- {
- return emptyList;
- }
-
- public override UIComponent getParent () {
- return null;
- }
-
- public override void setParent (UIComponent parent) {
- //ignore: parent is root
- }
-
- // TODO: consider validators state
- public override object processSaveState (FacesContext context) {
- System.Diagnostics.Trace.WriteLine ("processSaveState");
-
- object state = new Pair (PageState, GetValidatorsState ());
- return new StateSerializer (state);
- }
-
- public override void processRestoreState (FacesContext context, object state) {
- System.Diagnostics.Trace.WriteLine ("processRestoreState");
-
- if (state == null) {
- Console.WriteLine ("WARNING: processRestoreState was called with null state.");
- return; //throw new ArgumentNullException ("state");
- }
- IHttpHandler jsfHandler = EnterThread ();
- try {
- state = ((StateSerializer) state).State;
- PageState = (Pair) ((Pair) state).First;
- _validatorsState = (bool []) ((Pair) state).Second;
- RestorePageState ();
- }
- catch (Exception ex) {
- HandleException (ex);
- }
- finally {
- ExitThread (jsfHandler);
- }
- }
-
- public override void processDecodes (FacesContext context) {
- System.Diagnostics.Trace.WriteLine ("processDecodes");
-
- IHttpHandler jsfHandler = EnterThread ();
- try {
- ProcessPostData ();
-
- EventRaiserFacesEvent facesEvent = new EventRaiserFacesEvent (this);
- facesEvent.setPhaseId (PhaseId.INVOKE_APPLICATION);
- context.getViewRoot ().queueEvent (facesEvent);
-
- base.processDecodes (context);
- }
- catch (Exception ex) {
- HandleException (ex);
- }
- finally {
- ExitThread (jsfHandler);
- }
- }
-
- public override void processValidators (FacesContext context) {
- System.Diagnostics.Trace.WriteLine ("processValidators");
-
- IHttpHandler jsfHandler = EnterThread ();
- try {
- base.processValidators (context);
- }
- catch (Exception ex) {
- HandleException (ex);
- }
- finally {
- ExitThread (jsfHandler);
- }
- }
-
- public override void processUpdates (FacesContext context) {
- System.Diagnostics.Trace.WriteLine ("processUpdates");
-
- IHttpHandler jsfHandler = EnterThread ();
- try {
- base.processUpdates (context);
- }
- catch (Exception ex) {
- HandleException (ex);
- }
- finally {
- ExitThread (jsfHandler);
- }
- }
-
- public override void broadcast (FacesEvent e) {
- System.Diagnostics.Trace.WriteLine ("broadcast");
-
- if (!(e is EventRaiserFacesEvent))
- throw new NotSupportedException ("FacesEvent of class " + e.GetType ().Name + " not supported by Page");
-
- IHttpHandler jsfHandler = EnterThread ();
- bool doUnload = false;
- try {
- ProcessRaiseEvents ();
- doUnload = (ProcessLoadComplete () && IsCrossPagePostBack);
- }
- catch (Exception ex) {
- doUnload = false;
- HandleException (ex);
- }
- finally {
- try {
- if (doUnload) {
- getFacesContext ().responseComplete ();
- ProcessUnload ();
- }
- }
- finally {
- ExitThread (jsfHandler);
- }
- }
- }
-
- void HandleException (Exception ex) {
- try {
- if (ex is ThreadAbortException) {
- if (FlagEnd.Value == ((ThreadAbortException) ex).ExceptionState) {
- Thread.ResetAbort ();
- return;
- }
- vmw.common.TypeUtils.Throw (ex);
- }
- else
- ProcessException (ex);
- }
- finally {
- if (getFacesContext () != null)
- getFacesContext ().responseComplete ();
- ProcessUnload ();
- }
- }
-
- bool [] GetValidatorsState () {
- if (is_validated && Validators.Count > 0) {
- bool [] validatorsState = new bool [Validators.Count];
- bool isValid = true;
- for (int i = 0; i < Validators.Count; i++) {
- IValidator val = Validators [i];
- if (!val.IsValid)
- isValid = false;
- else
- validatorsState [i] = true;
- }
- return validatorsState;
- }
- return null;
- }
-
- void RestoreValidatorsState (bool [] validatorsState) {
- if (validatorsState == null)
- return;
-
- is_validated = true;
- for (int i = 0; i < Math.Min (validatorsState.Length, Validators.Count); i++) {
- IValidator val = Validators [i];
- val.IsValid = validatorsState [i];
- }
- }
-
- ResponseWriter SetupResponseWriter (TextWriter httpWriter) { //TODO
- FacesContext facesContext = getFacesContext ();
-
- ResponseWriter oldWriter = facesContext.getResponseWriter ();
- if (oldWriter == null)
- throw new InvalidOperationException ();
-
- ResponseWriter writer = oldWriter.cloneWithWriter (new AspNetResponseWriter (httpWriter));
-
- facesContext.setResponseWriter (writer);
- return oldWriter;
- }
-
- string DecodeNamespace (string id) {
- if (Namespace.Length > 0 && id.Length > Namespace.Length && id.StartsWith (Namespace, StringComparison.Ordinal))
- id = id.Substring (Namespace.Length);
- return id;
- }
-
- protected override FacesContext getFacesContext () {
- return _facesContext ?? (_facesContext = FacesContext.getCurrentInstance ());
- }
-
- internal FacesContext FacesContext {
- get { return getFacesContext (); }
- }
-
- #region EventRaiserFacesEvent
- sealed class EventRaiserFacesEvent : FacesEvent
- {
- public EventRaiserFacesEvent (Page page)
- : base (page) {
- }
-
- public override bool isAppropriateListener (FacesListener __p1) {
- throw new NotSupportedException ();
- }
-
- public override void processListener (FacesListener __p1) {
- throw new NotSupportedException ();
- }
- }
- #endregion
-
- #region AspNetResponseWriter
- sealed class AspNetResponseWriter : java.io.Writer
- {
- readonly TextWriter _writer;
- public AspNetResponseWriter (TextWriter writer) {
- _writer = writer;
- }
- public override void close () {
- _writer.Close ();
- }
-
- public override void flush () {
- _writer.Flush ();
- }
-
- public override void write (char [] __p1, int __p2, int __p3) {
- _writer.Write (__p1, __p2, __p3);
- }
-
- public override void write (int __p1) {
- _writer.Write ((char) __p1);
- }
-
- public override void write (char [] __p1) {
- _writer.Write (__p1);
- }
-
- public override void write (string __p1) {
- _writer.Write (__p1);
- }
-
- public override void write (string __p1, int __p2, int __p3) {
- _writer.Write (__p1, __p2, __p3);
- }
- }
- #endregion
-
- #region StateSerializer
- public sealed class StateSerializer : java.io.Externalizable
- {
- object _state;
-
- public StateSerializer ()
- {
- }
-
- public StateSerializer (object state)
- {
- _state = state;
- }
-
- public object State
- {
- get { return _state; }
- }
-
- public void readExternal (java.io.ObjectInput __p1)
- {
- Page page = CurrentPage;
- ObjectStateFormatter osf = new ObjectStateFormatter (page);
- ObjectInputStream inputStream = new ObjectInputStream (__p1);
-
- if (page.NeedViewStateEncryption || page.EnableViewStateMac)
- _state = osf.Deserialize ((string) inputStream.readObject ());
- else
- _state = osf.Deserialize (inputStream);
- }
-
- public void writeExternal (java.io.ObjectOutput __p1)
- {
- Page page = CurrentPage;
- ObjectStateFormatter osf = new ObjectStateFormatter (page);
- ObjectOutputStream outputStream = new ObjectOutputStream (__p1);
-
- if (page.NeedViewStateEncryption || page.EnableViewStateMac)
- outputStream.writeObject (osf.Serialize (_state));
- else
- osf.Serialize (outputStream, _state);
- }
-
- Page CurrentPage
- {
- get
- {
- HttpContext context = HttpContext.Current;
- if (context.CurrentHandler is Page)
- return (Page) context.CurrentHandler;
-
- return context.CurrentHandlerInternal;
- }
- }
- }
- #endregion
- }
-}
+++ /dev/null
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.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.Web;
-using System.Web.J2EE;
-using vmw.common;
-//using System.Web.Compilation;
-
-
-namespace System.Web.UI
-{
- public class PageHandlerFactory : IHttpHandlerFactory
- {
- public virtual IHttpHandler GetHandler (HttpContext context, string requestType, string url, string path)
- {
- if (!path.StartsWith(IAppDomainConfig.WAR_ROOT_SYMBOL))
- path = context.Request.MapPath(path);
- Type tmpType = PageMapper.GetObjectType(path);
- Object obj = Activator.CreateInstance(tmpType);
- return (IHttpHandler) obj;
- }
-
- public virtual void ReleaseHandler (IHttpHandler handler)
- {
- }
- }
-}
-
+++ /dev/null
-//
-// System.Web.UI.PageParser
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Security.Permissions;
-using System.Text;
-using System.Web.Compilation;
-using System.Web.Configuration;
-using System.Web.Util;
-using System.Web.J2EE;
-
-namespace System.Web.UI
-{
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public sealed class PageParser
- {
- public static IHttpHandler GetCompiledPageInstance (string virtualPath,
- string inputFile,
- HttpContext context)
- {
- Type tmpType = PageMapper.GetObjectType(context, virtualPath);
- if (tmpType == null)
- throw new InvalidOperationException ("Documentation page '" + virtualPath + "' not found");
- Object obj = Activator.CreateInstance(tmpType);
- return (IHttpHandler) obj;
- }
-
- }
-}
-
+++ /dev/null
-//
-// System.Web.UI.PageParserFilter.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-using System.Collections;
-
-namespace System.Web.UI
-{
- public abstract class PageParserFilter
- {
- protected PageParserFilter () {
- throw new NotImplementedException ();
- }
- public virtual bool AllowCode {
- get {
- throw new NotImplementedException ();
- }
- }
- public virtual int NumberOfControlsAllowed {
- get {
- throw new NotImplementedException ();
- }
- }
- public virtual int NumberOfDirectDependenciesAllowed {
- get {
- throw new NotImplementedException ();
- }
- }
- public virtual int TotalNumberOfDependenciesAllowed {
- get {
- throw new NotImplementedException ();
- }
- }
- protected string VirtualPath {
- get {
- throw new NotImplementedException ();
- }
- }
- public virtual bool AllowBaseType (
- Type baseType
- ) {
- throw new NotImplementedException ();
- }
- public virtual bool AllowControl (Type controlType, ControlBuilder builder) {
- throw new NotImplementedException ();
- }
- public virtual bool AllowServerSideInclude (string includeVirtualPath) {
- throw new NotImplementedException ();
- }
- public virtual bool AllowVirtualReference (string referenceVirtualPath, VirtualReferenceType referenceType) {
- throw new NotImplementedException ();
- }
- public virtual CompilationMode GetCompilationMode (CompilationMode current) {
- throw new NotImplementedException ();
- }
- public virtual void ParseComplete (ControlBuilder rootBuilder) {
- throw new NotImplementedException ();
- }
- public virtual void PreprocessDirective (string directiveName, IDictionary attributes) {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.RootBuilder
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2003 Ximian, Inc. (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.Security.Permissions;
-using System.Web.Compilation;
-using System.Web.UI.HtmlControls;
-
-namespace System.Web.UI {
-
-#if NET_2_0
- public class RootBuilder : TemplateBuilder {
-
- public RootBuilder ()
- {
- }
-#else
- public sealed class RootBuilder : TemplateBuilder {
-#endif
- public RootBuilder (TemplateParser parser)
- {
- throw new NotImplementedException ();
- }
-
- public override Type GetChildControlType (string tagName, IDictionary attribs)
- {
- throw new NotImplementedException ();
-
- }
-
-#if NET_2_0
- // FIXME: it's empty (but not null) when using the new default ctor
- // but I'm not sure when something should gets in...
- public IDictionary BuiltObjects {
- get {
- throw new NotImplementedException ();
- }
- }
-#endif
- }
-}
+++ /dev/null
-//
-// System.Web.UI.SessionPageStatePersister.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-using System.Web.UI;
-
-namespace System.Web.UI
-{
- public class SessionPageStatePersister : PageStatePersister
- {
- public SessionPageStatePersister (Page page):base(page)
- {
- throw new NotImplementedException ();
- }
-
- public override void Load ()
- {
- throw new NotImplementedException ();
- }
-
- public override void Save ()
- {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.SimpleWebHandlerParser
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.IO;
-using System.Reflection;
-using System.Security.Permissions;
-using System.Text;
-using System.Web.Compilation;
-using System.Web.Configuration;
-using System.Web.Util;
-
-namespace System.Web.UI
-{
- public abstract class SimpleWebHandlerParser
- {
- protected SimpleWebHandlerParser (HttpContext context, string virtualPath, string physicalPath)
- {
- throw new NotImplementedException ();
- }
-
- protected Type GetCompiledTypeFromCache ()
- {
- throw new NotImplementedException ();
- }
-
- // Properties
- protected abstract string DefaultDirectiveName { get; }
- }
-}
-
+++ /dev/null
-//
-// System.Web.UI.SkinBuilder.cs
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-// (C) 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.
-//
-
-#if NET_2_0
-
-namespace System.Web.UI {
-
- public sealed class SkinBuilder : ControlBuilder
- {
- public SkinBuilder (ThemeProvider provider,
- Control control,
- ControlBuilder skinBuilder,
- string themePath)
- {
- throw new NotImplementedException ();
- }
-
- public Control ApplyTheme ()
- {
- throw new NotImplementedException ();
- }
- }
-
-}
-
-#endif
+++ /dev/null
-//
-// System.Web.UI.TemplateBuilder
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2003 Ximian, Inc. (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.Reflection;
-using System.Security.Permissions;
-#if NET_2_0
-using System.ComponentModel;
-#endif
-
-namespace System.Web.UI {
-
- public class TemplateBuilder : ControlBuilder, ITemplate {
-
- public TemplateBuilder ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual string Text {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
-#if NET_2_0
- public override object BuildObject ()
- {
- throw new NotImplementedException ();
- }
-#endif
-
- public override void Init (TemplateParser parser,
- ControlBuilder parentBuilder,
- Type type,
- string tagName,
- string ID,
- IDictionary attribs)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void InstantiateIn (Control container)
- {
- throw new NotImplementedException ();
- }
-
- public override bool NeedsTagInnerText ()
- {
- throw new NotImplementedException ();
- }
-
- public override void SetTagInnerText (string text)
- {
- throw new NotImplementedException ();
- }
- }
-}
-
+++ /dev/null
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Reflection;
-using System.Web;
-using System.IO;
-using System.Web.J2EE;
-using System.Xml;
-using vmw.common;
-using System.Web.Util;
-using System.Collections.Generic;
-
-namespace System.Web.UI {
-
- public abstract class TemplateControl : Control, INamingContainer
- {
- static readonly object abortTransaction = new object ();
- static readonly object commitTransaction = new object ();
- static readonly object error = new object ();
- static readonly string [] methodNames = { "Page_Init",
-#if NET_2_0
- "Page_PreInit",
- "Page_PreLoad",
- "Page_LoadComplete",
- "Page_PreRenderComplete",
- "Page_SaveStateComplete",
- "Page_InitComplete",
-#endif
- "Page_Load",
- "Page_DataBind",
- "Page_PreRender",
- "Page_Disposed",
- "Page_Unload",
- "Page_Error",
- "Page_AbortTransaction",
- "Page_CommitTransaction" };
-
- static readonly object [] EventKeys = {
- Control.InitEvent,
-#if NET_2_0
- Page.PreInitEvent,
- Page.PreLoadEvent,
- Page.LoadCompleteEvent,
- Page.PreRenderCompleteEvent,
- Page.SaveStateCompleteEvent,
- Page.InitCompleteEvent,
-#endif
- Control.LoadEvent,
- Control.DataBindingEvent,
- Control.PreRenderEvent,
- Control.DisposedEvent,
- Control.UnloadEvent,
- error,
- abortTransaction,
- commitTransaction
- };
-
- enum LifeCycleEvent
- {
- Init,
-#if NET_2_0
- PreInit,
- PreLoad,
- LoadComplete,
- PreRenderComplete,
- SaveStateComplete,
- InitComplete,
-#endif
- Load,
- DataBinding,
- PreRender,
- Disposed,
- Unload,
- Error,
- AbortTransaction,
- CommitTransaction
- }
-
- const BindingFlags bflags = BindingFlags.Public |
- BindingFlags.NonPublic |
- BindingFlags.Instance;
-
- byte [] GetResourceBytes (Type type)
- {
- Hashtable table = (Hashtable) AppDomain.CurrentDomain.GetData ("TemplateControl.RES_BYTES");
- if (table == null) {
- return null;
- }
- return (byte []) table [type];
- }
- void SetResourceBytes (Type type, byte [] bytes)
- {
- Hashtable table = (Hashtable) AppDomain.CurrentDomain.GetData ("TemplateControl.RES_BYTES");
- if (table == null) {
- table = new Hashtable ();
- AppDomain.CurrentDomain.SetData ("TemplateControl.RES_BYTES", table);
- }
- table [type] = bytes;
- return;
- }
-
- Hashtable ResourceHash
- {
- get
- {
- Hashtable table = (Hashtable) AppDomain.CurrentDomain.GetData ("TemplateControl.RES_STRING");
- if (table == null) {
- table = new Hashtable ();
- AppDomain.CurrentDomain.SetData ("TemplateControl.RES_STRING", table);
- }
- return table;
- }
- set
- {
- AppDomain.CurrentDomain.SetData ("TemplateControl.RES_STRING", value);
- }
- }
-
- string CachedString (Type type, int offset, int size)
- {
- CacheKey key = new CacheKey (type, offset, size);
-
- string strObj = (string) ResourceHash [key];
- if (strObj == null) {
- char [] tmp = System.Text.Encoding.UTF8.GetChars (GetResourceBytes (this.GetType ()), offset, size);
- strObj = new string (tmp);
-
- Hashtable tmpResourceHash = (Hashtable) ResourceHash.Clone ();
- tmpResourceHash.Add (key, strObj);
- ResourceHash = tmpResourceHash;
- }
- return strObj;
- }
- public virtual string TemplateSourceDirectory_Private
- {
- get { return null; }
- }
-
- #region Constructor
- protected TemplateControl ()
- {
- Construct ();
- }
-
- #endregion
-
- #region Properties
- [EditorBrowsable (EditorBrowsableState.Never)]
- protected virtual int AutoHandlers
- {
- get { return 0; }
- set { }
- }
-
- [EditorBrowsable (EditorBrowsableState.Never)]
- protected virtual bool SupportAutoEvents
- {
- get { return true; }
- }
-
- #endregion
-
- #region Methods
-
- protected virtual void Construct ()
- {
- }
-
- [MonoTODO]
- protected LiteralControl CreateResourceBasedLiteralControl (int offset,
- int size,
- bool fAsciiOnly)
- {
- string str = CachedString (this.GetType (), offset, size);
- return new LiteralControl (str);
- }
-
- sealed class EventMethodMap
- {
- public EventMethodMap (LifeCycleEvent EventKeyIndex, MethodInfo Method, bool NoParameters)
- {
- this.EventKeyIndex = EventKeyIndex;
- this.Method = Method;
- this.NoParameters = NoParameters;
- }
-
- public readonly LifeCycleEvent EventKeyIndex;
- public readonly MethodInfo Method;
- public readonly bool NoParameters;
- }
-
- // This hashtable cashes methods and events found in user code
- const string eventMethodCacheKey = "eventMethodCacheKey";
- static Hashtable EventMethodCache
- {
- get { return (Hashtable) AppDomain.CurrentDomain.GetData (eventMethodCacheKey); }
- set { AppDomain.CurrentDomain.SetData (eventMethodCacheKey, value); }
- }
-
- internal void WireupAutomaticEvents ()
- {
- Type cacheKey = this.GetType ();
- Hashtable eventMethodCache = EventMethodCache;
- ArrayList eventMethodList = eventMethodCache == null ? null : (ArrayList) eventMethodCache [cacheKey];
-
- if (eventMethodList == null) {
- eventMethodList = new ArrayList ();
-
- if (!SupportAutoEvents || !AutoEventWireup)
- return;
-
- Type thisType = typeof (TemplateControl);
- Type voidType = typeof (void);
- Type [] DefaultParams = new Type [] {
- typeof (object),
- typeof (EventArgs) };
-
- LifeCycleEvent[] _pageEvents = new LifeCycleEvent[] {
- LifeCycleEvent.PreInit,
- LifeCycleEvent.PreLoad,
- LifeCycleEvent.LoadComplete,
- LifeCycleEvent.PreRenderComplete,
- LifeCycleEvent.SaveStateComplete,
- LifeCycleEvent.InitComplete
- };
- List<LifeCycleEvent> pageEvents = new List<LifeCycleEvent>(_pageEvents);
-
- bool isPage = Page.GetType().IsAssignableFrom(GetType());
-
- for (int i = 0; i < methodNames.Length; i++) {
-
- // Don't look for page-only events in non-page controls.
- if (!isPage && pageEvents.Contains((LifeCycleEvent)i))
- continue;
-
- string methodName = methodNames [i];
- MethodInfo method;
- bool noParams = false;
- Type type = GetType ();
- do {
- method = type.GetMethod (methodName, bflags, null, DefaultParams, null);
- if (method != null) {
- break;
- }
-
- type = type.BaseType;
- }
- while (type != thisType);
-
- if (method == null) {
- type = GetType ();
- do {
- method = type.GetMethod (methodName, bflags, null, Type.EmptyTypes, null);
- if (method != null) {
- noParams = true;
- break;
- }
-
- type = type.BaseType;
- }
- while (type != thisType);
-
- if (method == null)
- continue;
- }
- if (method.ReturnType != voidType)
- continue;
-
- eventMethodList.Add (new EventMethodMap ((LifeCycleEvent) i, method, noParams));
- }
- // We copy to not lock
-
- Hashtable newEventMethodCache = eventMethodCache == null ? new Hashtable () : (Hashtable) eventMethodCache.Clone ();
- newEventMethodCache [cacheKey] = eventMethodList;
- EventMethodCache = newEventMethodCache;
- }
-
- foreach (EventMethodMap eventMethod in eventMethodList) {
- EventHandler handler = eventMethod.NoParameters ?
- new NoParamsInvoker (this, eventMethod.Method).FakeDelegate :
- (EventHandler)Delegate.CreateDelegate (typeof (EventHandler), this, eventMethod.Method);
-
- object eventKey = EventKeys [(int) eventMethod.EventKeyIndex];
-
- Delegate existing = Events [eventKey];
- if (existing != null && handler.Equals(existing))
- continue;
-
- switch (eventMethod.EventKeyIndex) {
- case LifeCycleEvent.Init:
- Init += handler;
- break;
-#if NET_2_0
- case LifeCycleEvent.PreInit:
- ((Page)this).PreInit += handler;
- break;
- case LifeCycleEvent.PreLoad:
- ((Page) this).PreLoad += handler;
- break;
- case LifeCycleEvent.LoadComplete:
- ((Page) this).LoadComplete += handler;
- break;
- case LifeCycleEvent.PreRenderComplete:
- ((Page) this).PreRenderComplete += handler;
- break;
- case LifeCycleEvent.SaveStateComplete:
- ((Page) this).SaveStateComplete += handler;
- break;
- case LifeCycleEvent.InitComplete:
- ((Page) this).InitComplete += handler;
- break;
-#endif
- case LifeCycleEvent.Load:
- Load += handler;
- break;
- case LifeCycleEvent.DataBinding:
- DataBinding += handler;
- break;
- case LifeCycleEvent.PreRender:
- PreRender += handler;
- break;
- case LifeCycleEvent.Disposed:
- Disposed += handler;
- break;
- case LifeCycleEvent.Unload:
- Unload += handler;
- break;
- case LifeCycleEvent.Error:
- Error += handler;
- break;
- case LifeCycleEvent.AbortTransaction:
- AbortTransaction += handler;
- break;
- case LifeCycleEvent.CommitTransaction:
- CommitTransaction += handler;
- break;
- }
- }
- }
-
- [EditorBrowsable (EditorBrowsableState.Never)]
- protected virtual void FrameworkInitialize ()
- {
- }
-
- Type GetTypeFromControlPath (string virtualPath)
- {
- if (virtualPath == null)
- throw new ArgumentNullException ("virtualPath");
-
- string vpath = UrlUtils.Combine (TemplateSourceDirectory, virtualPath);
- return PageMapper.GetObjectType (Context, vpath);
- }
-
- public Control LoadControl (string virtualPath)
- {
-#if NET_2_0
- if (virtualPath == null)
- throw new ArgumentNullException ("virtualPath");
-#else
- if (virtualPath == null)
- throw new HttpException ("virtualPath is null");
-#endif
- Type type = GetTypeFromControlPath (virtualPath);
- return LoadControl (type, null);
- }
-
- public Control LoadControl (Type type, object [] parameters)
- {
- object [] attrs = type.GetCustomAttributes (typeof (PartialCachingAttribute), true);
- if (attrs != null && attrs.Length == 1) {
- PartialCachingAttribute attr = (PartialCachingAttribute) attrs [0];
- PartialCachingControl ctrl = new PartialCachingControl (type, parameters);
- ctrl.VaryByParams = attr.VaryByParams;
- ctrl.VaryByControls = attr.VaryByControls;
- ctrl.VaryByCustom = attr.VaryByCustom;
- return ctrl;
- }
-
- object control = Activator.CreateInstance (type, parameters);
- if (control is UserControl)
- ((UserControl) control).InitializeAsUserControl (Page);
-
- return (Control) control;
- }
-
- public ITemplate LoadTemplate (string virtualPath)
- {
- Type t = GetTypeFromControlPath (virtualPath);
- return new SimpleTemplate (t);
- }
-
- protected virtual void OnAbortTransaction (EventArgs e)
- {
- EventHandler eh = Events [abortTransaction] as EventHandler;
- if (eh != null)
- eh (this, e);
- }
-
- protected virtual void OnCommitTransaction (EventArgs e)
- {
- EventHandler eh = Events [commitTransaction] as EventHandler;
- if (eh != null)
- eh (this, e);
- }
-
- protected virtual void OnError (EventArgs e)
- {
- EventHandler eh = Events [error] as EventHandler;
- if (eh != null)
- eh (this, e);
- }
-
- [MonoNotSupported ("Not supported")]
- public Control ParseControl (string content)
- {
- throw new NotSupportedException ();
- }
-
- [MonoLimitation ("Always returns false")]
- public virtual bool TestDeviceFilter (string filterName)
- {
- return false;
- }
-
- [MonoTODO]
- [EditorBrowsable (EditorBrowsableState.Never)]
- public static object ReadStringResource (Type t)
- {
- return t;
- }
-#if NET_2_0
- [MonoTODO ("is this correct?")]
- public Object ReadStringResource ()
- {
- return this.GetType ();
- }
-#endif
- [MonoTODO]
- [EditorBrowsable (EditorBrowsableState.Never)]
- protected void SetStringResourcePointer (object stringResourcePointer,
- int maxResourceOffset)
- {
- if (GetResourceBytes (this.GetType ()) != null)
- return;
-
- java.lang.Class c = vmw.common.TypeUtils.ToClass (stringResourcePointer);
- java.lang.ClassLoader contextClassLoader = c.getClassLoader ();
-
- //TODO:move this code to page mapper
- string assemblyName = PageMapper.GetAssemblyResource (Context, VirtualPathUtility.ToAbsolute (AppRelativeVirtualPath));
- if (assemblyName == null)
- throw new HttpException (404, "The requested resource (" + this.AppRelativeVirtualPath + ") is not available.");
-
- java.io.InputStream inputStream = contextClassLoader.getResourceAsStream (assemblyName);
-
- System.IO.Stream strim = null;
- if (inputStream == null) {
- string descPath = String.Join ("/", new string [] { "assemblies", this.GetType ().Assembly.GetName ().Name, assemblyName });
- try {
- strim = new StreamReader (HttpContext.Current.Request.MapPath ("/" + descPath)).BaseStream;
- }
- catch (Exception ex) {
- throw new System.IO.IOException ("couldn't open resource file:" + assemblyName, ex);
- }
- if (strim == null)
- throw new System.IO.IOException ("couldn't open resource file:" + assemblyName);
- }
-
- try {
- if (strim == null)
- strim = (System.IO.Stream) vmw.common.IOUtils.getStream (inputStream);
- int capacity = (int) strim.Length;
- byte [] resourceBytes = new byte [capacity];
- strim.Read (resourceBytes, 0, capacity);
- SetResourceBytes (this.GetType (), resourceBytes);
- }
- catch (Exception e) {
- throw new HttpException ("problem with dll.ghres file", e);
- }
- finally {
- if (strim != null)
- strim.Close ();
- if (inputStream != null)
- inputStream.close ();
- }
- }
-
- [MonoTODO]
- [EditorBrowsable (EditorBrowsableState.Never)]
- protected void WriteUTF8ResourceString (HtmlTextWriter output, int offset,
- int size, bool fAsciiOnly)
- {
- string str = CachedString (this.GetType (), offset, size);
- output.Write (str);
- }
-
- #endregion
-
- #region Events
-
- [WebSysDescription ("Raised when the user aborts a transaction.")]
- public event EventHandler AbortTransaction
- {
- add { Events.AddHandler (abortTransaction, value); }
- remove { Events.RemoveHandler (abortTransaction, value); }
- }
-
- [WebSysDescription ("Raised when the user initiates a transaction.")]
- public event EventHandler CommitTransaction
- {
- add { Events.AddHandler (commitTransaction, value); }
- remove { Events.RemoveHandler (commitTransaction, value); }
- }
-
- [WebSysDescription ("Raised when an exception occurs that cannot be handled.")]
- public event EventHandler Error
- {
- add { Events.AddHandler (error, value); }
- remove { Events.RemoveHandler (error, value); }
- }
-
- #endregion
-
- class SimpleTemplate : ITemplate
- {
- Type type;
-
- public SimpleTemplate (Type type)
- {
- this.type = type;
- }
-
- public void InstantiateIn (Control control)
- {
- Control template = Activator.CreateInstance (type) as Control;
- template.SetBindingContainer (false);
- control.Controls.Add (template);
- }
- }
-
- sealed class CacheKey
- {
- readonly Type _type;
- readonly int _offset;
- readonly int _size;
-
- public CacheKey (Type type, int offset, int size)
- {
- _type = type;
- _offset = offset;
- _size = size;
- }
-
- public override int GetHashCode ()
- {
- return _type.GetHashCode () ^ _offset ^ _size;
- }
-
- public override bool Equals (object obj)
- {
- if (obj == null || !(obj is CacheKey))
- return false;
-
- CacheKey key = (CacheKey) obj;
- return key._type == _type && key._offset == _offset && key._size == _size;
- }
- }
-
-#if NET_2_0
-
- string _appRelativeVirtualPath = null;
-
- public string AppRelativeVirtualPath
- {
- get { return _appRelativeVirtualPath; }
- set
- {
- if (value == null)
- throw new ArgumentNullException ("value");
- if (!UrlUtils.IsRooted (value) && !(value.Length > 0 && value [0] == '~'))
- throw new ArgumentException ("The path that is set is not rooted");
- _appRelativeVirtualPath = value;
-
- int lastSlash = _appRelativeVirtualPath.LastIndexOf ('/');
- AppRelativeTemplateSourceDirectory = (lastSlash > 0) ? _appRelativeVirtualPath.Substring (0, lastSlash + 1) : "~/";
- }
- }
-
- internal override TemplateControl TemplateControlInternal {
- get { return this; }
- }
-
- protected internal object Eval (string expression)
- {
- return DataBinder.Eval (Page.GetDataItem (), expression);
- }
-
- protected internal string Eval (string expression, string format)
- {
- return DataBinder.Eval (Page.GetDataItem (), expression, format);
- }
-
- protected internal object XPath (string xpathexpression)
- {
- return XPathBinder.Eval (Page.GetDataItem (), xpathexpression);
- }
-
- protected internal object XPath (string xpathexpression, IXmlNamespaceResolver resolver)
- {
- return XPathBinder.Eval (Page.GetDataItem (), xpathexpression, null, resolver);
- }
-
- protected internal string XPath (string xpathexpression, string format)
- {
- return XPathBinder.Eval (Page.GetDataItem (), xpathexpression, format);
- }
-
- protected internal string XPath (string xpathexpression, string format, IXmlNamespaceResolver resolver)
- {
- return XPathBinder.Eval (Page.GetDataItem (), xpathexpression, format, resolver);
- }
-
- protected internal IEnumerable XPathSelect (string xpathexpression)
- {
- return XPathBinder.Select (Page.GetDataItem (), xpathexpression);
- }
-
- protected internal IEnumerable XPathSelect (string xpathexpression, IXmlNamespaceResolver resolver)
- {
- return XPathBinder.Select (Page.GetDataItem (), xpathexpression, resolver);
- }
-
- protected object GetGlobalResourceObject (string className, string resourceKey)
- {
- return HttpContext.GetGlobalResourceObject (className, resourceKey);
- }
-
- protected object GetGlobalResourceObject (string className, string resourceKey, Type objType, string propName)
- {
- return ConvertResource (GetGlobalResourceObject (className, resourceKey), objType, propName);
- }
-
- protected Object GetLocalResourceObject (string resourceKey)
- {
- return HttpContext.GetLocalResourceObject (Context.Request.Path, resourceKey);
- }
-
- protected Object GetLocalResourceObject (string resourceKey, Type objType, string propName)
- {
- return ConvertResource (GetLocalResourceObject (resourceKey), objType, propName);
- }
-
- static Object ConvertResource (Object resource, Type objType, string propName) {
- if (resource == null)
- return resource;
-
- PropertyDescriptor pdesc = TypeDescriptor.GetProperties (objType) [propName];
- if (pdesc == null)
- return resource;
-
- TypeConverter converter = pdesc.Converter;
- if (converter == null)
- return resource;
-
- return resource is string ?
- converter.ConvertFromInvariantString ((string) resource) :
- converter.ConvertFrom (resource);
- }
-
-#endif
-
- }
-}
+++ /dev/null
-//
-// System.Web.UI.TemplateControlParser
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.IO;
-using System.Reflection;
-using System.Security.Permissions;
-using System.Web.Compilation;
-using System.Web.Configuration;
-using System.Web.Util;
-
-namespace System.Web.UI {
- public abstract class TemplateControlParser
-#if NET_2_0
- : BaseTemplateParser
-#else
- : TemplateParser
-#endif
- {
- protected TemplateControlParser ()
- {
- throw new NotImplementedException ();
- }
- }
-}
-
+++ /dev/null
-//
-// System.Web.UI.TemplateParser
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002,2003 Ximian, Inc. (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.ComponentModel;
-using System.Globalization;
-using System.IO;
-using System.Reflection;
-using System.Security.Permissions;
-using System.Web.Compilation;
-using System.Web.Configuration;
-using System.Web.Util;
-
-#if NET_2_0
-using System.Collections.Generic;
-#endif
-
-namespace System.Web.UI {
-
- public abstract class TemplateParser : BaseParser
- {
- protected abstract Type CompileIntoType ();
- }
-}
-
+++ /dev/null
-//
-// System.Web.UI.TemplatePropertyEntry.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-namespace System.Web.UI
-{
- public class TemplatePropertyEntry : BuilderPropertyEntry
- {
- public TemplatePropertyEntry()
- {
- throw new NotImplementedException ();
- }
- public bool BindableTemplate { get { throw new NotImplementedException (); } }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.ThemeProvider.cs
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-// (C) 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.
-//
-
-#if NET_2_0
-
-using System.Collections;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.ComponentModel.Design;
-
-namespace System.Web.UI {
-
- public sealed class ThemeProvider
- {
- public ThemeProvider (IDesignerHost host,
- string name,
- string themeDefinition,
- string[] cssFiles,
- string themePath)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO("Not implemented")]
- public SkinBuilder GetSkinBuilder (Control control)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("Not implemented")]
- public IDictionary GetSkinControlBuildersForControlType (Type type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("Not implemented")]
- public ICollection GetSkinsForControl (Type type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("Not implemented")]
- public int ContentHashCode {
- get { throw new NotImplementedException (); }
- }
-
- public ICollection CssFiles {
- get { throw new NotImplementedException (); }
- }
-
- public IDesignerHost DesignerHost {
- get { throw new NotImplementedException (); }
- }
-
- public string ThemeName {
- get { throw new NotImplementedException (); }
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.VerificationAttribute.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-namespace System.Web.UI
-{
- [AttributeUsageAttribute (AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true)]
- public sealed class VerificationAttribute : Attribute
- {
- public VerificationAttribute (string guideline,
- string checkpoint,
- VerificationReportLevel reportLevel,
- int priority,
- string message) {
- }
- public VerificationAttribute (string guideline,
- string checkpoint,
- VerificationReportLevel reportLevel,
- int priority,
- string message,
- VerificationRule rule,
- string conditionalProperty) {
- }
- public VerificationAttribute (string guideline,
- string checkpoint,
- VerificationReportLevel reportLevel,
- int priority,
- string message,
- VerificationRule rule,
- string conditionalProperty,
- VerificationConditionalOperator conditionalOperator,
- string conditionalValue,
- string guidelineUrl) {
- }
- public string Checkpoint {
- get {
- throw new NotImplementedException ();
- }
- }
- public string ConditionalProperty {
- get {
- throw new NotImplementedException ();
- }
- }
- public string ConditionalValue {
- get {
- throw new NotImplementedException ();
- }
- }
- public string Guideline {
- get {
- throw new NotImplementedException ();
- }
- }
- public string GuidelineUrl {
- get {
- throw new NotImplementedException ();
- }
- }
- public string Message {
- get {
- throw new NotImplementedException ();
- }
- }
- public int Priority {
- get {
- throw new NotImplementedException ();
- }
- }
- public VerificationConditionalOperator VerificationConditionalOperator {
- get {
- throw new NotImplementedException ();
- }
- }
- public VerificationReportLevel VerificationReportLevel {
- get {
- throw new NotImplementedException ();
- }
- }
- public VerificationRule VerificationRule {
- get {
- throw new NotImplementedException ();
- }
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.ViewStateException.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-using System.Runtime.Serialization;
-
-namespace System.Web.UI
-{
- [SerializableAttribute]
- public sealed class ViewStateException : Exception, ISerializable
- {
- public ViewStateException () {
- throw new NotImplementedException ();
- }
- public bool IsConnected {
- get {
- throw new NotImplementedException ();
- }
- }
- public override string Message {
- get {
- throw new NotImplementedException ();
- }
- }
- public string Path {
- get {
- throw new NotImplementedException ();
- }
- }
- public string PersistedState {
- get {
- throw new NotImplementedException ();
- }
- }
- public string Referer {
- get {
- throw new NotImplementedException ();
- }
- }
- public string RemoteAddress {
- get {
- throw new NotImplementedException ();
- }
- }
- public string RemotePort {
- get {
- throw new NotImplementedException ();
- }
- }
- public string UserAgent {
- get {
- throw new NotImplementedException ();
- }
- }
- public override void GetObjectData (SerializationInfo info, StreamingContext context) {
- throw new NotImplementedException ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.ViewStateModeByIdAttribute.cs
-//
-// Authors:
-// Arina Itkes (arinai@mainsoft.com)
-//
-// (C) 2007 Mainsoft Co. (http://www.mainsoft.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_2_0
-namespace System.Web.UI
-{
- [AttributeUsageAttribute (AttributeTargets.Class)]
- public sealed class ViewStateModeByIdAttribute : Attribute
- {
- public ViewStateModeByIdAttribute ()
- {}
- }
-}
-#endif
+++ /dev/null
-//
-// System.Web.UI.WebServiceParser
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Security.Permissions;
-using System.Web.Compilation;
-using System.Web.J2EE;
-
-namespace System.Web.UI {
-
- // CAS
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- public class WebServiceParser
- {
- public static Type GetCompiledType (string inputFile, HttpContext context)
- {
- return PageMapper.GetObjectType (context, inputFile);
- }
- }
-}
-
+++ /dev/null
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.CompilerServices;
-namespace System.Web.Util
-{
- class ICalls
- {
- ICalls () {}
-
- static public string GetMachineConfigPath ()
- {
- return ".";
- }
-
- static public string GetMachineInstallDirectory ()
- {
- return ".";
- }
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Default.targets"/>
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <NoWarn>612,618</NoWarn>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0,INSIDE_SYSTEM_WEB</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <Reference Include="System"/>
- <Reference Include="System.Drawing"/>
- <Reference Include="System.Data"/>
- <Reference Include="System.Xml"/>
- <Reference Include="System.Configuration"/>
- <Reference Include="System.EnterpriseServices"/>
- <Reference Include="Mono.Data.Sqlite">
- <HintPath>..\lib\net_2_0\Mono.Data.Sqlite.dll</HintPath>
- </Reference>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
public override string Get (string name)
{
if (!_loaded) {
-#if TARGET_JVM
- return InternalGet (name);
-#else
string s = InternalGet (name);
if (s != null && s.Length > 0)
return s;
LoadInfo ();
-#endif
}
return base.Get (name);
BrowserData parent;
string text;
string pattern;
-#if TARGET_JVM
- java.util.regex.Pattern regex;
-#else
Regex regex;
-#endif
ListDictionary data;
public BrowserData (string pattern)
lock (this_lock) {
if (regex == null)
-#if TARGET_JVM
- regex = java.util.regex.Pattern.compile (pattern);
-#else
regex = new Regex (pattern);
-#endif
}
-#if TARGET_JVM
- return regex.matcher ((java.lang.CharSequence) (object) expression).matches ();
-#else
return regex.Match (expression).Success;
-#endif
}
}
static Hashtable defaultCaps;
static readonly object lockobj = new object ();
-#if TARGET_JVM
- static bool loaded {
- get {
- return alldata != null;
- }
- set {
- if (alldata == null)
- alldata = new ArrayList ();
- }
- }
-
- const string alldataKey = "System.Web.CapabilitiesLoader.alldata";
- static ICollection alldata {
- get {
- return (ICollection) AppDomain.CurrentDomain.GetData (alldataKey);
- }
- set {
- AppDomain.CurrentDomain.SetData (alldataKey, value);
- }
- }
-
- const string userAgentsCacheKey = "System.Web.CapabilitiesLoader.userAgentsCache";
- static Hashtable userAgentsCache {
- get {
- lock (typeof (CapabilitiesLoader)) {
- Hashtable agentsCache = (Hashtable) AppDomain.CurrentDomain.GetData (userAgentsCacheKey);
- if (agentsCache == null) {
- agentsCache = Hashtable.Synchronized (new Hashtable (userAgentsCacheSize + 10));
- AppDomain.CurrentDomain.SetData (userAgentsCacheKey, agentsCache);
- }
-
- return agentsCache;
- }
- }
- }
-#else
static volatile bool loaded;
static ICollection alldata;
static Hashtable userAgentsCache = Hashtable.Synchronized(new Hashtable(userAgentsCacheSize+10));
-#endif
CapabilitiesLoader () {}
context.Handler = handler;
context.PushHandler (handler);
} catch (FileNotFoundException fnf){
-#if TARGET_JVM
- Console.WriteLine ("$$$$$$$$$$:Sys.Web Pipeline");
- Console.WriteLine (fnf.ToString ());
-#endif
if (context.Request.IsLocal)
ProcessError (HttpException.NewWithCode (404,
String.Format ("File not found {0}", fnf.FileName),
th.CurrentUICulture = new_app_culture;
}
-#if !TARGET_JVM
prev_user = Thread.CurrentPrincipal;
-#endif
}
void PostDone ()
}
Thread th = Thread.CurrentThread;
-#if !TARGET_JVM
if (Thread.CurrentPrincipal != prev_user)
Thread.CurrentPrincipal = prev_user;
-#endif
if (prev_appui_culture != null && prev_appui_culture != th.CurrentUICulture)
th.CurrentUICulture = prev_appui_culture;
if (prev_app_culture != null && prev_app_culture != th.CurrentCulture)
cultures [0] = Thread.CurrentThread.CurrentCulture;
cultures [1] = Thread.CurrentThread.CurrentUICulture;
-#if TARGET_JVM
- if (true)
-#else
if (Thread.CurrentThread.IsThreadPoolThread)
-#endif
Start (null);
else
ThreadPool.QueueUserWorkItem (x => {
if (type != null)
return type;
-#if !TARGET_JVM
Assembly [] assemblies = AppDomain.CurrentDomain.GetAssemblies ();
foreach (Assembly ass in assemblies) {
type = ass.GetType (typeName, false);
if (type != null)
return type;
-#endif
if (throwOnMissing)
throw new TypeLoadException (String.Format ("Type '{0}' cannot be found", typeName), loadException);
+++ /dev/null
-//
-// System.Web.HttpApplication.cs
-//
-// Author:
-// Miguel de Icaza (miguel@novell.com)
-// Gonzalo Paniagua (gonzalo@ximian.com)
-//
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// The Application Processing Pipeline.
-//
-// The Http application pipeline implemented in this file is a
-// beautiful thing. The application pipeline invokes a number of
-// hooks at various stages of the processing of a request. These
-// hooks can be either synchronous or can be asynchronous.
-//
-// The pipeline must ensure that every step is completed before
-// moving to the next step. A trivial thing for synchronous
-// hooks, but asynchronous hooks introduce an extra layer of
-// complexity: when the hook is invoked, the thread must
-// relinquish its control so that the thread can be reused in
-// another operation while waiting.
-//
-// To implement this functionality we used C# iterators manually;
-// we drive the pipeline by executing the various hooks from the
-// `RunHooks' routine which is an enumerator that will yield the
-// value `false' if execution must proceed or `true' if execution
-// must be stopped.
-//
-// By yielding values we can suspend execution of RunHooks.
-//
-// Special attention must be given to `in_begin' and `must_yield'
-// variables. These are used in the case that an async hook
-// completes synchronously as its important to not yield in that
-// case or we would hang.
-//
-// Many of Mono modules used to be declared async, but they would
-// actually be completely synchronous, this might resurface in the
-// future with other modules.
-//
-// TODO:
-// Events Disposed
-//
-
-using System.IO;
-using System.Collections;
-using System.ComponentModel;
-using System.Globalization;
-using System.Security.Permissions;
-using System.Security.Principal;
-using System.Threading;
-using System.Web.Configuration;
-using System.Web.SessionState;
-using System.Web.UI;
-
-namespace System.Web {
-
- // CAS
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- // attributes
- [ToolboxItem(false)]
- public class HttpApplication : IHttpAsyncHandler, IHttpHandler, IComponent, IDisposable {
- HttpContext context;
- HttpSessionState session;
- ISite isite;
-
- // The source, and the exposed API (cache).
- HttpModuleCollection modcoll;
-
- string assemblyLocation;
-
- //
- // The factory for the handler currently running.
- //
- IHttpHandlerFactory factory;
-
- //
- // Whether the pipeline should be stopped
- //
- bool stop_processing;
-
- //
- // The Pipeline
- //
- IEnumerator pipeline;
-
- // To flag when we are done processing a request from BeginProcessRequest.
- ManualResetEvent done;
-
- // The current IAsyncResult for the running async request handler in the pipeline
- AsyncRequestState begin_iar;
-
- // Tracks the current AsyncInvocation being dispatched
- AsyncInvoker current_ai;
-
- // We don't use the EventHandlerList here, but derived classes might do
- EventHandlerList events;
-
- // Culture and IPrincipal
- CultureInfo app_culture;
- CultureInfo appui_culture;
- CultureInfo prev_app_culture;
- CultureInfo prev_appui_culture;
- IPrincipal prev_user;
-
- //
- // These are used to detect the case where the EndXXX method is invoked
- // from within the BeginXXXX delegate, so we detect whether we kick the
- // pipeline from here, or from the the RunHook routine
- //
- bool must_yield;
- bool in_begin;
-
- public HttpApplication ()
- {
- done = new ManualResetEvent (false);
- }
-
- internal void InitOnce (bool full_init)
- {
- lock (this) {
- if (modcoll != null)
- return;
-
-#if NET_2_0
- HttpModulesSection modules;
- modules = (HttpModulesSection) WebConfigurationManager.GetSection ("system.web/httpModules");
-#else
- ModulesConfiguration modules;
-
- modules = (ModulesConfiguration) HttpContext.GetAppConfig ("system.web/httpModules");
-#endif
-
- modcoll = modules.LoadModules (this);
-
- if (full_init)
- HttpApplicationFactory.AttachEvents (this);
-
-#if NET_2_0
- GlobalizationSection cfg;
- cfg = (GlobalizationSection) WebConfigurationManager.GetSection ("system.web/globalization");
- app_culture = cfg.GetCulture();
- appui_culture = cfg.GetUICulture();
-#else
- GlobalizationConfiguration cfg;
- cfg = GlobalizationConfiguration.GetInstance (null);
- if (cfg != null) {
- app_culture = cfg.Culture;
- appui_culture = cfg.UICulture;
- }
-#endif
- }
- }
-
- internal string AssemblyLocation {
- get {
- if (assemblyLocation == null)
- assemblyLocation = GetType ().Assembly.Location;
- return assemblyLocation;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public HttpApplicationState Application {
- get {
- return HttpApplicationFactory.ApplicationState;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public HttpContext Context {
- get {
- return context;
- }
- }
-
- protected EventHandlerList Events {
- get {
- if (events == null)
- events = new EventHandlerList ();
-
- return events;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public HttpModuleCollection Modules {
- [AspNetHostingPermission (SecurityAction.Demand, Level = AspNetHostingPermissionLevel.High)]
- get {
- if (modcoll == null)
- modcoll = new HttpModuleCollection ();
-
- return modcoll;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public HttpRequest Request {
- get {
- if (context == null)
- throw new HttpException (Locale.GetText ("No context is available."));
-
- if (false == HttpApplicationFactory.ContextAvailable)
- throw new HttpException (Locale.GetText ("Request is not available in this context."));
-
- return context.Request;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public HttpResponse Response {
- get {
- if (context == null)
- throw new HttpException (Locale.GetText ("No context is available."));
-
- if (false == HttpApplicationFactory.ContextAvailable)
- throw new HttpException (Locale.GetText ("Response is not available in this context."));
-
- return context.Response;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public HttpServerUtility Server {
- get {
- if (context != null)
- return context.Server;
-
- //
- // This is so we can get the Server and call a few methods
- // which are not context sensitive, see HttpServerUtilityTest
- //
- return new HttpServerUtility ((HttpContext) null);
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public HttpSessionState Session {
- get {
- // Only used for Session_End
- if (session != null)
- return session;
-
- if (context == null)
- throw new HttpException (Locale.GetText ("No context is available."));
- return context.Session;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public virtual ISite Site {
- get {
- return isite;
- }
-
- set {
- isite = value;
- }
- }
-
- [Browsable (false)]
- [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
- public IPrincipal User {
- get {
- if (context == null)
- throw new HttpException (Locale.GetText ("No context is available."));
- if (context.User == null)
- throw new HttpException (Locale.GetText ("No currently authenticated user."));
-
- return context.User;
- }
- }
-
- public virtual event EventHandler Disposed;
- public virtual event EventHandler Error;
-
- public event EventHandler PreSendRequestHeaders;
- internal void TriggerPreSendRequestHeaders ()
- {
- if (PreSendRequestHeaders != null)
- PreSendRequestHeaders (this, EventArgs.Empty);
- }
-
- public event EventHandler PreSendRequestContent;
- internal void TriggerPreSendRequestContent ()
- {
- if (PreSendRequestContent != null)
- PreSendRequestContent (this, EventArgs.Empty);
- }
-
- public event EventHandler AcquireRequestState;
- public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- AcquireRequestState += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler AuthenticateRequest;
- public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- AuthenticateRequest += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler AuthorizeRequest;
- public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- AuthorizeRequest += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler BeginRequest;
- public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- BeginRequest += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler EndRequest;
- public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- EndRequest += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler PostRequestHandlerExecute;
- public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- PostRequestHandlerExecute += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler PreRequestHandlerExecute;
- public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- PreRequestHandlerExecute += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler ReleaseRequestState;
- public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- ReleaseRequestState += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler ResolveRequestCache;
- public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- ResolveRequestCache += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler UpdateRequestCache;
- public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
- UpdateRequestCache += new EventHandler (invoker.Invoke);
- }
-
-#if NET_2_0
- public event EventHandler PostAuthenticateRequest;
- public void AddOnPostAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AddOnPostAuthenticateRequestAsync (bh, eh, null);
- }
-
- public void AddOnPostAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PostAuthenticateRequest += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler PostAuthorizeRequest;
- public void AddOnPostAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AddOnPostAuthorizeRequestAsync (bh, eh, null);
- }
-
- public void AddOnPostAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PostAuthorizeRequest += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler PostResolveRequestCache;
- public void AddOnPostResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AddOnPostResolveRequestCacheAsync (bh, eh, null);
- }
-
- public void AddOnPostResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PostResolveRequestCache += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler PostMapRequestHandler;
- public void AddOnPostMapRequestHandlerAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AddOnPostMapRequestHandlerAsync (bh, eh, null);
- }
-
- public void AddOnPostMapRequestHandlerAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PostMapRequestHandler += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler PostAcquireRequestState;
- public void AddOnPostAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AddOnPostAcquireRequestStateAsync (bh, eh, null);
- }
-
- public void AddOnPostAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PostAcquireRequestState += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler PostReleaseRequestState;
- public void AddOnPostReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AddOnPostReleaseRequestStateAsync (bh, eh, null);
- }
-
- public void AddOnPostReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PostReleaseRequestState += new EventHandler (invoker.Invoke);
- }
-
- public event EventHandler PostUpdateRequestCache;
- public void AddOnPostUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
- {
- AddOnPostUpdateRequestCacheAsync (bh, eh, null);
- }
-
- public void AddOnPostUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PostUpdateRequestCache += new EventHandler (invoker.Invoke);
- }
-
- //
- // The new overloads that take a data parameter
- //
- public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- AcquireRequestState += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- AuthenticateRequest += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- AuthorizeRequest += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- BeginRequest += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- EndRequest += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PostRequestHandlerExecute += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- PreRequestHandlerExecute += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- ReleaseRequestState += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- ResolveRequestCache += new EventHandler (invoker.Invoke);
- }
-
- public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
- {
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
- UpdateRequestCache += new EventHandler (invoker.Invoke);
- }
-#endif
-
- internal event EventHandler DefaultAuthentication;
-
- //
- // Bypass all the event on the Http pipeline and go directly to EndRequest
- //
- public void CompleteRequest ()
- {
- stop_processing = true;
- }
-
- internal bool RequestCompleted {
- set { stop_processing = value; }
- }
-
- public virtual void Dispose ()
- {
- if (modcoll != null) {
- for (int i = modcoll.Count; i >= 0; i--) {
- modcoll.Get (i).Dispose ();
- }
- modcoll = null;
- }
-
- if (Disposed != null)
- Disposed (this, EventArgs.Empty);
-
- done.Close ();
- done = null;
- }
-
- public virtual string GetVaryByCustomString (HttpContext context, string custom)
- {
- if (custom == null) // Sigh
- throw new NullReferenceException ();
-
- if (0 == String.Compare (custom, "browser", true, CultureInfo.InvariantCulture))
- return context.Request.Browser.Type;
-
- return null;
- }
-
- //
- // If we catch an error, queue this error
- //
- void ProcessError (Exception e)
- {
- bool first = context.Error == null;
-
- context.AddError (e);
- if (first){
- if (Error != null){
- try {
- Error (this, EventArgs.Empty);
- } catch (ThreadAbortException ee){
- // This happens on Redirect() or End()
- Thread.ResetAbort ();
- } catch (Exception ee){
- context.AddError (ee);
- }
- }
- }
- stop_processing = true;
- }
-
- //
- // Ticks the clock: next step on the pipeline.
- //
- void Tick ()
- {
- try {
- if (pipeline.MoveNext ()){
- if ((bool)pipeline.Current)
- PipelineDone ();
- }
- } catch (Exception e) {
- Console.WriteLine ("Tick caught an exception that has not been propagated:\n" + e);
- }
- }
-
- void Resume ()
- {
- if (in_begin)
- must_yield = false;
- else
- Tick ();
- }
-
- //
- // Invoked when our async callback called from RunHooks completes,
- // we restart the pipeline here.
- //
- void async_callback_completed_cb (IAsyncResult ar)
- {
- if (current_ai.end != null){
- try {
- current_ai.end (ar);
- } catch (Exception e) {
- ProcessError (e);
- }
- }
-
- Resume ();
- }
-
- void async_handler_complete_cb (IAsyncResult ar)
- {
- IHttpAsyncHandler async_handler = ((IHttpAsyncHandler) ar.AsyncState);
-
- try {
- async_handler.EndProcessRequest (ar);
- } catch (Exception e){
- ProcessError (e);
- }
-
- Resume ();
- }
-
- //
- // This enumerator yields whether processing must be stopped:
- // true: processing of the pipeline must be stopped
- // false: processing of the pipeline must not be stopped
- //
-#if TARGET_JVM && !NET_2_0
- sealed class RunHooksEnumerator : IEnumerable, IEnumerator
- {
- Delegate [] delegates;
- int currentStep = 0;
- HttpApplication app;
-
- internal RunHooksEnumerator(HttpApplication app, Delegate list)
- {
- this.app = app;
- delegates = list.GetInvocationList ();
- }
-
- public IEnumerator GetEnumerator() { return this; }
- public object Current { get{ return app.stop_processing; } }
- public void Reset()
- {
- throw new NotImplementedException("HttpApplication.RunHooksEnumerator.Reset called.");
- }
- public bool MoveNext ()
- {
- while (currentStep < delegates.Length) {
- if (ProcessDelegate((EventHandler)delegates[currentStep++]))
- return true;
- }
- return false;
- }
-
- bool ProcessDelegate(EventHandler d)
- {
- if (d.Target != null && (d.Target is AsyncInvoker)){
- app.current_ai = (AsyncInvoker) d.Target;
-
- try {
- app.must_yield = true;
- app.in_begin = true;
- app.context.BeginTimeoutPossible ();
- app.current_ai.begin (app, EventArgs.Empty, new AsyncCallback(app.async_callback_completed_cb), app.current_ai.data);
- }
- catch (ThreadAbortException taex){
- object obj = taex.ExceptionState;
- Thread.ResetAbort ();
- app.stop_processing = true;
- if (obj is StepTimeout)
- app.ProcessError (new HttpException ("The request timed out."));
- }
- catch (Exception e){
- app.ProcessError (e);
- }
- finally {
- app.in_begin = false;
- app.context.EndTimeoutPossible ();
- }
-
- //
- // If things are still moving forward, yield this
- // thread now
- //
- if (app.must_yield)
- return true;
- else if (app.stop_processing)
- return true;
- }
- else {
- try {
- app.context.BeginTimeoutPossible ();
- d (app, EventArgs.Empty);
- } catch (ThreadAbortException taex){
- object obj = taex.ExceptionState;
- Thread.ResetAbort ();
- app.stop_processing = true;
- if (obj is StepTimeout)
- app.ProcessError (new HttpException ("The request timed out."));
- }
- catch (Exception e){
- app.ProcessError (e);
- }
- finally {
- app.context.EndTimeoutPossible ();
- }
- if (app.stop_processing)
- return true;
- }
- return false;
- }
- }
-
- IEnumerable RunHooks (Delegate list)
- {
- return new RunHooksEnumerator(this, list);
- }
-#else
- IEnumerable RunHooks (Delegate list)
- {
- Delegate [] delegates = list.GetInvocationList ();
-
- foreach (EventHandler d in delegates){
- if (d.Target != null && (d.Target is AsyncInvoker)){
- current_ai = (AsyncInvoker) d.Target;
-
- try {
- must_yield = true;
- in_begin = true;
- context.BeginTimeoutPossible ();
- current_ai.begin (this, EventArgs.Empty, async_callback_completed_cb, current_ai.data);
- } catch (ThreadAbortException taex){
- object obj = taex.ExceptionState;
- Thread.ResetAbort ();
- stop_processing = true;
- if (obj is StepTimeout)
- ProcessError (new HttpException ("The request timed out."));
- } catch (Exception e){
- ProcessError (e);
- } finally {
- in_begin = false;
- context.EndTimeoutPossible ();
- }
-
- //
- // If things are still moving forward, yield this
- // thread now
- //
- if (must_yield)
- yield return stop_processing;
- else if (stop_processing)
- yield return true;
- } else {
- try {
- context.BeginTimeoutPossible ();
- d (this, EventArgs.Empty);
- } catch (ThreadAbortException taex){
- object obj = taex.ExceptionState;
- Thread.ResetAbort ();
- stop_processing = true;
- if (obj is StepTimeout)
- ProcessError (new HttpException ("The request timed out."));
- } catch (Exception e){
- ProcessError (e);
- } finally {
- context.EndTimeoutPossible ();
- }
- if (stop_processing)
- yield return true;
- }
- }
- }
-#endif
-
- static void FinalErrorWrite (HttpResponse response, string error)
- {
- try {
- response.Write (error);
- response.Flush (true);
- } catch {
- response.Close ();
- }
- }
-
- void OutputPage ()
- {
- if (context.Error == null){
- try {
- context.Response.Flush (true);
- } catch (Exception e){
- context.AddError (e);
- }
- }
-
- Exception error = context.Error;
- if (error != null){
- HttpResponse response = context.Response;
-
- if (!response.HeadersSent){
- response.ClearHeaders ();
- response.ClearContent ();
-
- if (error is HttpException){
- response.StatusCode = ((HttpException)error).GetHttpCode ();
- } else {
- error = new HttpException ("", error);
- response.StatusCode = 500;
- }
- if (!RedirectCustomError ())
- FinalErrorWrite (response, ((HttpException) error).GetHtmlErrorMessage ());
- else
- response.Flush (true);
- } else {
- if (!(error is HttpException))
- error = new HttpException ("", error);
- FinalErrorWrite (response, ((HttpException) error).GetHtmlErrorMessage ());
- }
- }
-
- }
-
- //
- // Invoked at the end of the pipeline execution
- //
- void PipelineDone ()
- {
- try {
- if (EndRequest != null)
- EndRequest (this, EventArgs.Empty);
- } catch (Exception e){
- ProcessError (e);
- }
-
- try {
-
- OutputPage ();
- } catch (Exception e) {
- Console.WriteLine ("Internal error: OutputPage threw an exception " + e);
- } finally {
- context.WorkerRequest.EndOfRequest();
- if (begin_iar != null){
- try {
- begin_iar.Complete ();
- } catch {
- //
- // TODO: if this throws an error, we have no way of reporting it
- // Not really too bad, since the only failure might be
- // `HttpRuntime.request_processed'
- //
- }
- }
-
- done.Set ();
-
- if (factory != null && context.Handler != null){
- factory.ReleaseHandler (context.Handler);
- factory = null;
- }
-
- context.Handler = null;
- // context = null; -> moved to PostDone
- pipeline = null;
- current_ai = null;
- }
- PostDone ();
- }
-
- //
- // Events fired as described in `Http Runtime Support, HttpModules,
- // Handling Public Events'
- //
-#if TARGET_JVM && !NET_2_0
- sealed class PipeLineEnumerator : IEnumerator
- {
- readonly HttpApplication _this;
-
- object current;
- int currentYield;
- IEnumerator currentEnumerator;
-
- IHttpHandler handler = null;
-
- internal PipeLineEnumerator(HttpApplication app) {
- _this = app;
- }
-
- public object Current { get{ return currentEnumerator != null ? currentEnumerator.Current : current; } }
- public void Reset() {
- currentEnumerator = null;
- currentYield = 0;
- }
-
- void ResetEnumerator() {
- if (currentEnumerator != null) {
- current = currentEnumerator.Current;
- currentEnumerator = null;
- }
- }
-
- public bool MoveNext () {
- switch (currentYield) {
- case 0: break;
- case 1: goto yield_1;
- case 2: goto yield_2;
- case 3: goto yield_3;
- case 4: goto yield_4;
-#if NET_2_0
- case 5: goto yield_5;
-#endif
- case 6: goto yield_6;
-#if NET_2_0
- case 7: goto yield_7;
-#endif
- case 8: goto yield_8;
- case 9: goto yield_9;
-#if NET_2_0
- case 10: goto yield_10;
- case 11: goto yield_11;
-#endif
- case 12: goto yield_12;
-#if NET_2_0
- case 13: goto yield_13;
-#endif
- case 14: goto yield_14;
- case 15: goto yield_15;
-#if NET_2_0
- case 16: goto yield_16;
-#endif
- case 17: goto yield_17;
-#if NET_2_0
- case 18: goto yield_18;
-#endif
- default: goto yield_19;
- }
-
- if (_this.stop_processing) {
- //yield return true;
- current = true;
- currentYield = 1;
- return true;
- }
-yield_1:
-yield_2:
- if (_this.BeginRequest != null) {
- //foreach (bool stop in RunHooks (BeginRequest))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 2;
- currentEnumerator = _this.RunHooks(_this.BeginRequest).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-yield_3:
- if (_this.AuthenticateRequest != null) {
- //foreach (bool stop in RunHooks (AuthenticateRequest))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 3;
- currentEnumerator = _this.RunHooks(_this.AuthenticateRequest).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-yield_4:
- if (_this.DefaultAuthentication != null) {
- //foreach (bool stop in RunHooks (DefaultAuthentication))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 4;
- currentEnumerator = _this.RunHooks(_this.DefaultAuthentication).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-
-#if NET_2_0
-yield_5:
- if (_this.PostAuthenticateRequest != null) {
- //foreach (bool stop in RunHooks (AuthenticateRequest))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 5;
- currentEnumerator = _this.RunHooks(_this.PostAuthenticateRequest).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-#endif
-yield_6:
- if (_this.AuthorizeRequest != null) {
- //foreach (bool stop in RunHooks (AuthorizeRequest))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 6;
- currentEnumerator = _this.RunHooks(_this.AuthorizeRequest).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-#if NET_2_0
-yield_7:
- if (_this.PostAuthorizeRequest != null) {
- //foreach (bool stop in RunHooks (PostAuthorizeRequest))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 7;
- currentEnumerator = _this.RunHooks(_this.PostAuthorizeRequest).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-#endif
-yield_8:
- if (_this.ResolveRequestCache != null) {
- //foreach (bool stop in RunHooks (ResolveRequestCache))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 8;
- currentEnumerator = _this.RunHooks(_this.ResolveRequestCache).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-
- // Obtain the handler for the request.
- //IHttpHandler handler = null;
- try {
- handler = _this.GetHandler (_this.context);
- } catch (FileNotFoundException fnf){
- if (_this.context.Request.IsLocal)
- _this.ProcessError (new HttpException (404, String.Format ("File not found {0}", fnf.FileName), fnf));
- else
- _this.ProcessError (new HttpException (404, "File not found", fnf));
- } catch (DirectoryNotFoundException dnf){
- _this.ProcessError (new HttpException (404, "Directory not found", dnf));
- } catch (Exception e) {
- _this.ProcessError (e);
- }
-
- if (_this.stop_processing) {
- //yield return true;
- current = true;
- currentYield = 9;
- return true;
- }
-yield_9:
-#if NET_2_0
-yield_10:
- if (_this.PostResolveRequestCache != null) {
- //foreach (bool stop in RunHooks (PostResolveRequestCache))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 10;
- currentEnumerator = _this.RunHooks(_this.PostResolveRequestCache).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-yield_11:
- if (_this.PostMapRequestHandler != null) {
- //foreach (bool stop in RunHooks (PostMapRequestHandler))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 11;
- currentEnumerator = _this.RunHooks(_this.PostMapRequestHandler).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-
-#endif
-yield_12:
- if (_this.AcquireRequestState != null){
- //foreach (bool stop in RunHooks (AcquireRequestState))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 12;
- currentEnumerator = _this.RunHooks(_this.AcquireRequestState).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-
-#if NET_2_0
-yield_13:
- if (_this.PostAcquireRequestState != null){
- //foreach (bool stop in RunHooks (PostAcquireRequestState))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 13;
- currentEnumerator = _this.RunHooks(_this.PostAcquireRequestState).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-#endif
-
- //
- // From this point on, we need to ensure that we call
- // ReleaseRequestState, so the code below jumps to
- // `release:' to guarantee it rather than yielding.
- //
- if (_this.PreRequestHandlerExecute != null)
- foreach (bool stop in _this.RunHooks (_this.PreRequestHandlerExecute))
- if (stop)
- goto release;
-
- try {
- _this.context.BeginTimeoutPossible ();
- if (handler != null){
- IHttpAsyncHandler async_handler = handler as IHttpAsyncHandler;
-
- if (async_handler != null){
- _this.must_yield = true;
- _this.in_begin = true;
- async_handler.BeginProcessRequest (_this.context, new AsyncCallback(_this.async_handler_complete_cb), handler);
- } else {
- _this.must_yield = false;
- handler.ProcessRequest (_this.context);
- }
- }
- } catch (ThreadAbortException taex){
- object obj = taex.ExceptionState;
- Thread.ResetAbort ();
- _this.stop_processing = true;
- if (obj is StepTimeout)
- _this.ProcessError (new HttpException ("The request timed out."));
- } catch (Exception e){
- _this.ProcessError (e);
- } finally {
- _this.in_begin = false;
- _this.context.EndTimeoutPossible ();
- }
- if (_this.must_yield) {
- //yield return stop_processing;
- current = _this.stop_processing;
- currentYield = 14;
- return true;
- }
- else if (_this.stop_processing)
- goto release;
-yield_14:
- // These are executed after the application has returned
-
- if (_this.PostRequestHandlerExecute != null)
- foreach (bool stop in _this.RunHooks (_this.PostRequestHandlerExecute))
- if (stop)
- goto release;
-
- release:
- if (_this.ReleaseRequestState != null){
- foreach (bool stop in _this.RunHooks (_this.ReleaseRequestState)){
- //
- // Ignore the stop signal while release the state
- //
-
- }
- }
-
- if (_this.stop_processing) {
- //yield return true;
- current = true;
- currentYield = 15;
- return true;
- }
-yield_15:
-#if NET_2_0
-yield_16:
- if (_this.PostReleaseRequestState != null) {
- //foreach (bool stop in RunHooks (PostReleaseRequestState))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 16;
- currentEnumerator = _this.RunHooks(_this.PostReleaseRequestState).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-#endif
-
- if (_this.context.Error == null)
- _this.context.Response.DoFilter (true);
-yield_17:
- if (_this.UpdateRequestCache != null) {
- //foreach (bool stop in RunHooks (UpdateRequestCache))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 17;
- currentEnumerator = _this.RunHooks(_this.UpdateRequestCache).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-
-#if NET_2_0
-yield_18:
- if (_this.PostUpdateRequestCache != null) {
- //foreach (bool stop in RunHooks (PostUpdateRequestCache))
- // yield return stop;
- if (currentEnumerator == null) {
- currentYield = 18;
- currentEnumerator = _this.RunHooks(_this.PostUpdateRequestCache).GetEnumerator();
- }
- while (currentEnumerator.MoveNext())
- return true;
-
- ResetEnumerator();
- }
-#endif
- _this.PipelineDone ();
- currentYield = 19;
-yield_19:
- return false;
- }
- }
-
- IEnumerator Pipeline ()
- {
- return new PipeLineEnumerator(this);
- }
-#else
- IEnumerator Pipeline ()
- {
- if (stop_processing)
- yield return true;
-
- if (BeginRequest != null)
- foreach (bool stop in RunHooks (BeginRequest))
- yield return stop;
-
- if (AuthenticateRequest != null)
- foreach (bool stop in RunHooks (AuthenticateRequest))
- yield return stop;
-
- if (DefaultAuthentication != null)
- foreach (bool stop in RunHooks (DefaultAuthentication))
- yield return stop;
-
-#if NET_2_0
- if (PostAuthenticateRequest != null)
- foreach (bool stop in RunHooks (AuthenticateRequest))
- yield return stop;
-#endif
- if (AuthorizeRequest != null)
- foreach (bool stop in RunHooks (AuthorizeRequest))
- yield return stop;
-#if NET_2_0
- if (PostAuthorizeRequest != null)
- foreach (bool stop in RunHooks (PostAuthorizeRequest))
- yield return stop;
-#endif
-
- if (ResolveRequestCache != null)
- foreach (bool stop in RunHooks (ResolveRequestCache))
- yield return stop;
-
- // Obtain the handler for the request.
- IHttpHandler handler = null;
- try {
- handler = GetHandler (context);
- } catch (FileNotFoundException fnf){
- if (context.Request.IsLocal)
- ProcessError (new HttpException (404, String.Format ("File not found {0}", fnf.FileName), fnf));
- else
- ProcessError (new HttpException (404, "File not found", fnf));
- } catch (DirectoryNotFoundException dnf){
- ProcessError (new HttpException (404, "Directory not found", dnf));
- } catch (Exception e) {
- ProcessError (e);
- }
-
- if (stop_processing)
- yield return true;
-
-#if NET_2_0
- if (PostResolveRequestCache != null)
- foreach (bool stop in RunHooks (PostResolveRequestCache))
- yield return stop;
-
- if (PostMapRequestHandler != null)
- foreach (bool stop in RunHooks (PostMapRequestHandler))
- yield return stop;
-
-#endif
- if (AcquireRequestState != null){
- foreach (bool stop in RunHooks (AcquireRequestState))
- yield return stop;
- }
-
-#if NET_2_0
- if (PostAcquireRequestState != null){
- foreach (bool stop in RunHooks (PostAcquireRequestState))
- yield return stop;
- }
-#endif
-
- //
- // From this point on, we need to ensure that we call
- // ReleaseRequestState, so the code below jumps to
- // `release:' to guarantee it rather than yielding.
- //
- if (PreRequestHandlerExecute != null)
- foreach (bool stop in RunHooks (PreRequestHandlerExecute))
- if (stop)
- goto release;
-
- try {
- context.BeginTimeoutPossible ();
- if (handler != null){
- IHttpAsyncHandler async_handler = handler as IHttpAsyncHandler;
-
- if (async_handler != null){
- must_yield = true;
- in_begin = true;
- async_handler.BeginProcessRequest (context, async_handler_complete_cb, handler);
- } else {
- must_yield = false;
- handler.ProcessRequest (context);
- }
- }
- } catch (ThreadAbortException taex){
- object obj = taex.ExceptionState;
- Thread.ResetAbort ();
- stop_processing = true;
- if (obj is StepTimeout)
- ProcessError (new HttpException ("The request timed out."));
- } catch (Exception e){
- ProcessError (e);
- } finally {
- in_begin = false;
- context.EndTimeoutPossible ();
- }
- if (must_yield)
- yield return stop_processing;
- else if (stop_processing)
- goto release;
-
- // These are executed after the application has returned
-
- if (PostRequestHandlerExecute != null)
- foreach (bool stop in RunHooks (PostRequestHandlerExecute))
- if (stop)
- goto release;
-
- release:
- if (ReleaseRequestState != null){
- foreach (bool stop in RunHooks (ReleaseRequestState)){
- //
- // Ignore the stop signal while release the state
- //
-
- }
- }
-
- if (stop_processing)
- yield return true;
-
-#if NET_2_0
- if (PostReleaseRequestState != null)
- foreach (bool stop in RunHooks (PostReleaseRequestState))
- yield return stop;
-#endif
-
- if (context.Error == null)
- context.Response.DoFilter (true);
-
- if (UpdateRequestCache != null)
- foreach (bool stop in RunHooks (UpdateRequestCache))
- yield return stop;
-
-#if NET_2_0
- if (PostUpdateRequestCache != null)
- foreach (bool stop in RunHooks (PostUpdateRequestCache))
- yield return stop;
-#endif
- PipelineDone ();
- }
-#endif
-
- void PreStart ()
- {
-#if !TARGET_J2EE
- HttpRuntime.TimeoutManager.Add (context);
-#endif
- Thread th = Thread.CurrentThread;
- if (app_culture != null) {
- prev_app_culture = th.CurrentCulture;
- th.CurrentCulture = app_culture;
- }
-
- if (appui_culture != null) {
- prev_appui_culture = th.CurrentUICulture;
- th.CurrentUICulture = appui_culture;
- }
-
-#if !TARGET_JVM
- prev_user = Thread.CurrentPrincipal;
-#endif
- }
-
- void PostDone ()
- {
- Thread th = Thread.CurrentThread;
-#if !TARGET_JVM
- if (Thread.CurrentPrincipal != prev_user)
- Thread.CurrentPrincipal = prev_user;
-#endif
- if (prev_appui_culture != null && prev_appui_culture != th.CurrentUICulture)
- th.CurrentUICulture = prev_appui_culture;
- if (prev_app_culture != null && prev_app_culture != th.CurrentCulture)
- th.CurrentCulture = prev_app_culture;
-
-#if !TARGET_J2EE
- HttpRuntime.TimeoutManager.Remove (context);
-#endif
- context = null;
- session = null;
- HttpContext.Current = null;
- }
-
- void Start (object x)
- {
- InitOnce (true);
- PreStart ();
- pipeline = Pipeline ();
- Tick ();
- }
-
- // Used by HttpServerUtility.Execute
- internal IHttpHandler GetHandler (HttpContext context)
- {
- HttpRequest request = context.Request;
- string verb = request.RequestType;
- string url = request.FilePath;
-
- IHttpHandler handler = null;
-#if NET_2_0
- HttpHandlersSection section = (HttpHandlersSection) WebConfigurationManager.GetSection ("system.web/httpHandlers");
- object o = section.LocateHandler (verb, url);
-#else
- HandlerFactoryConfiguration factory_config = (HandlerFactoryConfiguration) HttpContext.GetAppConfig ("system.web/httpHandlers");
- object o = factory_config.LocateHandler (verb, url);
-#endif
-
- factory = o as IHttpHandlerFactory;
-
- if (factory == null) {
- handler = (IHttpHandler) o;
- } else {
- handler = factory.GetHandler (context, verb, url, request.PhysicalPath);
- }
- context.Handler = handler;
-
- return handler;
- }
-
- void IHttpHandler.ProcessRequest (HttpContext context)
- {
- begin_iar = null;
- this.context = context;
- done.Reset ();
-
- Start (null);
- done.WaitOne ();
- }
-
- //
- // This is used by FireOnAppStart, when we init the application
- // as the context is required to be set at that point (the user
- // might call methods that require it on that hook).
- //
- internal void SetContext (HttpContext context)
- {
- this.context = context;
- }
-
- internal void SetSession (HttpSessionState session)
- {
- this.session = session;
- }
-
- IAsyncResult IHttpAsyncHandler.BeginProcessRequest (HttpContext context, AsyncCallback cb, object extraData)
- {
- this.context = context;
- done.Reset ();
-
- begin_iar = new AsyncRequestState (done, cb, extraData);
-#if TARGET_JVM
- if (true)
-#else
- if (Thread.CurrentThread.IsThreadPoolThread)
-#endif
- Start (null);
- else
- ThreadPool.QueueUserWorkItem (new WaitCallback (Start), null);
-
- return begin_iar;
- }
-
- void IHttpAsyncHandler.EndProcessRequest (IAsyncResult result)
- {
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne ();
- begin_iar = null;
- }
-
- public virtual void Init ()
- {
- }
-
- bool IHttpHandler.IsReusable {
- get {
- return true;
- }
- }
-
-#region internals
- internal void ClearError ()
- {
- context.ClearError ();
- }
-
- bool RedirectErrorPage (string error_page)
- {
- if (context.Request.QueryString ["aspxerrorpath"] != null)
- return false;
-
- Response.Redirect (error_page + "?aspxerrorpath=" + Request.Path, false);
- return true;
- }
-
- bool RedirectCustomError ()
- {
- if (!context.IsCustomErrorEnabled)
- return false;
-
-#if NET_2_0
- CustomErrorsSection config = (CustomErrorsSection)WebConfigurationManager.GetSection ("system.web/customErrors");
-#else
- CustomErrorsConfig config = null;
- try {
- config = (CustomErrorsConfig) context.GetConfig ("system.web/customErrors");
- } catch { }
-#endif
-
- if (config == null) {
- if (context.ErrorPage != null)
- return RedirectErrorPage (context.ErrorPage);
-
- return false;
- }
-
-#if NET_2_0
- CustomError err = config.Errors [context.Response.StatusCode.ToString()];
- string redirect = err == null ? null : err.Redirect;
-#else
- string redirect = config [context.Response.StatusCode];
-#endif
- if (redirect == null) {
- redirect = context.ErrorPage;
- if (redirect == null)
- redirect = config.DefaultRedirect;
- }
-
- if (redirect == null)
- return false;
-
- return RedirectErrorPage (redirect);
- }
-#endregion
- }
-
- //
- // Based on Fritz' Onion's AsyncRequestState class for asynchronous IHttpAsyncHandlers
- //
- class AsyncRequestState : IAsyncResult {
- AsyncCallback cb;
- object cb_data;
- bool completed;
- ManualResetEvent complete_event = null;
-
- internal AsyncRequestState (ManualResetEvent complete_event, AsyncCallback cb, object cb_data)
- {
- this.cb = cb;
- this.cb_data = cb_data;
- this.complete_event = complete_event;
- }
-
- internal void Complete ()
- {
- completed = true;
- if (cb != null)
- cb (this);
-
- complete_event.Set ();
- }
-
- public object AsyncState {
- get {
- return cb_data;
- }
- }
-
- public bool CompletedSynchronously {
- get {
- return false;
- }
- }
-
- public bool IsCompleted {
- get {
- return completed;
- }
- }
-
- public WaitHandle AsyncWaitHandle {
- get {
- return complete_event;
- }
- }
- }
-
-#region Helper classes
-
- //
- // A wrapper to keep track of begin/end pairs
- //
- class AsyncInvoker {
- public BeginEventHandler begin;
- public EndEventHandler end;
- public object data;
-
- public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, object d)
- {
- begin = bh;
- end = eh;
- data = d;
- }
-
- public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh)
- {
- begin = bh;
- end = eh;
- }
-
- public void Invoke (object sender, EventArgs e)
- {
- throw new Exception ("This is just a dummy");
- }
- }
-#endregion
-}
-
[ThreadStatic]
static Dictionary <string, IResourceProvider> resource_providers;
-#if TARGET_JVM
- const string app_global_res_key = "HttpContext.app_global_res_key";
- internal static Assembly AppGlobalResourcesAssembly {
- get { return (Assembly) AppDomain.CurrentDomain.GetData (app_global_res_key); }
- set { AppDomain.CurrentDomain.SetData (app_global_res_key, value); }
- }
-#else
internal static Assembly AppGlobalResourcesAssembly;
-#endif
ProfileBase profile = null;
LinkedList<IHttpHandler> handlers;
// The "Current" property is set just after we have constructed it with
// the 'HttpContext (HttpWorkerRequest)' constructor.
//
-#if !TARGET_JVM // No remoting CallContext support in Grasshopper
public static HttpContext Current {
get {
return (HttpContext) CallContext.GetData ("c");
CallContext.SetData ("c", value);
}
}
-#endif
public Exception Error {
get {
return (cfg.Mode == CustomErrorMode.RemoteOnly) && !Request.IsLocal;
}
}
-#if !TARGET_JVM
public bool IsDebuggingEnabled {
get { return RuntimeHelpers.DebuggingEnabled; }
}
-#endif
public IDictionary Items {
get {
if (items == null)
+++ /dev/null
-//
-// System.Web.HttpContext.cs
-//
-// Author:
-// Eyal Alaluf (eyala@mainsoft.com)
-//
-
-//
-// Copyright (C) 2005 Mainsoft Co. (http://www.mainsoft.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;
-using System.Configuration;
-using System.Threading;
-using javax.servlet.http;
-using javax.faces.context;
-using System.Web.J2EE;
-using System.Web.UI;
-using javax.servlet;
-using System.Collections.Specialized;
-using Mainsoft.Web;
-
-namespace System.Web {
-
- public sealed partial class HttpContext {
- static readonly LocalDataStoreSlot _ContextSlot = Thread.GetNamedDataSlot ("Context");
- // No remoting support (CallContext) yet in Grasshopper
- [MonoInternalNote("Context - Use System.Remoting.Messaging.CallContext instead of Thread storage")]
- public static HttpContext Current
- {
- get { return (HttpContext) Thread.GetData (_ContextSlot); }
- set { Thread.SetData (_ContextSlot, value); }
- }
-
- public bool IsDebuggingEnabled { get { return false; } }
-
- internal bool IsServletRequest {
- get { return ServletRequest != null; }
- }
-
- internal object GetWorkerService(Type t)
- {
- IServiceProvider prv = WorkerRequest as IServiceProvider;
- return prv != null ? prv.GetService(t) : null;
- }
-
- internal HttpServlet Servlet {
- get { return (HttpServlet)GetWorkerService(typeof(HttpServlet)); }
- }
-
- internal HttpServletRequest ServletRequest {
- get { return (HttpServletRequest)GetWorkerService(typeof(HttpServletRequest)); }
- }
-
- internal NameValueCollection RequestParameters {
- get { return (NameValueCollection) GetWorkerService (typeof (NameValueCollection)); }
- }
-
- internal HttpServletResponse ServletResponse {
- get { return (HttpServletResponse)GetWorkerService(typeof(HttpServletResponse)); }
- }
-
- HttpRuntime _httpRuntime = null;
- internal HttpRuntime HttpRuntimeInstance {
- get
- {
- if (_httpRuntime == null)
- _httpRuntime = (HttpRuntime) AppDomain.CurrentDomain.GetData ("HttpRuntime");
- return _httpRuntime;
- }
- }
-
- static Hashtable resourceManagerCache
- {
- get
- {
- Hashtable cache = (Hashtable) AppDomain.CurrentDomain.GetData ("ResourceManagerCache");
- if (cache == null) {
- cache = new Hashtable ();
- AppDomain.CurrentDomain.SetData ("ResourceManagerCache", cache);
- }
- return cache;
- }
- set
- {
- AppDomain.CurrentDomain.SetData ("ResourceManagerCache", value);
- }
- }
-
- // Timeout is not supported in GH
- internal bool CheckIfTimeout (DateTime t)
- {
- return false;
- }
-
- internal bool TimeoutPossible
- {
- get { return true; }
- }
-
- internal void BeginTimeoutPossible ()
- {
- }
-
- internal void EndTimeoutPossible ()
- {
- }
-
- internal void SetWorkerRequest (HttpWorkerRequest wr) {
- WorkerRequest = wr;
- Request.SetWorkerRequest (wr);
- Response.SetWorkerRequest (wr);
- }
-
- Page _currentHandlerInternal;
- internal Page CurrentHandlerInternal
- {
- get { return _currentHandlerInternal; }
- set { _currentHandlerInternal = value; }
- }
- }
-}
}
}
-#if !TARGET_JVM
public WindowsIdentity LogonUserIdentity {
get { throw new NotImplementedException (); }
}
-#endif
string anonymous_id;
public string AnonymousID {
// GetSubStream returns a 'copy' of the InputStream with Position set to 0.
static Stream GetSubStream (Stream stream)
{
-#if !TARGET_JVM
if (stream is IntPtrStream)
return new IntPtrStream (stream);
-#endif
if (stream is MemoryStream) {
MemoryStream other = (MemoryStream) stream;
input_stream = new MemoryStream (ms.GetBuffer (), 0, (int) ms.Length, false, true);
}
-#if !TARGET_JVM
const int INPUT_BUFFER_SIZE = 32*1024;
TempFileStream GetTempStream ()
if (total < content_length)
throw HttpException.NewWithCode (411, "The request body is incomplete.", WebEventCodes.WebErrorOtherError);
}
-#endif
internal void ReleaseResources ()
{
if (!isAppVirtualPath && !virtualPath.StartsWith (appVirtualPath, RuntimeHelpers.StringComparison))
throw new InvalidOperationException (String.Format ("Failed to map path '{0}'", virtualPath));
-#if TARGET_JVM
- return worker_request.MapPath (virtualPath);
-#else
string path = worker_request.MapPath (virtualPath);
if (virtualPath [virtualPath.Length - 1] != '/' && path [path.Length - 1] == System.IO.Path.DirectorySeparatorChar)
path = path.TrimEnd (System.IO.Path.DirectorySeparatorChar);
return path;
-#endif
}
public void SaveAs (string filename, bool includeHeaders)
+++ /dev/null
-//
-// System.Web.HttpRequest.jvm.cs
-//
-//
-// Author:
-// Eyal Alaluf <eyala@mainsoft.com>
-//
-
-//
-// Copyright (C) 2006 Mainsoft, Co. (http://www.mainsoft.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.Web.Hosting;
-using javax.servlet.http;
-using System.Web.Configuration;
-using System.IO;
-using System.Collections;
-using System.Collections.Specialized;
-using Mainsoft.Web;
-
-namespace System.Web
-{
- public sealed partial class HttpRequest
- {
- const string SessionLock = "vmw.session.lock";
- const string SessionCookies = "vmw.session.cookies";
-
- static object GetJavaSessionLock (HttpSession javaSession)
- {
- lock (SessionLock) {
- object sessionLock = javaSession.getAttribute (SessionLock);
- if (sessionLock == null) {
- sessionLock = String.Copy (SessionLock);
- javaSession.setAttribute (SessionLock, sessionLock);
- }
- return sessionLock;
- }
- }
-
- void LoadWwwForm ()
- {
- HttpServletRequest servletReq = context.ServletRequest;
- if (servletReq == null) {
- NameValueCollection requestParameters = context.RequestParameters;
- if (requestParameters != null)
- form.Add (requestParameters);
- else
- RawLoadWwwForm ();
- return;
- }
-
- servletReq.setCharacterEncoding (ContentEncoding.WebName);
-
- for (java.util.Enumeration e = servletReq.getParameterNames(); e.hasMoreElements() ;) {
- string key = (string) e.nextElement();
- string [] qvalue = QueryString.GetValues (key);
- string [] qfvalue = servletReq.getParameterValues (key);
-
- for (int i = (qvalue != null) ? qvalue.Length : 0; i < qfvalue.Length; i++)
- form.Add (key, qfvalue [i]);
- }
- }
-
- const int INPUT_BUFFER_SIZE = 1024;
-
- void MakeInputStream ()
- {
- if (worker_request == null)
- throw new HttpException ("No HttpWorkerRequest");
-
- // consider for perf:
- // return ((ServletWorkerRequest)worker_request).InputStream();
-
- //
- // Use an unmanaged memory block as this might be a large
- // upload
- //
- int content_length = ContentLength;
-#if NET_2_0
- HttpRuntimeSection config = (HttpRuntimeSection) WebConfigurationManager.GetSection ("system.web/httpRuntime");
-#else
- HttpRuntimeConfig config = (HttpRuntimeConfig) HttpContext.GetAppConfig ("system.web/httpRuntime");
-#endif
- if (content_length > (config.MaxRequestLength * 1024))
- throw new HttpException ("File exceeds httpRuntime limit");
-
- byte[] content = new byte[content_length];
- if (content == null)
- throw new HttpException (String.Format ("Not enough memory to allocate {0} bytes", content_length));
-
- int total;
- byte [] buffer;
- buffer = worker_request.GetPreloadedEntityBody ();
- if (buffer != null){
- total = buffer.Length;
- if (content_length > 0)
- total = Math.Min (content_length, total);
- Array.Copy (buffer, content, total);
- }
- else
- total = 0;
-
- buffer = new byte [INPUT_BUFFER_SIZE];
- while (total < content_length) {
- int n;
- n = worker_request.ReadEntityBody (buffer, Math.Min (content_length-total, INPUT_BUFFER_SIZE));
- if (n <= 0)
- break;
- Array.Copy (buffer, 0, content, total, n);
- total += n;
- }
- if (total < content_length)
- throw new HttpException (411, "The uploaded file is incomplete");
-
- input_stream = new MemoryStream (content, 0, content.Length, false, true);
-
- DoFilter (buffer);
- }
-
- internal void GetSessionCookiesForPortal (HttpCookieCollection cookies)
- {
- if (context == null)
- return;
- if (!(context.WorkerRequest is IHttpExtendedWorkerRequest))
- return;
- IHttpExtendedWorkerRequest exWorker = (IHttpExtendedWorkerRequest) context.WorkerRequest;
- HttpSession javaSession = exWorker.GetSession (false);
- if (javaSession == null)
- return;
-
- object sessionLock = GetJavaSessionLock (javaSession);
- lock (sessionLock) {
- Hashtable sessionCookies = (Hashtable) javaSession.getAttribute (SessionCookies);
- if (sessionCookies == null)
- return;
-
- ArrayList expiredCookies = null;
- foreach (string key in sessionCookies.Keys) {
- HttpCookie sessionCookie = (HttpCookie) sessionCookies [key];
- if (sessionCookie.Expires.Ticks != 0 &&
- sessionCookie.Expires.Ticks < DateTime.Now.Ticks) {
- if (cookies [key] != null)
- cookies.Remove (key);
- else {
- if (expiredCookies == null)
- expiredCookies = new ArrayList();
- expiredCookies.Add (key);
- }
- }
- else
- cookies.Set (sessionCookie);
- }
-
- if (expiredCookies != null)
- foreach (object key in expiredCookies)
- sessionCookies.Remove (key);
- }
- }
-
- internal void SetSessionCookiesForPortal (HttpCookieCollection cookies)
- {
- if (cookies == null || cookies.Count == 0)
- return;
-
- if (!(context.WorkerRequest is IHttpExtendedWorkerRequest))
- return;
- IHttpExtendedWorkerRequest exWorker = (IHttpExtendedWorkerRequest) context.WorkerRequest;
- bool inPortletMode = !context.IsServletRequest;
- bool shouldStoreCookiesCollection = false;
- HttpSession javaSession = exWorker.GetSession (false);
-
- if (javaSession == null && inPortletMode)
- javaSession = exWorker.GetSession (true);
-
- if (javaSession == null)
- return;
-
- object sessionLock = GetJavaSessionLock (javaSession);
- lock (sessionLock) {
- Hashtable sessionCookies = (Hashtable)javaSession.getAttribute (SessionCookies);
- if (sessionCookies == null)
- if (inPortletMode) {
- sessionCookies = new Hashtable ();
- shouldStoreCookiesCollection = true;
- }
- else
- return;
-
- ArrayList sessionStoredCookies = null;
- for (int i=0; i < cookies.Count; i++) {
- HttpCookie cookie = cookies[i];
- if (sessionCookies [cookie.Name] != null || inPortletMode) {
- sessionCookies [cookie.Name] = cookie;
- if (sessionStoredCookies == null)
- sessionStoredCookies = new ArrayList();
- sessionStoredCookies. Add (cookie.Name);
- }
- }
-
- if (sessionStoredCookies != null)
- foreach (object key in sessionStoredCookies)
- cookies.Remove ((string) key);
-
- if (shouldStoreCookiesCollection)
- javaSession.setAttribute (SessionCookies, sessionCookies);
- }
- }
-
- internal void SetWorkerRequest (HttpWorkerRequest wr) {
- worker_request = wr;
- current_exe_path = null;
- file_path = null;
- base_virtual_dir = null;
- form = null;
- all_params = null;
- }
-
- }
-}
Flush ();
}
-#if TARGET_JVM
- public void WriteFile (IntPtr fileHandle, long offset, long size) {
- throw new PlatformNotSupportedException("IntPtr not supported");
- }
-#else
public void WriteFile (IntPtr fileHandle, long offset, long size)
{
if (offset < 0)
output_stream.ApplyFilter (false);
Flush ();
}
-#endif
public void WriteFile (string filename, long offset, long size)
{
+++ /dev/null
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace System.Web
-{
- partial class HttpResponse
- {
- internal void SetWorkerRequest (HttpWorkerRequest wr) {
- WorkerRequest = wr;
- }
-
- }
-}
filter = value;
}
}
-#if TARGET_JVM
-
- class BlockManager {
- const int PreferredLength = 16 * 1024;
- static readonly byte[] EmptyBuffer = new byte[0];
-
- byte[] buffer = EmptyBuffer;
- int position;
-
- public BlockManager () {
- }
-
- public int Position {
- get { return position; }
- }
-
- void EnsureCapacity (int capacity) {
- if (buffer.Length >= capacity)
- return;
-
- capacity += PreferredLength;
- capacity = (capacity / PreferredLength) * PreferredLength;
- byte[] temp = new byte[capacity];
- Array.Copy(buffer, 0, temp, 0, buffer.Length);
- buffer = temp;
- }
-
- public void Write (byte [] buffer, int offset, int count) {
- if (count == 0)
- return;
-
- EnsureCapacity (position + count);
- Array.Copy(buffer, offset, this.buffer, position, count);
- position += count;
- }
-
- public void Send (HttpWorkerRequest wr, int start, int end) {
- int length = end - start;
- if (length <= 0)
- return;
-
- if (length > buffer.Length - start)
- length = buffer.Length - start;
-
- if (start > 0) {
- byte[] temp = new byte[length];
- Array.Copy(buffer, start, temp, 0, length);
- buffer = temp;
- }
- wr.SendResponseFromMemory(buffer, length);
- }
-
- public void Send (Stream stream, int start, int end) {
- int length = end - start;
- if (length <= 0)
- return;
-
- if (length > buffer.Length - start)
- length = buffer.Length - start;
-
- stream.Write(buffer, start, length);
- }
-
- public void Dispose () {
- buffer = null;
- }
- }
-
-#else // TARGET_JVM
unsafe sealed class BlockManager {
const int PreferredLength = 128 * 1024;
byte *data;
}
}
-#endif
abstract class Bucket {
public Bucket Next;
public abstract int Length { get; }
}
-#if !TARGET_JVM
unsafe
-#endif
class ByteBucket : Bucket {
int start;
int length;
}
}
-#if TARGET_JVM
- void UnsafeWrite (HttpWorkerRequest wr, byte [] buffer, int offset, int count)
- {
- if (count <= 0)
- return;
-
- byte[] copy = new byte[count];
- Array.Copy(buffer, offset, copy, 0, count);
- wr.SendResponseFromMemory (copy, count);
- }
-#else
unsafe void UnsafeWrite (HttpWorkerRequest wr, byte [] buffer, int offset, int count)
{
fixed (byte *ptr = buffer) {
wr.SendResponseFromMemory ((IntPtr) (ptr + offset), count);
}
}
-#endif
void AppendBuffer (byte [] buffer, int offset, int count)
{
if (!(cur_bucket is ByteBucket))
+++ /dev/null
-//
-// System.Web.HttpResponseStream.cs
-//
-//
-// Author:
-// Miguel de Icaza (miguel@novell.com)
-// Ben Maurer (bmaurer@ximian.com)
-//
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.Globalization;
-using System.Runtime.InteropServices;
-
-namespace System.Web
-{
-
- //
- // HttpResponseStream implements the "OutputStream" from HttpResponse
- //
- // The MS implementation is broken in that it does not hook up this
- // to HttpResponse, so calling "Flush" on Response.OutputStream does not
- // flush the contents and produce the headers.
- //
- // You must call HttpResponse.Flush which does the actual header generation
- // and actual data flushing
- //
- internal class HttpResponseStream : Stream
- {
- Bucket first_bucket;
- Bucket cur_bucket;
- HttpResponse response;
- bool dirty = false;
-
- Stream filter;
-
- public HttpResponseStream (HttpResponse response)
- {
- this.response = response;
- }
-
- internal bool HaveFilter
- {
- get { return filter != null; }
- }
-
- public Stream Filter
- {
- get
- {
- if (filter == null)
- filter = new OutputFilterStream (this);
- return filter;
- }
- set
- {
- filter = value;
- }
- }
- abstract class Bucket
- {
- public Bucket Next;
-
- public virtual void Dispose ()
- {
- }
-
- public abstract void Send (HttpWorkerRequest wr);
- public abstract void Send (Stream stream);
- public abstract int Length { get; }
- public abstract int FreeSpace { get; }
- }
-
- class ByteBucket : Bucket
- {
-
- const int _preferredLength = 16 * 1024;
-
- int _position = 0;
- int _freeSpace = _preferredLength;
- byte [] buffer = new byte [_preferredLength];
-
- public ByteBucket ()
- {
- }
-
- public override int Length
- {
- get { return _position; }
- }
-
- public override int FreeSpace
- {
- get { return _freeSpace; }
- }
-
- public int Write (byte [] buf, int offset, int count)
- {
- if (count > _freeSpace)
- throw new InvalidOperationException ("Out of bucket space");
-
- Array.Copy (buf, offset, buffer, _position, count);
- _position += count;
- _freeSpace = _preferredLength - _position;
- return count;
- }
-
- public override void Dispose ()
- {
- buffer = null;
- }
-
- public override void Send (HttpWorkerRequest wr)
- {
- if (_position == 0)
- return;
-
- wr.SendResponseFromMemory (buffer, _position);
- }
-
- public override void Send (Stream stream)
- {
- if (_position == 0)
- return;
-
- stream.Write (buffer, 0, _position);
- }
- }
-
- class CharBucket : Bucket
- {
- const int _preferredLength = 8 * 1024;
-
- int _position = 0;
- int _freeSpace = _preferredLength;
- char [] buffer = new char [_preferredLength];
- readonly Encoding _encoding;
-
- public CharBucket (Encoding encoding)
- {
- _encoding = encoding;
- }
-
- public override int Length
- {
- get
- {
- HttpContext current = HttpContext.Current;
- Encoding enc = (current != null) ? current.Response.ContentEncoding : Encoding.UTF8;
- return enc.GetByteCount (buffer, 0, _position);
- }
- }
-
- public override int FreeSpace
- {
- get { return _freeSpace; }
- }
-
- public int Write (string buf, int offset, int count)
- {
- if (count > _freeSpace)
- throw new InvalidOperationException ("Out of bucket space");
-
- buf.CopyTo (offset, buffer, _position, count);
- _position += count;
-
- _freeSpace = _preferredLength - _position;
- return count;
- }
-
- public int Write (char [] buf, int offset, int count)
- {
- if (count > _freeSpace)
- throw new InvalidOperationException ("Out of bucket space");
-
- if (count == 1)
- buffer [_position] = buf [offset];
- else
- Array.Copy (buf, offset, buffer, _position, count);
-
- _position += count;
- _freeSpace = _preferredLength - _position;
- return count;
- }
-
- public override void Dispose ()
- {
- buffer = null;
- }
-
- public override void Send (HttpWorkerRequest wr)
- {
- if (_position == 0)
- return;
-
- wr.SendResponseFromMemory (buffer, 0, _position, _encoding);
- }
-
- public override void Send (Stream stream)
- {
- if (_position == 0)
- return;
-
- byte[] bytesToWrite =_encoding.GetBytes (buffer, 0, _position);
- stream.Write (bytesToWrite, 0, bytesToWrite.Length);
- }
- }
-
- class BufferedFileBucket : Bucket
- {
- string file;
- long offset;
- long length;
-
- public BufferedFileBucket (string f, long off, long len)
- {
- file = f;
- offset = off;
- length = len;
- }
-
- public override int Length
- {
- get { return (int) length; }
- }
-
- public override int FreeSpace
- {
- get { return int.MaxValue; }
- }
-
- public override void Send (HttpWorkerRequest wr)
- {
- wr.SendResponseFromFile (file, offset, length);
- }
-
- public override void Send (Stream stream)
- {
- using (FileStream fs = File.OpenRead (file)) {
- byte [] buffer = new byte [Math.Min (fs.Length, 32 * 1024)];
-
- long remain = fs.Length;
- int n;
- while (remain > 0 && (n = fs.Read (buffer, 0, (int) Math.Min (remain, 32 * 1024))) != 0) {
- remain -= n;
- stream.Write (buffer, 0, n);
- }
- }
- }
-
- public override string ToString ()
- {
- return String.Format ("file {0} {1} bytes from position {2}", file, length, offset);
- }
- }
-
- void AppendBucket (Bucket b)
- {
- if (first_bucket == null) {
- cur_bucket = first_bucket = b;
- return;
- }
-
- cur_bucket.Next = b;
- cur_bucket = b;
- }
-
- //
- // Nothing happens here, broken by requirement.
- // See note at the start
- //
- public override void Flush ()
- {
- }
-
- internal void Flush (HttpWorkerRequest wr, bool final_flush)
- {
- if (!dirty && !final_flush)
- return;
-
- for (Bucket b = first_bucket; b != null; b = b.Next) {
- b.Send (wr);
- }
-
- wr.FlushResponse (final_flush);
- Clear ();
- }
-
- internal int GetTotalLength ()
- {
- int size = 0;
- for (Bucket b = first_bucket; b != null; b = b.Next)
- size += b.Length;
-
- return size;
- }
-
- internal MemoryStream GetData ()
- {
- MemoryStream stream = new MemoryStream ();
- for (Bucket b = first_bucket; b != null; b = b.Next)
- b.Send (stream);
- return stream;
- }
-
- public void WriteFile (string f, long offset, long length)
- {
- if (length == 0)
- return;
-
- dirty = true;
-
- AppendBucket (new BufferedFileBucket (f, offset, length));
- // Flush () is called from HttpResponse if needed (WriteFile/TransmitFile)
- }
-
- bool filtering;
- internal void ApplyFilter (bool close)
- {
- if (filter == null)
- return;
-
- filtering = true;
- Bucket one = first_bucket;
- first_bucket = null; // This will recreate new buckets for the filtered content
- cur_bucket = null;
- dirty = false;
- for (Bucket b = one; b != null; b = b.Next)
- b.Send (filter);
-
- for (Bucket b = one; b != null; b = b.Next)
- b.Dispose ();
-
- if (close) {
- filter.Flush ();
- filter.Close ();
- filter = null;
- }
- else {
- filter.Flush ();
- }
- filtering = false;
- }
-
- public void Write (char [] buffer, int offset, int count)
- {
- bool buffering = response.BufferOutput;
-
- if (buffering) {
- // It does not matter whether we're in ApplyFilter or not
- AppendBuffer (buffer, offset, count);
- }
- else if (filter == null || filtering) {
- response.WriteHeaders (false);
- HttpWorkerRequest wr = response.WorkerRequest;
- // Direct write because not buffering
- wr.SendResponseFromMemory (buffer, offset, count, response.ContentEncoding);
- wr.FlushResponse (false);
- }
- else {
- // Write to the filter, which will call us back, and then Flush
- filtering = true;
- try {
- byte [] bytesToWrite = response.ContentEncoding.GetBytes (buffer, offset, count);
- filter.Write (bytesToWrite, 0, bytesToWrite.Length);
- }
- finally {
- filtering = false;
- }
- Flush (response.WorkerRequest, false);
- }
- }
-
- public void Write (string s, int offset, int count)
- {
- bool buffering = response.BufferOutput;
-
- if (buffering) {
- // It does not matter whether we're in ApplyFilter or not
- AppendBuffer (s, offset, count);
- }
- else if (filter == null || filtering) {
- response.WriteHeaders (false);
- HttpWorkerRequest wr = response.WorkerRequest;
- // Direct write because not buffering
- wr.SendResponseFromMemory (s, offset, count, response.ContentEncoding);
- wr.FlushResponse (false);
- }
- else {
- // Write to the filter, which will call us back, and then Flush
- filtering = true;
- try {
- byte [] bytesToWrite = response.ContentEncoding.GetBytes (s.ToCharArray (), offset, count);
- filter.Write (bytesToWrite, 0, bytesToWrite.Length);
- }
- finally {
- filtering = false;
- }
- Flush (response.WorkerRequest, false);
- }
- }
-
- public override void Write (byte [] buffer, int offset, int count)
- {
- bool buffering = response.BufferOutput;
-
- if (buffering) {
- // It does not matter whether we're in ApplyFilter or not
- AppendBuffer (buffer, offset, count);
- }
- else if (filter == null || filtering) {
- response.WriteHeaders (false);
- HttpWorkerRequest wr = response.WorkerRequest;
- // Direct write because not buffering
- if (offset == 0) {
- wr.SendResponseFromMemory (buffer, count);
- }
- else {
- UnsafeWrite (wr, buffer, offset, count);
- }
- wr.FlushResponse (false);
- }
- else {
- // Write to the filter, which will call us back, and then Flush
- filtering = true;
- try {
- filter.Write (buffer, offset, count);
- }
- finally {
- filtering = false;
- }
- Flush (response.WorkerRequest, false);
- }
- }
-
-#if TARGET_JVM
- void UnsafeWrite (HttpWorkerRequest wr, byte [] buffer, int offset, int count)
- {
- if (count <= 0)
- return;
-
- byte [] copy = new byte [count];
- Array.Copy (buffer, offset, copy, 0, count);
- wr.SendResponseFromMemory (copy, count);
- }
-#else
- unsafe void UnsafeWrite (HttpWorkerRequest wr, byte [] buffer, int offset, int count)
- {
- fixed (byte *ptr = buffer) {
- wr.SendResponseFromMemory ((IntPtr) (ptr + offset), count);
- }
- }
-#endif
- void AppendBuffer (byte [] buffer, int offset, int count)
- {
- if (!(cur_bucket is ByteBucket))
- AppendBucket (new ByteBucket ());
-
- dirty = true;
-
- while (count > 0) {
- if (cur_bucket.FreeSpace == 0)
- AppendBucket (new ByteBucket ());
-
- int len = count;
- int freeSpace = cur_bucket.FreeSpace;
-
- if (len > freeSpace)
- len = freeSpace;
-
- ((ByteBucket) cur_bucket).Write (buffer, offset, len);
- offset += len;
- count -= len;
- }
-
- }
-
- void AppendBuffer (char [] buffer, int offset, int count)
- {
- if (!(cur_bucket is CharBucket))
- AppendBucket (new CharBucket (response.ContentEncoding));
-
- dirty = true;
-
- while (count > 0) {
- if (cur_bucket.FreeSpace == 0)
- AppendBucket (new CharBucket (response.ContentEncoding));
-
- int len = count;
- int freeSpace = cur_bucket.FreeSpace;
-
- if (len > freeSpace)
- len = freeSpace;
-
- ((CharBucket) cur_bucket).Write (buffer, offset, len);
- offset += len;
- count -= len;
- }
- }
-
- void AppendBuffer (string buffer, int offset, int count)
- {
- if (!(cur_bucket is CharBucket))
- AppendBucket (new CharBucket (response.ContentEncoding));
-
- dirty = true;
-
- while (count > 0) {
- if (cur_bucket.FreeSpace == 0)
- AppendBucket (new CharBucket (response.ContentEncoding));
-
- int len = count;
- int freeSpace = cur_bucket.FreeSpace;
-
- if (len > freeSpace)
- len = freeSpace;
-
- ((CharBucket) cur_bucket).Write (buffer, offset, len);
- offset += len;
- count -= len;
- }
- }
-
- //
- // This should not flush/close or anything else, its called
- // just to free any memory we might have allocated (when we later
- // implement something with unmanaged memory).
- //
- internal void ReleaseResources (bool close_filter)
- {
- if (close_filter && filter != null) {
- filter.Close ();
- filter = null;
- }
-
- for (Bucket b = first_bucket; b != null; b = b.Next)
- b.Dispose ();
-
- first_bucket = null;
- cur_bucket = null;
- }
-
- public void Clear ()
- {
- //
- // IMPORTANT: you must dispose *AFTER* using all the buckets Byte chunks might be
- // split across two buckets if there is a file between the data.
- //
- ReleaseResources (false);
- dirty = false;
- }
-
- public override bool CanRead
- {
- get
- {
- return false;
- }
- }
-
- public override bool CanSeek
- {
- get
- {
- return false;
- }
- }
- public override bool CanWrite
- {
- get
- {
- return true;
- }
- }
-
- const string notsupported = "HttpResponseStream is a forward, write-only stream";
-
- public override long Length
- {
- get
- {
- throw new InvalidOperationException (notsupported);
- }
- }
-
- public override long Position
- {
- get
- {
- throw new InvalidOperationException (notsupported);
- }
- set
- {
- throw new InvalidOperationException (notsupported);
- }
- }
-
- public override long Seek (long offset, SeekOrigin origin)
- {
- throw new InvalidOperationException (notsupported);
- }
-
- public override void SetLength (long value)
- {
- throw new InvalidOperationException (notsupported);
- }
-
- public override int Read (byte [] buffer, int offset, int count)
- {
- throw new InvalidOperationException (notsupported);
- }
- }
-}
-
}
#endif
-#if TARGET_JVM
- [MonoNotSupported ("UnloadAppDomain is not supported")]
- public static void UnloadAppDomain ()
- {
- throw new NotImplementedException ("UnloadAppDomain is not supported");
- }
-#else
//
// Called when we are shutting down or we need to reload an application
// that has been modified (touch global.asax)
}
});
}
-#endif
//
// Shuts down the AppDomain
//
// apparently does nothing in MS.NET
}
-#if !TARGET_JVM
public virtual void SendResponseFromMemory (IntPtr data, int length)
{
if (data != IntPtr.Zero) {
SendResponseFromMemory (copy, length);
}
}
-#endif
public virtual void SetEndOfSendNotification (HttpWorkerRequest.EndOfSendNotification callback, object extraData)
{
+++ /dev/null
-//
-// System.Web.HttpWorkerRequest partial
-//
-// Authors:
-// Vladimir Krasnov (vladimirk@mainsoft.com)
-//
-// (C) 2006 Mainsoft
-//
-//
-// 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 TARGET_JVM
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace System.Web
-{
- public abstract partial class HttpWorkerRequest
- {
- java.io.Writer _outputWriter;
-
- public virtual void SendResponseFromMemory (IntPtr data, int length)
- {
- throw new NotImplementedException ("SendResponseFromMemory: unsafe buffers (IntPtr) are not supported");
- }
-
- internal void SendResponseFromMemory (string data, int offset, int length, Encoding encoding) {
- java.io.Writer writer = GetOutputWriter (encoding);
- if (writer == null) //if was redirected - silently returns null
- return;
-
- writer.write (data, offset, length);
- }
-
- internal void SendResponseFromMemory (char [] data, int offset, int length, Encoding encoding) {
- java.io.Writer writer = GetOutputWriter (encoding);
- if (writer == null) //if was redirected - silently returns null
- return;
-
- writer.write (data, offset, length);
- }
-
- java.io.Writer GetOutputWriter (Encoding encoding) {
- if (_outputWriter == null) {
- IServiceProvider prov = this as IServiceProvider;
- if (prov == null)
- ; //throw ;
-
- javax.servlet.http.HttpServletResponse sr = (javax.servlet.http.HttpServletResponse) prov.GetService (typeof (javax.servlet.http.HttpServletResponse));
- if (sr != null)
- sr.setCharacterEncoding (encoding.HeaderName);
-
- return (java.io.Writer) prov.GetService (typeof (java.io.Writer));
- }
- return _outputWriter;
- }
-
- }
-}
-
-
-#endif
{
if (buffer == null || index < 0 || count < 0 || (buffer.Length - index) < count)
throw new ArgumentOutOfRangeException ();
-#if TARGET_JVM
- output_stream.Write (buffer, index, count);
-#else
int length = encoding.GetMaxByteCount (count);
byte [] bytebuffer = GetByteBuffer (length);
int realLength = encoding.GetBytes (buffer, index, count, bytebuffer, 0);
output_stream.Write (bytebuffer, 0, realLength);
-#endif
if (response.buffer)
return;
if (index < 0 || count < 0 || ((index + count > s.Length)))
throw new ArgumentOutOfRangeException ();
-#if TARGET_JVM
- output_stream.Write (s, index, count);
-#else
int length = encoding.GetMaxByteCount (count);
byte [] bytebuffer = GetByteBuffer (length);
int realLength = encoding.GetBytes (s, index, count, bytebuffer, 0);
output_stream.Write (bytebuffer, 0, realLength);
-#endif
if (response.buffer)
return;
+++ /dev/null
-//
-// (C) 2007 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using javax.servlet.http;
-
-namespace Mainsoft.Web
-{
- public interface IHttpExtendedWorkerRequest
- {
- HttpSession GetSession (bool create);
- }
-
- public interface IHttpUnifyWorkerRequest
- {
- }
-
- public class UnifyRequestException : Exception
- {
- public UnifyRequestException (Exception innerException)
- : base (String.Empty, innerException) {
- }
- }
-}
mimeTypes.Add ("la", "audio/nspaudio");
mimeTypes.Add ("lam", "audio/x-liveaudio");
mimeTypes.Add ("latex", "application/x-latex");
+ mimeTypes.Add ("less", "text/css");
mimeTypes.Add ("list", "text/plain");
mimeTypes.Add ("lma", "audio/nspaudio");
mimeTypes.Add ("log", "text/plain");
mimeTypes.Add ("wmls", "text/vnd.wap.wmlscript");
mimeTypes.Add ("wml", "text/vnd.wap.wml");
mimeTypes.Add ("wmp", "video/x-ms-wmp");
- mimeTypes.Add ("woff", "application/x-woff");
+ mimeTypes.Add ("woff", "application/font-woff");
mimeTypes.Add ("word", "application/msword");
mimeTypes.Add ("wp5", "application/wordperfect");
mimeTypes.Add ("wp6", "application/wordperfect");
}
}
-#if TARGET_JVM
- const string SiteMap_provider = "SiteMap_provider";
- const string SiteMap_providers = "SiteMap_providers";
- static SiteMapProvider provider
- {
- get { return (SiteMapProvider) AppDomain.CurrentDomain.GetData (SiteMap_provider); }
- set { AppDomain.CurrentDomain.SetData (SiteMap_provider, value); }
- }
- static SiteMapProviderCollection providers
- {
- get { return (SiteMapProviderCollection) AppDomain.CurrentDomain.GetData (SiteMap_providers); }
- set { AppDomain.CurrentDomain.SetData (SiteMap_providers, value); }
- }
-#else
static SiteMapProvider provider;
static SiteMapProviderCollection providers;
-#endif
static object locker = new object ();
}
}
public class SiteMapNodeCollection : IList, IHierarchicalEnumerable
{
ArrayList list;
-#if TARGET_JVM
- const string _siteMapNodeCollection_EmptyList = "SiteMapNodeCollection.EmptyList";
- internal static SiteMapNodeCollection EmptyList
- {
- get { return (SiteMapNodeCollection) AppDomain.CurrentDomain.GetData (_siteMapNodeCollection_EmptyList); }
- set { AppDomain.CurrentDomain.SetData (_siteMapNodeCollection_EmptyList, value); }
- }
-#else
internal static SiteMapNodeCollection EmptyList;
-#endif
static SiteMapNodeCollection ()
{
if (strHeader != null) {
DateTime dtIfModifiedSince = DateTime.ParseExact (strHeader, "r", null);
DateTime ftime;
-#if TARGET_JVM
- try
- {
- ftime = fi.LastWriteTime.ToUniversalTime ();
- }
- catch (NotSupportedException)
- {
- // The file is in a WAR, it might be modified with last redeploy.
- try {
- ftime = (DateTime) AppDomain.CurrentDomain.GetData (".appStartTime");
- }
- catch {
- ftime = DateTime.MaxValue;
- }
- }
-#else
ftime = fi.LastWriteTime.ToUniversalTime ();
-#endif
if (ftime <= dtIfModifiedSince) {
response.ContentType = MimeTypes.GetMimeType (fileName);
response.StatusCode = 304;
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21022</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{0F744BEF-F9B1-4953-BB86-9ADBF73C3CD4}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>System.Web</RootNamespace>
- <AssemblyName>System.Web</AssemblyName>
- <JDKName>1.4.2</JDKName>
- <GHProjectType>1</GHProjectType>
- <!-- workaqround that should be changed to be "framework" when we will be able to compile without MS refs -->
- <GHProjectKind>runtime</GHProjectKind>
- <Version>2.0</Version>
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <jarserver>ip2</jarserver>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>2.0</OldToolsVersion>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">
- <OutputPath>bin\Release_Java20\</OutputPath>
- <DefineConstants>TARGET_JVM;TARGET_J2EE;NET_1_1;NET_2_0</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <Optimize>true</Optimize>
- <NoStdLib>false</NoStdLib>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>False</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.4.2</JDKName>
- <TargetPlatform>0</TargetPlatform>
- <NoWarn>67,168,169,219,414,612,618,649</NoWarn>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Java\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;TARGET_J2EE;NET_1_1;ONLY_1_1</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <NoStdLib>false</NoStdLib>
- <SkipValidation>True</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <NoWarn>67,168,169,219,414,612,618,649</NoWarn>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Java\</OutputPath>
- <DefineConstants>TARGET_JVM;TARGET_J2EE;NET_1_1;ONLY_1_1</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <NoStdLib>false</NoStdLib>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <NoWarn>67,168,169,219,414,612,618,649</NoWarn>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\Debug_Java20\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;TARGET_J2EE;NET_1_1;NET_2_0</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <NoStdLib>false</NoStdLib>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>True</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.4.2</JDKName>
- <TargetPlatform>0</TargetPlatform>
- <NoWarn>67,168,169,219,414,612,618,649</NoWarn>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="..\..\build\common\Locale.cs">
- <Link>Locale.cs</Link>
- </Compile>
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">
- <Link>MonoTODOAttribute.cs</Link>
- </Compile>
- <Compile Include="System.Web.Caching\Cache.cs" />
- <Compile Include="System.Web.Caching\CacheDependency.cs" />
- <Compile Include="System.Web.Caching\CachedRawResponse.cs" />
- <Compile Include="System.Web.Caching\CachedVaryBy.cs" />
- <Compile Include="System.Web.Caching\CacheItemPriority.cs" />
- <Compile Include="System.Web.Caching\CacheItemRemovedCallback.cs" />
- <Compile Include="System.Web.Caching\CacheItemRemovedReason.cs" />
- <Compile Include="System.Web.Caching\OutputCacheModule.cs" />
- <Compile Include="System.Web.Configuration.Internal\IInternalConfigWebHost.cs" />
- <Compile Include="System.Web.Configuration\AuthConfig.cs" />
- <Compile Include="System.Web.Configuration\AuthenticationConfigHandler.cs" />
- <Compile Include="System.Web.Configuration\AuthenticationMode.cs" />
- <Compile Include="System.Web.Configuration\AuthorizationConfig.cs" />
- <Compile Include="System.Web.Configuration\AuthorizationConfigHandler.cs" />
- <Compile Include="System.Web.Configuration\ClientTargetSectionHandler.cs" />
- <Compile Include="System.Web.Configuration\CompilationConfiguration.cs" />
- <Compile Include="System.Web.Configuration\CompilationConfigurationHandler.cs" />
- <Compile Include="System.Web.Configuration\CustomErrorsConfigHandler.cs" />
- <Compile Include="System.Web.Configuration\FormsAuthPasswordFormat.cs" />
- <Compile Include="System.Web.Configuration\FormsProtectionEnum.cs" />
- <Compile Include="System.Web.Configuration\GlobalizationConfiguration.cs" />
- <Compile Include="System.Web.Configuration\GlobalizationConfigurationHandler.cs" />
- <Compile Include="System.Web.Configuration\HandlerFactoryConfiguration.cs" />
- <Compile Include="System.Web.Configuration\HttpCapabilitiesBase.cs" />
- <Compile Include="System.Web.Configuration\HttpConfigurationContext.cs" />
- <Compile Include="System.Web.Configuration\HttpHandlersSectionHandler.cs" />
- <Compile Include="System.Web.Configuration\HttpModulesConfigurationHandler.cs" />
- <Compile Include="System.Web.Configuration\HttpRuntimeConfig.cs" />
- <Compile Include="System.Web.Configuration\HttpRuntimeConfigurationHandler.cs" />
- <Compile Include="System.Web.Configuration\MachineKeyConfig.cs" />
- <Compile Include="System.Web.Configuration\MachineKeyConfigHandler.cs" />
- <Compile Include="System.Web.Configuration\MachineKeyValidation.cs" />
- <Compile Include="System.Web.Configuration\ModulesConfiguration.cs" />
- <Compile Include="System.Web.Configuration\PagesConfiguration.cs" />
- <Compile Include="System.Web.Configuration\PagesConfigurationHandler.cs" />
- <Compile Include="System.Web.Configuration\TraceConfig.cs" />
- <Compile Include="System.Web.Configuration\TraceConfigurationHandler.cs" />
- <Compile Include="System.Web.Configuration\WebControlsSectionHandler.cs" />
- <Compile Include="System.Web.Configuration_2.0\AdapterDictionary.cs" />
- <Compile Include="System.Web.Configuration_2.0\AnonymousIdentificationSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\AssemblyCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\AssemblyInfo.cs" />
- <Compile Include="System.Web.Configuration_2.0\AuthenticationSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\AuthorizationRule.cs" />
- <Compile Include="System.Web.Configuration_2.0\AuthorizationRuleAction.cs" />
- <Compile Include="System.Web.Configuration_2.0\AuthorizationRuleCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\AuthorizationSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\BufferModesCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\BufferModeSettings.cs" />
- <Compile Include="System.Web.Configuration_2.0\BuildProvider.cs" />
- <Compile Include="System.Web.Configuration_2.0\CacheSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\ClientTarget.cs" />
- <Compile Include="System.Web.Configuration_2.0\ClientTargetCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\ClientTargetSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\CodeSubDirectoriesCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\CodeSubDirectory.cs" />
- <Compile Include="System.Web.Configuration_2.0\CompilationSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\Compiler.cs" />
- <Compile Include="System.Web.Configuration_2.0\CompilerCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\CustomError.cs" />
- <Compile Include="System.Web.Configuration_2.0\CustomErrorCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\CustomErrorsMode.cs" />
- <Compile Include="System.Web.Configuration_2.0\CustomErrorsSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\DeploymentSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\EventMappingSettings.cs" />
- <Compile Include="System.Web.Configuration_2.0\EventMappingSettingsCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\ExpressionBuilder.cs" />
- <Compile Include="System.Web.Configuration_2.0\ExpressionBuilderCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\FormsAuthenticationConfiguration.cs" />
- <Compile Include="System.Web.Configuration_2.0\FormsAuthenticationCredentials.cs" />
- <Compile Include="System.Web.Configuration_2.0\FormsAuthenticationUser.cs" />
- <Compile Include="System.Web.Configuration_2.0\FormsAuthenticationUserCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\GlobalizationSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\HealthMonitoringSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\HostingEnvironmentSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpCapabilitiesBase.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpConfigurationSystem.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpCookiesSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpHandlerAction.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpHandlerActionCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpHandlersSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpModuleAction.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpModuleActionCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpModulesSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\HttpRuntimeSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\IdentitySection.cs" />
- <Compile Include="System.Web.Configuration_2.0\IRemoteWebConfigurationHostServer.cs" />
- <Compile Include="System.Web.Configuration_2.0\LowerCaseStringConverter.cs" />
- <Compile Include="System.Web.Configuration_2.0\MachineKeySection.cs" />
- <Compile Include="System.Web.Configuration_2.0\MachineKeyValidationConverter.cs" />
- <Compile Include="System.Web.Configuration_2.0\MembershipSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\NamespaceCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\NamespaceInfo.cs" />
- <Compile Include="System.Web.Configuration_2.0\NullableStringValidator.cs" />
- <Compile Include="System.Web.Configuration_2.0\OutputCacheProfile.cs" />
- <Compile Include="System.Web.Configuration_2.0\OutputCacheProfileCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\OutputCacheSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\OutputCacheSettingsSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\PagesEnableSessionState.cs" />
- <Compile Include="System.Web.Configuration_2.0\PagesSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\PassportAuthentication.cs" />
- <Compile Include="System.Web.Configuration_2.0\PositiveTimeSpanValidator.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProcessModelComAuthenticationLevel.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProcessModelComImpersonationLevel.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProcessModelLogLevel.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProcessModelSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProfileGroupSettings.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProfileGroupSettingsCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProfilePropertyNameValidator.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProfilePropertySettings.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProfilePropertySettingsCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProfileSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProfileSettings.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProfileSettingsCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\PropertyHelper.cs" />
- <Compile Include="System.Web.Configuration_2.0\ProvidersHelper.cs" />
- <Compile Include="System.Web.Configuration_2.0\RegexWorker.cs" />
- <Compile Include="System.Web.Configuration_2.0\RoleManagerSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\RootProfilePropertySettingsCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\RuleSettings.cs" />
- <Compile Include="System.Web.Configuration_2.0\RuleSettingsCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\SecurityPolicySection.cs" />
- <Compile Include="System.Web.Configuration_2.0\SerializationMode.cs" />
- <Compile Include="System.Web.Configuration_2.0\SessionPageStateSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\SessionStateSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\SiteMapSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\SqlCacheDependencyDatabase.cs" />
- <Compile Include="System.Web.Configuration_2.0\SqlCacheDependencyDatabaseCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\SqlCacheDependencySection.cs" />
- <Compile Include="System.Web.Configuration_2.0\SystemWebCachingSectionGroup.cs" />
- <Compile Include="System.Web.Configuration_2.0\SystemWebSectionGroup.cs" />
- <Compile Include="System.Web.Configuration_2.0\TagMapCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\TagMapInfo.cs" />
- <Compile Include="System.Web.Configuration_2.0\TagPrefixCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\TagPrefixInfo.cs" />
- <Compile Include="System.Web.Configuration_2.0\TraceDisplayMode.cs" />
- <Compile Include="System.Web.Configuration_2.0\TraceSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\TransformerInfo.cs" />
- <Compile Include="System.Web.Configuration_2.0\TransformerInfoCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\TrustLevel.cs" />
- <Compile Include="System.Web.Configuration_2.0\TrustLevelCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\TrustSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\UrlMapping.cs" />
- <Compile Include="System.Web.Configuration_2.0\UrlMappingCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\UrlMappingsSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\VirtualDirectoryMapping.cs" />
- <Compile Include="System.Web.Configuration_2.0\VirtualDirectoryMappingCollection.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebApplicationLevel.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebConfigurationFileMap.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebConfigurationHost.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebConfigurationManager.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebContext.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebControlsSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebPartsPersonalization.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebPartsPersonalizationAuthorization.cs" />
- <Compile Include="System.Web.Configuration_2.0\WebPartsSection.cs" />
- <Compile Include="System.Web.Configuration_2.0\XhtmlConformanceMode.cs" />
- <Compile Include="System.Web.Configuration_2.0\XhtmlConformanceSection.cs" />
- <Compile Include="System.Web.Handlers\AssemblyResourceLoader.cs" />
- <Compile Include="System.Web.Handlers\TraceHandler.cs" />
- <Compile Include="System.Web.Hosting\AppDomainFactory.cs" />
- <Compile Include="System.Web.Hosting\ApplicationHost.cs" />
- <Compile Include="System.Web.Hosting\ApplicationInfo.cs" />
- <Compile Include="System.Web.Hosting\ApplicationManager.cs" />
- <Compile Include="System.Web.Hosting\AppManagerAppDomainFactory.cs" />
- <Compile Include="System.Web.Hosting\BareApplicationHost.cs" />
- <Compile Include="System.Web.Hosting\DefaultVirtualDirectory.cs" />
- <Compile Include="System.Web.Hosting\DefaultVirtualFile.cs" />
- <Compile Include="System.Web.Hosting\DefaultVirtualPathProvider.cs" />
- <Compile Include="System.Web.Hosting\HostingEnvironment.cs" />
- <Compile Include="System.Web.Hosting\IAppDomainFactory.cs" />
- <Compile Include="System.Web.Hosting\IAppManagerAppDomainFactory.cs" />
- <Compile Include="System.Web.Hosting\IISAPIRuntime.cs" />
- <Compile Include="System.Web.Hosting\IRegisteredObject.cs" />
- <Compile Include="System.Web.Hosting\ISAPIRuntime.cs" />
- <Compile Include="System.Web.Hosting\SimpleWorkerRequest.cs" />
- <Compile Include="System.Web.Hosting\VirtualDirectory.cs" />
- <Compile Include="System.Web.Hosting\VirtualFile.cs" />
- <Compile Include="System.Web.Hosting\VirtualFileBase.cs" />
- <Compile Include="System.Web.Hosting\VirtualPathProvider.cs" />
- <Compile Include="System.Web.J2EE\J2EEConsts.cs" />
- <Compile Include="System.Web.J2EE\J2EEUtils.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.J2EE\PageMapper.cs" />
- <Compile Include="System.Web.Mail\Base64AttachmentEncoder.cs" />
- <Compile Include="System.Web.Mail\IAttachmentEncoder.cs" />
- <Compile Include="System.Web.Mail\MailAddress.cs" />
- <Compile Include="System.Web.Mail\MailAddressCollection.cs" />
- <Compile Include="System.Web.Mail\MailAttachment.cs" />
- <Compile Include="System.Web.Mail\MailEncoding.cs" />
- <Compile Include="System.Web.Mail\MailFormat.cs" />
- <Compile Include="System.Web.Mail\MailHeader.cs" />
- <Compile Include="System.Web.Mail\MailMessage.cs" />
- <Compile Include="System.Web.Mail\MailMessageWrapper.cs" />
- <Compile Include="System.Web.Mail\MailPriority.cs" />
- <Compile Include="System.Web.Mail\MailUtil.cs" />
- <Compile Include="System.Web.Mail\RelatedBodyPart.cs" />
- <Compile Include="System.Web.Mail\SmtpClient.cs" />
- <Compile Include="System.Web.Mail\SmtpException.cs" />
- <Compile Include="System.Web.Mail\SmtpMail.cs" />
- <Compile Include="System.Web.Mail\SmtpResponse.cs" />
- <Compile Include="System.Web.Mail\SmtpStream.cs" />
- <Compile Include="System.Web.Mail\ToUUEncodingTransform.cs" />
- <Compile Include="System.Web.Mail\UUAttachmentEncoder.cs" />
- <Compile Include="System.Web.Management\EventNotificationType.cs" />
- <Compile Include="System.Web.Management\IRegiisUtility.cs" />
- <Compile Include="System.Web.Management\IWebEventCustomEvaluator.cs" />
- <Compile Include="System.Web.Management\RuleFiringRecord.cs" />
- <Compile Include="System.Web.Management\SessionStateType.cs" />
- <Compile Include="System.Web.Management\SqlFeatures.cs" />
- <Compile Include="System.Web.Management\WebApplicationInformation.cs" />
- <Compile Include="System.Web.Management\WebBaseEvent.cs" />
- <Compile Include="System.Web.Management\WebEventFormatter.cs" />
- <Compile Include="System.Web.Profile\CustomProviderDataAttribute.cs" />
- <Compile Include="System.Web.Profile\DefaultProfile.cs" />
- <Compile Include="System.Web.Profile\ProfileAuthenticationOption.cs" />
- <Compile Include="System.Web.Profile\ProfileAutoSaveEventArgs.cs" />
- <Compile Include="System.Web.Profile\ProfileAutoSaveEventHandler.cs" />
- <Compile Include="System.Web.Profile\ProfileBase.cs" />
- <Compile Include="System.Web.Profile\ProfileEventArgs.cs" />
- <Compile Include="System.Web.Profile\ProfileEventHandler.cs" />
- <Compile Include="System.Web.Profile\ProfileGroupBase.cs" />
- <Compile Include="System.Web.Profile\ProfileInfo.cs" />
- <Compile Include="System.Web.Profile\ProfileInfoCollection.cs" />
- <Compile Include="System.Web.Profile\ProfileManager.cs" />
- <Compile Include="System.Web.Profile\ProfileParser.jvm.cs" />
- <Compile Include="System.Web.Profile\ProfileMigrateEventArgs.cs" />
- <Compile Include="System.Web.Profile\ProfileMigrateEventHandler.cs" />
- <Compile Include="System.Web.Profile\ProfileModule.cs" />
- <Compile Include="System.Web.Profile\ProfileProvider.cs" />
- <Compile Include="System.Web.Profile\ProfileProviderAttribute.cs" />
- <Compile Include="System.Web.Profile\ProfileProviderCollection.cs" />
- <Compile Include="System.Web.Profile\SettingsAllowAnonymousAttribute.cs" />
- <Compile Include="System.Web.Profile\SqlProfileProvider.cs" />
- <Compile Include="System.Web.Security\ActiveDirectoryConnectionProtection.cs" />
- <Compile Include="System.Web.Security\ActiveDirectoryMembershipProvider.cs" />
- <Compile Include="System.Web.Security\AnonymousIdentificationEventArgs.cs" />
- <Compile Include="System.Web.Security\AnonymousIdentificationEventHandler.cs" />
- <Compile Include="System.Web.Security\AnonymousIdentificationModule.cs" />
- <Compile Include="System.Web.Security\CookieProtection.cs" />
- <Compile Include="System.Web.Security\DefaultAuthenticationEventArgs.cs" />
- <Compile Include="System.Web.Security\DefaultAuthenticationEventHandler.cs" />
- <Compile Include="System.Web.Security\DefaultAuthenticationModule.cs" />
- <Compile Include="System.Web.Security\FileAuthorizationModule.cs" />
- <Compile Include="System.Web.Security\FormsAuthentication.cs" />
- <Compile Include="System.Web.Security\FormsAuthenticationEventArgs.cs" />
- <Compile Include="System.Web.Security\FormsAuthenticationEventHandler.cs" />
- <Compile Include="System.Web.Security\FormsAuthenticationModule.cs" />
- <Compile Include="System.Web.Security\FormsAuthenticationTicket.cs" />
- <Compile Include="System.Web.Security\FormsIdentity.cs" />
- <Compile Include="System.Web.Security\Membership.cs" />
- <Compile Include="System.Web.Security\MembershipCreateStatus.cs" />
- <Compile Include="System.Web.Security\MembershipCreateUserException.cs" />
- <Compile Include="System.Web.Security\MembershipOnlineStatus.cs" />
- <Compile Include="System.Web.Security\MembershipPasswordException.cs" />
- <Compile Include="System.Web.Security\MembershipPasswordFormat.cs" />
- <Compile Include="System.Web.Security\MembershipProvider.cs" />
- <Compile Include="System.Web.Security\MembershipProviderCollection.cs" />
- <Compile Include="System.Web.Security\MembershipSortOptions.cs" />
- <Compile Include="System.Web.Security\MembershipUser.cs" />
- <Compile Include="System.Web.Security\MembershipUserCollection.cs" />
- <Compile Include="System.Web.Security\MembershipValidatePasswordEventHandler.cs" />
- <Compile Include="System.Web.Security\PassportAuthenticationEventArgs.cs" />
- <Compile Include="System.Web.Security\PassportAuthenticationEventHandler.cs" />
- <Compile Include="System.Web.Security\PassportAuthenticationModule.cs" />
- <Compile Include="System.Web.Security\PassportIdentity.cs" />
- <Compile Include="System.Web.Security\RoleManagerEventArgs.cs" />
- <Compile Include="System.Web.Security\RoleManagerEventHandler.cs" />
- <Compile Include="System.Web.Security\RoleManagerModule.cs" />
- <Compile Include="System.Web.Security\RolePrincipal.cs" />
- <Compile Include="System.Web.Security\RoleProvider.cs" />
- <Compile Include="System.Web.Security\RoleProviderCollection.cs" />
- <Compile Include="System.Web.Security\Roles.cs" />
- <Compile Include="System.Web.Security\SqlMembershipProvider.cs" />
- <Compile Include="System.Web.Security\SqlRoleProvider.cs" />
- <Compile Include="System.Web.Security\UrlAuthorizationModule.cs" />
- <Compile Include="System.Web.Security\ValidatePasswordEventArgs.cs" />
- <Compile Include="System.Web.SessionState\IReadOnlySessionState.cs" />
- <Compile Include="System.Web.SessionState\IRequiresSessionState.cs" />
- <Compile Include="System.Web.SessionState\IStateRuntime.cs" />
- <Compile Include="System.Web.SessionState\RemoteStateServer.cs" />
- <Compile Include="System.Web.SessionState\SessionConfig.cs" />
- <Compile Include="System.Web.SessionState\SessionDictionary.cs" />
- <Compile Include="System.Web.SessionState\SessionId.cs" />
- <Compile Include="System.Web.SessionState\SessionSQLServerHandler.cs" />
- <Compile Include="System.Web.SessionState\SessionStateMode.cs" />
- <Compile Include="System.Web.SessionState\StateRuntime.cs" />
- <Compile Include="System.Web.SessionState\StateServerItem.cs" />
- <Compile Include="System.Web.SessionState_2.0\HttpSessionState.cs" />
- <Compile Include="System.Web.SessionState_2.0\HttpSessionStateContainer.cs" />
- <Compile Include="System.Web.SessionState_2.0\IHttpSessionState.cs" />
- <Compile Include="System.Web.SessionState_2.0\ISessionIDManager.cs" />
- <Compile Include="System.Web.SessionState_2.0\ISessionStateItemCollection.cs" />
- <Compile Include="System.Web.SessionState_2.0\RemoteStateServer.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionIDManager.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionInProcHandler.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionSQLServerHandler.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionStateActions.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionStateItemCollection.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionStateItemExpireCallback.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionStateModule.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionStateServerHandler.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionStateStoreData.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionStateStoreProviderBase.cs" />
- <Compile Include="System.Web.SessionState_2.0\SessionStateUtility.cs" />
- <Compile Include="System.Web.SessionState_2.0\StateServerItem.cs" />
- <Compile Include="System.Web.UI.Adapters\ControlAdapter.cs" />
- <Compile Include="System.Web.UI.Adapters\PageAdapter.cs" />
- <Compile Include="System.Web.UI.Adapters\WmlPostFieldType.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlAnchor.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlButton.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlContainerControl.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlControl.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlForm.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlGenericControl.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlHead.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlImage.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputButton.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputCheckBox.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputControl.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputFile.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputHidden.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputImage.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputPassword.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputRadioButton.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputReset.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputSubmit.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputText.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlLink.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlMeta.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelect.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTable.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCell.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCellCollection.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableRow.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableRowCollection.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTextArea.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTitle.cs" />
- <Compile Include="System.Web.UI.WebControls.Adapters\DataBoundControlAdapter.cs" />
- <Compile Include="System.Web.UI.WebControls.Adapters\HideDisabledControlAdapter.cs" />
- <Compile Include="System.Web.UI.WebControls.Adapters\HierarchicalDataBoundControlAdapter.cs" />
- <Compile Include="System.Web.UI.WebControls.Adapters\MenuAdapter.cs" />
- <Compile Include="System.Web.UI.WebControls.Adapters\WebControlAdapter.cs" />
- <Compile Include="System.Web.UI.WebControls\AccessDataSource.cs" />
- <Compile Include="System.Web.UI.WebControls\AccessDataSourceView.cs" />
- <Compile Include="System.Web.UI.WebControls\AdCreatedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\AdCreatedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\AdRotator.cs" />
- <Compile Include="System.Web.UI.WebControls\AssociatedControlConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\AuthenticateEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\AuthenticateEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\AutoCompleteType.cs" />
- <Compile Include="System.Web.UI.WebControls\AutoGeneratedField.cs" />
- <Compile Include="System.Web.UI.WebControls\AutoGeneratedFieldProperties.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseCompareValidator.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseDataBoundControl.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseDataList.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseValidator.cs" />
- <Compile Include="System.Web.UI.WebControls\BorderStyle.cs" />
- <Compile Include="System.Web.UI.WebControls\BoundColumn.cs" />
- <Compile Include="System.Web.UI.WebControls\BoundField.cs" />
- <Compile Include="System.Web.UI.WebControls\BulletedList.cs" />
- <Compile Include="System.Web.UI.WebControls\BulletedListDisplayMode.cs" />
- <Compile Include="System.Web.UI.WebControls\BulletedListEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\BulletedListEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\BulletStyle.cs" />
- <Compile Include="System.Web.UI.WebControls\Button.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonColumn.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonColumnType.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonField.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonFieldBase.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonType.cs" />
- <Compile Include="System.Web.UI.WebControls\Calendar.cs" />
- <Compile Include="System.Web.UI.WebControls\CalendarDay.cs" />
- <Compile Include="System.Web.UI.WebControls\CalendarSelectionMode.cs" />
- <Compile Include="System.Web.UI.WebControls\ChangePassword.cs" />
- <Compile Include="System.Web.UI.WebControls\CheckBox.cs" />
- <Compile Include="System.Web.UI.WebControls\CheckBoxField.cs" />
- <Compile Include="System.Web.UI.WebControls\CheckBoxList.cs" />
- <Compile Include="System.Web.UI.WebControls\ChildTable.cs" />
- <Compile Include="System.Web.UI.WebControls\CircleHotSpot.cs" />
- <Compile Include="System.Web.UI.WebControls\CollectionDataSource.cs" />
- <Compile Include="System.Web.UI.WebControls\CommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\CommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\CommandField.cs" />
- <Compile Include="System.Web.UI.WebControls\CompareValidator.cs" />
- <Compile Include="System.Web.UI.WebControls\CompleteWizardStep.cs" />
- <Compile Include="System.Web.UI.WebControls\CompositeControl.cs" />
- <Compile Include="System.Web.UI.WebControls\CompositeDataBoundControl.cs" />
- <Compile Include="System.Web.UI.WebControls\ContainedTable.cs" />
- <Compile Include="System.Web.UI.WebControls\Content.cs" />
- <Compile Include="System.Web.UI.WebControls\ContentDirection.cs" />
- <Compile Include="System.Web.UI.WebControls\ContentPlaceHolder.cs" />
- <Compile Include="System.Web.UI.WebControls\ControlIDConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\ControlParameter.cs" />
- <Compile Include="System.Web.UI.WebControls\ControlPropertyNameConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\CookieParameter.cs" />
- <Compile Include="System.Web.UI.WebControls\CreateUserErrorEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\CreateUserErrorEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\CreateUserWizard.cs" />
- <Compile Include="System.Web.UI.WebControls\CreateUserWizardStep.cs" />
- <Compile Include="System.Web.UI.WebControls\CustomValidator.cs" />
- <Compile Include="System.Web.UI.WebControls\DataBoundControl.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlButton.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlCellType.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlCommands.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlField.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlFieldCell.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlFieldCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlFieldHeaderCell.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlRowState.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlRowType.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGrid.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridColumn.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridColumnCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridCommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridCommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridItem.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridItemCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridItemEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridItemEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridPageChangedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridPageChangedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridPagerStyle.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridSortCommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridSortCommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DataKey.cs" />
- <Compile Include="System.Web.UI.WebControls\DataKeyArray.cs" />
- <Compile Include="System.Web.UI.WebControls\DataKeyCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\DataList.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListCommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListCommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListItem.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListItemCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListItemEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListItemEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DataSourceCacheManager.cs" />
- <Compile Include="System.Web.UI.WebControls\DayNameFormat.cs" />
- <Compile Include="System.Web.UI.WebControls\DayRenderEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DayRenderEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsView.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewCommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewCommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewDeletedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewDeletedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewDeleteEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewDeleteEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewInsertedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewInsertedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewInsertEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewInsertEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewMode.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewModeEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewModeEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewPageEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewPageEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewPagerRow.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewRow.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewRowCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewUpdatedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewUpdatedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewUpdateEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewUpdateEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\DropDownList.cs" />
- <Compile Include="System.Web.UI.WebControls\EditCommandColumn.cs" />
- <Compile Include="System.Web.UI.WebControls\EmbeddedMailObject.cs" />
- <Compile Include="System.Web.UI.WebControls\EmbeddedMailObjectsCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\FileUpload.cs" />
- <Compile Include="System.Web.UI.WebControls\FirstDayOfWeek.cs" />
- <Compile Include="System.Web.UI.WebControls\FontInfo.cs" />
- <Compile Include="System.Web.UI.WebControls\FontNamesConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\FontSize.cs" />
- <Compile Include="System.Web.UI.WebControls\FontUnit.cs" />
- <Compile Include="System.Web.UI.WebControls\FontUnitConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\FormParameter.cs" />
- <Compile Include="System.Web.UI.WebControls\FormView.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewCommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewCommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewDeletedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewDeletedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewDeleteEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewDeleteEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewInsertedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewInsertedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewInsertEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewInsertEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewMode.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewModeEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewModeEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewPageEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewPageEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewRow.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewPagerRow.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewUpdatedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewUpdatedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewUpdateEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewUpdateEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridLines.cs" />
- <Compile Include="System.Web.UI.WebControls\GridView.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewCancelEditEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewCancelEditEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewCommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewCommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewDeletedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewDeletedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewDeleteEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewDeleteEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewEditEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewEditEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewPageEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewPageEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewRow.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewRowCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewRowEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewRowEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewSelectEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewSelectEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewSortEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewSortEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewUpdatedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewUpdatedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewUpdateEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewUpdateEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\HiddenField.cs" />
- <Compile Include="System.Web.UI.WebControls\HierarchicalDataBoundControl.cs" />
- <Compile Include="System.Web.UI.WebControls\HorizontalAlign.cs" />
- <Compile Include="System.Web.UI.WebControls\HorizontalAlignConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\HotSpot.cs" />
- <Compile Include="System.Web.UI.WebControls\HotSpotCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\HotSpotMode.cs" />
- <Compile Include="System.Web.UI.WebControls\HyperLink.cs" />
- <Compile Include="System.Web.UI.WebControls\HyperLinkColumn.cs" />
- <Compile Include="System.Web.UI.WebControls\HyperLinkField.cs" />
- <Compile Include="System.Web.UI.WebControls\IButtonControl.cs" />
- <Compile Include="System.Web.UI.WebControls\ICallbackContainer.cs" />
- <Compile Include="System.Web.UI.WebControls\ICompositeControlDesignerAccessor.cs" />
- <Compile Include="System.Web.UI.WebControls\Image.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageAlign.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageButton.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageField.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageMap.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageMapEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageMapEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\IPostBackContainer.cs" />
- <Compile Include="System.Web.UI.WebControls\IRepeatInfoUser.cs" />
- <Compile Include="System.Web.UI.WebControls\Label.cs" />
- <Compile Include="System.Web.UI.WebControls\LinkButton.cs" />
- <Compile Include="System.Web.UI.WebControls\ListBox.cs" />
- <Compile Include="System.Web.UI.WebControls\ListControl.cs" />
- <Compile Include="System.Web.UI.WebControls\ListItem.cs" />
- <Compile Include="System.Web.UI.WebControls\ListItemCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\ListItemType.cs" />
- <Compile Include="System.Web.UI.WebControls\ListSelectionMode.cs" />
- <Compile Include="System.Web.UI.WebControls\Literal.cs" />
- <Compile Include="System.Web.UI.WebControls\LiteralMode.cs" />
- <Compile Include="System.Web.UI.WebControls\Localize.cs" />
- <Compile Include="System.Web.UI.WebControls\Login.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginCancelEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginCancelEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginFailureAction.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginName.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginStatus.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginTextLayout.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginView.cs" />
- <Compile Include="System.Web.UI.WebControls\LogoutAction.cs" />
- <Compile Include="System.Web.UI.WebControls\MailDefinition.cs" />
- <Compile Include="System.Web.UI.WebControls\MailMessageEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\MailMessageEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\Menu.cs" />
- <Compile Include="System.Web.UI.WebControls\MenuEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\MenuEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\MenuItem.cs" />
- <Compile Include="System.Web.UI.WebControls\MenuItemBinding.cs" />
- <Compile Include="System.Web.UI.WebControls\MenuItemBindingCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\MenuItemCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\MenuItemStyle.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\MenuItemStyleCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\MenuItemTemplateContainer.cs" />
- <Compile Include="System.Web.UI.WebControls\MonthChangedEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\MonthChangedEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\MultiView.cs" />
- <Compile Include="System.Web.UI.WebControls\NextPrevFormat.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSource.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceDisposingEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceDisposingEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceFilteringEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceFilteringEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceMethodEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceMethodEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceSelectingEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceSelectingEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceStatusEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceStatusEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceView.cs" />
- <Compile Include="System.Web.UI.WebControls\Orientation.cs" />
- <Compile Include="System.Web.UI.WebControls\PagedDataSource.cs" />
- <Compile Include="System.Web.UI.WebControls\PagerButtons.cs" />
- <Compile Include="System.Web.UI.WebControls\PagerMode.cs" />
- <Compile Include="System.Web.UI.WebControls\PagerPosition.cs" />
- <Compile Include="System.Web.UI.WebControls\PagerSettings.cs" />
- <Compile Include="System.Web.UI.WebControls\Panel.cs" />
- <Compile Include="System.Web.UI.WebControls\PanelStyle.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\Parameter.cs" />
- <Compile Include="System.Web.UI.WebControls\ParameterCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\PasswordRecovery.cs" />
- <Compile Include="System.Web.UI.WebControls\PathDirection.cs" />
- <Compile Include="System.Web.UI.WebControls\PlaceHolder.cs" />
- <Compile Include="System.Web.UI.WebControls\PolygonHotSpot.cs" />
- <Compile Include="System.Web.UI.WebControls\ProfileParameter.cs" />
- <Compile Include="System.Web.UI.WebControls\QueryStringParameter.cs" />
- <Compile Include="System.Web.UI.WebControls\RadioButton.cs" />
- <Compile Include="System.Web.UI.WebControls\RadioButtonList.cs" />
- <Compile Include="System.Web.UI.WebControls\RangeValidator.cs" />
- <Compile Include="System.Web.UI.WebControls\RectangleHotSpot.cs" />
- <Compile Include="System.Web.UI.WebControls\RegularExpressionValidator.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeatDirection.cs" />
- <Compile Include="System.Web.UI.WebControls\Repeater.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeaterCommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeaterCommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeaterItem.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeaterItemCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeaterItemEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeaterItemEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeatInfo.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeatLayout.cs" />
- <Compile Include="System.Web.UI.WebControls\RequiredFieldValidator.cs" />
- <Compile Include="System.Web.UI.WebControls\RoleGroup.cs" />
- <Compile Include="System.Web.UI.WebControls\RoleGroupCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\ScrollBars.cs" />
- <Compile Include="System.Web.UI.WebControls\SelectedDatesCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\SendMailErrorEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\SendMailErrorEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\ServerValidateEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\ServerValidateEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\SessionParameter.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapDataSource.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapDataSourceView.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapHierarchicalDataSourceView.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapNodeItem.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapNodeItemEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapNodeItemEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapNodeItemType.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapPath.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapViewType.cs" />
- <Compile Include="System.Web.UI.WebControls\SortDirection.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSource.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceCommandEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceCommandEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceCommandType.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceFilteringEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceFilteringEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceMode.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceSelectingEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceSelectingEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceStatusEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceStatusEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceView.cs" />
- <Compile Include="System.Web.UI.WebControls\StringArrayConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\Style.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\SubMenuStyle.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\SubMenuStyleCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\Table.cs" />
- <Compile Include="System.Web.UI.WebControls\TableCaptionAlign.cs" />
- <Compile Include="System.Web.UI.WebControls\TableCell.cs" />
- <Compile Include="System.Web.UI.WebControls\TableCellCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\TableFooterRow.cs" />
- <Compile Include="System.Web.UI.WebControls\TableHeaderCell.cs" />
- <Compile Include="System.Web.UI.WebControls\TableHeaderRow.cs" />
- <Compile Include="System.Web.UI.WebControls\TableHeaderScope.cs" />
- <Compile Include="System.Web.UI.WebControls\TableItemStyle.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableRow.cs" />
- <Compile Include="System.Web.UI.WebControls\TableRowCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\TableRowSection.cs" />
- <Compile Include="System.Web.UI.WebControls\TableSectionStyle.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableStyle.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TargetConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\TemplateColumn.cs" />
- <Compile Include="System.Web.UI.WebControls\TemplatedWizardStep.cs" />
- <Compile Include="System.Web.UI.WebControls\TemplateField.cs" />
- <Compile Include="System.Web.UI.WebControls\TextAlign.cs" />
- <Compile Include="System.Web.UI.WebControls\TextBox.cs" />
- <Compile Include="System.Web.UI.WebControls\TextBoxMode.cs" />
- <Compile Include="System.Web.UI.WebControls\TitleFormat.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNode.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeBinding.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeBindingCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeSelectAction.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeStyle.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TreeNodeStyleCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeTypes.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeView.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeViewImageSet.cs" />
- <Compile Include="System.Web.UI.WebControls\Unit.cs" />
- <Compile Include="System.Web.UI.WebControls\UnitConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\UnitType.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidatedControlConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidationCompareOperator.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidationDataType.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidationSummary.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidationSummaryDisplayMode.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidatorDisplay.cs" />
- <Compile Include="System.Web.UI.WebControls\VerticalAlign.cs" />
- <Compile Include="System.Web.UI.WebControls\VerticalAlignConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\View.cs" />
- <Compile Include="System.Web.UI.WebControls\ViewCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\WebColorConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\WebControl.cs" />
- <Compile Include="System.Web.UI.WebControls\Wizard.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardNavigationEventArgs.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardNavigationEventHandler.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardStep.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardStepBase.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardStepCollection.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardStepType.cs" />
- <Compile Include="System.Web.UI.WebControls\Xml.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlDataSource.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlDataSourceNodeDescriptor.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlDataSourcePropertyDescriptor.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlDataSourceView.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlHierarchicalDataSourceView.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlHierarchicalEnumerable.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlHierarchyData.cs" />
- <Compile Include="System.Web.UI\AttributeCollection.cs" />
- <Compile Include="System.Web.UI\BasePartialCachingControl.cs" />
- <Compile Include="System.Web.UI\BoundPropertyEntry.cs" />
- <Compile Include="System.Web.UI\BuildMethod.cs" />
- <Compile Include="System.Web.UI\BuildTemplateMethod.cs" />
- <Compile Include="System.Web.UI\ChtmlTextWriter.cs" />
- <Compile Include="System.Web.UI\ClientScriptManager.cs" />
- <Compile Include="System.Web.UI\CompilationMode.cs" />
- <Compile Include="System.Web.UI\CompiledBindableTemplateBuilder.cs" />
- <Compile Include="System.Web.UI\CompiledTemplateBuilder.cs" />
- <Compile Include="System.Web.UI\ConflictOptions.cs" />
- <Compile Include="System.Web.UI\ConstructorNeedsTagAttribute.cs" />
- <Compile Include="System.Web.UI\Control.cs" />
- <Compile Include="System.Web.UI\Control.jvm.cs" />
- <Compile Include="System.Web.UI\ControlBuilderAttribute.cs" />
- <Compile Include="System.Web.UI\ControlCachePolicy.cs" />
- <Compile Include="System.Web.UI\ControlCollection.cs" />
- <Compile Include="System.Web.UI\ControlSkin.cs" />
- <Compile Include="System.Web.UI\ControlSkinDelegate.cs" />
- <Compile Include="System.Web.UI\ControlValuePropertyAttribute.cs" />
- <Compile Include="System.Web.UI\CssStyleCollection.cs" />
- <Compile Include="System.Web.UI\DataBinder.cs" />
- <Compile Include="System.Web.UI\DataBinding.cs" />
- <Compile Include="System.Web.UI\DataBindingCollection.cs" />
- <Compile Include="System.Web.UI\DataBindingHandlerAttribute.cs" />
- <Compile Include="System.Web.UI\DataBoundLiteralControl.cs" />
- <Compile Include="System.Web.UI\DataSourceCacheExpiry.cs" />
- <Compile Include="System.Web.UI\DataSourceCapabilities.cs" />
- <Compile Include="System.Web.UI\DataSourceControl.cs" />
- <Compile Include="System.Web.UI\DataSourceOperation.cs" />
- <Compile Include="System.Web.UI\DataSourceSelectArguments.cs" />
- <Compile Include="System.Web.UI\DataSourceView.cs" />
- <Compile Include="System.Web.UI\DataSourceViewOperationCallback.cs" />
- <Compile Include="System.Web.UI\DataSourceViewSelectCallback.cs" />
- <Compile Include="System.Web.UI\DesignerDataBoundLiteralControl.cs" />
- <Compile Include="System.Web.UI\EmptyControlCollection.cs" />
- <Compile Include="System.Web.UI\ExpressionBinding.cs" />
- <Compile Include="System.Web.UI\ExpressionBindingCollection.cs" />
- <Compile Include="System.Web.UI\ExtractTemplateValuesMethod.cs" />
- <Compile Include="System.Web.UI\FilterableAttribute.cs" />
- <Compile Include="System.Web.UI\HiddenFieldPageStatePersister.cs" />
- <Compile Include="System.Web.UI\HierarchicalDataSourceControl.cs" />
- <Compile Include="System.Web.UI\HierarchicalDataSourceView.cs" />
- <Compile Include="System.Web.UI\Html32TextWriter.cs" />
- <Compile Include="System.Web.UI\HtmlControlPersistableAttribute.cs" />
- <Compile Include="System.Web.UI\HtmlTextWriter.cs" />
- <Compile Include="System.Web.UI\HtmlTextWriterAttribute.cs" />
- <Compile Include="System.Web.UI\HtmlTextWriterStyle.cs" />
- <Compile Include="System.Web.UI\HtmlTextWriterTag.cs" />
- <Compile Include="System.Web.UI\IAttributeAccessor.cs" />
- <Compile Include="System.Web.UI\IBindableTemplate.cs" />
- <Compile Include="System.Web.UI\ICallbackEventHandler.cs" />
- <Compile Include="System.Web.UI\ICheckBoxControl.cs" />
- <Compile Include="System.Web.UI\IControlBuilderAccessor.cs" />
- <Compile Include="System.Web.UI\IControlDesignerAccessor.cs" />
- <Compile Include="System.Web.UI\IDataBindingsAccessor.cs" />
- <Compile Include="System.Web.UI\IDataItemContainer.cs" />
- <Compile Include="System.Web.UI\IDataSource.cs" />
- <Compile Include="System.Web.UI\IDataSourceViewSchemaAccessor.cs" />
- <Compile Include="System.Web.UI\IDReferencePropertyAttribute.cs" />
- <Compile Include="System.Web.UI\IEditableTextControl.cs" />
- <Compile Include="System.Web.UI\IExpressionsAccessor.cs" />
- <Compile Include="System.Web.UI\IFilterResolutionService.cs" />
- <Compile Include="System.Web.UI\IgnoreUnknownContentAttribute.cs" />
- <Compile Include="System.Web.UI\IHierarchicalDataSource.cs" />
- <Compile Include="System.Web.UI\IHierarchicalEnumerable.cs" />
- <Compile Include="System.Web.UI\IHierarchyData.cs" />
- <Compile Include="System.Web.UI\ImageClickEventArgs.cs" />
- <Compile Include="System.Web.UI\ImageClickEventHandler.cs" />
- <Compile Include="System.Web.UI\INamingContainer.cs" />
- <Compile Include="System.Web.UI\INavigateUIData.cs" />
- <Compile Include="System.Web.UI\IParserAccessor.cs" />
- <Compile Include="System.Web.UI\IPostBackDataHandler.cs" />
- <Compile Include="System.Web.UI\IPostBackEventHandler.cs" />
- <Compile Include="System.Web.UI\IResourceUrlGenerator.cs" />
- <Compile Include="System.Web.UI\IStateFormatter.cs" />
- <Compile Include="System.Web.UI\IStateManager.cs" />
- <Compile Include="System.Web.UI\IStyleSheet.cs" />
- <Compile Include="System.Web.UI\ITagNameToTypeMapper.cs" />
- <Compile Include="System.Web.UI\ITemplate.cs" />
- <Compile Include="System.Web.UI\ITextControl.cs" />
- <Compile Include="System.Web.UI\IUrlResolutionService.cs" />
- <Compile Include="System.Web.UI\IUserControlDesignerAccessor.cs" />
- <Compile Include="System.Web.UI\IUserControlTypeResolutionService.cs" />
- <Compile Include="System.Web.UI\IValidator.cs" />
- <Compile Include="System.Web.UI\KeyedList.cs" />
- <Compile Include="System.Web.UI\KeyedListEnumerator.cs" />
- <Compile Include="System.Web.UI\ListSourceHelper.cs" />
- <Compile Include="System.Web.UI\LiteralControl.cs" />
- <Compile Include="System.Web.UI\LosFormatter.cs" />
- <Compile Include="System.Web.UI\MasterPage.cs" />
- <Compile Include="System.Web.UI\MinimizableAttributeTypeConverter.cs" />
- <Compile Include="System.Web.UI\NonVisualControlAttribute.cs" />
- <Compile Include="System.Web.UI\ObjectConverter.cs" />
- <Compile Include="System.Web.UI\ObjectStateFormatter.cs" />
- <Compile Include="System.Web.UI\ObjectTag.cs" />
- <Compile Include="System.Web.UI\OutputCacheLocation.cs" />
- <Compile Include="System.Web.UI\OutputCacheParameters.cs" />
- <Compile Include="System.Web.UI\PageHandlerFactory.cs" />
- <Compile Include="System.Web.UI\PageStatePersister.cs" />
- <Compile Include="System.Web.UI\PageTheme.cs" />
- <Compile Include="System.Web.UI\Pair.cs" />
- <Compile Include="System.Web.UI\ParseChildrenAttribute.cs" />
- <Compile Include="System.Web.UI\PartialCachingAttribute.cs" />
- <Compile Include="System.Web.UI\PartialCachingControl.cs" />
- <Compile Include="System.Web.UI\PersistChildrenAttribute.cs" />
- <Compile Include="System.Web.UI\PersistenceMode.cs" />
- <Compile Include="System.Web.UI\PersistenceModeAttribute.cs" />
- <Compile Include="System.Web.UI\PostBackOptions.cs" />
- <Compile Include="System.Web.UI\PropertyConverter.cs" />
- <Compile Include="System.Web.UI\PropertyEntry.cs" />
- <Compile Include="System.Web.UI\RenderMethod.cs" />
- <Compile Include="System.Web.UI\SimplePropertyEntry.cs" />
- <Compile Include="System.Web.UI\StateBag.cs" />
- <Compile Include="System.Web.UI\StateItem.cs" />
- <Compile Include="System.Web.UI\StateManagedCollection.cs" />
- <Compile Include="System.Web.UI\StaticPartialCachingControl.cs" />
- <Compile Include="System.Web.UI\SupportsEventValidationAttribute.cs" />
- <Compile Include="System.Web.UI\TagPrefixAttribute.cs" />
- <Compile Include="System.Web.UI\TemplateContainerAttribute.cs" />
- <Compile Include="System.Web.UI\TemplateContentType.cs" />
- <Compile Include="System.Web.UI\TemplateInstance.cs" />
- <Compile Include="System.Web.UI\TemplateInstanceAttribute.cs" />
- <Compile Include="System.Web.UI\ThemeableAttribute.cs" />
- <Compile Include="System.Web.UI\ToolboxDataAttribute.cs" />
- <Compile Include="System.Web.UI\Triplet.cs" />
- <Compile Include="System.Web.UI\UrlPropertyAttribute.cs" />
- <Compile Include="System.Web.UI\UrlTypes.cs" />
- <Compile Include="System.Web.UI\UserControl.cs" />
- <Compile Include="System.Web.UI\ValidationPropertyAttribute.cs" />
- <Compile Include="System.Web.UI\ValidatorCollection.cs" />
- <Compile Include="System.Web.UI\VerificationConditionalOperator.cs" />
- <Compile Include="System.Web.UI\VerificationReportLevel.cs" />
- <Compile Include="System.Web.UI\VerificationRule.cs" />
- <Compile Include="System.Web.UI\ViewStateEncryptionMode.cs" />
- <Compile Include="System.Web.UI\VirtualReferenceType.cs" />
- <Compile Include="System.Web.UI\WebResourceAttribute.cs" />
- <Compile Include="System.Web.UI\XhtmlMobileDocType.cs" />
- <Compile Include="System.Web.UI\XhtmlTextWriter.cs" />
- <Compile Include="System.Web.UI\XPathBinder.cs" />
- <Compile Include="System.Web.Util\AltSerialization.cs" />
- <Compile Include="System.Web.Util\DataSourceHelper.cs" />
- <Compile Include="System.Web.Util\DataSourceResolver.cs" />
- <Compile Include="System.Web.Util\IWebObjectFactory.cs" />
- <Compile Include="System.Web.Util\IWebPropertyAccessor.cs" />
- <Compile Include="System.Web.Util\StrUtils.cs" />
- <Compile Include="System.Web.Util\TimeUtil.cs" />
- <Compile Include="System.Web.Util\TransactedCallback.cs" />
- <Compile Include="System.Web.Util\UrlUtils.cs" />
- <Compile Include="System.Web.Util\WebEncoding.cs" />
- <Compile Include="System.Web.Util\WebTrace.cs" />
- <Compile Include="System.Web.Util\WorkItem.cs" />
- <Compile Include="System.Web.Util\WorkItemCallback.cs" />
- <Compile Include="System.Web\ApplicationShutdownReason.cs" />
- <Compile Include="System.Web\BeginEventHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\BrowserCapabilities.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\CapabilitiesLoader.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\DefaultHttpHandler.cs" />
- <Compile Include="System.Web\EndEventHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HtmlizedException.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpApplicationFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpApplicationState.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpBrowserCapabilities.cs" />
- <Compile Include="System.Web\HttpCacheability.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCachePolicy.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCacheRevalidation.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCacheValidateHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCacheVaryByHeaders.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCacheVaryByParams.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpClientCertificate.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpContext.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpContext.jvm.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCookie.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCookieCollection.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCookieMode.cs" />
- <Compile Include="System.Web\HttpException.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpFileCollection.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpForbiddenHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpMethodNotAllowedHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpModuleCollection.cs" />
- <Compile Include="System.Web\HttpNotFoundHandler.cs" />
- <Compile Include="System.Web\HttpNotImplementedHandler.cs" />
- <Compile Include="System.Web\HttpParseException.cs" />
- <Compile Include="System.Web\HttpPostedFile.cs" />
- <Compile Include="System.Web\HttpRequest.cs" />
- <Compile Include="System.Web\HttpRequest.jvm.cs" />
- <Compile Include="System.Web\HttpRequestValidationException.cs" />
- <Compile Include="System.Web\HttpResponse.cs" />
- <Compile Include="System.Web\HttpResponseHeader.cs" />
- <Compile Include="System.Web\HttpResponseSubstitutionCallback.cs" />
- <Compile Include="System.Web\HttpRuntime.cs" />
- <Compile Include="System.Web\HttpServerUtility.cs" />
- <Compile Include="System.Web\HttpUnhandledException.cs" />
- <Compile Include="System.Web\HttpUtility.cs" />
- <Compile Include="System.Web\HttpValidationStatus.cs" />
- <Compile Include="System.Web\HttpWorkerRequest.cs" />
- <Compile Include="System.Web\HttpWriter.cs" />
- <Compile Include="System.Web\IHttpAsyncHandler.cs" />
- <Compile Include="System.Web\IHttpExtendedHandler.cs" />
- <Compile Include="System.Web\IHttpHandler.cs" />
- <Compile Include="System.Web\IHttpHandlerFactory.cs" />
- <Compile Include="System.Web\IHttpMapPath.cs" />
- <Compile Include="System.Web\IHttpModule.cs" />
- <Compile Include="System.Web\InputFilterStream.cs" />
- <Compile Include="System.Web\MimeTypes.cs" />
- <Compile Include="System.Web\NoParamsInvoker.cs" />
- <Compile Include="System.Web\OutputFilterStream.cs" />
- <Compile Include="System.Web\ParserError.cs" />
- <Compile Include="System.Web\ParserErrorCollection.cs" />
- <Compile Include="System.Web\ProcessInfo.cs" />
- <Compile Include="System.Web\ProcessModelInfo.cs" />
- <Compile Include="System.Web\ProcessShutdownReason.cs" />
- <Compile Include="System.Web\ProcessStatus.cs" />
- <Compile Include="System.Web\QueueManager.cs" />
- <Compile Include="System.Web\ServerVariablesCollection.cs" />
- <Compile Include="System.Web\SiteMap.cs" />
- <Compile Include="System.Web\SiteMapNode.cs" />
- <Compile Include="System.Web\SiteMapNodeCollection.cs" />
- <Compile Include="System.Web\SiteMapProvider.cs" />
- <Compile Include="System.Web\SiteMapProviderCollection.cs" />
- <Compile Include="System.Web\SiteMapResolveEventArgs.cs" />
- <Compile Include="System.Web\StaticFileHandler.cs" />
- <Compile Include="System.Web\StaticSiteMapProvider.cs" />
- <Compile Include="System.Web\TempFileStream.cs" />
- <Compile Include="System.Web\TraceContext.cs" />
- <Compile Include="System.Web\TraceContextEventArgs.cs" />
- <Compile Include="System.Web\TraceContextEventHandler.cs" />
- <Compile Include="System.Web\TraceData.cs" />
- <Compile Include="System.Web\TraceManager.cs" />
- <Compile Include="System.Web\TraceMode.cs" />
- <Compile Include="System.Web\VirtualPathUtility.cs" />
- <Compile Include="System.Web\WebCategoryAttribute.cs" />
- <Compile Include="System.Web\WebROCollection.cs" />
- <Compile Include="System.Web\WebSysDescriptionAttribute.cs" />
- <Compile Include="System.Web\XmlSiteMapProvider.cs" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\..\build\common\Consts.cs.in">
- <Link>Consts.cs.in</Link>
- </Compile>
- <Compile Include="Assembly\AssemblyInfo.cs" />
- <Compile Include="System.Web.Compilation\AppSettingsExpressionBuilder.cs" />
- <Compile Include="System.Web.Compilation\BuildManager.jvm.cs" />
- <Compile Include="System.Web.Compilation\ConnectionStringsExpressionBuilder.cs" />
- <Compile Include="System.Web.Compilation\AppResourcesCompiler.jvm.cs" />
- <Compile Include="System.Web.Compilation\ExpressionBuilder.cs" />
- <Compile Include="System.Web.Compilation\ExpressionBuilderContext.cs" />
- <Compile Include="System.Web.Compilation\ExpressionEditorAttribute.cs" />
- <Compile Include="System.Web.Compilation\ExpressionPrefixAttribute.cs" />
- <Compile Include="System.Web.Compilation\ILocation.cs" />
- <Compile Include="System.Web.Compilation\IResourceProvider.cs" />
- <Compile Include="System.Web.Compilation\ResourceProviderFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Compilation\Location.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Compilation\ParseException.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Compilation\TagAttributes.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Compilation\TagType.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Compilation\ThemeDirectoryCompiler.jvm.cs" />
- <Compile Include="System.Web.Configuration\FileMatchingInfo.cs" />
- <Compile Include="System.Web.Configuration_2.0\AppSettings.jvm.cs" />
- <Compile Include="System.Web.Configuration_2.0\CapabilitiesBuild.cs" />
- <Compile Include="System.Web.Configuration_2.0\CapabilitiesChecksum.cs" />
- <Compile Include="System.Web.Configuration_2.0\CapabilitiesResult.cs" />
- <Compile Include="System.Web.Configuration_2.0\ICapabilitiesProcess.cs" />
- <Compile Include="System.Web.Configuration_2.0\MachineKeySectionUtils.cs" />
- <Compile Include="System.Web.Configuration_2.0\nBrowser\Build.cs" />
- <Compile Include="System.Web.Configuration_2.0\nBrowser\Exception.cs" />
- <Compile Include="System.Web.Configuration_2.0\nBrowser\File.cs" />
- <Compile Include="System.Web.Configuration_2.0\nBrowser\Identification.cs" />
- <Compile Include="System.Web.Configuration_2.0\nBrowser\Node.cs" />
- <Compile Include="System.Web.Configuration_2.0\nBrowser\NodeTypes.cs" />
- <Compile Include="System.Web.Configuration_2.0\nBrowser\Result.cs" />
- <Compile Include="System.Web.J2EE\ObjectInputStream.cs" />
- <Compile Include="System.Web.J2EE\ObjectOutputStream.cs" />
- <Compile Include="System.Web.Security\AspNetDBSchemaChecker.cs" />
- <Compile Include="System.Web.SessionState\HttpSessionState.cs" />
- <Compile Include="System.Web.SessionState\ISessionHandler.cs" />
- <Compile Include="System.Web.SessionState\SessionStateModule.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlEmptyTagControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlHeadBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelectBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ContentPlaceHolderBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\HyperLinkControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LabelControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LinkButtonControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ListItemControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LiteralControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\PlaceHolderControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableCellControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TextBoxControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\WizardStepControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\XmlBuilder.jvm.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ClientScriptManager.jvm.cs" />
- <Compile Include="System.Web.UI\BaseParser.jvm.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\BaseTemplateParser.jvm.cs" />
- <Compile Include="System.Web.UI\BuilderPropertyEntry .jvm.cs" />
- <Compile Include="System.Web.UI\ComplexPropertyEntry.jvm.cs" />
- <Compile Include="System.Web.UI\ControlBuilder.jvm.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DataSourceCacheDurationConverter .jvm.cs" />
- <Compile Include="System.Web.UI\DataSourceControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DesignTimeParseData.jvm.cs" />
- <Compile Include="System.Web.UI\EventEntry.jvm.cs" />
- <Compile Include="System.Web.UI\FileLevelControlBuilderAttribute .jvm.cs" />
- <Compile Include="System.Web.UI\FileLevelPageControlBuilder.jvm.cs" />
- <Compile Include="System.Web.UI\FileLevelUserControlBuilder.jvm.cs" />
- <Compile Include="System.Web.UI\IndexedString.jvm.cs" />
- <Compile Include="System.Web.UI\IScriptManager.cs" />
- <Compile Include="System.Web.UI\IThemeResolutionService.cs" />
- <Compile Include="System.Web.UI\MasterPageControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\MasterPageParser.jvm.cs" />
- <Compile Include="System.Web.UI\ObjectPersistData.jvm.cs" />
- <Compile Include="System.Web.UI\ObjectTagBuilder.jvm.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\Page.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\Page.jvm.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\PageAsyncTask.cs" />
- <Compile Include="System.Web.UI\PageParser.jvm.cs" />
- <Compile Include="System.Web.UI\PageParserFilter.jvm.cs" />
- <Compile Include="System.Web.UI\ReadOnlyDataSourceView.cs" />
- <Compile Include="System.Web.UI\RootBuilder.jvm.cs" />
- <Compile Include="System.Web.UI\SessionPageStatePersister.jvm.cs" />
- <Compile Include="System.Web.UI\SimpleWebHandlerParser.jvm.cs" />
- <Compile Include="System.Web.UI\SkinBuilder.jvm.cs" />
- <Compile Include="System.Web.UI\TemplateBuilder.jvm.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\TemplateControl.jvm.cs" />
- <Compile Include="System.Web.UI\TemplateControlParser.jvm.cs" />
- <Compile Include="System.Web.UI\TemplateParser.jvm.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\TemplatePropertyEntry.jvm.cs" />
- <Compile Include="System.Web.UI\ThemeProvider.jvm.cs" />
- <Compile Include="System.Web.UI\UserControlControlBuilder.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\VerificationAttribute.jvm.cs" />
- <Compile Include="System.Web.UI\ViewStateException .jvm.cs" />
- <Compile Include="System.Web.UI\ViewStateModeByIdAttribute.jvm.cs" />
- <Compile Include="System.Web.UI\WebServiceParser.jvm.cs" />
- <Compile Include="System.Web.Util\ICalls.jvm.cs" />
- <Compile Include="System.Web\BaseParamsCollection.cs" />
- <Compile Include="System.Web\HeadersCollection.cs" />
- <Compile Include="System.Web\HttpApplication.cs" />
- <Compile Include="System.Web\HttpCacheVaryByContentEncodings.cs" />
- <Compile Include="System.Web\HttpParamsCollection.cs" />
- <Compile Include="System.Web\HttpResponse.jvm.cs" />
- <Compile Include="System.Web\HttpResponseStream.jvm.cs" />
- <Compile Include="System.Web\HttpStaticObjectsCollection.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpWorkerRequest.jvm.cs" />
- <Compile Include="System.Web\IHttpExtendedWorkerRequest.cs" />
- <Compile Include="System.Web\RequestNotification.cs" />
- <Compile Include="System.Web\RequestNotificationStatus.cs" />
- <Compile Include="System.Web\UplevelHelper.cs" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="resources\file.gif">
- <LogicalName>file.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\folder.gif">
- <LogicalName>folder.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\computer.gif">
- <LogicalName>computer.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\arrow_down.gif">
- <LogicalName>arrow_down.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\arrow_minus.gif">
- <LogicalName>arrow_minus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\arrow_noexpand.gif">
- <LogicalName>arrow_noexpand.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\arrow_plus.gif">
- <LogicalName>arrow_plus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\arrow_up.gif">
- <LogicalName>arrow_up.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\box_empty.gif">
- <LogicalName>box_empty.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\box_full.gif">
- <LogicalName>box_full.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\box_minus.gif">
- <LogicalName>box_minus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\box_noexpand.gif">
- <LogicalName>box_noexpand.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\box_plus.gif">
- <LogicalName>box_plus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\contact.gif">
- <LogicalName>contact.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\dot_empty.gif">
- <LogicalName>dot_empty.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\dot_full.gif">
- <LogicalName>dot_full.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\dots.gif">
- <LogicalName>dots.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\inbox.gif">
- <LogicalName>inbox.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\star_empty.gif">
- <LogicalName>star_empty.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\star_full.gif">
- <LogicalName>star_full.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\transparent.gif">
- <LogicalName>transparent.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_dash.gif">
- <LogicalName>TreeView_dash.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_dashminus.gif">
- <LogicalName>TreeView_dashminus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_dashplus.gif">
- <LogicalName>TreeView_dashplus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_i.gif">
- <LogicalName>TreeView_i.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_l.gif">
- <LogicalName>TreeView_l.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_lminus.gif">
- <LogicalName>TreeView_lminus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_lplus.gif">
- <LogicalName>TreeView_lplus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_minus.gif">
- <LogicalName>TreeView_minus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_noexpand.gif">
- <LogicalName>TreeView_noexpand.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_plus.gif">
- <LogicalName>TreeView_plus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_r.gif">
- <LogicalName>TreeView_r.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_rminus.gif">
- <LogicalName>TreeView_rminus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_rplus.gif">
- <LogicalName>TreeView_rplus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_t.gif">
- <LogicalName>TreeView_t.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_tminus.gif">
- <LogicalName>TreeView_tminus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\TreeView_tplus.gif">
- <LogicalName>TreeView_tplus.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\warning.gif">
- <LogicalName>warning.gif</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\webform.js">
- <LogicalName>webform.js</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="resources\WebUIValidation_2.0.js">
- <LogicalName>WebUIValidation_2.0.js</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="System.Web.UI.WebControls\GridView.js">
- <LogicalName>GridView.js</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="System.Web.UI.WebControls\DetailsView.js">
- <LogicalName>DetailsView.js</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="System.Web.UI.WebControls\Menu.js">
- <LogicalName>Menu.js</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="System.Web.UI.WebControls\TreeView.js">
- <LogicalName>TreeView.js</LogicalName>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
- <Reference Include="JavaEE, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
- <Reference Include="myfaces, Version=1.6.65535.65535, Culture=neutral, processorArchitecture=MSIL" />
- <Reference Include="Mainsoft.Configuration, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
- <Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
- <Reference Include="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86" />
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="..\..\..\mono\data\browscap.ini">
- <Link>browscap.ini</Link>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Properties\" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <ProjectExtensions>
- <VisualStudio>
- <UserProperties REFS-RefInfo-mainsoft-mscorlib="repository:vmw:framework:2.0" REFS-RefInfo-mainsoft-configuration="repository:vmw:framework:2.0" REFS-JarPath-mainsoft-configuration="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-RefInfo-j2se-helpers="repository:vmw:framework:2.0" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-RefInfo-system-configuration="repository:vmw:framework:2.0" REFS-RefInfo-j2ee-helpers="repository:vmw:framework:2.0" REFS-RefInfo-javaee="repository:JavaEE:tomcat:1.3" REFS-JarPath-javaee="" REFS-JarPath-j2se-helpers="" REFS-JarPath-j2ee-helpers="" REFS-JarPath-j2ee="..\lib\j2ee.jar" REFS-RefInfo-rt="repository:jre:sun:1.4.2" REFS-JarPath-rt="" REFS-JarPath-mscorlib="" REFS-JarPath-system="" REFS-JarPath-system-xml="" REFS-JarPath-system-drawing="" REFS-JarPath-system-data="" REFS-JarPath-system-configuration="" REFS-RefInfo-myfaces="repository:vmw:framework:2.0" REFS-JarPath-myfaces="" />
- </VisualStudio>
- </ProjectExtensions>
- <PropertyGroup>
- <PreBuildEvent>"$(ProjectDir)..\..\class\lib\net_2_0\culevel.exe" -o "$(ProjectDir)System.Web\UplevelHelper.cs" "$(ProjectDir)UplevelHelperDefinitions.xml"</PreBuildEvent>
- </PropertyGroup>
-</Project>
[Test]
[NUnit.Framework.Category ("NunitWeb")]
-#if !TARGET_JVM
[NUnit.Framework.Category ("NotWorking")]
-#endif
public void ReadOnlyPropertyBindTest ()
{
new WebTest ("ReadOnlyPropertyBind.aspx").Run ();
[Test]
[ExpectedException(typeof(SerializationException))]
-#if TARGET_JVM //System.Security.Policy.Evidence not implemented
- [Category ("NotWorking")]
-#endif
public void Constructor_PlainType ()
{
ApplicationHost.CreateApplicationHost (typeof (ApplicationHostTest), "/app", Environment.CurrentDirectory);
}
}
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
public void SetContext ()
{
SetContext (Context);
}
#if NET_2_0
-#if !TARGET_DOTNET && !TARGET_JVM
+#if !TARGET_DOTNET
[Test]
public void ActionStringWithQuery ()
{
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Ignore ("TD #7024")]
-#endif
public void ActiveStepIndex () {
new WebTest (PageInvoker.CreateOnLoad (ActiveStepIndex_Load)).Run ();
}
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Ignore ("TD #6665")]
-#endif
public void DataBoundControl_DataBindFlow2 () {
new WebTest (PageInvoker.CreateOnLoad (DataBoundControl_DataBindFlow2_Load)).Run ();
}
[Test]
[Category ("NunitWeb")]
-//#if TARGET_JVM //BUG #6518
-// [Category ("NotWorking")]
-//#endif
public void FormView_RenderSimpleTemplate()
{
string renderedPageHtml = new WebTest ("FormViewTest1.aspx").Run ();
[Test]
[Category ("NunitWeb")]
-//#if TARGET_JVM //BUG #6518
-// [Category ("NotWorking")]
-//#endif
public void FormView_RenderFooterAndPager()
{
string renderedPageHtml = new WebTest ("FormViewTest1_2.aspx").Run ();
[Test]
[Category ("NunitWeb")]
-//#if TARGET_JVM //BUG #6518
-// [Category ("NotWorking")]
-//#endif
public void FormView_RenderWithHeader()
{
string renderedPageHtml = new WebTest ("FormViewTest1_4.aspx").Run ();
[Test]
[Category ("NunitWeb")]
-//#if TARGET_JVM //BUG #6518
-// [Category ("NotWorking")]
-//#endif
public void FormView_Render ()
{
string RenderedPageHtml = new WebTest ("FormViewTest1_3.aspx").Run ();
[Test]
[Category("NunitWeb")]
-#if !TARGET_JVM
[Category("NotWorking")]
-#endif
public void SessionParameter_Evaluate()
{
SessionParameterPoker sessionParam = new SessionParameterPoker("employee",TypeCode.String ,"id") ;
+++ /dev/null
-//
-// Tests for System.Web.UI.WebControls.SqlDataSource
-// This test uses Derby, java embedded database.
-//
-// Author:
-// Vladimir Krasnov (vladimirk@mainsoft.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_2_0 && TARGET_JVM
-
-using NUnit.Framework;
-using System;
-using System.Configuration;
-using System.Data;
-using System.Data.OleDb;
-using System.Data.Common;
-using System.IO;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using System.Collections.Specialized;
-
-namespace MonoTests.System.Web.UI.WebControls
-{
- [TestFixture]
- public class SqlDataSourceDerbyTest {
- [TestFixtureSetUp]
- public void setup ()
- {
- if (Directory.Exists (_dataDir))
- Directory.Delete (_dataDir, true);
-
- string initSql = @"CREATE TABLE Table1 (
- UserId int NOT NULL PRIMARY KEY,
- UserName varchar(256) NOT NULL,
- Description varchar(256)
- )";
-
- OleDbConnection connection = new OleDbConnection (_connectionString);
- try {
- connection.Open ();
- DbCommand cmd = connection.CreateCommand ();
- cmd.CommandText = initSql;
- cmd.CommandType = CommandType.Text;
- cmd.ExecuteNonQuery ();
- }
- catch (Exception) {
- }
- finally {
- connection.Close ();
- }
- }
-
- [Test]
- public void SelectTest1 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1";
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
-
- Assert.AreEqual (10, dataView.Count);
- }
-
- [Test]
- public void SelectTest2 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1";
- ds.FilterExpression = "UserId > 5";
-
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (4, dataView.Count);
- }
-
- [Test]
- public void SelectTest3 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1";
-
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ("Description"));
- Assert.AreEqual ("Description", dataView.Sort);
- }
-
- [Test]
- public void SelectTest4 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1";
- try {
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments (1, 2));
- }
- catch (NotSupportedException) {
- Assert.AreEqual (true, true);
- }
- }
-
- [Test]
- public void SelectTest5 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserId = ?";
- ds.SelectParameters.Add (new Parameter ("UserId", TypeCode.Int32, "5"));
-
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- }
-
- [Test]
- public void UpdateTest1 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserName = ?";
- ds.SelectParameters.Add (new Parameter ("UserName", TypeCode.String, "superuser"));
-
- ds.UpdateCommand = "UPDATE Table1 SET UserName = ? WHERE UserId = ?";
- ds.UpdateParameters.Add (new Parameter ("UserName", TypeCode.String, "superuser"));
- ds.UpdateParameters.Add (new Parameter ("UserId", TypeCode.Int32, "5"));
-
- int records = ds.Update ();
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- Assert.AreEqual (1, records);
-
- }
-
- [Test]
- public void UpdateTest2 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserName = ?";
- ds.SelectParameters.Add (new Parameter ("UserName", TypeCode.String, "SimpleUser"));
-
- ds.UpdateCommand = "UPDATE Table1 SET UserName = ? WHERE UserId = ?";
- ds.UpdateParameters.Add (new Parameter ("UserName", TypeCode.String, "superuser"));
- ds.UpdateParameters.Add (new Parameter ("UserId", TypeCode.Int32, "5"));
- ds.OldValuesParameterFormatString = "original_{0}";
-
- SqlDataSourceView view = (SqlDataSourceView) ((IDataSource) ds).GetView ("");
-
- OrderedDictionary keys = new OrderedDictionary ();
- keys.Add ("UserId", 7);
-
- OrderedDictionary values = new OrderedDictionary ();
- values.Add ("UserName", "SimpleUser");
-
- OrderedDictionary oldvalues = new OrderedDictionary ();
- oldvalues.Add ("UserName", "user7");
-
- int records = view.Update (keys, values, oldvalues);
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- Assert.AreEqual (1, records);
-
- }
-
- [Test]
- public void InsertTest1 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserName = ?";
- ds.SelectParameters.Add (new Parameter ("UserName", TypeCode.String, "newuser"));
-
- ds.InsertCommand = "INSERT INTO Table1 (UserId, UserName, Description) VALUES (?, ?, ?)";
- ds.InsertParameters.Add (new Parameter ("UserId", TypeCode.Int32, "15"));
- ds.InsertParameters.Add (new Parameter ("UserName", TypeCode.String, "newuser"));
- ds.InsertParameters.Add (new Parameter ("Description", TypeCode.String, "newuser"));
-
- int records = ds.Insert ();
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- Assert.AreEqual (1, records);
-
- }
-
- [Test]
- public void InsertTest2 ()
- {
- SqlDataSource ds = CreateDataSource ();
- ds.SelectCommand = "SELECT * FROM Table1 WHERE UserName = ?";
- ds.SelectParameters.Add (new Parameter ("UserName", TypeCode.String, "newuser2"));
-
- ds.InsertCommand = "INSERT INTO Table1 (UserId, UserName, Description) VALUES (?, ?, ?)";
- ds.InsertParameters.Add (new Parameter ("UserId", TypeCode.Int32, "5"));
- ds.InsertParameters.Add (new Parameter ("UserName", TypeCode.String, "newuser"));
- ds.InsertParameters.Add (new Parameter ("Description", TypeCode.String, "newuser"));
-
- SqlDataSourceView view = (SqlDataSourceView) ((IDataSource) ds).GetView ("");
-
- OrderedDictionary values = new OrderedDictionary ();
- values.Add ("UserId", "17");
- values.Add ("UserName", "newuser2");
- values.Add ("Description", "newuser2");
-
- int records = view.Insert (values);
- DataView dataView = (DataView) ds.Select (new DataSourceSelectArguments ());
- Assert.AreEqual (1, dataView.Count);
- Assert.AreEqual (1, records);
-
- }
-
-
- const string _dataDir = "DataDir";
- const string _connectionString = "JdbcDriverClassName=org.apache.derby.jdbc.EmbeddedDriver;JdbcURL=jdbc:derby:" + _dataDir + ";create=true";
- private SqlDataSource CreateDataSource ()
- {
- SqlDataSource ds = new SqlDataSource ();
- ds.ConnectionString = _connectionString;
- ds.ProviderName = "System.Data.OleDb";
- ds.DataSourceMode = SqlDataSourceMode.DataSet;
- return ds;
- }
-
- [SetUp]
- public void RestoreData ()
- {
- string insertSql = @"INSERT INTO Table1 VALUES ({0}, '{1}', '{2}')";
- string deleteSql = @"DELETE FROM Table1";
-
- OleDbConnection connection = new OleDbConnection (_connectionString);
- connection.Open ();
- try {
- DbCommand dc = connection.CreateCommand ();
- dc.CommandText = deleteSql;
- dc.CommandType = CommandType.Text;
- dc.ExecuteNonQuery ();
-
- for (int i = 0; i < 10; i++) {
- DbCommand ic = connection.CreateCommand ();
- ic.CommandText = string.Format (insertSql, i.ToString (), "user" + i.ToString (), (9 - i).ToString ());
- ic.CommandType = CommandType.Text;
- ic.ExecuteNonQuery ();
- }
- }
- catch (Exception) {
- }
- finally {
- connection.Close ();
- }
- }
- }
-
-}
-
-#endif
namespace MonoTests.System.Web.UI.WebControls {
-#if TARGET_JVM
- [vmw.common.ChangeInterfaceMethodNames]
-#endif
public interface ITableRowTest {
// testing
[Test]
[Category ("NunitWeb")]
-#if TARGET_JVM
- [Category ("NotWorking")] // File watcher is not supported
-#endif
public void Save ()
{
string origin = @"<div>
public static void ResolveUrl_Load (Page p)
{
-#if TARGET_JVM
- string appPath = "/MainsoftWebApp20";
-#else
string appPath = "/NunitWeb";
-#endif
Control ctrl = new Control ();
p.Controls.Add (ctrl);
Assert.AreEqual (appPath + "/MyPage.aspx", ctrl.ResolveUrl ("~/MyPage.aspx"), "ResolveClientUrl Failed");
public static void ResolveUrl2_Load (Page p)
{
-#if TARGET_JVM
- string appPath = "/MainsoftWebApp20";
-#else
string appPath = "/NunitWeb";
-#endif
Control uc = p.FindControl ("WebUserControl1");
Control ctrl = uc.FindControl ("Label");
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
public void AddOnPreRenderCompleteAsync ()
{
WebTest t = new WebTest ("AsyncPage.aspx");
}
[Test]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[Category ("NunitWeb")]
public void ExecuteRegisteredAsyncTasks ()
{
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[ExpectedException (typeof (Exception))]
public void AddOnPreRenderCompleteAsyncBeginThrows ()
{
[Test]
[Category ("NunitWeb")]
-#if !TARGET_JVM
[Category ("NotWorking")] // Mono PageParser does not handle @Page Async=true
-#endif
[ExpectedException (typeof (Exception))]
public void AddOnPreRenderCompleteAsyncEndThrows ()
{
Assert.AreEqual (true, t.DoSupportAutoEvents, "SupportAutoEvents");
}
-#if TARGET_JVM
- [Test]
- public void TemplateControl_DefaultPropertyNotWorking ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- Assert.AreEqual (null, t.AppRelativeVirtualPath, "AppRelativeVirtualPath");
- }
-#endif
[Test]
[Category ("NunitWeb")]
}
-#if TARGET_JVM
- [Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void TemplateControl_AppRelativeVirtualPathException1 ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- t.AppRelativeVirtualPath = null;
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentException))]
- public void TemplateControl_AppRelativeVirtualPathException2 ()
- {
- PokerTemplateControl t = new PokerTemplateControl ();
- t.AppRelativeVirtualPath = "fake";
- }
-#endif
[TestFixtureTearDown]
public void TearDown ()
{
}
}
}
-#endif
\ No newline at end of file
+#endif
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")] // char output stream in gh make this test fail
-#endif
public void Test_Response ()
{
FakeHttpWorkerRequest2 f;
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")] // char output stream in gh make this test fail
-#endif
public void TestResponse_Chunked ()
{
FakeHttpWorkerRequest2 f;
[Test]
[Category ("NotDotNet")]
-#if TARGET_JVM
- [Ignore ("TD #6954")]
-#endif
public void HtmlEncode_XSS ()
{
string problem = "\xff1cscript\xff1e"; // unicode looks alike <script>
[Test]
[Category ("NotDotNet")]
-#if TARGET_JVM
- [Ignore ("TD #6954")]
-#endif
public void HtmlEncode_XSS ()
{
string problem = "\xff1cscript\xff1e"; // unicode looks alike <script>
}
#endif
[Test]
-#if !TARGET_JVM
[Category ("NotWorking")]
-#endif
public void HtmlEncode ()
{
for (char c = char.MinValue; c < char.MaxValue; c++) {
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD #6956")]
-#endif
public void UrlEncodeUnicodeTest ()
{
string str = "sch" + (char) 0xf6 + "n";
[Test]
-#if TARGET_JVM
- [Ignore ("TD #6956")]
-#endif
public void ParseQueryString ()
{
ParseQueryString_Helper (HttpUtility.ParseQueryString ("name=value"), "#1",
}
-#if TARGET_JVM //BUG #6499
- [Category ("NotWorking")]
-#endif
[Test] public void TestDefaults ()
{
FakeHttpWorkerRequest f = new FakeHttpWorkerRequest ();
[TestFixture]
public class VirtualPathUtilityTest {
-#if TARGET_JVM
- const string NunitWebAppName = "MainsoftWebApp20";
-#else
const string NunitWebAppName = "NunitWeb";
-#endif
[Test]
public void AppendTrailingSlash ()
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{6B1B3FE4-0AC2-4740-8F93-933D9A74F505}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>MonoTests</RootNamespace>\r
- <AssemblyName>System.Web_test_net_2_0</AssemblyName>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;NET_2_0;NET_3_5;TARGET_DOTNET;VISUAL_STUDIO</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="nunit.framework, Version=2.5.2.9222, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />\r
- <Reference Include="System" />\r
- <Reference Include="System.configuration" />\r
- <Reference Include="System.Core">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Drawing" />\r
- <Reference Include="System.EnterpriseServices" />\r
- <Reference Include="System.Web" />\r
- <Reference Include="System.Web.Extensions">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.XML" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="Cas\AspNetHostingMinimal.cs" />\r
- <Compile Include="Cas\AspNetHostingNone.cs" />\r
- <Compile Include="Cas\AspNetHostingPermissionHelper.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\crc32.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\Header.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\HtmlAttribute.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\HtmlDocument.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\HtmlEntity.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\HtmlNode.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\HtmlNodeNavigator.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\HtmlWeb.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\MixedCodeDocument.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\ParseReader.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\HtmlAgilityPack\tools.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\NunitWebTest.cs" />\r
- <Compile Include="mainsoft\MainsoftWebTest\XmlComparer.cs" />\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\NoDoubleOnInitOnRemoveAdd.aspx.cs">\r
- <SubType>ASPXCodeBehind</SubType>\r
- <LogicalName>NoDoubleOnInitOnRemoveAdd.aspx.cs</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\UrlProperty.ascx.cs">\r
- <SubType>ASPXCodeBehind</SubType>\r
- <LogicalName>UrlProperty.ascx.cs</LogicalName>\r
- </EmbeddedResource>\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\BaseControl.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\BaseControlCollection.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\BaseInvoker.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\BaseRequest.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\BaseWorkerRequest.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\CustomSection.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\FakeMembershipProvider.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\FormRequest.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\Global.asax.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\HandlerInvoker.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\IForeignData.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\MyHandler.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\MyHost.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\MyPageHandlerFactory.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\MyTemplateControls.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\PageDelegates.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\PageInvoker.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\PostableRequest.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\PostableWorkerRequest.cs" />\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\MyPage.aspx.cs">\r
- <DependentUpon>MyPage.aspx</DependentUpon>\r
- <LogicalName>MyPage.aspx.cs</LogicalName>\r
- <SubType>ASPXCodeBehind</SubType>\r
- </EmbeddedResource>\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\Response.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\StandardUrl.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\Tests\TagsNestedInClientTag.cs">\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\Tests\TestSiteMapProvider.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\WebTest.cs" />\r
- <Compile Include="mainsoft\NunitWeb\NunitWeb\WebTestResourcesSetupAttribute.cs" />\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
- <Compile Include="System.Web.Caching\AggregateCacheDependencyTest.cs" />\r
- <Compile Include="System.Web.Caching\CacheCas.cs" />\r
- <Compile Include="System.Web.Caching\CacheDependencyCas.cs" />\r
- <Compile Include="System.Web.Caching\CacheStress.cs" />\r
- <Compile Include="System.Web.Compilation\AppSettingsExpressionBuilderTest.cs" />\r
- <Compile Include="System.Web.Compilation\ClientBuildManagerParameterTest.cs" />\r
- <Compile Include="System.Web.Compilation\TemplateControlCompilerTest.cs" />\r
- <Compile Include="System.Web.Configuration\AnonymousIdentificationSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\AssemblyCollectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\AssemblyInfoTest.cs" />\r
- <Compile Include="System.Web.Configuration\AuthenticationSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\AuthorizationRuleCollectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\AuthorizationRuleTest.cs" />\r
- <Compile Include="System.Web.Configuration\AuthorizationSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\BufferModeSettingsTest.cs" />\r
- <Compile Include="System.Web.Configuration\BuildProviderTest.cs" />\r
- <Compile Include="System.Web.Configuration\CacheSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\ClientTargetSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\ClientTargetTest.cs" />\r
- <Compile Include="System.Web.Configuration\CodeSubDirectoryTest.cs" />\r
- <Compile Include="System.Web.Configuration\CompilationSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\CustomErrorCollectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\CustomErrorsSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\DeploymentSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\GlobalizationSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\HealthMonitoringSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\HostingEnvironmentSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\HttpCapabilitiesBaseCas.cs" />\r
- <Compile Include="System.Web.Configuration\MachineKeyValidationConverterTest.cs" />\r
- <Compile Include="System.Web.Configuration\NullableStringValidatorTest.cs" />\r
- <Compile Include="System.Web.Configuration\ProfilePropertySettingsTest.cs" />\r
- <Compile Include="System.Web.Configuration\SiteMapSectionTest.cs" />\r
- <Compile Include="System.Web.Configuration\WebConfigurationManagerTest.cs" />\r
- <Compile Include="System.Web.Handlers\TraceHandlerCas.cs" />\r
- <Compile Include="System.Web.Hosting\AppDomainFactoryCas.cs" />\r
- <Compile Include="System.Web.Hosting\ApplicationHostCas.cs" />\r
- <Compile Include="System.Web.Hosting\ApplicationHostTest.cs" />\r
- <Compile Include="System.Web.Hosting\HostingEnvironmentTest.cs" />\r
- <Compile Include="System.Web.Hosting\ISAPIRuntimeCas.cs" />\r
- <Compile Include="System.Web.Hosting\SimpleWorkerRequestCas.cs" />\r
- <Compile Include="System.Web.Hosting\SimpleWorkerRequestTest.cs" />\r
- <Compile Include="System.Web.Hosting\VirtualPathProviderTest.cs" />\r
- <Compile Include="System.Web.Mail\MailAttachmentCas.cs" />\r
- <Compile Include="System.Web.Mail\MailMessageCas.cs" />\r
- <Compile Include="System.Web.Mail\SmtpMailCas.cs" />\r
- <Compile Include="System.Web.Profile\ProfileInfoTest.cs" />\r
- <Compile Include="System.Web.Security\DefaultAuthenticationEventArgsCas.cs" />\r
- <Compile Include="System.Web.Security\DefaultAuthenticationModuleCas.cs" />\r
- <Compile Include="System.Web.Security\FileAuthorizationModuleCas.cs" />\r
- <Compile Include="System.Web.Security\FormsAuthenticationCas.cs" />\r
- <Compile Include="System.Web.Security\FormsAuthenticationEventArgsCas.cs" />\r
- <Compile Include="System.Web.Security\FormsAuthenticationModuleCas.cs" />\r
- <Compile Include="System.Web.Security\FormsAuthenticationTest.cs" />\r
- <Compile Include="System.Web.Security\FormsAuthenticationTicketCas.cs" />\r
- <Compile Include="System.Web.Security\FormsIdentityCas.cs" />\r
- <Compile Include="System.Web.Security\FormsIdentityTest.cs" />\r
- <Compile Include="System.Web.Security\MembershipProviderCollectionTest.cs" />\r
- <Compile Include="System.Web.Security\MembershipProviderTest.cs" />\r
- <Compile Include="System.Web.Security\MembershipTest.cs" />\r
- <Compile Include="System.Web.Security\MembershipUserCollectionTest.cs" />\r
- <Compile Include="System.Web.Security\PassportAuthenticationEventArgsCas.cs" />\r
- <Compile Include="System.Web.Security\PassportAuthenticationModuleCas.cs" />\r
- <Compile Include="System.Web.Security\PassportIdentityCas.cs" />\r
- <Compile Include="System.Web.Security\RolePrincipalTest.cs" />\r
- <Compile Include="System.Web.Security\RolesTest.cs" />\r
- <Compile Include="System.Web.Security\UrlAuthorizationModuleCas.cs" />\r
- <Compile Include="System.Web.Security\WindowsAuthenticationEventArgsCas.cs" />\r
- <Compile Include="System.Web.Security\WindowsAuthenticationModuleCas.cs" />\r
- <Compile Include="System.Web.SessionState\SessionStateModuleCas.cs" />\r
- <Compile Include="System.Web.SessionState\StateRuntimeCas.cs" />\r
- <Compile Include="System.Web.UI.Adapters\ControlAdapterTest.cs" />\r
- <Compile Include="System.Web.UI.Adapters\PageAdapterTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlAnchorCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlAnchorTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlButtonCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlButtonTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlContainerControlCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlContainerControlTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlEmptyTagControlBuilderCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlFormCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlFormTest.cs">\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlGenericControlCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlHeadBuilderCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlHeadCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlImageCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlImageTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputButtonCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputButtonTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputCheckBoxCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputCheckBoxTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputControlCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputControlTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputFileCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputFileTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputHiddenCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputHiddenTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputImageCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputPasswordCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputPasswordTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputRadioButtonCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputRadioButtonTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputResetCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputResetTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputSubmitCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputSubmitTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputTextCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputTextTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlLinkCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlLinkTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlMetaCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlMetaTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelectBuilderCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelectCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelectTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCellCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCellTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableRowCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableRowTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTextAreaCas.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTextAreaTest.cs" />\r
- <Compile Include="System.Web.UI.HtmlControls\HtmlTitleCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls.Adapters\DataBoundControlAdapterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls.Adapters\HideDisabledControlAdapterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls.Adapters\HierarchicalDataBoundControlAdapterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls.Adapters\MenuAdapterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls.Adapters\WebControlAdapterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls.WebParts\ConnectionInterfaceCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls.WebParts\WebPartTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\AccessDataSourceTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\AdCreatedEventArgsCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\AdCreatedEventArgsTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\AutoGeneratedFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BaseCompareValidatorCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BaseCompareValidatorTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BaseDataBoundControlCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BaseDataBoundControlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BaseDataListCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BaseDataListTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BaseValidatorCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BaseValidatorTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BoundColumnCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BoundColumnTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BoundFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\BulletedListTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ButtonColumnCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ButtonColumnTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ButtonFieldBaseTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ButtonFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ButtonTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CalandarCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CalendarDayCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CalendarDayTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CalendarTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CallBackTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ChangePasswordTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CheckBoxCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CheckBoxFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CheckBoxListCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CheckBoxListTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CheckBoxTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CircleHotSpotTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CommandFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CompareValidatorCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CompareValidatorTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CompleteWizardStepTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CompositeControlCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CompositeControlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CompositeDataBoundControlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ContentTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ControlParameterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CookieParameterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CreateUserWizardStepTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CreateUserWizardTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CrossPagePostingTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CustomValidatorCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\CustomValidatorTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataBoundControlCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataBoundControlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataControlFieldCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataControlFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridColumnCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridColumnTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridItemCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridItemCollectionCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridItemCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridItemTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridPagerStyleCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridPagerStyleTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataGridTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataKeyArrayTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataKeyCollectionCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataKeyCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataKeyTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataListCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataListItemCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataListItemCollectionCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataListItemCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataListItemTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataListTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataSourceControlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DataSourceViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DetailsViewRowCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DetailsViewRowTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DetailsViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DropDownListCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\DropDownListTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\EditCommandColumnCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\EditCommandColumnTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FileUploadTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FontInfoCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FontInfoTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FontNamesConverterCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FontNamesConverterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FontUnitCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FontUnitTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FormParameterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FormViewCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FormViewRowTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\FormViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\GridViewRowCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\GridViewRowTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\GridViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\HierarchicalDataBoundControlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\HotSpotCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\HotSpotTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\HyperLinkCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\HyperLinkColumnCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\HyperLinkColumnTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\HyperLinkFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\HyperLinkTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ImageButtonCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ImageButtonTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ImageCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ImageFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ImageMapTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ImageTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LabelCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LabelTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LinkButtonCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LinkButtonTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ListBoxCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ListBoxTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ListControlCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ListControlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ListItemCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ListItemCollectionCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ListItemCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ListItemTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LiteralCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LiteralTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LoginCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LoginNameCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LoginNameTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LoginStatusCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LoginStatusTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LoginTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\LoginViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\MappingUrlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\MasterPageTest.cs">\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.WebControls\MenuTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\MonthChangedEventArgsCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\MonthChangedEventArgsTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\MultiViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\PagedDataSourceCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\PagedDataSourceTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\PagerSettingsTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\PanelCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\PanelTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ParameterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\PasswordRecoveryTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\PolygonHotSpotTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\QueryStringParameterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RadioButtonCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RadioButtonListCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RadioButtonListTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RadioButtonTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RangeValidatorCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RangeValidatorTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RectangleHotSpotTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RegularExpressionValidatorCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RegularExpressionValidatorTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RepeaterCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RepeaterItemCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RepeaterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RepeatInfoCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.auto.2.0.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.auto.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.gen.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RequiredFieldValidatorCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RoleGroupCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RoleGroupCollectionCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RoleGroupCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\RoleGroupTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\SelectedDatesCollectionCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\SelectedDatesCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\SessionParameterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\SiteMapDataSourceTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\SiteMapPathTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceDerbyTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\StyleCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\StyleTest.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.WebControls\TableCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableCellCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableCellTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableFooterRowCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableFooterRowTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableHeaderCellCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableHeaderCellTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableHeaderRowCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableHeaderRowTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableItemStyleCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableItemStyleTest.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.WebControls\TableRowCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableRowTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableSectionStyleCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableSectionStyleTest.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.WebControls\TableStyleCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TableStyleTest.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI.WebControls\TableTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TargetConverterCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TargetConverterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TemplateFieldTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TestControlIDConverter.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TextBoxCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TextBoxTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ThemeTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TreeNodeBindingCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TreeNodeBindingTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TreeNodeCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TreeNodeStyleCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TreeNodeStyleTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TreeNodeTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TreeViewCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\TreeViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\UnitCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\UnitConverterCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\UnitConverterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\UnitTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ValidatedControlConverterCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ValidatedControlConverterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ValidationSummaryCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ValidationSummaryTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ValidatorTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\ViewTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\WebColorConverterCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\WebColorConverterTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\WebControlCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\WebControlTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\WizardStepBaseTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\WizardStepCollectionTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\WizardStepTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\WizardTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\XmlCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\XmlDataSourceCas.cs" />\r
- <Compile Include="System.Web.UI.WebControls\XmlDataSourceTest.cs" />\r
- <Compile Include="System.Web.UI.WebControls\XmlTest.cs" />\r
- <Compile Include="System.Web.UI\AttributeCollectionCas.cs" />\r
- <Compile Include="System.Web.UI\AttributeCollectionTest.cs" />\r
- <Compile Include="System.Web.UI\BaseParserCas.cs" />\r
- <Compile Include="System.Web.UI\ChtmlTextWriterTest.cs" />\r
- <Compile Include="System.Web.UI\CleanHtmlTextWriter.cs" />\r
- <Compile Include="System.Web.UI\ClientScriptManagerTest.cs">\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI\CompiledTemplateBuilderCas.cs" />\r
- <Compile Include="System.Web.UI\ConstructorNeedsTagAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\ControlBuilderAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\ControlBuilderCas.cs" />\r
- <Compile Include="System.Web.UI\ControlCas.cs" />\r
- <Compile Include="System.Web.UI\ControlCollectionCas.cs" />\r
- <Compile Include="System.Web.UI\ControlCollectionTest.cs" />\r
- <Compile Include="System.Web.UI\ControlTest.cs" />\r
- <Compile Include="System.Web.UI\CssStyleCollectionCas.cs" />\r
- <Compile Include="System.Web.UI\CssStyleCollectionTest.cs" />\r
- <Compile Include="System.Web.UI\DataBinderCas.cs" />\r
- <Compile Include="System.Web.UI\DataBinderTest.cs" />\r
- <Compile Include="System.Web.UI\DataBindingCas.cs" />\r
- <Compile Include="System.Web.UI\DataBindingCollectionCas.cs" />\r
- <Compile Include="System.Web.UI\DataBindingCollectionTest.cs" />\r
- <Compile Include="System.Web.UI\DataBindingHandlerAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\DataBindingHandlerAttributeTest.cs" />\r
- <Compile Include="System.Web.UI\DataBoundLiteralControlCas.cs" />\r
- <Compile Include="System.Web.UI\DataSourceSelectArgumentsTest.cs" />\r
- <Compile Include="System.Web.UI\DesignerDataBoundLiteralControlCas.cs" />\r
- <Compile Include="System.Web.UI\DesignTimeParseDataCas.cs" />\r
- <Compile Include="System.Web.UI\DesignTimeTemplateParserCas.cs" />\r
- <Compile Include="System.Web.UI\EmptyCollectionCas.cs" />\r
- <Compile Include="System.Web.UI\Html32TextWriterCas.cs" />\r
- <Compile Include="System.Web.UI\HtmlTextWriterCas.cs" />\r
- <Compile Include="System.Web.UI\HtmlTextWriterTest.cs" />\r
- <Compile Include="System.Web.UI\ImageClickEventArgsCas.cs" />\r
- <Compile Include="System.Web.UI\LiteralControlCas.cs" />\r
- <Compile Include="System.Web.UI\LiteralControlTest.cs" />\r
- <Compile Include="System.Web.UI\LosFormatterCas.cs" />\r
- <Compile Include="System.Web.UI\LosFormatterTest.cs" />\r
- <Compile Include="System.Web.UI\MinimizableAttributeTypeConverterTest.cs" />\r
- <Compile Include="System.Web.UI\ObjectConverterCas.cs" />\r
- <Compile Include="System.Web.UI\ObjectTagBuilderCas.cs" />\r
- <Compile Include="System.Web.UI\OutputCacheParametersTest.cs" />\r
- <Compile Include="System.Web.UI\PageCas.cs" />\r
- <Compile Include="System.Web.UI\PageParserFilterTest.cs" />\r
- <Compile Include="System.Web.UI\PageParserTest.cs" />\r
- <Compile Include="System.Web.UI\PageTest.cs">\r
- <SubType>ASPXCodeBehind</SubType>\r
- </Compile>\r
- <Compile Include="System.Web.UI\PairCas.cs" />\r
- <Compile Include="System.Web.UI\ParseChildrenAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\PartialCachingAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\PersistChildrenAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\PersistenceModeAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\PostBackOptionsTest.cs" />\r
- <Compile Include="System.Web.UI\PropertyConverterCas.cs" />\r
- <Compile Include="System.Web.UI\PropertyConverterTest.cs" />\r
- <Compile Include="System.Web.UI\RootBuilderCas.cs" />\r
- <Compile Include="System.Web.UI\StateBagCas.cs" />\r
- <Compile Include="System.Web.UI\StateBagTest.cs" />\r
- <Compile Include="System.Web.UI\StateItemCas.cs" />\r
- <Compile Include="System.Web.UI\StaticPartialCachingControlCas.cs" />\r
- <Compile Include="System.Web.UI\TagPrefixAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\TemplateBuilderCas.cs" />\r
- <Compile Include="System.Web.UI\TemplateContainerAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\TemplateControlCas.cs" />\r
- <Compile Include="System.Web.UI\TemplateControlTest.cs" />\r
- <Compile Include="System.Web.UI\TemplateInstanceAttributeTest.cs" />\r
- <Compile Include="System.Web.UI\TestUrlPropertyAttribute.cs" />\r
- <Compile Include="System.Web.UI\ToolboxDataAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\ToolboxDataAttributeTest.cs" />\r
- <Compile Include="System.Web.UI\TripletCas.cs" />\r
- <Compile Include="System.Web.UI\UserControlCas.cs" />\r
- <Compile Include="System.Web.UI\UserControlControlBuilderCas.cs" />\r
- <Compile Include="System.Web.UI\ValidationPropertyAttributeCas.cs" />\r
- <Compile Include="System.Web.UI\ValidatorCollectionCas.cs" />\r
- <Compile Include="System.Web.UI\XhtmlTextWriterTest.cs" />\r
- <Compile Include="System.Web.Util\TransactionsCas.cs" />\r
- <Compile Include="System.Web.Util\UrlUtilsTest.cs" />\r
- <Compile Include="System.Web.Util\WorkItemCas.cs" />\r
- <Compile Include="System.Web\AppBrowsersTest.cs" />\r
- <Compile Include="System.Web\HttpApplicationCas.cs" />\r
- <Compile Include="System.Web\HttpApplicationStateCas.cs" />\r
- <Compile Include="System.Web\HttpBrowserCapabilitiesCas.cs" />\r
- <Compile Include="System.Web\HttpBrowserCapabilitiesTest.cs" />\r
- <Compile Include="System.Web\HttpCachePolicyCas.cs" />\r
- <Compile Include="System.Web\HttpCacheVaryByContentEncodingsTest.cs" />\r
- <Compile Include="System.Web\HttpCacheVaryByHeadersCas.cs" />\r
- <Compile Include="System.Web\HttpCacheVaryByHeadersTest.cs" />\r
- <Compile Include="System.Web\HttpCacheVaryByParamsCas.cs" />\r
- <Compile Include="System.Web\HttpCacheVaryByParamsTest.cs" />\r
- <Compile Include="System.Web\HttpClientCertificateCas.cs" />\r
- <Compile Include="System.Web\HttpClientCertificateTest.cs" />\r
- <Compile Include="System.Web\HttpCompileExceptionCas.cs" />\r
- <Compile Include="System.Web\HttpContext.cs" />\r
- <Compile Include="System.Web\HttpContextCas.cs" />\r
- <Compile Include="System.Web\HttpCookieCas.cs" />\r
- <Compile Include="System.Web\HttpCookieCollectionCas.cs" />\r
- <Compile Include="System.Web\HttpCookieCollectionTest.cs" />\r
- <Compile Include="System.Web\HttpCookieTest.cs" />\r
- <Compile Include="System.Web\HttpExceptionCas.cs" />\r
- <Compile Include="System.Web\HttpFileCollectionCas.cs" />\r
- <Compile Include="System.Web\HttpModuleCollectionCas.cs" />\r
- <Compile Include="System.Web\HttpParseExceptionCas.cs" />\r
- <Compile Include="System.Web\HttpRequestCas.cs" />\r
- <Compile Include="System.Web\HttpRequestTest.cs" />\r
- <Compile Include="System.Web\HttpRequestValidationExceptionCas.cs" />\r
- <Compile Include="System.Web\HttpResponseCas.cs" />\r
- <Compile Include="System.Web\HttpResponseTest.cs" />\r
- <Compile Include="System.Web\HttpRuntimeCas.cs" />\r
- <Compile Include="System.Web\HttpRuntimeTest.cs" />\r
- <Compile Include="System.Web\HttpServerUtilityCas.cs" />\r
- <Compile Include="System.Web\HttpServerUtilityTest.cs" />\r
- <Compile Include="System.Web\HttpStaticObjectsCollectionCas.cs" />\r
- <Compile Include="System.Web\HttpUnhandledExceptionCas.cs" />\r
- <Compile Include="System.Web\HttpUtilityCas.cs" />\r
- <Compile Include="System.Web\HttpUtilityTest.cs" />\r
- <Compile Include="System.Web\HttpWorkerRequestCas.cs" />\r
- <Compile Include="System.Web\HttpWorkerRequestTest.cs" />\r
- <Compile Include="System.Web\HttpWriter.cs" />\r
- <Compile Include="System.Web\HttpWriterCas.cs" />\r
- <Compile Include="System.Web\ProcessInfoCas.cs" />\r
- <Compile Include="System.Web\ProcessModelInfoCas.cs" />\r
- <Compile Include="System.Web\SiteMapNodeTest.cs" />\r
- <Compile Include="System.Web\SiteMapProviderTest.cs" />\r
- <Compile Include="System.Web\StaticSiteMapProviderTest.cs" />\r
- <Compile Include="System.Web\TraceContextCas.cs" />\r
- <Compile Include="System.Web\TraceContextRecordTest.cs" />\r
- <Compile Include="System.Web\VirtualPathUtilityTest.cs" />\r
- <Compile Include="System.Web\XmlSiteMapProviderTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\Global.asax">\r
- <LogicalName>Global.asax</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\MyPage.aspx">\r
- <LogicalName>MyPage.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\MyPageWithDerivedMaster.aspx">\r
- <LogicalName>MyPageWithDerivedMaster.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\MyPageWithMaster.aspx">\r
- <LogicalName>MyPageWithMaster.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\MyPageWithMasterInvalidPlaceHolder.aspx">\r
- <LogicalName>MyPageWithMasterInvalidPlaceHolder.aspx</LogicalName>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\My.ashx">\r
- <LogicalName>My.ashx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\My.master">\r
- <LogicalName>My.master</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\sub_map_01.sitemap">\r
- <LogicalName>sub_map_01.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_01.sitemap">\r
- <LogicalName>test_map_01.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_02.sitemap">\r
- <LogicalName>test_map_02.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_03.sitemap">\r
- <LogicalName>test_map_03.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_04.sitemap">\r
- <LogicalName>test_map_04.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_05.sitemap">\r
- <LogicalName>test_map_05.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_06.sitemap">\r
- <LogicalName>test_map_06.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_07.sitemap">\r
- <LogicalName>test_map_07.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_08.sitemap">\r
- <LogicalName>test_map_08.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\test_map_09.sitemap">\r
- <LogicalName>test_map_09.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\Web.config">\r
- <LogicalName>Web.config</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\Web.config.1.1">\r
- <LogicalName>Web.config.1.1</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\Web.mono.config">\r
- <LogicalName>Web.mono.config</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWeb\NunitWeb\Resources\Web.mono.config.1.1">\r
- <LogicalName>Web.mono.config.1.1</LogicalName>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\adapters.browser">\r
- <LogicalName>adapters.browser</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ContentPlaceHolderInTemplate.master">\r
- <LogicalName>ContentPlaceHolderInTemplate.master</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\MyDerived.master">\r
- <LogicalName>MyDerived.master</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\TestCapability.browser">\r
- <LogicalName>TestCapability.browser</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\Theme1.skin">\r
- <LogicalName>Theme1.skin</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\Theme2.skin">\r
- <LogicalName>Theme2.skin</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\Web.sitemap">\r
- <LogicalName>Web.sitemap</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\WebControl.config">\r
- <LogicalName>WebControl.config</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\WebLogin.config">\r
- <LogicalName>WebLogin.config</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\WebMapping.config">\r
- <LogicalName>WebMapping.config</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\WizardTest.skin">\r
- <LogicalName>WizardTest.skin</LogicalName>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\AsyncPage.aspx">\r
- <LogicalName>AsyncPage.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\Bluehills.jpg">\r
- <LogicalName>Bluehills.jpg</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\CallbackTest1.aspx">\r
- <LogicalName>CallbackTest1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\CallbackTest2.aspx">\r
- <LogicalName>CallbackTest2.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ClearErrorOnError.aspx">\r
- <LogicalName>ClearErrorOnError.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ClientScript.js">\r
- <LogicalName>ClientScript.js</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ConditionalClientComments.aspx">\r
- <LogicalName>ConditionalClientComments.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ContentPlaceHolderInTemplate.aspx">\r
- <LogicalName>ContentPlaceHolderInTemplate.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\CrossPagePosting1.aspx">\r
- <LogicalName>CrossPagePosting1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\CrossPagePosting2.aspx">\r
- <LogicalName>CrossPagePosting2.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\CustomSectionEmptyCollection.aspx">\r
- <LogicalName>CustomSectionEmptyCollection.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\DataGrid.aspx">\r
- <LogicalName>DataGrid.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\DetailsViewDataActions.aspx">\r
- <LogicalName>DetailsViewDataActions.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\DetailsViewProperties1.aspx">\r
- <LogicalName>DetailsViewProperties1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\DetailsViewTemplates.aspx">\r
- <LogicalName>DetailsViewTemplates.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\DuplicateControlsInClientComment.aspx">\r
- <LogicalName>DuplicateControlsInClientComment.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\EvalTest.aspx">\r
- <LogicalName>EvalTest.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\EventValidationTest1.aspx">\r
- <LogicalName>EventValidationTest1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\EventValidationTest2.aspx">\r
- <LogicalName>EventValidationTest2.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ExpressionInListControl.aspx">\r
- <LogicalName>EventValidationTest2.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\FooterTemplateTest.aspx">\r
- <LogicalName>FooterTemplateTest.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\FormView.aspx">\r
- <LogicalName>FormView.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\FormViewInsertEditDelete.aspx">\r
- <LogicalName>FormViewInsertEditDelete.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\FormViewTest1.aspx">\r
- <LogicalName>FormViewTest1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\FullTagsInText.aspx">\r
- <LogicalName>FullTagsInText.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\GridViewUpdate.aspx">\r
- <LogicalName>GridViewUpdate.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\InvalidPropertyBind1.aspx">\r
- <LogicalName>InvalidPropertyBind1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\InvalidPropertyBind2.aspx">\r
- <LogicalName>InvalidPropertyBind2.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\InvalidPropertyBind3.aspx">\r
- <LogicalName>InvalidPropertyBind3.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\InvalidPropertyBind4.aspx">\r
- <LogicalName>InvalidPropertyBind4.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\LinkInHeadWithEmbeddedExpression.aspx">\r
- <LogicalName>LinkInHeadWithEmbeddedExpression.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ListControlPage.aspx">\r
- <LogicalName>ListControlPage.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\LoginDisplayRememberMe.aspx">\r
- <LogicalName>LoginDisplayRememberMe.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\LoginViewTest1.aspx">\r
- <LogicalName>LoginViewTest1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\Mapping.aspx">\r
- <LogicalName>Mapping.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\Mapping1.aspx">\r
- <LogicalName>Mapping1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\MasterTypeTest1.aspx">\r
- <LogicalName>MasterTypeTest1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\MasterTypeTest2.aspx">\r
- <LogicalName>MasterTypeTest2.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\menuclass.aspx">\r
- <LogicalName>menuclass.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\MissingMasterFile.aspx">\r
- <LogicalName>MissingMasterFile.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\MyPageWithDerivedMaster.aspx">\r
- <LogicalName>MyPageWithDerivedMaster.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\NewlineInCodeExpression.aspx">\r
- <LogicalName>NewlineInCodeExpression.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\NoBindForMethodsWithBindInName.aspx">\r
- <LogicalName>NoBindForMethodsWithBindInName.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\NoDoubleOnInitOnRemoveAdd.aspx">\r
- <LogicalName>NoDoubleOnInitOnRemoveAdd.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\NoEventValidation.aspx">\r
- <LogicalName>NoEventValidation.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\OneLetterIdentifierInCodeRender.aspx">\r
- <LogicalName>OneLetterIdentifierInCodeRender.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\PageCultureTest.aspx">\r
- <LogicalName>PageCultureTest.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\PageLifecycleTest.aspx">\r
- <LogicalName>PageLifecycleTest.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\PageValidationTest.aspx">\r
- <LogicalName>PageValidationTest.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\PageWithAdapter.aspx">\r
- <LogicalName>PageWithAdapter.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\PageWithStyleSheet.aspx">\r
- <LogicalName>PageWithStyleSheet.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\PageWithTheme.aspx">\r
- <LogicalName>PageWithTheme.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\PostBackMenuTest.aspx">\r
- <LogicalName>PostBackMenuTest.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\PreprocessorDirectivesInMarkup.aspx">\r
- <LogicalName>PreprocessorDirectivesInMarkup.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ReadOnlyPropertyBind.aspx">\r
- <LogicalName>ReadOnlyPropertyBind.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ReadOnlyPropertyControl.ascx">\r
- <LogicalName>ReadOnlyPropertyControl.ascx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ReadWritePropertyControl.ascx">\r
- <LogicalName>ReadWritePropertyControl.ascx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\RedirectOnError.aspx">\r
- <LogicalName>RedirectOnError.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ResolveUrl.ascx">\r
- <LogicalName>ResolveUrl.ascx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ResolveUrl.aspx">\r
- <LogicalName>ResolveUrl.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\RunTimeSetTheme.aspx">\r
- <LogicalName>RunTimeSetTheme.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ServerControlInClientSideComment.aspx">\r
- <LogicalName>ServerControlInClientSideComment.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ServerSideControlsInScriptBlock.aspx">\r
- <LogicalName>ServerSideControlsInScriptBlock.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\TagsExpressionsAndCommentsInText.aspx">\r
- <LogicalName>TagsExpressionsAndCommentsInText.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\TagsNestedInClientTag.aspx">\r
- <LogicalName>TagsNestedInClientTag.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\TemplateControlParsingTest.aspx">\r
- <LogicalName>TemplateControlParsingTest.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\TemplateUserControl.ascx">\r
- <LogicalName>TemplateUserControl.ascx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\TextBoxTestlPage.aspx">\r
- <LogicalName>TextBoxTestlPage.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\UnquotedAngleBrackets.aspx">\r
- <LogicalName>UnquotedAngleBrackets.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\UrlProperty.ascx">\r
- <LogicalName>UrlProperty.ascx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\UrlProperty.aspx">\r
- <LogicalName>UrlProperty.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ValidPropertyBind1.aspx">\r
- <LogicalName>ValidPropertyBind1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ValidPropertyBind2.aspx">\r
- <LogicalName>ValidPropertyBind2.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ValidPropertyBind3.aspx">\r
- <LogicalName>ValidPropertyBind3.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ValidPropertyBind4.aspx">\r
- <LogicalName>ValidPropertyBind4.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\ValidPropertyBind5.aspx">\r
- <LogicalName>ValidPropertyBind5.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\XMLDataSourceTest.xml">\r
- <LogicalName>XMLDataSourceTest.xml</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\XMLDataSourceTest.xsl">\r
- <LogicalName>XMLDataSourceTest.xsl</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\XMLDataSourceTest1.aspx">\r
- <LogicalName>XMLDataSourceTest1.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\XMLDataSourceTest2.aspx">\r
- <LogicalName>XMLDataSourceTest2.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\XMLDataSourceTest3.aspx">\r
- <LogicalName>XMLDataSourceTest3.aspx</LogicalName>\r
- </EmbeddedResource>\r
- <EmbeddedResource Include="mainsoft\NunitWebResources\XMLDataSourceTest4.aspx">\r
- <LogicalName>XMLDataSourceTest4.aspx</LogicalName>\r
- </EmbeddedResource>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\SystemWebTestShim\SystemWebTestShim.csproj">\r
- <Project>{3D20F8D4-EE91-4FA5-85D9-4C36E8D68805}</Project>\r
- <Name>SystemWebTestShim</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>
\ No newline at end of file
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestMonoWeb20", "TestMonoWeb20.csproj", "{7180B7A7-D0AB-4397-AC0A-CDB1A9DE6417}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NunitWeb20", "mainsoft\NunitWeb\NunitWeb\NunitWeb20.csproj", "{DC2320EB-CC91-4648-AF2B-8937F6794A14}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HtmlCompare20", "mainsoft\MainsoftWebTest\HtmlCompare20.csproj", "{C3375963-9409-41A1-ADD2-1076F5A90BDE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MainsoftWebApp20", "mainsoft\MainsoftWebApp20\MainsoftWebApp20.csproj", "{C14E7AA4-23AD-417D-9A63-62DE9036C9BB}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug_Java|Any CPU = Debug_Java|Any CPU
- Debug_Java20|Any CPU = Debug_Java20|Any CPU
- Release_Java|Any CPU = Release_Java|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {7180B7A7-D0AB-4397-AC0A-CDB1A9DE6417}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
- {7180B7A7-D0AB-4397-AC0A-CDB1A9DE6417}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
- {7180B7A7-D0AB-4397-AC0A-CDB1A9DE6417}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
- {7180B7A7-D0AB-4397-AC0A-CDB1A9DE6417}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
- {7180B7A7-D0AB-4397-AC0A-CDB1A9DE6417}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
- {7180B7A7-D0AB-4397-AC0A-CDB1A9DE6417}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
- {DC2320EB-CC91-4648-AF2B-8937F6794A14}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
- {DC2320EB-CC91-4648-AF2B-8937F6794A14}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
- {DC2320EB-CC91-4648-AF2B-8937F6794A14}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
- {DC2320EB-CC91-4648-AF2B-8937F6794A14}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
- {DC2320EB-CC91-4648-AF2B-8937F6794A14}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
- {DC2320EB-CC91-4648-AF2B-8937F6794A14}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
- {C3375963-9409-41A1-ADD2-1076F5A90BDE}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
- {C3375963-9409-41A1-ADD2-1076F5A90BDE}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
- {C3375963-9409-41A1-ADD2-1076F5A90BDE}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
- {C3375963-9409-41A1-ADD2-1076F5A90BDE}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
- {C3375963-9409-41A1-ADD2-1076F5A90BDE}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
- {C3375963-9409-41A1-ADD2-1076F5A90BDE}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
- {C14E7AA4-23AD-417D-9A63-62DE9036C9BB}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU
- {C14E7AA4-23AD-417D-9A63-62DE9036C9BB}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU
- {C14E7AA4-23AD-417D-9A63-62DE9036C9BB}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU
- {C14E7AA4-23AD-417D-9A63-62DE9036C9BB}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU
- {C14E7AA4-23AD-417D-9A63-62DE9036C9BB}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU
- {C14E7AA4-23AD-417D-9A63-62DE9036C9BB}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectType>Local</ProjectType>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{D4128FAA-D11C-4BC2-8950-E94B4E8B8ACE}</ProjectGuid>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ApplicationIcon>
- </ApplicationIcon>
- <AssemblyKeyContainerName>
- </AssemblyKeyContainerName>
- <AssemblyName>TestMonoWeb</AssemblyName>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
- <DefaultClientScript>JScript</DefaultClientScript>
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
- <DefaultTargetSchema>IE50</DefaultTargetSchema>
- <DelaySign>false</DelaySign>
- <OutputType>Library</OutputType>
- <RootNamespace>
- </RootNamespace>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <StartupObject>
- </StartupObject>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
- <OutputPath>bin\</OutputPath>
- <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>TRACE;DEBUG;NET_1_1;NET_2_0</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>1595</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>4</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
- <OutputPath>bin\Release_Java\</OutputPath>
- <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
- <BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>TRACE;JAVA;NET_1_1;ONLY_1_1;TARGET_JVM</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>false</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoStdLib>false</NoStdLib>
- <NoWarn>1595</NoWarn>
- <Optimize>true</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
- <WarningLevel>4</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="HtmlCompare, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>mainsoft\NunitWeb\NunitWeb\bin\Debug\HtmlCompare.dll</HintPath>
- </Reference>
- <Reference Include="nunit.framework, Version=2.3.6162.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
- <Reference Include="NunitWeb, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>mainsoft\NunitWeb\NunitWeb\bin\Debug\NunitWeb.dll</HintPath>
- </Reference>
- <Reference Include="System">
- <Name>System</Name>
- </Reference>
- <Reference Include="System.configuration" />
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Drawing">
- <Name>System.Drawing</Name>
- </Reference>
- <Reference Include="System.Web">
- <Name>System.Web</Name>
- <Private>False</Private>
- </Reference>
- <Reference Include="System.Xml">
- <Name>System.Xml</Name>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Cas\AspNetHostingMinimal.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Cas\AspNetHostingNone.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Cas\AspNetHostingPermissionHelper.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Caching\CacheCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Caching\CacheDependencyCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Caching\CacheStress.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Compilation\ClientBuildManagerParameterTest.cs" />
- <Compile Include="System.Web.Configuration\AnonymousIdentificationSectionTest.cs" />
- <Compile Include="System.Web.Configuration\AssemblyCollectionTest.cs" />
- <Compile Include="System.Web.Configuration\AssemblyInfoTest.cs" />
- <Compile Include="System.Web.Configuration\AuthenticationSectionTest.cs" />
- <Compile Include="System.Web.Configuration\AuthorizationRuleCollectionTest.cs" />
- <Compile Include="System.Web.Configuration\AuthorizationRuleTest.cs" />
- <Compile Include="System.Web.Configuration\AuthorizationSectionTest.cs" />
- <Compile Include="System.Web.Configuration\BufferModeSettingsTest.cs" />
- <Compile Include="System.Web.Configuration\BuildProviderTest.cs" />
- <Compile Include="System.Web.Configuration\CacheSectionTest.cs" />
- <Compile Include="System.Web.Configuration\ClientTargetSectionTest.cs" />
- <Compile Include="System.Web.Configuration\ClientTargetTest.cs" />
- <Compile Include="System.Web.Configuration\CodeSubDirectoryTest.cs" />
- <Compile Include="System.Web.Configuration\CompilationSectionTest.cs" />
- <Compile Include="System.Web.Configuration\CustomErrorCollectionTest.cs" />
- <Compile Include="System.Web.Configuration\CustomErrorsSectionTest.cs" />
- <Compile Include="System.Web.Configuration\DeploymentSectionTest.cs" />
- <Compile Include="System.Web.Configuration\GlobalizationSectionTest.cs" />
- <Compile Include="System.Web.Configuration\HealthMonitoringSectionTest.cs" />
- <Compile Include="System.Web.Configuration\HostingEnvironmentSectionTest.cs" />
- <Compile Include="System.Web.Configuration\HttpCapabilitiesBaseCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Configuration\MachineKeyValidationConverterTest.cs" />
- <Compile Include="System.Web.Configuration\ProfilePropertySettingsTest.cs" />
- <Compile Include="System.Web.Configuration\WebConfigurationManagerTest.cs" />
- <Compile Include="System.Web.Handlers\TraceHandlerCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Hosting\HostingEnvironmentTest.cs" />
- <Compile Include="System.Web.Hosting\SimpleWorkerRequestCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Hosting\VirtualPathProviderTest.cs" />
- <Compile Include="System.Web.Mail\MailAttachmentCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Mail\MailMessageCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Mail\SmtpMailCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Profile\ProfileInfoTest.cs" />
- <Compile Include="System.Web.Security\DefaultAuthenticationEventArgsCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\DefaultAuthenticationModuleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\FileAuthorizationModuleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\FormsAuthenticationCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\FormsAuthenticationEventArgsCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\FormsAuthenticationModuleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\FormsAuthenticationTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\FormsAuthenticationTicketCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\FormsIdentityCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\FormsIdentityTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Security\MembershipProviderCollectionTest.cs" />
- <Compile Include="System.Web.Security\MembershipProviderTest.cs" />
- <Compile Include="System.Web.Security\MembershipTest.cs" />
- <Compile Include="System.Web.Security\MembershipUserCollectionTest.cs" />
- <Compile Include="System.Web.Security\RolePrincipalTest.cs" />
- <Compile Include="System.Web.Security\RolesTest.cs" />
- <Compile Include="System.Web.Security\UrlAuthorizationModuleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.SessionState\SessionStateModuleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlAnchorCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlAnchorTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlButtonCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlButtonTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlContainerControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlContainerControlTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlEmptyTagControlBuilderCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlFormCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlFormTest.cs">
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlGenericControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlHeadBuilderCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlHeadCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlImageCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlImageTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputButtonCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputButtonTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputCheckBoxCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputCheckBoxTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputControlTest.cs">
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputFileCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputFileTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputHiddenCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputHiddenTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputImageCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputPasswordCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputPasswordTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputRadioButtonCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputRadioButtonTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputResetCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputResetTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputSubmitCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputSubmitTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputTextCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputTextTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlLinkCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlLinkTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlMetaCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlMetaTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelectBuilderCas.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelectCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelectTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCellCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCellTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableRowCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableRowTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTextAreaCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTextAreaTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlTitleCas.cs" />
- <Compile Include="System.Web.UI.WebControls.WebParts\ConnectionInterfaceCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls.WebParts\WebPartTest.cs" />
- <Compile Include="System.Web.UI.WebControls\AccessDataSourceTest.cs" />
- <Compile Include="System.Web.UI.WebControls\AdCreatedEventArgsCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\AdCreatedEventArgsTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\BaseDataBoundControlCas.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseDataBoundControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseDataListCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\BaseDataListTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\BaseValidatorCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\BaseValidatorTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\BoundColumnCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\BoundColumnTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ButtonColumnCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ButtonColumnTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ButtonTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CalandarCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CalendarDayCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CalendarDayTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CalendarTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CheckBoxCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CheckBoxListCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CheckBoxListTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CheckBoxTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CompareValidatorCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CompareValidatorTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CompositeControlCas.cs" />
- <Compile Include="System.Web.UI.WebControls\CompositeControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CustomValidatorCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\CustomValidatorTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataBoundControlCas.cs" />
- <Compile Include="System.Web.UI.WebControls\DataBoundControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridColumnCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridColumnTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridItemCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridItemCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridItemCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridItemTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridPagerStyleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridPagerStyleTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataGridTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataKeyCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataKeyCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataListCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataListItemCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataListItemCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataListItemCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataListItemTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DataListTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DropDownListCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\DropDownListTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\EditCommandColumnCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\EditCommandColumnTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\FontInfoCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\FontInfoTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\FontNamesConverterCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\FontNamesConverterTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\FontUnitCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\FontUnitTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\FormViewCas.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\HyperLinkCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\HyperLinkColumnCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\HyperLinkColumnTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\HyperLinkTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ImageButtonCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ImageButtonTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ImageCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ImageTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LabelCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LabelTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LinkButtonCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LinkButtonTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ListBoxCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ListBoxTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ListControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ListControlTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ListItemCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ListItemCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LiteralCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LiteralTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LoginCas.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginNameCas.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginNameTest.cs">
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LoginStatusCas.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginStatusTest.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginTest.cs" />
- <Compile Include="System.Web.UI.WebControls\MonthChangedEventArgsCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\MonthChangedEventArgsTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\PagedDataSourceCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\PagedDataSourceTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\PanelCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\PanelTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RadioButtonCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RadioButtonListCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RadioButtonListTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RadioButtonTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RangeValidatorCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RangeValidatorTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RegularExpressionValidatorCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RegularExpressionValidatorTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RepeaterCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RepeaterTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RepeatInfoCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.auto.2.0.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.auto.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.gen.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RequiredFieldValidatorCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\RoleGroupCas.cs" />
- <Compile Include="System.Web.UI.WebControls\RoleGroupCollectionCas.cs" />
- <Compile Include="System.Web.UI.WebControls\RoleGroupCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RoleGroupTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SelectedDatesCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\SelectedDatesCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\StyleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\StyleTest.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableCellCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableCellTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableItemStyleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableItemStyleTest.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableSectionStyleCas.cs" />
- <Compile Include="System.Web.UI.WebControls\TableSectionStyleTest.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableStyleCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableStyleTest.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TestControlIDConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\TextBoxCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TextBoxTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TreeViewCas.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\UnitCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\UnitConverterCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\UnitConverterTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\UnitTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ValidationSummaryCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ValidationSummaryTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\ValidatorTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\WebControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\WebControlTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\XmlDataSourceCas.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlDataSourceTest.cs" />
- <Compile Include="System.Web.UI\AttributeCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\AttributeCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ChtmlTextWriterTest.cs" />
- <Compile Include="System.Web.UI\CleanHtmlTextWriter.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\CompiledTemplateBuilderCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ConstructorNeedsTagAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ControlBuilderAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ControlCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ControlCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ControlTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\CssStyleCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DataBinderCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DataBindingCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DataBindingCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DataBindingCollectionTest.cs" />
- <Compile Include="System.Web.UI\DataBindingHandlerAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DataBindingHandlerAttributeTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DataBoundLiteralControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DesignerDataBoundLiteralControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\DesignTimeParseDataCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\EmptyCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\Html32TextWriterCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\HtmlTextWriterCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\HtmlTextWriterTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ImageClickEventArgsCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\LiteralControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\LosFormatterCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\MinimizableAttributeTypeConverterTest.cs" />
- <Compile Include="System.Web.UI\PageTest.cs">
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="System.Web.UI\PairCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ParseChildrenAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\PartialCachingAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\PersistChildrenAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\PersistenceModeAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\StateBagCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\StateBagTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\StateItemCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\StaticPartialCachingControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\TagPrefixAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\TemplateContainerAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\TemplateControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\TestUrlPropertyAttribute.cs" />
- <Compile Include="System.Web.UI\ToolboxDataAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ToolboxDataAttributeTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\TripletCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\UserControlCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\UserControlControlBuilderCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ValidationPropertyAttributeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ValidatorCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.UI\XhtmlTextWriterTest.cs" />
- <Compile Include="System.Web.Util\WorkItemCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpApplicationCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpApplicationStateCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpBrowserCapabilitiesCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCachePolicyCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCacheVaryByHeadersCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCacheVaryByHeadersTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCacheVaryByParamsCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCacheVaryByParamsTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpClientCertificateCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpClientCertificateTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCompileExceptionCas.cs" />
- <Compile Include="System.Web\HttpContext.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpContextCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCookieCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCookieCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCookieCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpCookieTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpExceptionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpFileCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpModuleCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpParseExceptionCas.cs" />
- <Compile Include="System.Web\HttpRequestCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpRequestTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpRequestValidationExceptionCas.cs" />
- <Compile Include="System.Web\HttpResponseTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpRuntimeCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpStaticObjectsCollectionCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpUnhandledExceptionCas.cs" />
- <Compile Include="System.Web\HttpWorkerRequestCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\HttpWriterCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\ProcessInfoCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\ProcessModelInfoCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\TraceContextCas.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web\VirtualPathUtilityTest.cs" />
- <None Include="Cas\ChangeLog" />
- <None Include="System.Web.Caching\ChangeLog" />
- <None Include="System.Web.Caching\Makefile" />
- <None Include="System.Web.Caching\README" />
- <None Include="System.Web.Compilation\ChangeLog" />
- <None Include="System.Web.Configuration\ChangeLog" />
- <None Include="System.Web.Handlers\ChangeLog" />
- <None Include="System.Web.Hosting\ChangeLog" />
- <None Include="System.Web.Mail\ChangeLog" />
- <None Include="System.Web.Security\ChangeLog" />
- <None Include="System.Web.SessionState\ChangeLog" />
- <None Include="System.Web.UI.HtmlControls\ChangeLog" />
- <None Include="System.Web.UI.WebControls.WebParts\ChangeLog" />
- <None Include="System.Web.UI.WebControls\ChangeLog" />
- <None Include="System.Web.UI\ChangeLog" />
- <None Include="System.Web.Util\ChangeLog" />
- <None Include="System.Web\ChangeLog" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21022</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{7180B7A7-D0AB-4397-AC0A-CDB1A9DE6417}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>
- </RootNamespace>
- <AssemblyName>TestMonoWeb</AssemblyName>
- <JDKName>1.6</JDKName>
- <GHProjectType>1</GHProjectType>
- <Version>2.0</Version>
- <StartupObject>
- </StartupObject>
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>2.0</OldToolsVersion>
- <jarserver>ip2</jarserver>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug_Java\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release_Java\</OutputPath>
- <DefineConstants>TRACE;JAVA</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <BaseAddress>285212672</BaseAddress>
- <SkipValidation>false</SkipValidation>
- <KeepIntermediate>false</KeepIntermediate>
- <TargetPlatform>0</TargetPlatform>
- <AdditionalClassPath>
- </AdditionalClassPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\Debug_Java20\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>True</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.5.0_05</JDKName>
- <TargetPlatform>0</TargetPlatform>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\Release_Java20\</OutputPath>
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>
- <BaseAddress>285212672</BaseAddress>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <SkipValidation>False</SkipValidation>
- <KeepIntermediate>False</KeepIntermediate>
- <GHProjectType>1</GHProjectType>
- <PreCompile>false</PreCompile>
- <AdditionalClassPath>
- </AdditionalClassPath>
- <ApplicationServerType>
- </ApplicationServerType>
- <Version>2.0</Version>
- <JDKName>1.5.0_05</JDKName>
- <TargetPlatform>0</TargetPlatform>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
- <ProjectExtensions>
- <VisualStudio>
- <UserProperties REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-RefInfo-system-drawing="repository:vmw:framework:2.0" REFS-RefInfo-system-configuration="repository:vmw:framework:2.0" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-rt="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-htmlcompare="mainsoft\MainsoftWebTest\bin\Debug_Java\HtmlCompare.jar" REFS-JarPath-nunit-framework="..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-nunitweb="mainsoft\NunitWeb\NunitWeb\bin\Debug_Java20\NunitWeb.jar" REFS-JarPath-system="" REFS-JarPath-system-configuration="" REFS-JarPath-system-data="" REFS-JarPath-system-drawing="" REFS-JarPath-system-web="" REFS-JarPath-system-xml="" REFS-RefInfo-nunit-framework="j2il:" REFS-RefInfo-system-web="repository:vmw:framework:2.0" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-j2se-helpers="" REFS-RefInfo-j2se-helpers="repository:vmw:framework:2.0" />
- </VisualStudio>
- </ProjectExtensions>
- <ItemGroup>
- <Reference Include="J2SE.Helpers, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
- <Reference Include="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86" />
- <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86" />
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="System.Web.Configuration\AnonymousIdentificationSectionTest.cs" />
- <Compile Include="System.Web.Configuration\AssemblyCollectionTest.cs" />
- <Compile Include="System.Web.Configuration\AssemblyInfoTest.cs" />
- <Compile Include="System.Web.Configuration\AuthenticationSectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Configuration\AuthorizationRuleCollectionTest.cs" />
- <Compile Include="System.Web.Configuration\AuthorizationRuleTest.cs" />
- <Compile Include="System.Web.Configuration\AuthorizationSectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Configuration\BufferModeSettingsTest.cs" />
- <Compile Include="System.Web.Configuration\BuildProviderTest.cs" />
- <Compile Include="System.Web.Configuration\CacheSectionTest.cs" />
- <Compile Include="System.Web.Configuration\ClientTargetSectionTest.cs" />
- <Compile Include="System.Web.Configuration\ClientTargetTest.cs" />
- <Compile Include="System.Web.Configuration\CodeSubDirectoryTest.cs" />
- <Compile Include="System.Web.Configuration\CustomErrorCollectionTest.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="System.Web.Configuration\CustomErrorsSectionTest.cs" />
- <Compile Include="System.Web.Configuration\DeploymentSectionTest.cs" />
- <Compile Include="System.Web.Configuration\GlobalizationSectionTest.cs" />
- <Compile Include="System.Web.Configuration\HostingEnvironmentSectionTest.cs" />
- <Compile Include="System.Web.Configuration\MachineKeyValidationConverterTest.cs" />
- <Compile Include="System.Web.Configuration\NullableStringValidatorTest.cs" />
- <Compile Include="System.Web.Configuration\ProfilePropertySettingsTest.cs" />
- <Compile Include="System.Web.Configuration\SiteMapSectionTest.cs" />
- <Compile Include="System.Web.Configuration\WebConfigurationManagerTest.cs" />
- <Compile Include="System.Web.Profile\ProfileInfoTest.cs" />
- <Compile Include="System.Web.Security\FormsAuthenticationTest.cs" />
- <Compile Include="System.Web.Security\FormsIdentityTest.cs" />
- <Compile Include="System.Web.Security\MembershipProviderCollectionTest.cs" />
- <Compile Include="System.Web.Security\MembershipProviderTest.cs" />
- <Compile Include="System.Web.Security\MembershipTest.cs" />
- <Compile Include="System.Web.Security\MembershipUserCollectionTest.cs" />
- <Compile Include="System.Web.Security\RolePrincipalTest.cs" />
- <Compile Include="System.Web.Security\RolesTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlAnchorTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlButtonTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlContainerControlTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlFormTest.cs">
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlImageTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputButtonTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputCheckBoxTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputControlTest.cs">
- </Compile>
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputFileTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputHiddenTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputPasswordTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputRadioButtonTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputResetTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputSubmitTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlInputTextTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlLinkTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlMetaTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlSelectTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableCellTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableRowTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTableTest.cs" />
- <Compile Include="System.Web.UI.HtmlControls\HtmlTextAreaTest.cs" />
- <Compile Include="System.Web.UI.WebControls\AccessDataSourceTest.cs" />
- <Compile Include="System.Web.UI.WebControls\AdCreatedEventArgsTest.cs" />
- <Compile Include="System.Web.UI.WebControls\AutoGeneratedFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseCompareValidatorTest.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseDataBoundControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseDataListTest.cs" />
- <Compile Include="System.Web.UI.WebControls\BaseValidatorTest.cs" />
- <Compile Include="System.Web.UI.WebControls\BoundColumnTest.cs" />
- <Compile Include="System.Web.UI.WebControls\BoundFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\BulletedListTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonColumnTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonFieldBaseTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ButtonTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CalendarDayTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CalendarTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CallBackTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ChangePasswordTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CheckBoxFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CheckBoxListTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CheckBoxTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CircleHotSpotTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CommandFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CompareValidatorTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CompleteWizardStepTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CompositeControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CompositeDataBoundControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ContentTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ControlParameterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CookieParameterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CreateUserWizardStepTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CreateUserWizardTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CrossPagePostingTest.cs" />
- <Compile Include="System.Web.UI.WebControls\CustomValidatorTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataBoundControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlFieldCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataControlFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridColumnTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridItemCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridItemTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridPagerStyleTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataGridTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataKeyArrayTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataKeyCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataKeyTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListItemCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListItemTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataListTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataSourceControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DataSourceViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewRowCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewRowTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DetailsViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\DropDownListTest.cs" />
- <Compile Include="System.Web.UI.WebControls\EditCommandColumnTest.cs" />
- <Compile Include="System.Web.UI.WebControls\FileUploadTest.cs" />
- <Compile Include="System.Web.UI.WebControls\FontInfoTest.cs" />
- <Compile Include="System.Web.UI.WebControls\FontNamesConverterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\FontUnitTest.cs" />
- <Compile Include="System.Web.UI.WebControls\FormParameterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewRowTest.cs" />
- <Compile Include="System.Web.UI.WebControls\FormViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewRowCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewRowTest.cs" />
- <Compile Include="System.Web.UI.WebControls\GridViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\HierarchicalDataBoundControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\HotSpotCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\HotSpotTest.cs" />
- <Compile Include="System.Web.UI.WebControls\HyperLinkColumnTest.cs" />
- <Compile Include="System.Web.UI.WebControls\HyperLinkFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\HyperLinkTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageButtonTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageMapTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ImageTest.cs" />
- <Compile Include="System.Web.UI.WebControls\LabelTest.cs" />
- <Compile Include="System.Web.UI.WebControls\LinkButtonTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ListBoxTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ListControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ListItemCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ListItemTest.cs" />
- <Compile Include="System.Web.UI.WebControls\LiteralTest.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginNameTest.cs">
- </Compile>
- <Compile Include="System.Web.UI.WebControls\LoginStatusTest.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginTest.cs" />
- <Compile Include="System.Web.UI.WebControls\LoginViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\MappingUrlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\MasterPageTest.cs">
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\MenuTest.cs" />
- <Compile Include="System.Web.UI.WebControls\MonthChangedEventArgsTest.cs" />
- <Compile Include="System.Web.UI.WebControls\MultiViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ObjectDataSourceViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\PagedDataSourceTest.cs" />
- <Compile Include="System.Web.UI.WebControls\PagerSettingsTest.cs" />
- <Compile Include="System.Web.UI.WebControls\PanelTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ParameterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\PasswordRecoveryTest.cs" />
- <Compile Include="System.Web.UI.WebControls\PolygonHotSpotTest.cs" />
- <Compile Include="System.Web.UI.WebControls\QueryStringParameterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RadioButtonListTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RadioButtonTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RangeValidatorTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RectangleHotSpotTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RegularExpressionValidatorTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeaterItemCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeaterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.auto.2.0.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.auto.cs" />
- <Compile Include="System.Web.UI.WebControls\RepeatInfoTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RoleGroupCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\RoleGroupTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SelectedDatesCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SessionParameterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapDataSourceTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SiteMapPathTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceDerbyTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceTest.cs" />
- <Compile Include="System.Web.UI.WebControls\SqlDataSourceViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\StyleTest.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableCellTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TableFooterRowTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TableHeaderCellTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TableHeaderRowTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TableItemStyleTest.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableRowTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TableSectionStyleTest.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableStyleTest.cs">
- <SubType>Component</SubType>
- </Compile>
- <Compile Include="System.Web.UI.WebControls\TableTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TargetConverterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TemplateFieldTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TestControlIDConverter.cs" />
- <Compile Include="System.Web.UI.WebControls\TextBoxTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ThemeTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeBindingCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeBindingTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeStyleCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeStyleTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeNodeTest.cs" />
- <Compile Include="System.Web.UI.WebControls\TreeViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\UnitConverterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\UnitTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidatedControlConverterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidationSummaryTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ValidatorTest.cs" />
- <Compile Include="System.Web.UI.WebControls\ViewTest.cs" />
- <Compile Include="System.Web.UI.WebControls\WebColorConverterTest.cs" />
- <Compile Include="System.Web.UI.WebControls\WebControlTest.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardStepBaseTest.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardStepCollectionTest.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardStepTest.cs" />
- <Compile Include="System.Web.UI.WebControls\WizardTest.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlDataSourceTest.cs" />
- <Compile Include="System.Web.UI.WebControls\XmlTest.cs" />
- <Compile Include="System.Web.UI\AttributeCollectionTest.cs" />
- <Compile Include="System.Web.UI\ChtmlTextWriterTest.cs" />
- <Compile Include="System.Web.UI\CleanHtmlTextWriter.cs" />
- <Compile Include="System.Web.UI\ClientScriptManagerTest.cs">
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="System.Web.UI\ControlCollectionTest.cs" />
- <Compile Include="System.Web.UI\ControlTest.cs" />
- <Compile Include="System.Web.UI\CssStyleCollectionTest.cs" />
- <Compile Include="System.Web.UI\DataBindingCollectionTest.cs" />
- <Compile Include="System.Web.UI\DataBindingHandlerAttributeTest.cs" />
- <Compile Include="System.Web.UI\DataSourceSelectArgumentsTest.cs" />
- <Compile Include="System.Web.UI\HtmlTextWriterTest.cs" />
- <Compile Include="System.Web.UI\LiteralControlTest.cs" />
- <Compile Include="System.Web.UI\MinimizableAttributeTypeConverterTest.cs" />
- <Compile Include="System.Web.UI\OutputCacheParametersTest.cs" />
- <Compile Include="System.Web.UI\PageTest.cs">
- <SubType>ASPXCodeBehind</SubType>
- </Compile>
- <Compile Include="System.Web.UI\PostBackOptionsTest.cs" />
- <Compile Include="System.Web.UI\PropertyConverterTest.cs" />
- <Compile Include="System.Web.UI\StateBagTest.cs" />
- <Compile Include="System.Web.UI\TemplateControlTest.cs" />
- <Compile Include="System.Web.UI\TemplateInstanceAttributeTest.cs" />
- <Compile Include="System.Web.UI\TestUrlPropertyAttribute.cs" />
- <Compile Include="System.Web.UI\ToolboxDataAttributeTest.cs" />
- <Compile Include="System.Web.UI\XhtmlTextWriterTest.cs" />
- <Compile Include="System.Web\HttpBrowserCapabilitiesTest.cs" />
- <Compile Include="System.Web\HttpCacheVaryByHeadersTest.cs" />
- <Compile Include="System.Web\HttpCacheVaryByParamsTest.cs" />
- <Compile Include="System.Web\HttpClientCertificateTest.cs" />
- <Compile Include="System.Web\HttpContext.cs" />
- <Compile Include="System.Web\HttpCookieCollectionTest.cs" />
- <Compile Include="System.Web\HttpCookieTest.cs" />
- <Compile Include="System.Web\HttpRequestTest.cs" />
- <Compile Include="System.Web\HttpResponseTest.cs" />
- <Compile Include="System.Web\HttpServerUtilityTest.cs" />
- <Compile Include="System.Web\HttpUtilityTest.cs" />
- <Compile Include="System.Web\HttpWorkerRequestTest.cs" />
- <Compile Include="System.Web\SiteMapNodeTest.cs" />
- <Compile Include="System.Web\SiteMapProviderTest.cs" />
- <Compile Include="System.Web\StaticSiteMapProviderTest.cs" />
- <Compile Include="System.Web\VirtualPathUtilityTest.cs">
- <SubType>Code</SubType>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <None Include="System.Web.Caching\ChangeLog" />
- <None Include="System.Web.Caching\Makefile" />
- <None Include="System.Web.Caching\README" />
- <None Include="System.Web.Configuration\ChangeLog" />
- <None Include="System.Web.Handlers\ChangeLog" />
- <None Include="System.Web.Mail\ChangeLog" />
- <None Include="System.Web.Security\ChangeLog" />
- <None Include="System.Web.SessionState\ChangeLog" />
- <None Include="System.Web.UI.HtmlControls\ChangeLog" />
- <None Include="System.Web.UI.WebControls\ChangeLog" />
- <None Include="System.Web.UI\ChangeLog" />
- <None Include="System.Web.Util\ChangeLog" />
- <None Include="System.Web\ChangeLog" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="mainsoft\MainsoftWebTest\HtmlCompare20.csproj">
- <Project>{C3375963-9409-41A1-ADD2-1076F5A90BDE}</Project>
- <Name>HtmlCompare20</Name>
- </ProjectReference>
- <ProjectReference Include="mainsoft\NunitWeb\NunitWeb\NunitWeb20.csproj">
- <Project>{DC2320EB-CC91-4648-AF2B-8937F6794A14}</Project>
- <Name>NunitWeb20</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <Folder Include="System.Web.Compilation\" />
- </ItemGroup>
-</Project>
\ No newline at end of file
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
-#if !(TARGET_JVM || TARGET_DOTNET)
+#if !(TARGET_DOTNET)
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx.pub")]
#endif
using System.Xml.Xsl;
using Microsoft.Win32;
-#if !TARGET_JVM
namespace HtmlAgilityPack
{
/// <summary>
}
}
}
-#endif
\ No newline at end of file
File.Copy(source, target, true);
}
}
-#if TARGET_JVM1
- internal struct HtmlLibrary
- {
- [Conditional("DEBUG")]
- internal static void GetVersion(out string version)
- {
- System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(1, true);
- version = sf.GetMethod().DeclaringType.Assembly.GetName().Version.ToString();
- }
-
- [Conditional("DEBUG")]
- [Conditional("TRACE")]
- internal static void Trace(object Value)
- {
- // category is the method
- string name = null;
- GetCurrentMethodName(2, out name);
- System.Diagnostics.Trace.WriteLine(Value, name);
- }
-
- [Conditional("DEBUG")]
- [Conditional("TRACE")]
- internal static void TraceStackFrame(int steps)
- {
- string name = null;
- GetCurrentMethodName(2, out name);
- string trace = "";
- for(int i=1;i<steps;i++)
- {
- System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(i, true);
- trace += sf.ToString();
- }
- System.Diagnostics.Trace.WriteLine(trace, name);
- System.Diagnostics.Trace.WriteLine("");
- }
-
- [Conditional("DEBUG")]
- internal static void GetCurrentMethodName(out string name)
- {
- name = null;
- GetCurrentMethodName(2, out name);
- }
-
- [Conditional("DEBUG")]
- internal static void GetCurrentMethodName(int skipframe, out string name)
- {
- StackFrame sf = new StackFrame(skipframe, true);
- name = sf.GetMethod().DeclaringType.Name + "." + sf.GetMethod().Name;
- }
-
- }
-#endif
internal class HtmlCmdLine
{
headers.Add (INVOKER_HEADER, Serialize (t.Invoker));
headers.Add (USER_HEADER, Serialize (t.UserData));
WebRequest wr = t.Request.CreateWebRequest (
-#if TARGET_JVM
- new Uri ("http://localhost:8080/MainsoftWebApp20/"),
-#else
new Uri ("http://localhost:59598/NunitWebTest/"),
-#endif
headers);
-#if TARGET_JVM
-#define BUG_78521_FIXED
-#endif
-
using System;
using System.Web.UI;
_page = (Page) parameters[0];
#if NET_2_0
-#if BUG_78521_FIXED
- _page.PreInit += OnPreInit;
-#else
OnPreInit (null, null);
-#endif
+
_page.LoadComplete += OnLoadComplete;
_page.PreLoad += OnPreLoad;
_page.PreRenderComplete += OnPreRenderComplete;
-#if TARGET_JVM
-#define BUG_78521_FIXED
-#endif
-
using System;
using System.Web.UI;
using MonoTests.SystemWeb.Framework;
public partial class MyPage : System.Web.UI.Page
{
//FIXME: mono defines its own constructor here
-#if BUG_78521_FIXED
- public MyPage ()
-#else
protected override void OnPreInit (EventArgs e)
-#endif
{
WebTest t = WebTest.CurrentTest;
if (t != null)
-#if TARGET_JVM_FOR_WEBTEST
-#define TARGET_JVM
-#endif
-
using System;
using System.Reflection;
using System.IO;
/// </summary>
public static void CleanApp ()
{
-#if !TARGET_JVM
if (host != null) {
lock (_appUnloadedSync) {
EventHandler handler = new EventHandler(PulseAppUnloadedSync);
baseDir = null;
binDir = null;
}
-#endif
}
private static object _appUnloadedSync = new object();
{
if (type == null)
throw new ArgumentNullException ("type");
-#if !TARGET_JVM
using (Stream source = type.Assembly.GetManifestResourceStream (resourceName)) {
if (source == null)
throw new ArgumentException ("resource not found: " + resourceName, "resourceName");
source.Read (array, 0, array.Length);
CopyBinary (array, targetUrl);
}
-#endif
}
public static void CopyPrefixedResources (Type type, string namePrefix, string targetDir)
/// <example><code>CopyBinary (System.Text.Encoding.UTF8.GetBytes ("Hello"), "App_Data/Greeting.txt");</code></example>
public static string CopyBinary (byte[] sourceArray, string targetUrl)
{
-#if TARGET_JVM
- return null;
-#else
EnsureWorkingDirectories ();
EnsureDirectoryExists (Path.Combine (baseDir, Path.GetDirectoryName (targetUrl)));
string targetFile = Path.Combine (baseDir, targetUrl);
}
return targetFile;
-#endif
}
static WebTestResourcesSetupAttribute.SetupHandler CheckResourcesSetupHandler ()
{
if (host != null)
return;
-#if TARGET_JVM
- host = new MyHost ();
- return;
-#else
host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
if (host == null)
SetupHosting ();
-#endif
}
public static void SetupHosting ()
public static void SetupHosting (WebTestResourcesSetupAttribute.SetupHandler resHandler)
{
-#if !TARGET_JVM
if (host == null)
host = AppDomain.CurrentDomain.GetData (HOST_INSTANCE_NAME) as MyHost;
-#endif
if (host != null)
CleanApp ();
-#if TARGET_JVM
- host = new MyHost ();
- return;
-#else
if (resHandler == null)
resHandler = CheckResourcesSetupHandler ();
if (resHandler == null)
AppDomain.CurrentDomain.SetData (HOST_INSTANCE_NAME, host);
host.AppDomain.SetData (HOST_INSTANCE_NAME, host);
host.AppDomain.DomainUnload += new EventHandler (_unloadHandler.OnUnload);
-#endif
}
private static UnloadHandler _unloadHandler = new UnloadHandler();
public void OnUnload (object o, EventArgs args)
{
-#if !TARGET_JVM
// Block new requests from starting
lock (_syncUnloading) {
// Wait for pending requests to finish
if (handler != null)
handler(this, null);
}
-#endif
}
}
public static string TestBaseDir {
get {
-#if !TARGET_JVM
return baseDir;
-#else
- return String.Empty;
-#endif
}
}
-#if !TARGET_JVM
const string VIRTUAL_BASE_DIR = "/NunitWeb";
private static string baseDir;
private static string binDir;
}
static partial void CopyResourcesLocal ();
-#endif
}
}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.30703</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{73F9BAEA-A04B-4254-A736-D3B8B9947340}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Windows.Forms.DataVisualization.Charting</RootNamespace>\r
- <AssemblyName>System.Windows.Forms.DataVisualization</AssemblyName>\r
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_4_0</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release\</OutputPath>\r
- <DefineConstants>TRACE;NET_4_0</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="Accessibility">\r
- <EmbedInteropTypes>True</EmbedInteropTypes>\r
- </Reference>\r
- <Reference Include="System" />\r
- <Reference Include="System.Core" />\r
- <Reference Include="System.Drawing" />\r
- <Reference Include="System.Windows.Forms" />\r
- <Reference Include="System.Xml.Linq" />\r
- <Reference Include="System.Data.DataSetExtensions" />\r
- <Reference Include="Microsoft.CSharp" />\r
- <Reference Include="System.Data" />\r
- <Reference Include="System.Xml" />\r
- <Reference Include="System.Configuration" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Axis.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AxisScaleView.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartArea3DStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartGraphics.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartPaintEventArgs.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ElementPosition.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\FormatNumberEventArgs.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Margins.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\MarkerStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AnnotationPathPoint.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AnnotationPathPointCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Annotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AnnotationPositionChangingEventArgs.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AnovaResult.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AreaAlignmentOrientations.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AreaAlignmentStyles.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ArrowAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ArrowStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AxisArrowStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AxisEnabled.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AxisName.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AxisScaleBreakStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AxisType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\BorderSkinStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\BreakLineStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\CalloutStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Chart.cs">\r
- <SubType>Component</SubType>\r
- </Compile>\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartArea.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AntiAliasingStyles.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartAreaCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartColorPalette.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartDashStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartElement.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartElementCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartElementType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartHatchStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartImageAlignmentStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartImageFormat.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartImageWrapMode.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartNamedElement.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartNamedElementCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartValueType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\CursorEventArgs.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\CustomLabel.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\CustomLabelCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\CompareMethod.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\DataPoint.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\DataPointCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\DataPointCustomProperties.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\DateRangeType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\DateTimeIntervalType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Docking.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\FinancialFormula.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\GradientStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Grid.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\GridTickTypes.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\IDataPointFilter.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\IntervalAutoMode.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\IntervalType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LabelAlignmentStyles.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LabelAutoFitStyles.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LabelCalloutStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LabelMarkStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LabelOutsidePlotAreaStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendCellColumnType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendCellType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendImageStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendItemOrder.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendSeparatorStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendTableStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LightStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LineAnchorCapStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\NamedImage.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\NamedImagesCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Point3D.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\PointSortOrder.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ScrollBarButtonStyles.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ScrollBarButtonType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ScrollType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\SerializationContents.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\SerializationFormat.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Series.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\SeriesChartType.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\SeriesCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\StartFromZero.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\TextAntiAliasingQuality.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\TextOrientation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\TextStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\TickMark.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\TickMarkStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ToolTipEventArgs.cs" />\r
- <Compile Include="..\..\build\common\Consts.cs">\r
- <Link>Consts.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LabelStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AxisScrollBar.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\StripLine.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\StripLinesCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Legend.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendCellColumn.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ScrollBarEventArgs.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ViewEventArgs.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\HitTestResult.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendItem.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\SmartLabelStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\CustomProperties.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Title.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AnnotationCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ChartSerializer.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\DataManipulator.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\PrintingManager.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\TitleCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\DataFormula.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\BorderSkin.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendCellColumnCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendItemsCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendCell.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LegendCellCollection.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\CalloutAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\TextAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\LineAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\RectangleAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AnnotationGroup.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\AnnotationSmartLabelStyle.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Cursor.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\CustomizeLegendEventArgs.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\PolylineAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\Border3DAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\EllipseAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\HorizontalLineAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ImageAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\PolygonAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\VerticalLineAnnotation.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\StatisticFormula.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\FTestResult.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\TTestResult.cs" />\r
- <Compile Include="System.Windows.Forms.DataVisualization.Charting\ZTestResult.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- <Folder Include="common\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
-</Project>\r
using System.Windows.Forms.DataVisualization.Charting;
using NUnit.Framework;
-namespace ChartingTests
+namespace MonoTests.System.Windows.Forms.DataVisualization.Charting
{
[TestFixture]
public class AnnotationPathPointTest
using System.Windows.Forms.DataVisualization.Charting;
using NUnit.Framework;
-namespace ChartingTests
+namespace MonoTests.System.Windows.Forms.DataVisualization.Charting
{
[TestFixture]
public class AnovaResultTest
using System.Windows.Forms.DataVisualization.Charting;
using NUnit.Framework;
-namespace ChartingTests
+namespace MonoTests.System.Windows.Forms.DataVisualization.Charting
{
[TestFixture]
public class ArrowAnnotationTest
using NUnit.Framework;
using System.Drawing;
-namespace ChartingTests
+namespace MonoTests.System.Windows.Forms.DataVisualization.Charting
{
[TestFixture]
public class AxisScaleBreakStyleTest
using System.Windows.Forms.DataVisualization.Charting;
using NUnit.Framework;
-namespace ChartingTests
+namespace MonoTests.System.Windows.Forms.DataVisualization.Charting
{
[TestFixture]
public class ChartElementTest
using System.Windows.Forms.DataVisualization.Charting;
using NUnit.Framework;
-namespace ChartingTests
+namespace MonoTests.System.Windows.Forms.DataVisualization.Charting
{
[TestFixture]
public class DataPointTest
[assembly: ComVisible (false)]
-#if !TARGET_JVM
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
#if NET_2_1
#else
[assembly: AssemblyKeyFile ("../ecma.pub")]
#endif
-#endif
#if NET_2_1
[assembly: InternalsVisibleTo ("System.Runtime.Serialization, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
LIBRARY_COMPILE = $(BOOT_COMPILE)
endif
-PROFILE_ANY_MOBILE := $(filter monotouch monotouch_runtime monodroid xammac, $(PROFILE))
+PROFILE_ANY_MOBILE := $(filter monotouch monotouch_runtime monodroid xammac mobile mobile_static, $(PROFILE))
LIB_MCS_FLAGS = -r:$(corlib) -r:System.dll -nowarn:0618,0612,0642
ifeq (2.1, $(FRAMEWORK_VERSION))
csproj-local:
$(MAKE) csproj-local intermediate=bare/
endif
-endif
\ No newline at end of file
+endif
if (children != null) children.Evaluate (p);
- if (isEmptyElement)
+ var templateContent = children as XslTemplateContent;
+ if (isEmptyElement || (templateContent != null && templateContent.IsEmptyElement))
p.Out.WriteEndElement ();
else
p.Out.WriteFullEndElement ();
int stackSize;
XPathNodeType parentType;
bool xslForEach;
+ bool isEmptyElement;
public XslTemplateContent (Compiler c,
XPathNodeType parentType, bool xslForEach)
get { return parentType; }
}
+ public bool IsEmptyElement {
+ get { return isEmptyElement; }
+ }
+
protected override void Compile (Compiler c)
{
if (c.Debugger != null)
} while (c.Input.MoveToNext ());
+ isEmptyElement = true;
+ foreach (var n in content) {
+ if (n is XslAttribute)
+ continue;
+
+ isEmptyElement = false;
+ break;
+ }
if (hasStack) {
stackSize = c.PopScope ().VariableHighTide;
public object Compile (XPathNavigator node)
{
-#if TARGET_JVM || MOBILE
+#if MOBILE
throw new NotImplementedException ();
#else
string suffix = "";
+++ /dev/null
-//
-// XslDecimalFormat.jvm.cs
-//
-// Authors:
-// Andrew Skiba <andrews@mainsoft.com>
-//
-// (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Xml;
-using System.Xml.XPath;
-using System.Xml.Xsl;
-
-using QName = System.Xml.XmlQualifiedName;
-
-namespace Mono.Xml.Xsl {
- internal class XslDecimalFormat {
-
- java.text.DecimalFormatSymbols javaFormat;
- string baseUri;
- int lineNumber;
- int linePosition;
-
- public static readonly XslDecimalFormat Default = new XslDecimalFormat ();
-
- XslDecimalFormat ()
- {
- javaFormat = new java.text.DecimalFormatSymbols ();
- javaFormat.setNaN ("NaN");
- javaFormat.setInfinity ("Infinity");
- }
-
- public XslDecimalFormat (Compiler c)
- :this ()
- {
- Initialize(c);
- }
-
- private void Initialize(Compiler c)
- {
- XPathNavigator n = c.Input;
-
- IXmlLineInfo li = n as IXmlLineInfo;
- if (li != null) {
- lineNumber = li.LineNumber;
- linePosition = li.LinePosition;
- }
- baseUri = n.BaseURI;
-
- if (n.MoveToFirstAttribute ()) {
- do {
- if (n.NamespaceURI != String.Empty)
- continue;
-
- switch (n.LocalName) {
- case "name": break; // already handled
- case "decimal-separator":
- if (n.Value.Length != 1)
- throw new XsltCompileException ("XSLT decimal-separator value must be exact one character.", null, n);
- javaFormat.setDecimalSeparator (n.Value[0]);
- break;
-
- case "grouping-separator":
- if (n.Value.Length != 1)
- throw new XsltCompileException ("XSLT grouping-separator value must be exact one character.", null, n);
- javaFormat.setGroupingSeparator (n.Value[0]);
- break;
-
- case "infinity":
- javaFormat.setInfinity (n.Value);
- break;
- case "minus-sign":
- if (n.Value.Length != 1)
- throw new XsltCompileException ("XSLT minus-sign value must be exact one character.", null, n);
- javaFormat.setMinusSign (n.Value[0]);
- break;
- case "NaN":
- javaFormat.setNaN (n.Value);
- break;
- case "percent":
- if (n.Value.Length != 1)
- throw new XsltCompileException ("XSLT percent value must be exact one character.", null, n);
- javaFormat.setPercent (n.Value[0]);
- break;
- case "per-mille":
- if (n.Value.Length != 1)
- throw new XsltCompileException ("XSLT per-mille value must be exact one character.", null, n);
- javaFormat.setPerMill (n.Value[0]);
- break;
- case "digit":
- if (n.Value.Length != 1)
- throw new XsltCompileException ("XSLT digit value must be exact one character.", null, n);
- javaFormat.setDigit (n.Value[0]);
- break;
- case "zero-digit":
- if (n.Value.Length != 1)
- throw new XsltCompileException ("XSLT zero-digit value must be exact one character.", null, n);
- javaFormat.setZeroDigit (n.Value [0]);
- break;
- case "pattern-separator":
- if (n.Value.Length != 1)
- throw new XsltCompileException ("XSLT pattern-separator value must be exact one character.", null, n);
- javaFormat.setPatternSeparator (n.Value [0]);
- break;
- }
- } while (n.MoveToNextAttribute ());
- n.MoveToParent ();
- }
- }
-
- public void CheckSameAs (XslDecimalFormat other)
- {
- if (! this.javaFormat.Equals (other.javaFormat))
- throw new XsltCompileException (null, other.baseUri, other.lineNumber, other.linePosition);
- }
-
- public string FormatNumber (double number, string pattern)
- {
- java.text.DecimalFormat frm = new java.text.DecimalFormat("", javaFormat);
-
- frm.applyLocalizedPattern (pattern);
-
- //TODO: the next 4 string could be replaced by just
- //return frm.format (number);
- //I don't want to do that before release
- java.lang.StringBuffer buffer= new java.lang.StringBuffer ();
- java.text.FieldPosition fld = new java.text.FieldPosition (0);
-
- frm.format (number, buffer, fld);
- return buffer.ToString();
- }
- }
-}
#if NET_2_0
using System;
-#if !TARGET_JVM
using System.Xml.Serialization.Advanced;
-#endif
namespace System.Xml.Serialization
{
WriteLine (string.Empty);
}
- WriteLine ("string " + GetGetEnumValueName (map) + " (" + map.TypeData.CSharpFullName + " val)");
+ WriteLine ("string " + GetGetEnumValueName (map) + " (" + GetTypeFullName (map.TypeData) + " val)");
WriteLineInd ("{");
void GenerateWriteObject (XmlTypeMapping typeMap)
{
- WriteLine ("void " + GetWriteObjectName (typeMap) + " (" + typeMap.TypeData.CSharpFullName + " ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)");
+ WriteLine ("void " + GetWriteObjectName (typeMap) + " (" + GetTypeFullName (typeMap.TypeData) + " ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)");
WriteLineInd ("{");
PushHookContext ();
if (typeMap.TypeData.SchemaType == SchemaTypes.XmlNode)
{
if (_format == SerializationFormat.Literal)
- WriteLine ("WriteElementLiteral (ob, \"\", \"\", true, false);");
+ WriteLine ("WriteElementLiteral (ob, \"\", \"\", true, " + GetLiteral(typeMap.IsAny) + ");");
else
- WriteLine ("WriteElementEncoded (ob, \"\", \"\", true, false);");
+ WriteLine ("WriteElementEncoded (ob, \"\", \"\", true, " + GetLiteral(typeMap.IsAny) + ");");
GenerateEndHook ();
WriteLineUni ("}");
if (typeMap.TypeData.SchemaType == SchemaTypes.XmlSerializable)
{
- WriteLine ("WriteSerializable (ob, element, namesp, isNullable);");
+ WriteLine ("WriteSerializable (ob, element, namesp, isNullable, " + GetLiteral(!typeMap.IsAny) + ");");
GenerateEndHook ();
WriteLineUni ("}");
void GenerateWriteAnyElementContent (XmlTypeMapMemberAnyElement member, string memberValue)
{
- bool singleElement = (member.TypeData.Type == typeof (XmlElement));
+ bool singleElement = (member.TypeData.Type == typeof (XmlElement) || member.TypeData.Type == typeof (XmlNode));
string var, var2;
var = GetObTempVar ();
else
return mem + " != " + GetLiteral (member.DefaultValue);
}
- else if (member.IsOptionalValueType)
- return ob + ".@" + member.Name + "Specified";
+ else if (member.HasSpecified) {
+ var sb = new StringBuilder ();
+ sb.AppendFormat ("{0}.@{1}Specified", ob, member.Name);
+ if (member.HasShouldSerialize)
+ sb.AppendFormat (" && {0}.@ShouldSerialize{1} ()", ob, member.Name);
+ return sb.ToString ();
+ } else if (member.HasShouldSerialize)
+ return ob + ".@ShouldSerialize" + member.Name + " ()";
+
return null;
}
else
WriteLine ("return ReadXmlNode (false);");
} else {
- WriteLineInd ("if (Reader.LocalName != " + GetLiteral (typeMap.ElementName) + " || Reader.NamespaceURI != " + GetLiteral (typeMap.Namespace) + ")");
- WriteLine ("throw CreateUnknownNodeException();");
- Unindent ();
+ if (!typeMap.IsAny) {
+ WriteLineInd ("if (Reader.LocalName != " + GetLiteral (typeMap.ElementName) + " || Reader.NamespaceURI != " + GetLiteral (typeMap.Namespace) + ")");
+ WriteLine ("throw CreateUnknownNodeException();");
+ Unindent ();
+ }
WriteLine ("return " + GetReadObjectCall (typeMap, GetLiteral(typeMap.IsNullable), "true") + ";");
}
WriteLine ("Reader.MoveToContent();");
WriteLine ("if (Reader.NodeType == System.Xml.XmlNodeType.Element) ");
WriteLineInd ("{");
- WriteLineInd ("if (Reader.LocalName == " + GetLiteral(typeMap.ElementName) + " && Reader.NamespaceURI == " + GetLiteral (typeMap.Namespace) + ")");
+ if (!typeMap.IsAny)
+ WriteLineInd ("if (Reader.LocalName == " + GetLiteral(typeMap.ElementName) + " && Reader.NamespaceURI == " + GetLiteral (typeMap.Namespace) + ")");
WriteLine ("ob = ReadReferencedElement();");
Unindent ();
- WriteLineInd ("else ");
- WriteLine ("throw CreateUnknownNodeException();");
- Unindent ();
+ if (!typeMap.IsAny) {
+ WriteLineInd ("else ");
+ WriteLine ("throw CreateUnknownNodeException();");
+ Unindent ();
+ }
WriteLineUni ("}");
WriteLineInd ("else ");
WriteLine ("UnknownNode(null);");
{
string isNullable;
if (_format == SerializationFormat.Literal) {
- WriteLine ("public " + typeMap.TypeData.CSharpFullName + " " + GetReadObjectName (typeMap) + " (bool isNullable, bool checkType)");
+ WriteLine ("public " + GetTypeFullName(typeMap.TypeData) + " " + GetReadObjectName (typeMap) + " (bool isNullable, bool checkType)");
isNullable = "isNullable";
}
else {
}
else {
WriteLine (ob + ".@" + member.Name + " = " + value + ";");
- if (member.IsOptionalValueType) {
+ if (member.IsOptionalValueType && member.IsValueSpecifiedSettable ()) {
string val = initializingMember ? "false" : "true";
WriteLine (ob + "." + member.Name + "Specified = " + val + ";");
}
WriteLine ("Reader.MoveToContent ();");
WriteLine ("if (Reader.NodeType == XmlNodeType.Element)");
WriteLineInd ("{");
- WriteLine ("if (Reader.LocalName == " + GetLiteral (typeMap.ElementName) + " && Reader.NamespaceURI == " + GetLiteral (typeMap.Namespace) + ")");
+ if (!typeMap.IsAny)
+ WriteLineInd ("if (Reader.LocalName == " + GetLiteral (typeMap.ElementName) + " && Reader.NamespaceURI == " + GetLiteral (typeMap.Namespace) + ")");
WriteLine (String.Format ("\treturn ({0}) ReadSerializable (({0}) Activator.CreateInstance(typeof({0}), true));", typeMap.TypeData.CSharpFullName));
- WriteLine ("else");
- WriteLine ("\tthrow CreateUnknownNodeException ();");
+ Unindent ();
+ if (!typeMap.IsAny) {
+ WriteLine ("else");
+ WriteLine ("\tthrow CreateUnknownNodeException ();");
+ }
WriteLineUni ("}");
WriteLine ("else UnknownNode (null);");
WriteLine ("");
string GetRootTypeName ()
{
- if (_typeMap is XmlTypeMapping) return ((XmlTypeMapping)_typeMap).TypeData.CSharpFullName;
+ if (_typeMap is XmlTypeMapping) return GetTypeFullName (((XmlTypeMapping)_typeMap).TypeData);
else return "object[]";
}
string GetCast (TypeData td, string val)
{
- if (td.IsNullable && td.IsValueType)
- return "((" + td.CSharpFullName + "?) " + val + ")";
- else
- return "((" + td.CSharpFullName + ") " + val + ")";
+ return "((" + GetTypeFullName (td) + ") " + val + ")";
}
string GetCast (Type td, string val)
string GetTypeOf (TypeData td)
{
- return "typeof(" + td.CSharpFullName + ")";
+ return "typeof(" + GetTypeFullName (td) + ")";
}
string GetTypeOf (Type td)
{
return "typeof(" + ToCSharpFullName (td) + ")";
}
+
+ string GetTypeFullName (TypeData td) {
+ if (td.IsNullable && td.IsValueType)
+ return td.CSharpFullName + "?";
+
+ return td.CSharpFullName;
+ }
string GetLiteral (object ob)
{
sb.Append (type.Name);
}
else {
- if (full && type.Namespace.Length > 0)
+ if (full && !string.IsNullOrEmpty(type.Namespace))
sb.Append (type.Namespace).Append ('.');
sb.Append (type.Name);
}
static Hashtable primitiveArrayTypes;
static Hashtable nullableTypes;
-#if TARGET_JVM
- static readonly object AppDomain_TypeTranslatorCacheLock = new object ();
- const string AppDomain_nameCacheName = "System.Xml.Serialization.TypeTranslator.nameCache";
- const string AppDomain_nullableTypesName = "System.Xml.Serialization.TypeTranslator.nullableTypes";
-
- static Hashtable AppDomain_nameCache {
- get { return GetAppDomainCache (AppDomain_nameCacheName); }
- }
-
- static Hashtable AppDomain_nullableTypes {
- get { return GetAppDomainCache (AppDomain_nullableTypesName); }
- }
-
- static Hashtable GetAppDomainCache(string name) {
- Hashtable res = (Hashtable) AppDomain.CurrentDomain.GetData (name);
-
- if (res == null) {
- lock (AppDomain_TypeTranslatorCacheLock) {
- res = (Hashtable) AppDomain.CurrentDomain.GetData (name);
- if (res == null) {
- res = Hashtable.Synchronized (new Hashtable ());
- AppDomain.CurrentDomain.SetData (name, res);
- }
- }
- }
-
- return res;
- }
-#endif
static TypeTranslator ()
{
nameCache = new Hashtable ();
primitiveArrayTypes = Hashtable.Synchronized (new Hashtable ());
-#if !TARGET_JVM
nameCache = Hashtable.Synchronized (nameCache);
-#endif
// XSD Types with direct map to CLR types
nameCache.Add (typeof (bool), new TypeData (typeof (bool), "boolean", true));
TypeData pt = GetTypeData (type); // beware this recursive call btw ...
if (pt != null) {
TypeData tt = (TypeData) nullableTypes [pt.XmlType];
-#if TARGET_JVM
- if (tt == null)
- tt = (TypeData) AppDomain_nullableTypes [pt.XmlType];
-#endif
if (tt == null) {
tt = new TypeData (type, pt.XmlType, false);
tt.IsNullable = true;
-#if TARGET_JVM
- AppDomain_nullableTypes [pt.XmlType] = tt;
-#else
nullableTypes [pt.XmlType] = tt;
-#endif
}
return tt;
}
TypeData typeData = nameCache[runtimeType] as TypeData;
if (typeData != null) return typeData;
-#if TARGET_JVM
- Hashtable dynamicCache = AppDomain_nameCache;
- typeData = dynamicCache[runtimeType] as TypeData;
- if (typeData != null) return typeData;
-#endif
string name;
if (type.IsArray) {
typeData = new TypeData (type, name, false);
if (nullableOverride)
typeData.IsNullable = true;
-#if TARGET_JVM
- dynamicCache[runtimeType] = typeData;
-#else
nameCache[runtimeType] = typeData;
-#endif
return typeData;
}
{
get { return _mapMember.Name; }
}
-#if !TARGET_JVM && !NET_2_1
+#if !NET_2_1
public string GenerateTypeName (System.CodeDom.Compiler.CodeDomProvider codeProvider)
{
string ret = codeProvider.CreateValidIdentifier (_mapMember.TypeData.FullTypeName);
return map;
}
- XmlTypeMapping ImportClassMapping (Type type, XmlRootAttribute root, string defaultNamespace)
+ XmlTypeMapping ImportClassMapping (Type type, XmlRootAttribute root, string defaultNamespace, bool isBaseType = false)
{
TypeData typeData = TypeTranslator.GetTypeData (type);
- return ImportClassMapping (typeData, root, defaultNamespace);
+ return ImportClassMapping (typeData, root, defaultNamespace, isBaseType);
}
- XmlTypeMapping ImportClassMapping (TypeData typeData, XmlRootAttribute root, string defaultNamespace)
+ XmlTypeMapping ImportClassMapping (TypeData typeData, XmlRootAttribute root, string defaultNamespace, bool isBaseType = false)
{
Type type = typeData.Type;
+ if (!allowPrivateTypes && !isBaseType)
+ ReflectionHelper.CheckSerializableType (type, false);
+
XmlTypeMapping map = helper.GetRegisteredClrType (type, GetTypeNamespace (typeData, root, defaultNamespace));
if (map != null) return map;
-
- if (!allowPrivateTypes)
- ReflectionHelper.CheckSerializableType (type, false);
map = CreateTypeMapping (typeData, root, null, defaultNamespace);
helper.RegisterClrType (map, type, map.XmlTypeNamespace);
string ns = map.XmlTypeNamespace;
if (rmember.XmlAttributes.XmlIgnore) continue;
if (rmember.DeclaringType != null && rmember.DeclaringType != type) {
- XmlTypeMapping bmap = ImportClassMapping (rmember.DeclaringType, root, defaultNamespace);
+ XmlTypeMapping bmap = ImportClassMapping (rmember.DeclaringType, root, defaultNamespace, true);
if (bmap.HasXmlTypeNamespace)
ns = bmap.XmlTypeNamespace;
}
if (type.BaseType != null)
{
- XmlTypeMapping bmap = ImportClassMapping (type.BaseType, root, defaultNamespace);
+ XmlTypeMapping bmap = ImportClassMapping (type.BaseType, root, defaultNamespace, true);
ClassMap cbmap = bmap.ObjectMap as ClassMap;
if (type.BaseType != typeof (object)) {
elem.Form = att.Form;
if (att.Form == XmlSchemaForm.Unqualified)
elem.Namespace = string.Empty;
- elem.IsNullable = att.IsNullable && CanBeNull (elem.TypeData);
+ elem.IsNullable = (!att.IsNullableSpecified || att.IsNullable) && CanBeNull (elem.TypeData);
elem.NestingLevel = att.NestingLevel;
if (isMultiArray) {
// Read all Fields via reflection.
ArrayList fieldList = new ArrayList();
FieldInfo[] tfields = type.GetFields (BindingFlags.Instance | BindingFlags.Public);
-#if TARGET_JVM
- // This statement ensures fields are ordered starting from the base type.
- for (int ti=0; ti<typeList.Count; ti++) {
- for (int i=0; i<tfields.Length; i++) {
- FieldInfo field = tfields[i];
- if (field.DeclaringType == typeList[ti])
- fieldList.Add (field);
- }
- }
-#else
currentType = null;
int currentIndex = 0;
foreach (FieldInfo field in tfields)
}
fieldList.Insert(currentIndex++, field);
}
-#endif
// Read all Properties via reflection.
ArrayList propList = new ArrayList();
PropertyInfo[] tprops = type.GetProperties (BindingFlags.Instance | BindingFlags.Public);
-#if TARGET_JVM
- // This statement ensures properties are ordered starting from the base type.
- for (int ti=0; ti<typeList.Count; ti++) {
- for (int i=0; i<tprops.Length; i++) {
- PropertyInfo prop = tprops[i];
- if (!prop.CanRead) continue;
- if (prop.GetIndexParameters().Length > 0) continue;
- if (prop.DeclaringType == typeList[ti])
- propList.Add (prop);
- }
- }
-#else
currentType = null;
currentIndex = 0;
foreach (PropertyInfo prop in tprops)
if (prop.GetIndexParameters().Length > 0) continue;
propList.Insert(currentIndex++, prop);
}
-#endif
var members = new List<XmlReflectionMember>();
int fieldIndex=0;
int propIndex=0;
if (choiceEnumMap != null) {
string cname = choiceEnumMap.GetEnumName (choiceEnumType.FullName, elem.ElementName);
+ if (cname == null && elem.Namespace != null)
+ cname = choiceEnumMap.GetEnumName (choiceEnumType.FullName,
+ elem.Namespace.ToString () + ":" + elem.ElementName);
if (cname == null)
throw new InvalidOperationException (string.Format (
CultureInfo.InvariantCulture, "Type {0} is missing"
//
using System.Xml;
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
using System.CodeDom.Compiler;
#endif
using System.Xml.Schema;
this.typeIdentifiers = typeIdentifiers;
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
[MonoTODO]
public XmlSchemaImporter (XmlSchemas schemas, CodeGenerationOptions options, CodeDomProvider codeProvider, ImportContext context)
{
}
else
{
- if (Reader.LocalName != rootMap.ElementName || Reader.NamespaceURI != rootMap.Namespace)
+ if (!rootMap.IsAny && (Reader.LocalName != rootMap.ElementName || Reader.NamespaceURI != rootMap.Namespace))
throw CreateUnknownNodeException();
return ReadObject (rootMap, rootMap.IsNullable, true);
void SetMemberValue (XmlTypeMapMember member, object ob, object value, bool isValueList)
{
+ var memberType = member.TypeData.Type;
+ if (value != null && !value.GetType().IsAssignableFrom (memberType))
+ value = XmlSerializationWriterInterpreter.ImplicitConvert (value, memberType);
+
if (isValueList)
((object[])ob)[member.GlobalIndex] = value;
else
Reader.MoveToContent ();
if (Reader.NodeType == XmlNodeType.Element)
{
- if (Reader.LocalName == typeMap.ElementName && Reader.NamespaceURI == typeMap.Namespace)
+ if (typeMap.IsAny || (Reader.LocalName == typeMap.ElementName && Reader.NamespaceURI == typeMap.Namespace))
{
object ob = CreateInstance (typeMap.TypeData.Type, true);
return ReadSerializable ((IXmlSerializable)ob);
if (isNullable)
WriteNullTagEncoded (name, ns);
}
+ else if (any)
+ WriteXmlNode (node);
else
{
Writer.WriteStartElement (name, ns);
if (isNullable)
WriteNullTagLiteral (name, ns);
}
+ else if (any)
+ WriteXmlNode (node);
else
{
Writer.WriteStartElement (name, ns);
if (ob is XmlNode)
{
- if (_format == SerializationFormat.Literal) WriteElementLiteral((XmlNode)ob, "", "", true, false);
- else WriteElementEncoded((XmlNode)ob, "", "", true, false);
+ if (_format == SerializationFormat.Literal) WriteElementLiteral((XmlNode)ob, "", "", true, typeMap.IsAny);
+ else WriteElementEncoded((XmlNode)ob, "", "", true, typeMap.IsAny);
return;
}
if (typeMap.TypeData.SchemaType == SchemaTypes.XmlSerializable)
{
- WriteSerializable ((IXmlSerializable)ob, element, namesp, isNullable);
+ WriteSerializable ((IXmlSerializable)ob, element, namesp, isNullable, !typeMap.IsAny);
return;
}
+ var obExpectedType = typeMap.TypeData.Type;
+ if (!ob.GetType().IsAssignableFrom (obExpectedType))
+ ob = ImplicitConvert (ob, obExpectedType);
+
XmlTypeMapping map = typeMap.GetRealTypeMap (ob.GetType());
if (map == null)
}
}
- object ImplicitConvert (object obj, Type type)
+ internal static object ImplicitConvert (object obj, Type type)
{
if (obj == null)
return null;
- for (Type t = type; t != typeof (object); t = t.BaseType) {
- MethodInfo mi = t.GetMethod ("op_Implicit", new Type [] {t});
- if (mi != null && mi.ReturnType.IsAssignableFrom (obj.GetType ()))
- return mi.Invoke (null, new object [] {obj});
- }
for (Type t = obj.GetType (); t != typeof (object); t = t.BaseType) {
MethodInfo mi = t.GetMethod ("op_Implicit", new Type [] {t});
if (mi != null && mi.ReturnType == type)
return mi.Invoke (null, new object [] {obj});
+
+ mi = type.GetMethod ("op_Implicit", new Type [] {t});
+ if (mi != null && mi.ReturnType == type)
+ return mi.Invoke (null, new object [] {obj});
}
return obj;
}
using System.Xml;
using System.Xml.Schema;
using System.Text;
-#if !TARGET_JVM && !NET_2_1
+#if !NET_2_1
using System.CodeDom;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
internal class SerializerData
{
public int UsageCount;
+ public bool Generated;
public Type ReaderType;
public MethodInfo ReaderMethod;
public Type WriterType;
// debugging pourposes by adding the "nofallback" option.
// For example: MONO_XMLSERIALIZER_THS=0,nofallback
-#if TARGET_JVM || NET_2_1
+#if NET_2_1
string db = null;
string th = null;
generationThreshold = -1;
else {
generationThreshold = int.Parse (th, CultureInfo.InvariantCulture);
backgroundGeneration = (generationThreshold != 0);
- if (generationThreshold < 1) generationThreshold = 1;
}
}
#endif
throw new NotImplementedException ();
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
public static Assembly GenerateSerializer (Type[] types, XmlMapping[] mappings)
{
return GenerateSerializer (types, mappings, null);
return new XmlSerializationReaderInterpreter (typeMapping);
}
-#if TARGET_JVM || NET_2_1
+#if NET_2_1
void CheckGeneratedTypes (XmlMapping typeMapping)
{
throw new NotImplementedException();
bool generate = false;
lock (serializerData)
{
- generate = (++serializerData.UsageCount == generationThreshold);
+ if (serializerData.UsageCount >= generationThreshold && !serializerData.Generated)
+ serializerData.Generated = generate = true;
+
+ serializerData.UsageCount++;
}
if (generate)
TypeData _typeData;
MemberInfo _member;
MemberInfo _specifiedMember;
+ MethodInfo _shouldSerialize;
object _defaultValue = System.DBNull.Value;
string documentation;
int _flags;
mems = type.GetMember (_name + "Specified", BindingFlags.Instance|BindingFlags.Public);
if (mems.Length > 0) _specifiedMember = mems[0];
- if (_specifiedMember is PropertyInfo && !((PropertyInfo) _specifiedMember).CanWrite)
+ if (_specifiedMember is PropertyInfo && !((PropertyInfo) _specifiedMember).CanRead)
_specifiedMember = null;
+
+ var method = type.GetMethod ("ShouldSerialize" + _name, BindingFlags.Instance | BindingFlags.Public, null, Type.EmptyTypes, null);
+ if (method != null && method.ReturnType == typeof (bool) && !method.IsGenericMethod)
+ _shouldSerialize = method;
}
public TypeData TypeData
{
// Used when reflecting a type
if (_member == null) InitMember (type);
- IsOptionalValueType = (_specifiedMember != null);
+ IsOptionalValueType = (_specifiedMember != null || _shouldSerialize != null);
}
public void CheckOptionalValueType (XmlReflectionMember[] members)
}
}
}
-
+
+ public bool HasSpecified {
+ get { return _specifiedMember != null; }
+ }
+
+ public bool HasShouldSerialize {
+ get { return _shouldSerialize != null; }
+ }
+
public bool GetValueSpecified (object ob)
{
if (_specifiedGlobalIndex != -1) {
object[] array = (object[])ob;
return _specifiedGlobalIndex < array.Length && (bool) array [_specifiedGlobalIndex];
}
- else if (_specifiedMember is PropertyInfo)
- return (bool) ((PropertyInfo)_specifiedMember).GetValue (ob, null);
- else
- return (bool) ((FieldInfo)_specifiedMember).GetValue (ob);
+ bool specified = true;
+
+ if (_specifiedMember != null) {
+ if (_specifiedMember is PropertyInfo)
+ specified = (bool)((PropertyInfo)_specifiedMember).GetValue (ob, null);
+ else
+ specified = (bool)((FieldInfo)_specifiedMember).GetValue (ob);
+ }
+ if (_shouldSerialize != null)
+ specified = specified && (bool)_shouldSerialize.Invoke (ob, new object [] {});
+
+ return specified;
+ }
+
+ public bool IsValueSpecifiedSettable () {
+ if (_specifiedMember is PropertyInfo)
+ return ((PropertyInfo) _specifiedMember).CanWrite;
+
+ if (_specifiedMember is FieldInfo)
+ return ((FieldInfo) _specifiedMember).IsInitOnly;
+
+ return false;
}
public void SetValueSpecified (object ob, bool value)
{
if (_specifiedGlobalIndex != -1)
((object[])ob) [_specifiedGlobalIndex] = value;
- else if (_specifiedMember is PropertyInfo)
+ else if (_specifiedMember is PropertyInfo) {
+ if (!((PropertyInfo) _specifiedMember).CanWrite)
+ return;
((PropertyInfo)_specifiedMember).SetValue (ob, value, null);
- else
+ } else if (_specifiedMember is FieldInfo)
((FieldInfo)_specifiedMember).SetValue (ob, value);
}
string documentation;
bool includeInSchema;
bool isNullable = true;
+ bool isAny;
ArrayList _derivedTypes = new ArrayList();
set { isNullable = value; }
}
+ internal bool IsAny
+ {
+ get { return isAny; }
+ set { isAny = value; }
+ }
+
internal XmlTypeMapping GetRealTypeMap (Type objectType)
{
if (TypeData.SchemaType == SchemaTypes.Enum)
XmlSchemaProviderAttribute schemaProvider = (XmlSchemaProviderAttribute) Attribute.GetCustomAttribute (typeData.Type, typeof (XmlSchemaProviderAttribute));
if (schemaProvider != null) {
+ _schemaTypeName = XmlQualifiedName.Empty;
+
+ if (schemaProvider.IsAny) {
+ IsAny = true;
+ return;
+ }
+
string method = schemaProvider.MethodName;
MethodInfo mi = typeData.Type.GetMethod (method, BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
if (mi == null)
throw new InvalidOperationException (String.Format ("Method '{0}' indicated by XmlSchemaProviderAttribute must have its return type as XmlQualifiedName", method));
XmlSchemaSet xs = new XmlSchemaSet ();
object retVal = mi.Invoke (null, new object [] { xs });
- _schemaTypeName = XmlQualifiedName.Empty;
if (retVal == null)
return;
bool enable_debug;
object debugger;
CompiledStylesheet s;
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
// TempFileCollection temporary_files;
#endif
XmlWriterSettings output_settings = new XmlWriterSettings ();
get { return output_settings; }
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
[MonoTODO]
public TempFileCollection TemporaryFiles {
get { return null; /*temporary_files;*/ }
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoWarn>0618,0612,0642</NoWarn>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'basic|AnyCPU' ">
- <DefineConstants>BOOTSTRAP_BASIC,NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0</DefineConstants>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="System.Xml.XPath\Parser.cs"/>
- <Compile Include="Mono.Xml.Xsl\PatternParser.cs"/>
- <Compile Include="Mono.Xml.Xsl\PatternTokenizer.cs"/>
- <Reference Include="System.dll"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- <Exec Command="..\..\jay\jay.exe -ct < ..\..\jay\skeleton.cs System.Xml.XPath\Parser.jay > System.Xml.XPath\Parser.cs"/>
- <Copy SourceFiles="System.Xml.XPath\Parser.jay" DestinationFiles="Mono.Xml.Xsl\PatternParser.jay"/>
- <MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="%start Expr" Replacement="%start Pattern" TextEncoding="Windows-1252" Files="Mono.Xml.Xsl\PatternParser.jay"/>
- <Exec Command="echo #define XSLT_PATTERN > Mono.Xml.Xsl\PatternParser.cs"/>
- <Exec Command="..\..\jay\jay.exe -ct Mono.Xml.Xsl\PatternParser.jay < ..\..\jay\skeleton.cs >> Mono.Xml.Xsl\PatternParser.cs"/>
- <Exec Command="echo #define XSLT_PATTERN > Mono.Xml.Xsl\PatternTokenizer.cs"/>
- <Exec Command="type System.Xml.XPath\Tokenizer.cs >> Mono.Xml.Xsl\PatternTokenizer.cs"/>
- </Target>
-</Project>
\ No newline at end of file
}
#if NET_2_0 // actually NET_3_5
-#if !TARGET_JVM
public static DateTimeOffset ToDateTimeOffset (string s)
{
{
return value.ToString (format, CultureInfo.InvariantCulture);
}
-#endif
// it is used only from 2.1 System.Xml.Serialization.dll from
// MS Silverlight SDK. We don't use it so far.
}
}
}
-#if TARGET_JVM
- else {
- if (bufLength >= 10 && Encoding.Unicode.GetString (buffer, 2, 8) == "?xml")
- enc = Encoding.Unicode;
- }
-#endif
bufPos = 0;
break;
default:
void IDisposable.Dispose()
#endif
{
- Dispose (false);
+ Dispose (true);
}
protected virtual void Dispose (bool disposing)
{
- if (ReadState != ReadState.Closed)
+ if (disposing && ReadState != ReadState.Closed)
Close ();
}
#endif
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{E2969437-970A-41A5-A621-B0027938EA16}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>System.Xml</RootNamespace>\r
- <AssemblyName>System.Xml</AssemblyName>\r
- <JDKName>1.4.2</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <GHProjectKind>framework</GHProjectKind>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;NET_1_1;TARGET_JVM;NET_2_0;CONFIGURATION_DEP</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <NoWarn>67,169,612,618,649,3021</NoWarn>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;NET_1_1;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;TARGET_JVM;NET_2_0;CONFIGURATION_DEP</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <NoWarn>67,169,612,618,649,3021</NoWarn>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20_Prepare|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>bin\Debug_Java20_Prepare\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;NET_1_1;TARGET_JVM;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <NoWarn>67,169,612,618,649,3021</NoWarn>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20_Prepare|AnyCPU' ">\r
- <OutputPath>bin\Release_Java20_Prepare\</OutputPath>\r
- <DefineConstants>TRACE;NET_1_1;TARGET_JVM;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <Optimize>true</Optimize>\r
- <DebugType>pdbonly</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <NoWarn>67,169,612,618,649,3021</NoWarn>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.4.2</JDKName>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=1.4.2.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System">\r
- <HintPath>..\lib\System.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System.Configuration">\r
- <HintPath>..\lib\System.Configuration.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Assembly\Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>Assembly\MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="Assembly\AssemblyInfo.cs" />\r
- <Compile Include="Mono.Xml.Schema\XmlSchemaValidatingReader.cs" />\r
- <Compile Include="Mono.Xml.Schema\XsdIdentityPath.cs" />\r
- <Compile Include="Mono.Xml.Schema\XsdIdentityState.cs" />\r
- <Compile Include="Mono.Xml.Schema\XsdKeyTable.cs" />\r
- <Compile Include="Mono.Xml.Schema\XsdParticleValidationState.cs" />\r
- <Compile Include="Mono.Xml.Schema\XsdValidatingReader.cs" />\r
- <Compile Include="Mono.Xml.Schema\XsdWildcard.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocument.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocument2.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocumentBuilder.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocumentBuilder2.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocumentWriter.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathDocumentWriter2.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathNavigator.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathNavigator2.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathNode.cs" />\r
- <Compile Include="Mono.Xml.XPath\DTMXPathNode2.cs" />\r
- <Compile Include="Mono.Xml.XPath\IdPattern.cs" />\r
- <Compile Include="Mono.Xml.XPath\KeyPattern.cs" />\r
- <Compile Include="Mono.Xml.XPath\LocationPathPattern.cs" />\r
- <Compile Include="Mono.Xml.XPath\Pattern.cs" />\r
- <Compile Include="Mono.Xml.XPath\UnionPattern.cs" />\r
- <Compile Include="Mono.Xml.XPath\XPathEditableDocument.cs" />\r
- <Compile Include="Mono.Xml.XPath\XPathNavigatorReader.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslApplyImports.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslApplyTemplates.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslAttribute.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslAvt.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslCallTemplate.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslChoose.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslComment.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslCompiledElement.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslCopy.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslCopyOf.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslElement.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslFallback.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslForEach.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslIf.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslLiteralElement.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslMessage.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslNotSupportedOperation.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslNumber.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslOperation.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslProcessingInstruction.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslTemplateContent.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslText.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslValueOf.cs" />\r
- <Compile Include="Mono.Xml.Xsl.Operations\XslVariable.cs" />\r
- <Compile Include="Mono.Xml.Xsl\Attribute.cs" />\r
- <Compile Include="Mono.Xml.Xsl\Compiler.cs" />\r
- <Compile Include="Mono.Xml.Xsl\Debug.cs" />\r
- <Compile Include="Mono.Xml.Xsl\Emitter.cs" />\r
- <Compile Include="Mono.Xml.Xsl\GenericOutputter.cs" />\r
- <Compile Include="Mono.Xml.Xsl\HtmlEmitter.cs" />\r
- <Compile Include="Mono.Xml.Xsl\MSXslScriptManager.cs" />\r
- <Compile Include="Mono.Xml.Xsl\Outputter.cs" />\r
- <Compile Include="Mono.Xml.Xsl\PatternParser.cs" />\r
- <Compile Include="Mono.Xml.Xsl\PatternTokenizer.cs" />\r
- <Compile Include="Mono.Xml.Xsl\TextEmitter.cs" />\r
- <Compile Include="Mono.Xml.Xsl\TextOutputter.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XmlWriterEmitter.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslAttributeSet.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslDecimalFormat.jvm.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslFunctions.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslKey.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslOutput.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslSortEvaluator.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslStylesheet.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XsltCompiledContext.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslTemplate.cs" />\r
- <Compile Include="Mono.Xml.Xsl\XslTransformProcessor.cs" />\r
- <Compile Include="Mono.Xml\IHasXmlParserContext.cs" />\r
- <Compile Include="Mono.Xml\IHasXmlSchemaInfo.cs" />\r
- <Compile Include="Mono.Xml\SubtreeXmlReader.cs" />\r
- <Compile Include="Mono.Xml\XmlFilterReader.cs" />\r
- <Compile Include="Mono.Xml\XmlNodeWriter.cs" />\r
- <Compile Include="System.Xml.Schema\BuiltInDatatype.cs" />\r
- <Compile Include="System.Xml.Schema\IXmlSchemaInfo.cs" />\r
- <Compile Include="System.Xml.Schema\SchemaDataValueType.cs" />\r
- <Compile Include="System.Xml.Schema\ValidationEventArgs.cs" />\r
- <Compile Include="System.Xml.Schema\ValidationHandler.cs" />\r
- <Compile Include="System.Xml.Schema\XmlAtomicValue.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchema.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAll.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAnnotated.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAnnotation.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAny.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAnyAttribute.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAppInfo.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAttribute.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAttributeGroup.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaAttributeGroupRef.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaChoice.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaCollection.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaCollectionEnumerator.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaCompilationSettings.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaComplexContent.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaComplexContentExtension.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaComplexContentRestriction.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaComplexType.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaContent.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaContentModel.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaContentProcessing.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaContentType.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaDatatype.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaDatatypeVariety.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaDerivationMethod.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaDocumentation.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaElement.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaEnumerationFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaException.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaExternal.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaForm.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaFractionDigitsFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaGroup.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaGroupBase.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaGroupRef.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaIdentityConstraint.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaImport.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaInclude.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaInference.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaInferenceException.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaInfo.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaKey.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaKeyref.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaLengthFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaMaxExclusiveFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaMaxInclusiveFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaMaxLengthFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaMinExclusiveFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaMinInclusiveFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaMinLengthFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaNotation.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaNumericFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaObject.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaObjectCollection.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaObjectEnumerator.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaObjectTable.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaParticle.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaPatternFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaReader.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaRedefine.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSequence.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSerializer.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSimpleContent.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSimpleContentExtension.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSimpleContentRestriction.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSimpleType.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSimpleTypeContent.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSimpleTypeList.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSimpleTypeRestriction.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSimpleTypeUnion.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaTotalDigitsFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaType.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaUnique.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaUse.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaUtil.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaValidationException.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaValidationFlags.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaValidator.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaValidity.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaWhiteSpaceFacet.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaXPath.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSeverityType.cs" />\r
- <Compile Include="System.Xml.Schema\XmlTypeCode.cs" />\r
- <Compile Include="System.Xml.Schema\XmlValueConverter.cs" />\r
- <Compile Include="System.Xml.Schema\XmlValueGetter.cs" />\r
- <Compile Include="System.Xml.Serialization\CodeGenerationOptions.cs" />\r
- <Compile Include="System.Xml.Serialization\CodeIdentifier.cs" />\r
- <Compile Include="System.Xml.Serialization\CodeIdentifiers.cs" />\r
- <Compile Include="System.Xml.Serialization\ImportContext.cs" />\r
- <Compile Include="System.Xml.Serialization\IXmlSerializable.cs" />\r
- <Compile Include="System.Xml.Serialization\IXmlTextParser.cs" />\r
- <Compile Include="System.Xml.Serialization\ReflectionHelper.cs" />\r
- <Compile Include="System.Xml.Serialization\SchemaTypes.cs" />\r
- <Compile Include="System.Xml.Serialization\SerializationCodeGenerator.cs" />\r
- <Compile Include="System.Xml.Serialization\SerializationCodeGeneratorConfiguration.cs" />\r
- <Compile Include="System.Xml.Serialization\SerializationSource.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapAttributeAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapAttributeOverrides.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapAttributes.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapElementAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapEnumAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapIgnoreAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapIncludeAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapReflectionImporter.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapSchemaExporter.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapSchemaMember.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapTypeAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\TypeData.cs" />\r
- <Compile Include="System.Xml.Serialization\TypeMember.cs" />\r
- <Compile Include="System.Xml.Serialization\TypeTranslator.cs" />\r
- <Compile Include="System.Xml.Serialization\UnreferencedObjectEventArgs.cs" />\r
- <Compile Include="System.Xml.Serialization\UnreferencedObjectEventHandler.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAnyAttributeAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAnyElementAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAnyElementAttributes.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlArrayAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlArrayItemAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlArrayItemAttributes.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAttributeAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAttributeEventArgs.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAttributeEventHandler.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAttributeOverrides.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAttributes.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlChoiceIdentifierAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlCustomFormatter.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlDeserializationEvents.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlElementAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlElementAttributes.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlElementEventArgs.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlElementEventHandler.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlEnumAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlIgnoreAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlIncludeAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlMapping.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlMappingAccess.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlMemberMapping.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlMembersMapping.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlNamespaceDeclarationsAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlNodeEventArgs.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlNodeEventHandler.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlReflectionImporter.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlReflectionMember.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlRootAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSchemaEnumerator.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSchemaExporter.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSchemaProviderAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSchemas.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationCollectionFixupCallback.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationFixupCallback.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationGeneratedCode.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationReadCallback.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationReader.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationReaderInterpreter.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationWriteCallback.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationWriter.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationWriterInterpreter.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializer.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializerAssemblyAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializerFactory.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializerImplementation.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializerNamespaces.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializerVersionAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTextAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTypeAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTypeMapElementInfo.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTypeMapMember.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTypeMapMemberAttribute.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTypeMapMemberElement.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTypeMapMemberNamespaces.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTypeMapping.cs" />\r
- <Compile Include="System.Xml.Serialization.Configuration\DateTimeSerializationSection.cs" />\r
- <Compile Include="System.Xml.Serialization.Configuration\SchemaImporterExtensionElement.cs" />\r
- <Compile Include="System.Xml.Serialization.Configuration\SchemaImporterExtensionElementCollection.cs" />\r
- <Compile Include="System.Xml.Serialization.Configuration\SchemaImporterExtensionsSection.cs" />\r
- <Compile Include="System.Xml.Serialization.Configuration\SerializationSectionGroup.cs" />\r
- <Compile Include="System.Xml.Serialization.Configuration\XmlSerializerSection.cs" />\r
- <Compile Include="System.Xml.XPath\DefaultContext.cs" />\r
- <Compile Include="System.Xml.XPath\Expression.cs" />\r
- <Compile Include="System.Xml.XPath\Iterator.cs" />\r
- <Compile Include="System.Xml.XPath\IXPathNavigable.cs" />\r
- <Compile Include="System.Xml.XPath\Parser.cs" />\r
- <Compile Include="System.Xml.XPath\Tokenizer.cs" />\r
- <Compile Include="System.Xml.XPath\XmlCaseOrder.cs" />\r
- <Compile Include="System.Xml.XPath\XmlDataType.cs" />\r
- <Compile Include="System.Xml.XPath\XmlSortOrder.cs" />\r
- <Compile Include="System.Xml.XPath\XPathComparer.cs" />\r
- <Compile Include="System.Xml.XPath\XPathDocument.cs" />\r
- <Compile Include="System.Xml.XPath\XPathException.cs" />\r
- <Compile Include="System.Xml.XPath\XPathExpression.cs" />\r
- <Compile Include="System.Xml.XPath\XPathItem.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNamespaceScope.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNavigator.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNodeIterator.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNodeType.cs" />\r
- <Compile Include="System.Xml.XPath\XPathResultType.cs" />\r
- <Compile Include="System.Xml.Xsl\IXsltContextFunction.cs" />\r
- <Compile Include="System.Xml.Xsl\IXsltContextVariable.cs" />\r
- <Compile Include="System.Xml.Xsl\XslCompiledTransform.cs" />\r
- <Compile Include="System.Xml.Xsl\XsltArgumentList.cs" />\r
- <Compile Include="System.Xml.Xsl\XsltCompileException.cs" />\r
- <Compile Include="System.Xml.Xsl\XsltContext.cs" />\r
- <Compile Include="System.Xml.Xsl\XsltException.cs" />\r
- <Compile Include="System.Xml.Xsl\XsltMessageEncounteredEventArgs.cs" />\r
- <Compile Include="System.Xml.Xsl\XsltMessageEncounteredEventHandler.cs" />\r
- <Compile Include="System.Xml.Xsl\XslTransform.cs" />\r
- <Compile Include="System.Xml.Xsl\XsltSettings.cs" />\r
- <Compile Include="System.Xml\ConformanceLevel.cs" />\r
- <Compile Include="System.Xml\DTDAutomata.cs" />\r
- <Compile Include="System.Xml\DTDObjectModel.cs" />\r
- <Compile Include="System.Xml\DTDReader.cs" />\r
- <Compile Include="System.Xml\DTDValidatingReader2.cs" />\r
- <Compile Include="System.Xml\EntityHandling.cs" />\r
- <Compile Include="System.Xml\EntityResolvingXmlReader.cs" />\r
- <Compile Include="System.Xml\Formatting.cs" />\r
- <Compile Include="System.Xml\IHasXmlChildNode.cs" />\r
- <Compile Include="System.Xml\IHasXmlNode.cs" />\r
- <Compile Include="System.Xml\IXmlLineInfo.cs" />\r
- <Compile Include="System.Xml\IXmlNamespaceResolver.cs" />\r
- <Compile Include="System.Xml\MonoFIXAttribute.cs" />\r
- <Compile Include="System.Xml\NameTable.cs" />\r
- <Compile Include="System.Xml\NewLineHandling.cs" />\r
- <Compile Include="System.Xml\ReadState.cs" />\r
- <Compile Include="System.Xml\ValidationType.cs" />\r
- <Compile Include="System.Xml\WhitespaceHandling.cs" />\r
- <Compile Include="System.Xml\WriteState.cs" />\r
- <Compile Include="System.Xml\XmlAttribute.cs" />\r
- <Compile Include="System.Xml\XmlAttributeCollection.cs" />\r
- <Compile Include="System.Xml\XmlCDataSection.cs" />\r
- <Compile Include="System.Xml\XmlChar.cs" />\r
- <Compile Include="System.Xml\XmlCharacterData.cs" />\r
- <Compile Include="System.Xml\XmlComment.cs" />\r
- <Compile Include="System.Xml\XmlConstructs.cs" />\r
- <Compile Include="System.Xml\XmlConvert.cs" />\r
- <Compile Include="System.Xml\XmlDateTimeSerializationMode.cs" />\r
- <Compile Include="System.Xml\XmlDeclaration.cs" />\r
- <Compile Include="System.Xml\XmlDocument.cs" />\r
- <Compile Include="System.Xml\XmlDocumentFragment.cs" />\r
- <Compile Include="System.Xml\XmlDocumentNavigator.cs" />\r
- <Compile Include="System.Xml\XmlDocumentType.cs" />\r
- <Compile Include="System.Xml\XmlElement.cs" />\r
- <Compile Include="System.Xml\XmlEntity.cs" />\r
- <Compile Include="System.Xml\XmlEntityReference.cs" />\r
- <Compile Include="System.Xml\XmlException.cs" />\r
- <Compile Include="System.Xml\XmlImplementation.cs" />\r
- <Compile Include="System.Xml\XmlInputStream.cs" />\r
- <Compile Include="System.Xml\XmlIteratorNodeList.cs" />\r
- <Compile Include="System.Xml\XmlLinkedNode.cs" />\r
- <Compile Include="System.Xml\XmlNamedNodeMap.cs" />\r
- <Compile Include="System.Xml\XmlNameEntry.cs" />\r
- <Compile Include="System.Xml\XmlNameEntryCache.cs" />\r
- <Compile Include="System.Xml\XmlNamespaceManager.cs" />\r
- <Compile Include="System.Xml\XmlNamespaceScope.cs" />\r
- <Compile Include="System.Xml\XmlNameTable.cs" />\r
- <Compile Include="System.Xml\XmlNode.cs" />\r
- <Compile Include="System.Xml\XmlNodeArrayList.cs" />\r
- <Compile Include="System.Xml\XmlNodeChangedAction.cs" />\r
- <Compile Include="System.Xml\XmlNodeChangedEventArgs.cs" />\r
- <Compile Include="System.Xml\XmlNodeChangedEventHandler.cs" />\r
- <Compile Include="System.Xml\XmlNodeList.cs" />\r
- <Compile Include="System.Xml\XmlNodeListChildren.cs" />\r
- <Compile Include="System.Xml\XmlNodeOrder.cs" />\r
- <Compile Include="System.Xml\XmlNodeReader2.cs" />\r
- <Compile Include="System.Xml\XmlNodeReaderImpl.cs" />\r
- <Compile Include="System.Xml\XmlNodeType.cs" />\r
- <Compile Include="System.Xml\XmlNotation.cs" />\r
- <Compile Include="System.Xml\XmlOutputMethod.cs" />\r
- <Compile Include="System.Xml\XmlParserContext.cs" />\r
- <Compile Include="System.Xml\XmlParserInput.cs" />\r
- <Compile Include="System.Xml\XmlProcessingInstruction.cs" />\r
- <Compile Include="System.Xml\XmlQualifiedName.cs" />\r
- <Compile Include="System.Xml\XmlReader.cs" />\r
- <Compile Include="System.Xml\XmlReaderBinarySupport.cs" />\r
- <Compile Include="System.Xml\XmlReaderSettings.cs" />\r
- <Compile Include="System.Xml\XmlResolver.cs" />\r
- <Compile Include="System.Xml\XmlSecureResolver.cs" />\r
- <Compile Include="System.Xml\XmlSignificantWhitespace.cs" />\r
- <Compile Include="System.Xml\XmlSpace.cs" />\r
- <Compile Include="System.Xml\XmlText.cs" />\r
- <Compile Include="System.Xml\XmlTextReader2.cs" />\r
- <Compile Include="System.Xml\XmlTextWriter2.cs" />\r
- <Compile Include="System.Xml\XmlTokenizedType.cs" />\r
- <Compile Include="System.Xml\XmlUrlResolver.cs" />\r
- <Compile Include="System.Xml\XmlValidatingReader.cs" />\r
- <Compile Include="System.Xml\XmlWhitespace.cs" />\r
- <Compile Include="System.Xml\XmlWriter.cs" />\r
- <Compile Include="System.Xml\XmlWriterSettings.cs" />\r
- <Compile Include="System.Xml\XQueryConvert.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Assembly\Consts.cs.in</Link>\r
- </Compile>\r
- <Compile Include="Mono.Xml.Xsl\XsltDebuggerWrapper.cs" />\r
- <Compile Include="System.Xml\XmlTextReader.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <None Include="Mono.Xml.Xsl\PatternParser.jay" />\r
- <None Include="System.Xml.XPath\Parser.jay" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.4.2" REFS-JarPath-system="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <PropertyGroup>\r
- <PreBuildEvent>$(ProjectDir)\jay.bat $(ProjectDir)</PreBuildEvent>\r
- </PropertyGroup>\r
-</Project>\r
{
[Test]
[NUnit.Framework.Category("NotDotNet")] // FDBK50639
-#if TARGET_JVM
- [Ignore ("JVM returns fields in different order")]
-#endif
public void WriteLiteral ()
{
Test data = BuildTestObject ();
"Novell bug #594490 (https://bugzilla.novell.com/show_bug.cgi?id=594490) not fixed.");
}
}
+
+ /*
+ * The following code was generated from Microsoft's xsd.exe with the /classes switch.
+ * It only includes the relevent details but was based on the following namespaces:
+ * urn:oasis:names:tc:SAML:2.0:protocol
+ * urn:oasis:names:tc:SAML:2.0:assertion
+ * http://www.w3.org/2000/09/xmldsig#
+ * http://www.w3.org/2001/04/xmlenc
+ */
+
+ [XmlTypeAttribute (Namespace = "urn:oasis:names:tc:SAML:2.0:protocol")]
+ [XmlRootAttribute ("RequestedAuthnContext", Namespace = "urn:oasis:names:tc:SAML:2.0:protocol", IsNullable = false)]
+ public class RequestedAuthnContext
+ {
+ string[] items;
+ ItemsChoice7[] itemsElementName;
+
+ [XmlElementAttribute ("AuthnContextClassRef", typeof (string), Namespace = "urn:oasis:names:tc:SAML:2.0:assertion", DataType = "anyURI")]
+ [XmlElementAttribute ("AuthnContextDeclRef", typeof (string), Namespace = "urn:oasis:names:tc:SAML:2.0:assertion", DataType = "anyURI")]
+ [XmlChoiceIdentifierAttribute ("ItemsElementName")]
+ public string[] Items {
+ get { return this.items; }
+ set { this.items = value; }
+ }
+
+ [XmlElementAttribute ("ItemsElementName")]
+ [XmlIgnoreAttribute ()]
+ public ItemsChoice7[] ItemsElementName {
+ get { return this.itemsElementName; }
+ set { this.itemsElementName = value; }
+ }
+ }
+
+ [XmlTypeAttribute (Namespace = "urn:oasis:names:tc:SAML:2.0:protocol", IncludeInSchema = false)]
+ public enum ItemsChoice7 {
+ [XmlEnumAttribute ("urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextClassRef")]
+ AuthnContextClassRef,
+ [XmlEnumAttribute ("urn:oasis:names:tc:SAML:2.0:assertion:AuthnContextDeclRef")]
+ AuthnContextDeclRef,
+ }
+ // End snippet from xsd.exe
+
+ [Test]
+ public void FullyQualifiedName_XmlEnumAttribute ()
+ {
+ var serializer = new XmlSerializer (typeof (RequestedAuthnContext));
+ }
}
}
[XmlElement ("Extra", Order=1)]
public string[] Extra;
}
+
+ public class SimpleObjectA
+ {
+ [XmlAttribute]
+ public string Text
+ {
+ get; set;
+ }
+
+ public static implicit operator SimpleObjectA (SimpleObjectB o)
+ {
+ return new SimpleObjectA { Text = o.Text };
+ }
+
+ public static implicit operator SimpleObjectB (SimpleObjectA o)
+ {
+ return new SimpleObjectB { Text = o.Text };
+ }
+ }
+
+ public class SimpleObjectB
+ {
+ [XmlAttribute]
+ public string Text
+ {
+ get; set;
+ }
+ }
+
+ public class ObjectWithElementRequiringImplicitCast
+ {
+ public ObjectWithElementRequiringImplicitCast () { }
+ public ObjectWithElementRequiringImplicitCast (string text)
+ {
+ Object = new SimpleObjectB { Text = text };
+ }
+
+ [XmlElement(Type = typeof (SimpleObjectA))]
+ public SimpleObjectB Object
+ {
+ get; set;
+ }
+ }
+
+ public class ObjectWithNullableArrayItems
+ {
+ [XmlArrayItem ("Element", IsNullable = true)]
+ public List<SimpleClass> Elements;
+ }
+
+ public class ObjectWithNonNullableArrayItems
+ {
+ [XmlArrayItem ("Element", IsNullable = false)]
+ public List<SimpleClass> Elements;
+ }
+
+ public class ObjectWithNotSpecifiedNullableArrayItems
+ {
+ [XmlArrayItem ("Element")]
+ public List<SimpleClass> Elements;
+ }
}
using System.Data;
using System.Xml.Schema;
using System.Xml.Serialization;
+using System.Reflection;
#if NET_2_0
using System.Collections.Generic;
#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("JVM returns fields in different order")]
-#endif
public void TestSerializeGroup ()
{
Group myGroup = new Group ();
ser.Deserialize (new XmlTextReader (xml, XmlNodeType.Document, null));
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
[Test]
public void GenerateSerializerGenerics ()
{
SoapReflectionImporter importer = new SoapReflectionImporter (ao, defaultNamespace);
return importer.ImportTypeMapping (type);
}
+
+ [XmlSchemaProvider (null, IsAny = true)]
+ public class AnySchemaProviderClass : IXmlSerializable {
+
+ public string Text;
+
+ void IXmlSerializable.WriteXml (XmlWriter writer)
+ {
+ writer.WriteElementString ("text", Text);
+ }
+
+ void IXmlSerializable.ReadXml (XmlReader reader)
+ {
+ Text = reader.ReadElementString ("text");
+ }
+
+ XmlSchema IXmlSerializable.GetSchema ()
+ {
+ return null;
+ }
+ }
+
+ [Test]
+ public void SerializeAnySchemaProvider ()
+ {
+ string expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?>" +
+ Environment.NewLine + "<text>test</text>";
+
+ var ser = new XmlSerializer (typeof (AnySchemaProviderClass));
+
+ var obj = new AnySchemaProviderClass {
+ Text = "test",
+ };
+
+ using (var t = new StringWriter ()) {
+ ser.Serialize (t, obj);
+ Assert.AreEqual (expected, t.ToString ());
+ }
+ }
+
+ [Test]
+ public void DeserializeAnySchemaProvider ()
+ {
+ string expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?>" +
+ Environment.NewLine + "<text>test</text>";
+
+ var ser = new XmlSerializer (typeof (AnySchemaProviderClass));
+
+ using (var t = new StringReader (expected)) {
+ var obj = (AnySchemaProviderClass) ser.Deserialize (t);
+ Assert.AreEqual ("test", obj.Text);
+ }
+ }
+
+ public class SubNoParameterlessConstructor : NoParameterlessConstructor
+ {
+ public SubNoParameterlessConstructor ()
+ : base ("")
+ {
+ }
+ }
+
+ public class NoParameterlessConstructor
+ {
+ [XmlElement ("Text")]
+ public string Text;
+
+ public NoParameterlessConstructor (string parameter)
+ {
+ }
+ }
+
+ [Test]
+ public void BaseClassWithoutParameterlessConstructor ()
+ {
+ var ser = new XmlSerializer (typeof (SubNoParameterlessConstructor));
+
+ var obj = new SubNoParameterlessConstructor {
+ Text = "test",
+ };
+
+ using (var w = new StringWriter ()) {
+ ser.Serialize (w, obj);
+ using (var r = new StringReader ( w.ToString ())) {
+ var desObj = (SubNoParameterlessConstructor) ser.Deserialize (r);
+ Assert.AreEqual (obj.Text, desObj.Text);
+ }
+ }
+ }
+
+ public class ClassWithXmlAnyElement
+ {
+ [XmlAnyElement ("Contents")]
+ public XmlNode Contents;
+ }
+
+ [Test] // bug #3211
+ public void TestClassWithXmlAnyElement ()
+ {
+ var d = new XmlDocument ();
+ var e = d.CreateElement ("Contents");
+ e.AppendChild (d.CreateElement ("SomeElement"));
+
+ var c = new ClassWithXmlAnyElement {
+ Contents = e,
+ };
+
+ var ser = new XmlSerializer (typeof (ClassWithXmlAnyElement));
+ using (var sw = new StringWriter ())
+ ser.Serialize (sw, c);
+ }
+
+ [Test]
+ public void ClassWithImplicitlyConvertibleElement ()
+ {
+ var ser = new XmlSerializer (typeof (ObjectWithElementRequiringImplicitCast));
+
+ var obj = new ObjectWithElementRequiringImplicitCast ("test");
+
+ using (var w = new StringWriter ()) {
+ ser.Serialize (w, obj);
+ using (var r = new StringReader ( w.ToString ())) {
+ var desObj = (ObjectWithElementRequiringImplicitCast) ser.Deserialize (r);
+ Assert.AreEqual (obj.Object.Text, desObj.Object.Text);
+ }
+ }
+ }
+
+ public class ClassWithOptionalMethods
+ {
+ private readonly bool shouldSerializeX;
+ private readonly bool xSpecified;
+
+ [XmlAttribute]
+ public int X { get; set; }
+
+ public bool ShouldSerializeX () { return shouldSerializeX; }
+
+ public bool XSpecified
+ {
+ get { return xSpecified; }
+ }
+
+ public ClassWithOptionalMethods ()
+ {
+ }
+
+ public ClassWithOptionalMethods (int x, bool shouldSerializeX, bool xSpecified)
+ {
+ this.X = x;
+ this.shouldSerializeX = shouldSerializeX;
+ this.xSpecified = xSpecified;
+ }
+ }
+
+ [Test]
+ public void OptionalMethods ()
+ {
+ var ser = new XmlSerializer (typeof (ClassWithOptionalMethods));
+
+ var expectedValueWithoutX = Infoset ("<?xml version=\"1.0\" encoding=\"utf-16\"?>" + Environment.NewLine +
+ "<ClassWithOptionalMethods xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" />");
+
+ var expectedValueWithX = Infoset ("<?xml version=\"1.0\" encoding=\"utf-16\"?>" + Environment.NewLine +
+ "<ClassWithOptionalMethods xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" X=\"11\" />");
+
+ using (var t = new StringWriter ()) {
+ var obj = new ClassWithOptionalMethods (11, false, false);
+ ser.Serialize (t, obj);
+ Assert.AreEqual (expectedValueWithoutX, Infoset (t.ToString ()));
+ }
+
+ using (var t = new StringWriter ()) {
+ var obj = new ClassWithOptionalMethods (11, true, false);
+ ser.Serialize (t, obj);
+ Assert.AreEqual (expectedValueWithoutX, Infoset (t.ToString ()));
+ }
+
+ using (var t = new StringWriter ()) {
+ var obj = new ClassWithOptionalMethods (11, false, true);
+ ser.Serialize (t, obj);
+ Assert.AreEqual (expectedValueWithoutX, Infoset (t.ToString ()));
+ }
+
+ using (var t = new StringWriter ()) {
+ var obj = new ClassWithOptionalMethods (11, true, true);
+ ser.Serialize (t, obj);
+ Assert.AreEqual (expectedValueWithX, Infoset (t.ToString ()));
+ }
+ }
+
+ public class ClassWithShouldSerializeGeneric
+ {
+ [XmlAttribute]
+ public int X { get; set; }
+
+ public bool ShouldSerializeX<T> () { return false; }
+ }
+
+ [Test]
+ [Category("NotDotNet")]
+ public void ShouldSerializeGeneric ()
+ {
+ var ser = new XmlSerializer (typeof (ClassWithShouldSerializeGeneric));
+
+ var expectedValueWithX = Infoset ("<?xml version=\"1.0\" encoding=\"utf-16\"?>" + Environment.NewLine +
+ "<ClassWithShouldSerializeGeneric xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" X=\"11\" />");
+
+ using (var t = new StringWriter ()) {
+ var obj = new ClassWithShouldSerializeGeneric { X = 11 };
+ ser.Serialize (t, obj);
+ Assert.AreEqual (expectedValueWithX, Infoset (t.ToString ()));
+ }
+ }
+
+ [Test]
+ public void NullableArrayItems ()
+ {
+ var ser = new XmlSerializer (typeof (ObjectWithNullableArrayItems));
+
+ var obj = new ObjectWithNullableArrayItems ();
+ obj.Elements = new List <SimpleClass> ();
+ obj.Elements.Add (new SimpleClass { something = "Hello" });
+ obj.Elements.Add (null);
+ obj.Elements.Add (new SimpleClass { something = "World" });
+
+ using (var w = new StringWriter ()) {
+ ser.Serialize (w, obj);
+ using (var r = new StringReader ( w.ToString ())) {
+ var desObj = (ObjectWithNullableArrayItems) ser.Deserialize (r);
+ Assert.IsNull (desObj.Elements [1]);
+ }
+ }
+ }
+
+ [Test]
+ public void NonNullableArrayItems ()
+ {
+ var ser = new XmlSerializer (typeof (ObjectWithNonNullableArrayItems));
+
+ var obj = new ObjectWithNonNullableArrayItems ();
+ obj.Elements = new List <SimpleClass> ();
+ obj.Elements.Add (new SimpleClass { something = "Hello" });
+ obj.Elements.Add (null);
+ obj.Elements.Add (new SimpleClass { something = "World" });
+
+ using (var w = new StringWriter ()) {
+ ser.Serialize (w, obj);
+ using (var r = new StringReader ( w.ToString ())) {
+ var desObj = (ObjectWithNonNullableArrayItems) ser.Deserialize (r);
+ Assert.IsNotNull (desObj.Elements [1]);
+ }
+ }
+ }
+
+ [Test]
+ public void NotSpecifiedNullableArrayItems ()
+ {
+ var ser = new XmlSerializer (typeof (ObjectWithNotSpecifiedNullableArrayItems));
+
+ var obj = new ObjectWithNotSpecifiedNullableArrayItems ();
+ obj.Elements = new List <SimpleClass> ();
+ obj.Elements.Add (new SimpleClass { something = "Hello" });
+ obj.Elements.Add (null);
+ obj.Elements.Add (new SimpleClass { something = "World" });
+
+ using (var w = new StringWriter ()) {
+ ser.Serialize (w, obj);
+ using (var r = new StringReader ( w.ToString ())) {
+ var desObj = (ObjectWithNotSpecifiedNullableArrayItems) ser.Deserialize (r);
+ Assert.IsNull (desObj.Elements [1]);
+ }
+ }
+ }
+ }
+
+ // Test generated serialization code.
+ public class XmlSerializerGeneratorTests : XmlSerializerTests {
+
+ private FieldInfo backgroundGeneration;
+ private FieldInfo generationThreshold;
+ private FieldInfo generatorFallback;
+
+ private bool backgroundGenerationOld;
+ private int generationThresholdOld;
+ private bool generatorFallbackOld;
+
+ [SetUp]
+ public void SetUp ()
+ {
+ // Make sure XmlSerializer static constructor is called
+ XmlSerializer.FromTypes (new Type [] {});
+
+ const BindingFlags binding = BindingFlags.Static | BindingFlags.NonPublic;
+ backgroundGeneration = typeof (XmlSerializer).GetField ("backgroundGeneration", binding);
+ generationThreshold = typeof (XmlSerializer).GetField ("generationThreshold", binding);
+ generatorFallback = typeof (XmlSerializer).GetField ("generatorFallback", binding);
+
+ if (backgroundGeneration == null)
+ Assert.Ignore ("Unable to access field backgroundGeneration");
+ if (generationThreshold == null)
+ Assert.Ignore ("Unable to access field generationThreshold");
+ if (generatorFallback == null)
+ Assert.Ignore ("Unable to access field generatorFallback");
+
+ backgroundGenerationOld = (bool) backgroundGeneration.GetValue (null);
+ generationThresholdOld = (int) generationThreshold.GetValue (null);
+ generatorFallbackOld = (bool) generatorFallback.GetValue (null);
+
+ backgroundGeneration.SetValue (null, false);
+ generationThreshold.SetValue (null, 0);
+ generatorFallback.SetValue (null, false);
+ }
+
+ [TearDown]
+ public void TearDown ()
+ {
+ if (backgroundGeneration == null || generationThreshold == null || generatorFallback == null)
+ return;
+
+ backgroundGeneration.SetValue (null, backgroundGenerationOld);
+ generationThreshold.SetValue (null, generationThresholdOld);
+ generatorFallback.SetValue (null, generatorFallbackOld);
+ }
}
}
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{11664246-C466-4600-ADC9-8ED9F0FE4AD2}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Xml.Test</AssemblyName>\r
- <JDKName>1.5.0_05</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <RootNamespace>System.Xml.Test20</RootNamespace>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>DEBUG;TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>True</SkipValidation>\r
- <KeepIntermediate>False</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Reference Include="System">\r
- <HintPath>..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll</HintPath>\r
- </Reference>\r
- <Reference Include="System.Data">\r
- <HintPath>..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll</HintPath>\r
- </Reference>\r
- <Reference Include="System.Xml">\r
- <HintPath>..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll</HintPath>\r
- </Reference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="System.Xml.Schema\XmlSchemaAssertion.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaBuiltInDatatypeTests.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaCollectionTests.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaDatatypeTests.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaExceptionCas.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaLengthFacetTests.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaSetTests.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaTests.cs" />\r
- <Compile Include="System.Xml.Schema\XmlSchemaTypeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\CodeIdentifiersTests.cs" />\r
- <Compile Include="System.Xml.Serialization\ComplexDataStructure.cs" />\r
- <Compile Include="System.Xml.Serialization\DeserializeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapAttributeAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapAttributesTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapElementAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapEnumAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapIncludeAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapReflectionImporterTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapSchemaExporterTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapSchemaMemberTests.cs" />\r
- <Compile Include="System.Xml.Serialization\SoapTypeAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAnyElementAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlArrayAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlArrayItemAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAttributeAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlAttributesTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlChoiceIdentifierAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlElementAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlEnumAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlIncludeAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlReflectionImporterTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlRootAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSchemaExporterTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationReaderTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializationWriterTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializerImplementationTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializerTestClasses.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlSerializerTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTextAttributeTests.cs" />\r
- <Compile Include="System.Xml.Serialization\XmlTypeAttributeTests.cs" />\r
- <Compile Include="System.Xml.XPath\SelectNodesTests.cs" />\r
- <Compile Include="System.Xml.XPath\XPathEditableNavigatorTests.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNavigatorCommonTests.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNavigatorEvaluateTests.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNavigatorMatchesTests.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNavigatorReaderTests.cs" />\r
- <Compile Include="System.Xml.XPath\XPathNavigatorTests.cs" />\r
- <Compile Include="System.Xml.Xsl\XsltExceptionTests.cs" />\r
- <Compile Include="System.Xml.Xsl\XslTransformTests.cs" />\r
- <Compile Include="System.Xml\NameTableTests.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\Attr\Attr.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\CharacterData\CharacterData.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\Comment\Comment.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\Document\Document.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\DOMImplementation\DOMImplementation.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\Element\Element.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\NamedNodeMap\NamedNodeMap.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\NodeList\NodeList.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\Node\Node.cs" />\r
- <Compile Include="System.Xml\nist_dom\fundamental\Text\Text.cs" />\r
- <Compile Include="System.Xml\nist_dom\ITest.cs">\r
- <SubType>Code</SubType>\r
- </Compile>\r
- <Compile Include="System.Xml\nist_dom\util.cs" />\r
- <Compile Include="System.Xml\XmlAssert.cs" />\r
- <Compile Include="System.Xml\XmlAttributeCollectionTests.cs" />\r
- <Compile Include="System.Xml\XmlAttributeTests.cs" />\r
- <Compile Include="System.Xml\XmlCDataSectionTests.cs" />\r
- <Compile Include="System.Xml\XmlCharacterDataTests.cs" />\r
- <Compile Include="System.Xml\XmlCharTests.cs" />\r
- <Compile Include="System.Xml\XmlCommentTests.cs" />\r
- <Compile Include="System.Xml\XmlConvertTests.cs" />\r
- <Compile Include="System.Xml\XmlDeclarationTests.cs" />\r
- <Compile Include="System.Xml\XmlDefaultReader.cs" />\r
- <Compile Include="System.Xml\XmlDocumentEventTests.cs" />\r
- <Compile Include="System.Xml\XmlDocumentFragmentTests.cs" />\r
- <Compile Include="System.Xml\XmlDocumentTests.cs" />\r
- <Compile Include="System.Xml\XmlDocumentTypeTests.cs" />\r
- <Compile Include="System.Xml\XmlElementTests.cs" />\r
- <Compile Include="System.Xml\XmlEntityReferenceTests.cs" />\r
- <Compile Include="System.Xml\XmlEntityTests.cs" />\r
- <Compile Include="System.Xml\XmlNamespaceManagerTests.cs" />\r
- <Compile Include="System.Xml\XmlNodeListTests.cs" />\r
- <Compile Include="System.Xml\XmlNodeReaderTests.cs" />\r
- <Compile Include="System.Xml\XmlNodeTests.cs" />\r
- <Compile Include="System.Xml\XmlProcessingInstructionTests.cs" />\r
- <Compile Include="System.Xml\XmlReaderCommonTests.cs" />\r
- <Compile Include="System.Xml\XmlReaderSettingsTests.cs" />\r
- <Compile Include="System.Xml\XmlSignificantWhitespaceTests.cs" />\r
- <Compile Include="System.Xml\XmlTextReaderTests.cs" />\r
- <Compile Include="System.Xml\XmlTextTests.cs" />\r
- <Compile Include="System.Xml\XmlTextWriterTests.cs" />\r
- <Compile Include="System.Xml\XmlUrlResolverTests.cs" />\r
- <Compile Include="System.Xml\XmlValidatingReaderTests.cs" />\r
- <Compile Include="System.Xml\XmlWhiteSpaceTests.cs" />\r
- <Compile Include="System.Xml\XmlWriterSettingsTests.cs" />\r
- <Compile Include="System.Xml\XmlWriterTests.cs" />\r
- <Compile Include="System.Xml\XsdParticleValidationTests.cs" />\r
- <Compile Include="System.Xml\XsdValidatingReaderTests.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj">\r
- <Project>{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}</Project>\r
- <Name>nunit.framework.dll20.J2EE</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-mscorlib="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\mscorlib.jar" REFS-JarPath-system="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.jar" REFS-JarPath-system-data="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Data.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\java_refs\framework\System.Xml.jar" REFS-JarPath-rt="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE V2\jre5\lib\rt.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "System.Xml.Test20", "System.Xml.Test20.csproj", "{11664246-C466-4600-ADC9-8ED9F0FE4AD2}"\r
-EndProject\r
-Project("{83B010C7-76FC-4FAD-A26C-00D7EFE60256}") = "nunit.framework.dll20.J2EE", "..\..\..\nunit20\framework\nunit.framework.dll20.J2EE.csproj", "{ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {11664246-C466-4600-ADC9-8ED9F0FE4AD2}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {11664246-C466-4600-ADC9-8ED9F0FE4AD2}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {11664246-C466-4600-ADC9-8ED9F0FE4AD2}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {11664246-C466-4600-ADC9-8ED9F0FE4AD2}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {11664246-C466-4600-ADC9-8ED9F0FE4AD2}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {11664246-C466-4600-ADC9-8ED9F0FE4AD2}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {11664246-C466-4600-ADC9-8ED9F0FE4AD2}.Release_Java20|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {11664246-C466-4600-ADC9-8ED9F0FE4AD2}.Release_Java20|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.ActiveCfg = Release_Java20|Any CPU\r
- {ACDA29DB-62AB-4AF8-8862-B3B4FC755BBC}.Release_Java20|Any CPU.Build.0 = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
t.Transform (new XPathDocument (new XmlTextReader (new StringReader ("<root attr='D'><foo attr='A'/><foo attr='B'/><foo attr='C'/></root>"))), null, sw);
Assert.AreEqual ("<?xml version=\"1.0\" encoding=\"utf-16\"?><root><bar>D</bar><baz>foo: A,foo: B,foo: C</baz></root>", sw.ToString ());
}
+
+ [Test]
+ public void ElementToAttribute ()
+ {
+ var xsl = @"<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
+ <xsl:output method='xml'/>
+ <xsl:template match='/'>
+ <Node>
+ <xsl:attribute name='name'>
+ <xsl:call-template name='makeName'>
+ <xsl:with-param name='Name' select='Node/Name' />
+ </xsl:call-template>
+ </xsl:attribute>
+ </Node>
+ </xsl:template>
+
+ <xsl:template name='makeName'>
+ <xsl:param name='Name' />
+ <xsl:value-of select='$Name' />
+ </xsl:template>
+</xsl:stylesheet>";
+
+ var t = new XslCompiledTransform ();
+ t.Load (new XmlTextReader (new StringReader (xsl)));
+
+ var source = "<?xml version='1.0' encoding='utf-8' ?><Node><Name>123</Name></Node>";
+ var expected = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Node name=\"123\" />";
+
+ StringWriter sw = new StringWriter ();
+ t.Transform (new XPathDocument (new XmlTextReader (new StringReader (source))), null, sw);
+ Assert.AreEqual (expected, sw.ToString ());
+ }
}
}
Assert.IsNull (xsltException.SourceUri, "#4");
Assert.IsNull (xsltException.InnerException, "#5");
Assert.IsNull (xsltException.Source, "#6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#7");
Assert.IsNull (xsltException.TargetSite, "#8");
-#endif
}
[Test]
Assert.IsNull (xsltException.SourceUri, "#4");
Assert.IsNull (xsltException.InnerException, "#5");
Assert.IsNull (xsltException.Source, "#6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#7");
Assert.IsNull (xsltException.TargetSite, "#8");
-#endif
}
#endif
Assert.IsNull (xsltException.SourceUri, "#A4");
Assert.AreSame (cause, xsltException.InnerException, "#A5");
Assert.IsNull (xsltException.Source, "#A6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#A7");
Assert.IsNull (xsltException.TargetSite, "#A8");
-#endif
xsltException = new XsltException ((string) null, cause);
Assert.AreEqual (0, xsltException.LineNumber, "#B1");
Assert.AreEqual (0, xsltException.LinePosition, "#B2");
Assert.IsNull (xsltException.SourceUri, "#B5");
Assert.AreSame (cause, xsltException.InnerException, "#B6");
Assert.IsNull (xsltException.Source, "#B7");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#B8");
Assert.IsNull (xsltException.TargetSite, "#B9");
-#endif
xsltException = new XsltException (msg, (Exception) null);
Assert.AreEqual (0, xsltException.LineNumber, "#C1");
Assert.AreEqual (0, xsltException.LinePosition, "#C2");
Assert.IsNull (xsltException.SourceUri, "#C4");
Assert.IsNull (xsltException.InnerException, "#C5");
Assert.IsNull (xsltException.Source, "#C6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#C7");
Assert.IsNull (xsltException.TargetSite, "#C8");
-#endif
xsltException = new XsltException ((string) null, (Exception) null);
Assert.AreEqual (0, xsltException.LineNumber, "#D1");
Assert.AreEqual (0, xsltException.LinePosition, "#D2");
Assert.IsNull (xsltException.SourceUri, "#D4");
Assert.IsNull (xsltException.InnerException, "#D5");
Assert.IsNull (xsltException.Source, "#D6");
-#if !TARGET_JVM
Assert.IsNull (xsltException.StackTrace, "#D7");
Assert.IsNull (xsltException.TargetSite, "#D8");
-#endif
}
}
}
+++ /dev/null
-To build and run this testsuite following steps are neccessary:\r
-\r
-1) Build nunit.core, framework, util and nunit-console\r
-2) Copy jars from step 2. to java_refs\r
-3) Edit java_refs/settings.xml to include core, framework and util, for example:\r
- <package readonly="true"\r
- identity="nunit.core"\r
- dllname="C:\views\DevQA\studio\GH\DevQA\tests\utils\nunit\nunit-2.2.0\nunit-console\bin\Debug_Java\nunit.core.dll">\r
- <jar>nunit.core.jar</jar>\r
- </package>\r
-4) Build W3 solution\r
-5) Edit run-test.j2ee.bat to refer correct path to java_refs\r
-6) Run bat\r
+++ /dev/null
-set JGAC_PATH=c:\Program Files\Mainsoft\Visual MainWin for J2EE\java_refs\framework\\r
-java -cp "%JGAC_PATH%mscorlib.jar;%JGAC_PATH%System.jar;%JGAC_PATH%System.Xml.jar;%JGAC_PATH%nunit.core.jar;%JGAC_PATH%nunit.framework.jar;%JGAC_PATH%nunit.util.jar;%JGAC_PATH%J2SE.Helpers.jar;xslt.jar;nunit-console.jar" NUnit.Console.ConsoleUi xslt.jar /fixture:MonoTests.oasis_xslt.SuiteBuilder /xml=TestResult.xml /include=KnownFailures\r
-\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{52564015-7939-46EF-B930-BB017FB6D26A}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>xslt</RootNamespace>\r
- <AssemblyName>xslt</AssemblyName>\r
- <JDKName>1.5.0_05</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <jarserver>iap2</jarserver>\r
- <StartupObject>\r
- </StartupObject>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>.\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>.\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_2_0;NET_1_1</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <jarserver>iap2</jarserver>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-nunit-framework="..\..\..\..\..\nunit20\core\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-nunit-core="..\..\..\..\..\nunit20\core\bin\Debug_Java20\nunit.core.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-system="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-rt="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <ItemGroup>\r
- <Reference Include="nunit.core, Version=0.0.0.0, Culture=neutral">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\..\..\nunit20\core\bin\Debug_Java20\nunit.core.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="nunit.framework, Version=0.0.0.0, Culture=neutral">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\..\..\nunit20\core\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="rt, Version=0.0.0.0, Culture=neutral">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="XmlCompare.cs" />\r
- <Compile Include="xslttest.cs" />\r
- <Compile Include="XsltTestUtils.cs" />\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xslt20.J2EE", "xslt20.J2EE.csproj", "{52564015-7939-46EF-B930-BB017FB6D26A}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Debug|Any CPU = Debug|Any CPU\r
- Debug-Strong|Any CPU = Debug-Strong|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Debug_Java|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Debug_Java|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Debug|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Debug|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Debug-Strong|Any CPU.ActiveCfg = Debug_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Debug-Strong|Any CPU.Build.0 = Debug_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Release|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {52564015-7939-46EF-B930-BB017FB6D26A}.Release|Any CPU.Build.0 = Release_Java|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
string exceptionsFilename = Path.Combine (EnvOptions.OutputDir, "res-exceptions.lst");
Helpers.ReadStrings (skipTargets, "ignore.lst");
-#if TARGET_JVM
- Helpers.ReadStrings (knownFailures, "knownFailures.jvm.lst");
-#else
Helpers.ReadStrings (knownFailures, "knownFailures.lst");
-#endif
Helpers.ReadStrings (fixmeList, "fixme.lst");
ArrayList exceptionsArray = new ArrayList();
Helpers.ReadStrings (exceptionsArray, exceptionsFilename);
+++ /dev/null
-To build and run this testsuite following steps are neccessary:\r
-\r
-1) Build nunit.core, framework, util and nunit-console\r
-2) Copy jars from step 2. to java_refs\r
-3) Edit java_refs/settings.xml to include core, framework and util, for example:\r
- <package readonly="true"\r
- identity="nunit.core"\r
- dllname="C:\views\DevQA\studio\GH\DevQA\tests\utils\nunit\nunit-2.2.0\nunit-console\bin\Debug_Java\nunit.core.dll">\r
- <jar>nunit.core.jar</jar>\r
- </package>\r
-4) Build W3 solution\r
-5) Edit run-test.j2ee.bat to refer correct path to java_refs\r
-6) Run bat\r
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{9DCE5474-B890-4237-ADAF-4C1375D1FA3A}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>W3C</RootNamespace>\r
- <AssemblyName>W3C</AssemblyName>\r
- <JDKName>1.5.0_05</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <jarserver>iap2</jarserver>\r
- <StartupObject>\r
- </StartupObject>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <NoStdLib>false</NoStdLib>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <NoStdLib>true</NoStdLib>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-nunit-framework="..\..\..\..\..\nunit20\core\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-nunit-core="..\..\..\..\..\nunit20\core\bin\Debug_Java20\nunit.core.jar" REFS-JarPath-mscorlib="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-system="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-rt="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <ItemGroup>\r
- <Reference Include="nunit.core, Version=2.3.6162.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />\r
- <Reference Include="nunit.framework, Version=2.3.6162.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />\r
- <Reference Include="rt, Version=0.0.0.0, Culture=neutral">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\jre5\rt.dll</HintPath>\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System" />\r
- <Reference Include="System.XML" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="xmlconf.cs" />\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>8.0.50727</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>W3C</RootNamespace>\r
- <AssemblyName>W3C</AssemblyName>\r
- <JDKName>1.5.0_05</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <jarserver>iap2</jarserver>\r
- <StartupObject>\r
- </StartupObject>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;ONLY_1_1</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <OutputPath>.\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;TARGET_JVM;NET_1_1;NET_2_0</DefineConstants>\r
- <BaseAddress>285212672</BaseAddress>\r
- <DebugType>full</DebugType>\r
- <PlatformTarget>AnyCPU</PlatformTarget>\r
- <ErrorReport>prompt</ErrorReport>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <GHProjectType>1</GHProjectType>\r
- <PreCompile>false</PreCompile>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <ApplicationServerType>\r
- </ApplicationServerType>\r
- <Version>2.0</Version>\r
- <JDKName>1.5.0_05</JDKName>\r
- <jarserver>iap2</jarserver>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-system-xml="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.Xml.jar" REFS-JarPath-system="..\..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\java_refs\framework\mscorlib.jar" REFS-JarPath-rt="..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-nunit-core="..\..\..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.core.jar" REFS-JarPath-nunit-framework="..\..\..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.framework.jar" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
- <ItemGroup>\r
- <Reference Include="nunit.core, Version=0.0.0.0, Culture=neutral">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.core.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="nunit.framework, Version=0.0.0.0, Culture=neutral">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\..\..\nunit20\nunit-console\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="rt, Version=0.0.0.0, Culture=neutral">\r
- <Private>False</Private>\r
- </Reference>\r
- <Reference Include="System" />\r
- <Reference Include="System.Xml" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="xmlconf.cs" />\r
- </ItemGroup>\r
-</Project>
\ No newline at end of file
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "W3C20.J2EE", "W3C20.J2EE.csproj", "{4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug_Java|Any CPU = Debug_Java|Any CPU\r
- Debug_Java20|Any CPU = Debug_Java20|Any CPU\r
- Release_Java|Any CPU = Release_Java|Any CPU\r
- Release_Java20|Any CPU = Release_Java20|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}.Debug_Java|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}.Debug_Java|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}.Debug_Java20|Any CPU.ActiveCfg = Debug_Java20|Any CPU\r
- {4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}.Debug_Java20|Any CPU.Build.0 = Debug_Java20|Any CPU\r
- {4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}.Release_Java|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}.Release_Java|Any CPU.Build.0 = Release_Java|Any CPU\r
- {4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}.Release_Java20|Any CPU.ActiveCfg = Release_Java|Any CPU\r
- {4A29F8EF-255A-444D-BAB9-3AB3A2CD72AD}.Release_Java20|Any CPU.Build.0 = Release_Java|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
+++ /dev/null
-set JGAC_PATH=c:\Program Files\Mainsoft\Visual MainWin for J2EE\java_refs\framework\\r
-java -cp "%JGAC_PATH%mscorlib.jar;%JGAC_PATH%System.jar;%JGAC_PATH%System.Xml.jar;%JGAC_PATH%nunit.core.jar;%JGAC_PATH%nunit.framework.jar;%JGAC_PATH%nunit.util.jar;%JGAC_PATH%J2SE.Helpers.jar;W3C.jar;nunit-console.jar" NUnit.Console.ConsoleUi /fixture=MonoTests.W3C_xmlconf.CleanTests W3C.jar /xml=TestsResult.xml\r
using NUnit.Framework;
-namespace MonoTest.System.Xml {
+namespace MonoTests.System.Xml {
[TestFixture]
public class XmlResolverTest {
using System.Security.Policy;
using System.Xml;
-using MonoTestsXml;
+using MonoTests.System.Xml;
namespace MonoCasTests.System.Xml {
}
}
-#endif
\ No newline at end of file
+#endif
using System.Xml;
using NUnit.Framework;
-namespace MonoTestsXml
+namespace MonoTests.System.Xml
{
[TestFixture]
public class XmlSecureResolverTests
+++ /dev/null
-Mono.Xml.Xsl/ScriptCompilerInfo.cs
-System.Xml.Serialization/MapCodeGenerator.cs
-System.Xml.Serialization/SoapCodeExporter.cs
-System.Xml.Serialization/XmlCodeExporter.cs
-Mono.Xml.Xsl/XslDecimalFormat.cs
+++ /dev/null
-#include System.Xml.dll.sources
-Mono.Xml.Xsl/XslDecimalFormat.jvm.cs
Test/XmlFiles/*.xml \
Test/XmlFiles/*.xaml
-VALID_PROFILE := $(filter 4 monodroid monotouch, $(FRAMEWORK_VERSION_MAJOR))
+VALID_PROFILE := $(filter 4 monodroid monotouch mobile mobile_static, $(FRAMEWORK_VERSION_MAJOR))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.Xaml.dll
NO_INSTALL = yes
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{8EF1DA1B-BB96-4248-B059-8F2C8F40721D}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Xml.Linq</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <OldToolsVersion>3.5</OldToolsVersion>\r
- <RootNamespace>System.Xml.Linq</RootNamespace>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <jarserver>ipa</jarserver>\r
- <PublishUrl>http://localhost/System.Xml.Linq/</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Web</InstallFrom>\r
- <UpdateEnabled>true</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>true</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java20|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java20\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;NET_1_1;NET_2_0;NET_3_5;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java20|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java20\</OutputPath>\r
- <DefineConstants>TRACE;JAVA;NET_1_1;NET_2_0;NET_3_5;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Locale.cs">\r
- <Link>Assembly\Locale.cs</Link>\r
- </Compile>\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs">\r
- <Link>Assembly\MonoTODOAttribute.cs</Link>\r
- </Compile>\r
- <Compile Include="System.Xml.Linq\Extensions.cs" />\r
- <Compile Include="System.Xml.Linq\LoadOptions.cs" />\r
- <Compile Include="System.Xml.Linq\SaveOptions.cs" />\r
- <Compile Include="System.Xml.Linq\XAttribute.cs" />\r
- <Compile Include="System.Xml.Linq\XCData.cs" />\r
- <Compile Include="System.Xml.Linq\XComment.cs" />\r
- <Compile Include="System.Xml.Linq\XContainer.cs" />\r
- <Compile Include="System.Xml.Linq\XDeclaration.cs" />\r
- <Compile Include="System.Xml.Linq\XDocument.cs" />\r
- <Compile Include="System.Xml.Linq\XDocumentType.cs" />\r
- <Compile Include="System.Xml.Linq\XElement.cs" />\r
- <Compile Include="System.Xml.Linq\XIterators.cs" />\r
- <Compile Include="System.Xml.Linq\XName.cs" />\r
- <Compile Include="System.Xml.Linq\XNamespace.cs" />\r
- <Compile Include="System.Xml.Linq\XNode.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeDocumentOrderComparer.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeEqualityComparer.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeNavigator.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeReader.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeWriter.cs" />\r
- <Compile Include="System.Xml.Linq\XObject.cs" />\r
- <Compile Include="System.Xml.Linq\XObjectChange.cs" />\r
- <Compile Include="System.Xml.Linq\XObjectChangeEventArgs.cs" />\r
- <Compile Include="System.Xml.Linq\XProcessingInstruction.cs" />\r
- <Compile Include="System.Xml.Linq\XStreamingElement.cs" />\r
- <Compile Include="System.Xml.Linq\XText.cs" />\r
- <Compile Include="System.Xml.Linq\XUtil.cs" />\r
- <Compile Include="System.Xml.Schema\Extensions.cs" />\r
- <Compile Include="System.Xml.XPath\Extensions.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="rt, Version=1.6.0.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs.in">\r
- <Link>Assembly\Consts.cs.in</Link>\r
- </Compile>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-JarPath-system="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-rt="" REFS-RefInfo-rt="repository:jre:sun:1.6.0" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
return attribute.value == null ? (DateTime?) null : XUtil.ToDateTime (attribute.value);
}
-#if !TARGET_JVM // Same as for System.Xml.XmlConvert.ToDateTimeOffset
[CLSCompliant (false)]
public static explicit operator DateTimeOffset (XAttribute attribute)
return attribute.value == null ? (DateTimeOffset?) null : XmlConvert.ToDateTimeOffset (attribute.value);
}
-#endif
[CLSCompliant (false)]
public static explicit operator decimal (XAttribute attribute)
//
using System;
+using System.Linq;
using System.Xml;
namespace System.Xml.Linq
public override void WriteTo (XmlWriter writer)
{
- writer.WriteComment (value);
+ var v = value.Replace ("--", "- -");
+ v = v.LastOrDefault () == '-' ? v.Substring (0, v.Length - 1) +"D;" : v;
+ writer.WriteComment (v);
}
}
}
foreach (object o in XUtil.ExpandArray (content))
{
+ if (o == null)
+ continue;
+
if (!OnAddingObject (o, false, last, false))
{
var node = XUtil.ToNode (o);
return element.Value == null ? (DateTime?) null : XUtil.ToDateTime (element.Value);
}
-#if !TARGET_JVM // Same as for System.Xml.XmlConvert.ToDateTimeOffset
[CLSCompliant (false)]
public static explicit operator DateTimeOffset (XElement element)
return element.Value == null ? (DateTimeOffset?) null : XmlConvert.ToDateTimeOffset (element.Value);
}
-#endif
[CLSCompliant (false)]
public static explicit operator decimal (XElement element)
{
if (Changing != null)
Changing (sender, args);
- if (Parent != null)
- Parent.OnChanging (sender, args);
+ if (Owner != null)
+ Owner.OnChanging (sender, args);
}
void OnChanged (object sender, XObjectChangeEventArgs args)
{
if (Changed != null)
Changed (sender, args);
- if (Parent != null)
- Parent.OnChanged (sender, args);
+ if (Owner != null)
+ Owner.OnChanged (sender, args);
}
}
}
System.Xml.Linq/ExtensionsTest.cs
System.Xml.Linq/XAttributeTest.cs
+System.Xml.Linq/XCommentTest.cs
System.Xml.Linq/XDocumentTest.cs
System.Xml.Linq/XElementTest.cs
System.Xml.Linq/XNameTest.cs
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug_Java</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.21022</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{EF1A17B1-3987-44F1-B796-7F89C9A1642A}</ProjectGuid>\r
- <ProjectTypeGuids>{F6B19D50-1E2E-4e87-ADFB-10393B439DE0};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\r
- <OutputType>Library</OutputType>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <AssemblyName>System.Xml.Linq.Tests</AssemblyName>\r
- <JDKName>1.6</JDKName>\r
- <GHProjectType>1</GHProjectType>\r
- <Version>2.0</Version>\r
- <UseVSHostingProcess>false</UseVSHostingProcess>\r
- <AdditionalClassPath>\r
- </AdditionalClassPath>\r
- <FileUpgradeFlags>\r
- </FileUpgradeFlags>\r
- <OldToolsVersion>3.5</OldToolsVersion>\r
- <RootNamespace>System.Xml.Linq.Tests</RootNamespace>\r
- <UpgradeBackupLocation>\r
- </UpgradeBackupLocation>\r
- <jarserver>ipa</jarserver>\r
- <PublishUrl>http://localhost/System.Xml.Linq.Tests/</PublishUrl>\r
- <Install>true</Install>\r
- <InstallFrom>Web</InstallFrom>\r
- <UpdateEnabled>true</UpdateEnabled>\r
- <UpdateMode>Foreground</UpdateMode>\r
- <UpdateInterval>7</UpdateInterval>\r
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r
- <UpdatePeriodically>false</UpdatePeriodically>\r
- <UpdateRequired>false</UpdateRequired>\r
- <MapFileExtensions>true</MapFileExtensions>\r
- <ApplicationRevision>0</ApplicationRevision>\r
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r
- <IsWebBootstrapper>true</IsWebBootstrapper>\r
- <UseApplicationTrust>false</UseApplicationTrust>\r
- <BootstrapperEnabled>true</BootstrapperEnabled>\r
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Java|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <Optimize>false</Optimize>\r
- <OutputPath>bin\Debug_Java\</OutputPath>\r
- <DefineConstants>TRACE;DEBUG;JAVA;NET_1_1;NET_2_0;NET_3_5;TARGET_JVM</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Java|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <Optimize>true</Optimize>\r
- <OutputPath>bin\Release_Java\</OutputPath>\r
- <DefineConstants>TRACE;JAVA</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- <BaseAddress>285212672</BaseAddress>\r
- <SkipValidation>false</SkipValidation>\r
- <KeepIntermediate>false</KeepIntermediate>\r
- <TargetPlatform>0</TargetPlatform>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <Compile Include="System.Xml.Linq\ExtensionsTest.cs" />\r
- <Compile Include="System.Xml.Linq\XAttributeTest.cs" />\r
- <Compile Include="System.Xml.Linq\XDocumentTest.cs" />\r
- <Compile Include="System.Xml.Linq\XElementTest.cs" />\r
- <Compile Include="System.Xml.Linq\XNamespaceTest.cs" />\r
- <Compile Include="System.Xml.Linq\XNameTest.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeDocumentOrderComparerTest.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeEqualityComparerTest.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeNavigatorTest.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeReaderTest.cs" />\r
- <Compile Include="System.Xml.Linq\XNodeWriterTest.cs" />\r
- <Compile Include="System.Xml.Linq\XObjectTest.cs" />\r
- <Compile Include="System.Xml.Linq\XProcessingInstructionTest.cs" />\r
- <Compile Include="System.Xml.Linq\XTextTest.cs" />\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Reference Include="nunit.framework">\r
- <SpecificVersion>False</SpecificVersion>\r
- <HintPath>..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.dll</HintPath>\r
- <Private>True</Private>\r
- </Reference>\r
- <Reference Include="rt, Version=1.6.0.65535, Culture=neutral, processorArchitecture=MSIL" />\r
- <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86" />\r
- <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />\r
- <Reference Include="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">\r
- <RequiredTargetFramework>3.5</RequiredTargetFramework>\r
- </Reference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\r
- <Install>true</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">\r
- <Visible>False</Visible>\r
- <ProductName>.NET Framework 3.5</ProductName>\r
- <Install>false</Install>\r
- </BootstrapperPackage>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
- <Import Project="$(MSBuildBinPath)\Microsoft.csharp.targets" />\r
- <Import Project="$(VMW_HOME)\bin\Mainsoft.Common.targets" />\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <ProjectExtensions>\r
- <VisualStudio>\r
- <UserProperties REFS-RefInfo-system-xml-linq="repository:vmw:framework:2.0" REFS-JarPath-system-xml-linq="" REFS-RefInfo-rt="repository:jre:sun:1.6.0" REFS-JarPath-rt="" REFS-RefInfo-system-xml="repository:vmw:framework:2.0" REFS-JarPath-system-xml="" REFS-RefInfo-system-data="repository:vmw:framework:2.0" REFS-JarPath-system-data="" REFS-RefInfo-system="repository:vmw:framework:2.0" REFS-JarPath-system="" />\r
- </VisualStudio>\r
- </ProjectExtensions>\r
-</Project>
\ No newline at end of file
--- /dev/null
+//
+// Authors:
+// Atsushi Enomoto
+//
+// Copyright 2014 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;
+using System.IO;
+using System.Xml;
+using System.Xml.Linq;
+using System.Linq;
+
+using NUnit.Framework;
+
+namespace MonoTests.System.Xml.Linq
+{
+ [TestFixture]
+ public class XCommentTest
+ {
+ [Test]
+ public void EscapeSequentialDashes ()
+ {
+ XComment c;
+
+ c = new XComment ("<--foo-->");
+ Assert.AreEqual ("<--foo-->", c.Value, "#1");
+ // bug #23318
+ // Unlike XmlWriter.WriteComment(), XComment.ToString() seems to accept "--" in the value.
+ Assert.AreEqual ("<!--<- -foo- ->-->", c.ToString (), "#2");
+ // make sure if it can be read...
+ XmlReader.Create (new StringReader (c.ToString ())).Read ();
+
+ // The last '-' causes some glitch...
+ c = new XComment ("--foo--");
+ Assert.AreEqual ("--foo--", c.Value, "#3");
+ Assert.AreEqual ("<!--- -foo- D;-->", c.ToString (), "#4");
+ XmlReader.Create (new StringReader (c.ToString ())).Read ();
+
+ // What if <!-- appears in the value?
+ c = new XComment ("<!--foo-->");
+ Assert.AreEqual ("<!--foo-->", c.Value, "#5");
+ Assert.AreEqual ("<!--<!- -foo- ->-->", c.ToString (), "#6");
+ XmlReader.Create (new StringReader (c.ToString ())).Read ();
+ }
+ }
+}
doc.WriteTo (writer);
Assert.IsTrue (sw.ToString ().StartsWith ("<?xml"), "#1");
}
+
+ [Test] // bug #18772
+ public void ChangedEvent ()
+ {
+ const string xml = "<?xml version='1.0' encoding='utf-8'?><Start><Ele1/></Start>";
+ var testXmlDoc = XDocument.Load (new MemoryStream(Encoding.UTF8.GetBytes(xml)));
+
+ var changed = false;
+ testXmlDoc.Changed += (sender, e) => {
+ changed = true;
+ };
+
+ XElement p = new XElement ("Hello");
+ testXmlDoc.Root.Add (p);
+
+ Assert.IsTrue (changed);
+ }
}
}
Assert.AreEqual (xe.Content.ToString (), "<Data />", "#3");
}
#endif
+
+ [Test] // Bug #20151
+ public void XElementFromArrayWithNullValuesAsObject ()
+ {
+ string[] content = {null, "content1", null, "content2"};
+ var el = new XElement ("test", (object)content);
+ Assert.AreEqual ("<test>content1content2</test>", el.ToString ());
+ }
}
}
LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 -unsafe $(RESOURCE_FILES:%=-resource:%)
TEST_MCS_FLAGS += -r:System.Configuration
-PROFILE_ANY_MOBILE := $(filter monotouch monotouch_runtime monodroid xammac, $(PROFILE))
-NOT_SL := $(filter net_2_0 net_4_0 net_4_5 monotouch_runtime mobile xammac, $(PROFILE))
+PROFILE_ANY_MOBILE := $(filter monotouch monotouch_runtime monodroid xammaci mobile mobile_static, $(PROFILE))
ifeq (2.1, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:INSIDE_SYSTEM
-ifeq (moonlight_raw, $(PROFILE))
-LIB_MCS_FLAGS += -d:SECURITY_DEP
-endif
endif
ifeq (monotouch, $(subst _runtime,,$(PROFILE)))
LIB_MCS_FLAGS += -d:SECURITY_DEP
$(MAKE) csproj-local intermediate=bare/
$(MAKE) csproj-local intermediate=secxml/
endif
-endif
\ No newline at end of file
+endif
using System.Text.RegularExpressions;
using System.Threading;
using System.Collections.Generic;
+ using System.Globalization;
internal class CSharpCodeCompiler : CSharpCodeGenerator, ICodeCompiler
{
if (Environment.GetEnvironmentVariable ("MONO_TESTS_IN_PROGRESS") != null) {
string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
if (!String.IsNullOrEmpty (monoPath)) {
- monoPath = monoPath.Replace ("/class/lib/net_2_0", "/class/lib/net_4_0");
+ const string basePath = "/class/lib/";
+ const string profile = "net_2_0";
+ var basePathIndex = monoPath.IndexOf (basePath, StringComparison.Ordinal);
+ if (basePathIndex > 0 && basePathIndex + basePath.Length + profile.Length <= monoPath.Length) {
+ var currentProfile = monoPath.Substring (basePathIndex + basePath.Length, profile.Length);
+ if (currentProfile.Equals (profile, StringComparison.OrdinalIgnoreCase))
+ monoPath = monoPath.Replace (basePath + currentProfile, basePath + "net_4_0");
+ }
mcs.StartInfo.EnvironmentVariables ["MONO_PATH"] = monoPath;
}
}
<Compile Include="System\UriElements.cs" />\r
<Compile Include="System\UriFormat.cs" />\r
<Compile Include="System\UriFormatException.cs" />\r
+ <Compile Include="System\UriHelper.cs" />\r
<Compile Include="System\UriHostNameType.cs" />\r
<Compile Include="System\UriIdnScope.cs" />\r
<Compile Include="System\UriKind.cs" />\r
<Compile Include="System\UriElements.cs" />\r
<Compile Include="System\UriFormat.cs" />\r
<Compile Include="System\UriFormatException.cs" />\r
+ <Compile Include="System\UriHelper.cs" />\r
<Compile Include="System\UriHostNameType.cs" />\r
<Compile Include="System\UriIdnScope.cs" />\r
<Compile Include="System\UriKind.cs" />\r
<Compile Include="System\UriElements.cs" />\r
<Compile Include="System\UriFormat.cs" />\r
<Compile Include="System\UriFormatException.cs" />\r
+ <Compile Include="System\UriHelper.cs" />\r
<Compile Include="System\UriHostNameType.cs" />\r
<Compile Include="System\UriIdnScope.cs" />\r
<Compile Include="System\UriKind.cs" />\r
uint version;
#if ONE_MEMBER_CACHE
-#if TARGET_JVM
- static readonly LocalDataStoreSlot _cachedPathStore = System.Threading.Thread.AllocateDataSlot ();
-
- static List<Node> cached_path {
- get { return (List<Node>) System.Threading.Thread.GetData (_cachedPathStore); }
- set { System.Threading.Thread.SetData (_cachedPathStore, value); }
- }
-#else
[ThreadStatic]
static List<Node> cached_path;
-#endif
static List<Node> alloc_path ()
{
Dispose (false);
}
-#if TARGET_JVM
- public virtual void Dispose ()
- {
- Dispose (true);
- }
-#else
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
-#endif
// <summary>
// Controls disposal of resources used by this.
// Set fields to null
}
-#if !TARGET_JVM
~MarshalByValueComponent ()
{
Dispose (false);
}
-#endif
public virtual object GetService (Type service)
{
properties.Clear ();
}
-#if !TARGET_JVM // DUAL_IFACE_CONFLICT
void IList.Clear ()
{
Clear ();
{
Clear ();
}
-#endif
public bool Contains (PropertyDescriptor value)
{
return properties.Contains (value);
}
-#if TARGET_JVM // DUAL_IFACE_CONFLICT
- public bool Contains (object value)
- {
- return Contains ((PropertyDescriptor) value);
- }
-#else
bool IList.Contains (object value)
{
{
return Contains ((PropertyDescriptor) value);
}
-#endif
public void CopyTo (Array array, int index)
{
properties.Remove (value);
}
-#if TARGET_JVM// DUAL_IFACE_CONFLICT
- public void Remove (object value)
- {
- Remove ((PropertyDescriptor) value);
- }
-#else
void IDictionary.Remove (object value)
{
Remove ((PropertyDescriptor) value);
{
Remove ((PropertyDescriptor) value);
}
-#endif
public void RemoveAt (int index)
{
if (readOnly) {
return new PropertyDescriptorCollection (descriptors, true);
}
-#if TARGET_JVM //DUAL_IFACE_CONFLICT
- public bool IsFixedSize
-#else
bool IDictionary.IsFixedSize
{
get {return ((IList)this).IsFixedSize;}
}
bool IList.IsFixedSize
-#endif
{
get
{
return readOnly;
}
}
-#if TARGET_JVM //DUAL_IFACE_CONFLICT
- public bool IsReadOnly
-#else
bool IDictionary.IsReadOnly
{
get {return ((IList)this).IsReadOnly;}
}
bool IList.IsReadOnly
-#endif
{
get
{
editor = CreateEditor (editorType, componentType);
if (editorType == null || editor == null) {
-#if !TARGET_JVM
// Make sure the editorBaseType's static constructor has been called,
// since that's where we're putting the initialization of its editor table.
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (editorBaseType.TypeHandle);
-#endif
if (editors != null)
editor = FindEditorInTable (componentType, editorBaseType, editors [editorBaseType] as Hashtable);
}
private int native_error_code;
// [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
-#if TARGET_JVM
- [MonoNotSupported("")]
-#endif
public Win32Exception ()
: base (W32ErrorMessage (Marshal.GetLastWin32Error ()))
{
native_error_code = error;
}
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
-#if TARGET_JVM
- [MonoNotSupported ("")]
-#endif
public Win32Exception (string message)
: base (message)
{
native_error_code = Marshal.GetLastWin32Error ();
}
-#if TARGET_JVM
- [MonoNotSupported ("")]
-#endif
[SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public Win32Exception (string message, Exception innerException)
: base (message, innerException)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if CONFIGURATION_DEP && !TARGET_JVM
+#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
//
-#if CONFIGURATION_DEP && !TARGET_JVM
+#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if CONFIGURATION_DEP && !TARGET_JVM
+#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
using System.Xml;
using System.Xml.XPath;
#endif
-#if TARGET_JVM
-using vmw.common;
-using vmw.@internal.io;
-#endif
namespace System.Configuration
{
public sealed class ConfigurationSettings
{
-#if !TARGET_JVM
static IConfigurationSystem config = DefaultConfig.GetInstance ();
-#else
- static IConfigurationSystem config {
- get {
- IConfigurationSystem conf = (IConfigurationSystem) AppDomain.CurrentDomain.GetData ("ConfigurationSettings.Config");
- if (conf == null) {
- conf = DefaultConfig.GetInstance ();
- AppDomain.CurrentDomain.SetData ("ConfigurationSettings.Config", conf);
- }
- return conf;
- }
- set {
- AppDomain.CurrentDomain.SetData ("ConfigurationSettings.Config", value);
- }
- }
-#endif
static object lockobj = new object ();
private ConfigurationSettings ()
{
//
class DefaultConfig : IConfigurationSystem
{
-#if !TARGET_JVM
static readonly DefaultConfig instance = new DefaultConfig ();
-#else
- static DefaultConfig instance {
- get {
- DefaultConfig conf = (DefaultConfig) AppDomain.CurrentDomain.GetData ("DefaultConfig.instance");
- if (conf == null) {
- conf = new DefaultConfig ();
- AppDomain.CurrentDomain.SetData ("DefaultConfig.instance", conf);
- }
- return conf;
- }
- set {
- AppDomain.CurrentDomain.SetData ("DefaultConfig.instance", value);
- }
- }
-#endif
ConfigurationData config;
private DefaultConfig ()
config = data;
}
}
-#if TARGET_JVM
- internal static string GetBundledMachineConfig ()
- {
- return null;
- }
- internal static string GetMachineConfigPath ()
- {
- return System.Runtime.InteropServices.RuntimeEnvironment.SystemConfigurationFile;
- }
-#else
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_machine_config ();
internal static string GetBundledMachineConfig ()
{
return get_machine_config_path ();
}
-#endif
private static string GetAppConfigPath ()
{
AppDomainSetup currentInfo = AppDomain.CurrentDomain.SetupInformation;
#if (XML_DEP)
this.fileName = fileName;
if (fileName == null
-#if !TARGET_JVM
|| !File.Exists (fileName)
-#endif
)
return false;
XmlTextReader reader = null;
try {
-#if !TARGET_JVM
FileStream fs = new FileStream (fileName, FileMode.Open, FileAccess.Read);
-#else
- Stream fs = (Stream) vmw.common.IOUtils.getStream (fileName);
-
- //patch for machine.config
- if (fs == null && fileName.EndsWith ("machine.config")) {
- fs = (Stream) IOUtils.getStreamForGHConfigs (fileName);
- }
-
- if (fs == null) {
- return false;
- }
-#endif
reader = new XmlTextReader (fs);
if (InitRead (reader))
ReadConfigFile (reader);
#if CONFIGURATION_DEP
-#if !TARGET_JVM
extern alias PrebuiltSystem;
-#endif
using System;
using System.Collections;
using System.Text;
using System.Xml;
-#if TARGET_JVM
-using NameValueCollection = System.Collections.Specialized.NameValueCollection;
-#else
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
-#endif
namespace System.Configuration
{
return attrs [0].Company;
}
-#if !TARGET_JVM
MethodInfo entryPoint = assembly.EntryPoint;
Type entryType = entryPoint != null ? entryPoint.DeclaringType : null;
if (entryType != null && !String.IsNullOrEmpty (entryType.Namespace)) {
return end < 0 ? entryType.Namespace : entryType.Namespace.Substring (0, end);
}
return "Program";
-#else
- return assembly.GetName ().Name;
-#endif
}
private static string GetProductName ()
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
-#if !TARGET_JVM
byte [] pkt = assembly.GetName ().GetPublicKeyToken ();
return String.Format ("{0}_{1}_{2}",
AppDomain.CurrentDomain.FriendlyName,
pkt != null && pkt.Length > 0 ? "StrongName" : "Url",
GetEvidenceHash());
-#else // AssemblyProductAttribute-based code
- AssemblyProductAttribute [] attrs = (AssemblyProductAttribute[]) assembly.GetCustomAttributes (typeof (AssemblyProductAttribute), true);
-
- if ((attrs != null) && attrs.Length > 0) {
- return attrs [0].Product;
- }
- return assembly.GetName ().Name;
-#endif
}
// Note: Changed from base64() to hex output to avoid unexpected chars like '\' or '/' with filesystem meaning.
ProductVersion = GetProductVersion ().Split('.');
// C:\Documents and Settings\(user)\Application Data
-#if !TARGET_JVM
if (userRoamingBasePath == "")
userRoamingPath = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
else
-#endif
userRoamingPath = userRoamingBasePath;
// C:\Documents and Settings\(user)\Local Settings\Application Data (on Windows)
-#if !TARGET_JVM
if (userLocalBasePath == "")
userLocalPath = Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData);
else
-#endif
userLocalPath = userLocalBasePath;
if (isCompany) {
Assembly assembly = Assembly.GetEntryAssembly ();
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
-#if !TARGET_JVM
byte [] pkt = assembly.GetName ().GetPublicKeyToken ();
ProductName = String.Format ("{0}_{1}_{2}",
ProductName,
pkt != null ? "StrongName" : "Url",
GetEvidenceHash());
-#endif
}
userRoamingPath = Path.Combine (userRoamingPath, ProductName);
userLocalPath = Path.Combine (userLocalPath, ProductName);
//
#if CONFIGURATION_DEP
-#if CONFIGURATION_DEP && !TARGET_JVM
+#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext context,
SettingsPropertyCollection properties)
{
-#if TARGET_JVM
- SettingsPropertyValueCollection pv = new SettingsPropertyValueCollection ();
- foreach (SettingsProperty prop in properties)
- pv.Add (new SettingsPropertyValue (prop));
- return pv;
-#else
return impl.GetPropertyValues (context, properties);
-#endif
}
#if CONFIGURATION_DEP
+++ /dev/null
-/Debugger.jvm.cs -crlf
-/StackFrame.jvm.cs -crlf
-/StackTrace.jvm.cs -crlf
-/TraceEventCache.jvm.cs -crlf
+++ /dev/null
-//\r\r
-// System.Diagnostics.Debugger.cs\r\r
-//\r\r
-// Author:\r\r
-// John R. Hicks (angryjohn69@nc.rr.com)\r\r
-//\r\r
-// (C) 2001\r\r
-//\r\r
-using System;\r\r
-\r\r
-namespace System.Diagnostics\r\r
-{\r\r
- /// <summary>\r\r
- /// Enables communication with a debugger.\r\r
- /// </summary>\r\r
- [MonoTODO]\r\r
- public sealed class Debugger\r\r
- {\r\r
- private static bool isAttached;\r\r
- \r\r
- /// <summary>\r\r
- /// Represents the default category of a message with a constant.\r\r
- /// </summary>\r\r
- public static readonly string DefaultCategory = "";\r\r
- \r\r
- /// <summary>\r\r
- /// Returns a Boolean indicating whether a debugger is attached to a process.\r\r
- /// </summary>\r\r
- /// <value>\r\r
- /// true if debugger is attached; otherwise, false.\r\r
- /// </value>\r\r
- public static bool IsAttached\r\r
- {\r\r
- get\r\r
- {\r\r
- return isAttached;\r\r
- }\r\r
- }\r\r
- \r\r
- /// <summary>\r\r
- /// Causes a breakpoint to be signaled to an attached debugger.\r\r
- /// </summary>\r\r
- [MonoTODO]\r\r
- public static void Break()\r\r
- {\r\r
- throw new NotImplementedException();\r\r
- }\r\r
- \r\r
- /// <summary>\r\r
- /// Checks to see if logging is enabled by an attached debugger.\r\r
- /// </summary>\r\r
- [MonoTODO]\r\r
- public static bool IsLogging()\r\r
- {\r\r
- // Return false. DefaultTraceListener invokes this method, so throwing\r\r
- // a NotImplementedException wouldn't be appropriate.\r\r
- return false;\r\r
-\r\r
- }\r\r
- \r\r
- /// <summary>\r\r
- /// Launches and attaches a debugger to the process.\r\r
- /// </summary>\r\r
- [MonoTODO]\r\r
- public static bool Launch()\r\r
- {\r\r
- throw new NotImplementedException();\r\r
- }\r\r
- \r\r
- /// <summary>\r\r
- /// Posts a message for the attached debugger.\r\r
- /// </summary>\r\r
- /// <param name="level">\r\r
- /// A description of the importance of this message\r\r
- /// </param>\r\r
- /// <param name="category">\r\r
- /// A string describing the category of this message.\r\r
- /// </param>\r\r
- /// <param name="message">\r\r
- /// A string representing the message to show.\r\r
- /// </param>\r\r
- [MonoTODO]\r\r
- public static void Log(int level, string category, string message)\r\r
- {\r\r
- // Do nothing. DefaultTraceListener invokes this method, so throwing\r\r
- // a NotImplementedException wouldn't be appropriate.\r\r
- }\r\r
- \r\r
- public Debugger()\r\r
- {\r\r
- isAttached = false;\r\r
- }\r\r
- }\r\r
-}\r\r
OnWin32 = (Path.DirectorySeparatorChar == '\\');
if (!OnWin32) {
-#if TARGET_JVM
- string trace = java.lang.System.getProperty("MONO_TRACE");
-#else
// If we're running on Unix, we don't have OutputDebugString.
// Instead, send output to...wherever the MONO_TRACE_LISTENER environment
// variables says to.
String trace = Environment.GetEnvironmentVariable("MONO_TRACE_LISTENER");
-#endif
#if MOBILE
if (trace == null)
Abort
}
-#if TARGET_JVM
- private void WriteDebugString (string message)
- {
-#else
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void WriteWindowsDebugString (string message);
if (OnWin32)
WriteWindowsDebugString (message);
else
-#endif
WriteMonoTrace (message);
}
public DiagnosticsConfigurationHandler ()
{
elementHandlers ["assert"] = new ElementHandler (AddAssertNode);
+ elementHandlers ["performanceCounters"] = new ElementHandler (AddPerformanceCountersNode);
elementHandlers ["switches"] = new ElementHandler (AddSwitchesNode);
elementHandlers ["trace"] = new ElementHandler (AddTraceNode);
elementHandlers ["sources"] = new ElementHandler (AddSourcesNode);
ThrowUnrecognizedElement (node.ChildNodes[0]);
}
+ private void AddPerformanceCountersNode (IDictionary d, XmlNode node)
+ {
+ XmlAttributeCollection c = node.Attributes;
+ string filemappingsize = GetAttribute (c, "filemappingsize", false, node);
+ ValidateInvalidAttributes (c, node);
+ if (filemappingsize != null) {
+ try {
+ d ["filemappingsize"] = int.Parse (filemappingsize);
+ }
+ catch (Exception e) {
+ throw new ConfigurationException ("The `filemappingsize' attribute must be an integral value.",
+ e, node);
+ }
+ }
+
+ if (node.ChildNodes.Count > 0)
+ ThrowUnrecognizedElement (node.ChildNodes[0]);
+ }
+
// name and value attributes are required
// Docs do not define "remove" or "clear" elements, but .NET recognizes
// them
private void AddSwitchesNode (IDictionary d, XmlNode node)
{
-#if !TARGET_JVM
// There are no attributes on <switch/>
ValidateInvalidAttributes (node.Attributes, node);
}
d [node.Name] = newNodes;
-#endif
}
private static object GetSwitchValue (string name, string value)
// for add, "name" is required; initializeData is optional; "type" is required in 1.x, optional in 2.0.
private void AddTraceListeners (IDictionary d, XmlNode listenersNode, TraceListenerCollection listeners)
{
-#if !TARGET_JVM
// There are no attributes on <listeners/>
ValidateInvalidAttributes (listenersNode.Attributes, listenersNode);
else
ThrowUnrecognizedNode (child);
}
-#endif
}
private void AddTraceListener (IDictionary d, XmlNode child, XmlAttributeCollection attributes, TraceListenerCollection listeners)
{
switch (eventType) {
case TraceEventType.Critical:
- return (Level & SourceLevels.Critical) != 0;
case TraceEventType.Error:
- return (Level & SourceLevels.Error) != 0;
case TraceEventType.Warning:
- return (Level & SourceLevels.Warning) != 0;
case TraceEventType.Information:
- return (Level & SourceLevels.Information) != 0;
case TraceEventType.Verbose:
- return (Level & SourceLevels.Verbose) != 0;
+ return (Level & (SourceLevels)eventType) != 0;
case TraceEventType.Start:
case TraceEventType.Stop:
case TraceEventType.Suspend:
}
}
+
protected override void OnValueChanged ()
{
SwitchSetting = (int) Enum.Parse (typeof (SourceLevels),
+++ /dev/null
-//\r
-// System.Diagnostics.StackFrame.cs\r
-//\r
-// Author:\r
-// Alexander Klyubin (klyubin@aqris.com)\r
-// Dietmar Maurer (dietmar@ximian.com)\r
-//\r
-// (C) 2001\r
-//\r
-\r
-using System;\r
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-namespace System.Diagnostics {\r
- /// <summary>\r
- /// Stack frame.\r
- /// </summary>\r
-\r
- [Serializable]\r
- public class StackFrame {\r
- /// <value>\r
- /// Constant returned when the native or IL offset is unknown.\r
- /// </value>\r
- public const int OFFSET_UNKNOWN = -1;\r
- \r
- /// <value>\r
- /// Offset from the start of the IL code for the method\r
- /// being executed.\r
- /// </value>\r
- private int ilOffset = OFFSET_UNKNOWN;\r
- \r
- /// <value>\r
- /// Offset from the start of the native code for the method\r
- /// being executed.\r
- /// </value>\r
- private int nativeOffset = OFFSET_UNKNOWN;\r
-\r
- /// <value>\r
- /// Method associated with this stack frame.\r
- /// </value>\r
- private MethodBase methodBase;\r
- \r
- /// <value>\r
- /// File name.\r
- /// </value>\r
- private string fileName;\r
- \r
- /// <value>\r
- /// Line number.\r
- /// </value>\r
- private int lineNumber;\r
- \r
- /// <value>\r
- /// Column number.\r
- /// </value>\r
- private int columnNumber;\r
-#if TARGET_JVM\r
- static bool get_frame_info (int skip, bool needFileInfo, out MethodBase method,\r
- out int iloffset, out int native_offset,\r
- out string file, out int line, out int column)\r
- {\r
- native_offset = 0;\r
- line = 0;\r
- column = 0;\r
- file = "";\r
- iloffset = 0;\r
- method = null;\r
- return false;\r
- }\r
-#else\r
- [MethodImplAttribute(MethodImplOptions.InternalCall)]\r
- extern static bool get_frame_info (int skip, bool needFileInfo, out MethodBase method,\r
- out int iloffset, out int native_offset,\r
- out string file, out int line, out int column);\r
-#endif\r
- /// <summary>\r
- /// Initializes a new StackFrame object corresponding to the\r
- /// active stack frame.\r
- /// </summary>\r
- public StackFrame() \r
- {\r
- get_frame_info (2, false, out methodBase, out ilOffset,\r
- out nativeOffset, out fileName, out lineNumber,\r
- out columnNumber); \r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new StackFrame object corresponding to the\r
- /// active stack frame.\r
- /// </summary>\r
- /// <param name="needFileInfo">\r
- /// TODO:\r
- /// </param>\r
- public StackFrame(bool needFileInfo) : this() {\r
- get_frame_info (2, needFileInfo, out methodBase, out ilOffset,\r
- out nativeOffset, out fileName, out lineNumber,\r
- out columnNumber); \r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new StackFrame object corresponding to the\r
- /// active stack frame.\r
- /// </summary>\r
- /// <param name="skipFrames">\r
- /// The number of frames up the stack to skip.\r
- /// </param>\r
- public StackFrame(int skipFrames) {\r
- get_frame_info (skipFrames + 2, false, out methodBase, out ilOffset,\r
- out nativeOffset, out fileName, out lineNumber,\r
- out columnNumber); \r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new StackFrame object corresponding to the\r
- /// active stack frame.\r
- /// </summary>\r
- /// <param name="skipFrames">\r
- /// The number of frames up the stack to skip.\r
- /// </param>\r
- /// <param name="needFileInfo">\r
- /// TODO:\r
- /// </param>\r
- public StackFrame(int skipFrames, bool needFileInfo) {\r
- get_frame_info (skipFrames + 2, needFileInfo, out methodBase, out ilOffset,\r
- out nativeOffset, out fileName, out lineNumber,\r
- out columnNumber);\r
- }\r
- \r
- /// <summary>\r
- /// Constructs a fake stack frame that just contains the\r
- /// given file name and line number. Use this constructor\r
- /// when you do not want to use the debugger's line mapping\r
- /// logic.\r
- /// </summary>\r
- /// <param name="fileName">\r
- /// The given file name.\r
- /// </param>\r
- /// <param name="lineNumber">\r
- /// The line number in the specified file.\r
- /// </param>\r
- // LAMESPEC: According to the MSDN docs, this creates a\r
- // fake stack frame. But MS fills out the frame info as well\r
- public StackFrame(string fileName, int lineNumber) {\r
- get_frame_info (2, false, out methodBase, out ilOffset,\r
- out nativeOffset, out fileName, out lineNumber,\r
- out columnNumber);\r
- this.fileName = fileName;\r
- this.lineNumber = lineNumber;\r
- this.columnNumber = 0;\r
- }\r
- \r
- /// <summary>\r
- /// Constructs a fake stack frame that just contains the\r
- /// given file name and line number. Use this constructor\r
- /// when you do not want to use the debugger's line mapping\r
- /// logic.\r
- /// </summary>\r
- /// <param name="fileName">\r
- /// The given file name.\r
- /// </param>\r
- /// <param name="lineNumber">\r
- /// The line number in the specified file.\r
- /// </param>\r
- /// <param name="colNumber">\r
- /// The column number in the specified file.\r
- /// </param>\r
- // LAMESPEC: According to the MSDN docs, this creates a\r
- // fake stack frame. But MS fills out the frame info as well\r
- public StackFrame(string fileName,\r
- int lineNumber,\r
- int colNumber) {\r
- get_frame_info (2, false, out methodBase, out ilOffset,\r
- out nativeOffset, out fileName, out lineNumber,\r
- out columnNumber);\r
- this.fileName = fileName;\r
- this.lineNumber = lineNumber;\r
- this.columnNumber = colNumber;\r
- }\r
- \r
- \r
- /// <summary>\r
- /// Gets the line number in the file containing the code\r
- /// being executed. This information is typically extracted\r
- /// from the debugging symbols for the executable.\r
- /// </summary>\r
- /// <returns>\r
- /// The file line number or zero if it cannot be determined.\r
- /// </returns>\r
- public virtual int GetFileLineNumber()\r
- {\r
- return lineNumber;\r
- }\r
- \r
- /// <summary>\r
- /// Gets the column number in the file containing the code\r
- /// being executed. This information is typically extracted\r
- /// from the debugging symbols for the executable.\r
- /// </summary>\r
- /// <returns>\r
- /// The file column number or zero if it cannot be determined.\r
- /// </returns>\r
- public virtual int GetFileColumnNumber()\r
- {\r
- return columnNumber;\r
- }\r
- \r
- /// <summary>\r
- /// Gets the file name containing the code being executed.\r
- /// This information is typically extracted from the\r
- /// debugging symbols for the executable.\r
- /// </summary>\r
- /// <returns>\r
- /// The file name or null if it cannot be determined.\r
- /// </returns> \r
- public virtual string GetFileName()\r
- {\r
- return fileName;\r
- }\r
- \r
- /// <summary>\r
- /// Gets the offset from the start of the IL code for the\r
- /// method being executed. This offset may be approximate\r
- /// depending on whether the JIT compiler is generating\r
- /// debugging code or not.\r
- /// </summary>\r
- /// <returns>\r
- /// The offset from the start of the IL code for the method\r
- /// being executed.\r
- /// </returns>\r
- public virtual int GetILOffset()\r
- {\r
- return ilOffset;\r
- }\r
- \r
- /// <summary>\r
- /// Gets the method in which the frame is executing.\r
- /// </summary>\r
- /// <returns>\r
- /// The method the frame is executing in.\r
- /// </returns>\r
- public virtual MethodBase GetMethod()\r
- {\r
- return methodBase;\r
- }\r
- \r
- /// <summary>\r
- /// Gets the offset from the start of the native\r
- /// (JIT-compiled) code for the method being executed.\r
- /// </summary>\r
- /// <returns>\r
- /// The offset from the start of the native (JIT-compiled)\r
- /// code or the method being executed.\r
- /// </returns>\r
- public virtual int GetNativeOffset()\r
- {\r
- return nativeOffset; \r
- }\r
- \r
- /// <summary>\r
- /// Builds a readable representation of the stack frame.\r
- /// </summary>\r
- /// <returns>\r
- /// A readable representation of the stack frame.\r
- /// </returns>\r
- public override string ToString() {\r
- string methodNameString =\r
- (GetMethod() == null)\r
- ? "<unknown method>"\r
- : GetMethod().Name;\r
- string offsetString =\r
- (GetILOffset() == OFFSET_UNKNOWN)\r
- ? "<unknown offset>"\r
- : "offset " + GetILOffset();\r
- string fileNameString =\r
- (GetFileName() == null)\r
- ? "<filename unknown>" : GetFileName();\r
- return methodNameString + " at " + offsetString\r
- + " in file:line:column " + fileNameString\r
- + ":" + GetFileLineNumber()\r
- + ":" + GetFileColumnNumber();\r
- }\r
- \r
- public override bool Equals(Object obj) {\r
- if ((obj == null) || (!(obj is StackFrame))) {\r
- return false;\r
- }\r
- \r
- StackFrame rhs = (StackFrame) obj;\r
- \r
- if (!ObjectsEqual(GetMethod(), rhs.GetMethod())) {\r
- return false;\r
- }\r
- \r
- if (!ObjectsEqual(GetFileName(), rhs.GetFileName())) {\r
- return false;\r
- }\r
- \r
- if (GetFileLineNumber() != rhs.GetFileLineNumber()) {\r
- return false;\r
- }\r
- \r
- if (GetFileColumnNumber() != rhs.GetFileColumnNumber()) {\r
- return false;\r
- }\r
- \r
- if (GetILOffset() != rhs.GetILOffset()) {\r
- return false;\r
- }\r
- \r
- if (GetNativeOffset() != rhs.GetNativeOffset()) {\r
- return false;\r
- }\r
- \r
- return true;\r
- \r
- }\r
- \r
- public override int GetHashCode() {\r
- return GetFileLineNumber();\r
- }\r
- \r
- /// <summary>\r
- /// Checks whether two objects are equal.\r
- /// The objects are assumed equal if and only if either\r
- /// both of the references are <code>null</code> or they\r
- /// equal via <code>Equals</code> method.\r
- /// </summary>\r
- /// <param name="obj1">\r
- /// First object.\r
- /// </param>\r
- /// <param name="obj2">\r
- /// Second object.\r
- /// </param>\r
- /// <returns>\r
- /// <code>true</code> if the two objects are equal,\r
- /// </code>false</code> otherwise.\r
- /// </returns>\r
- private static bool ObjectsEqual(Object obj1, Object obj2) {\r
- if (obj1 == null) {\r
- return (obj2 == null);\r
- } else {\r
- return obj1.Equals(obj2);\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-//\r
-// System.Diagnostics.StackTrace.cs\r
-//\r
-// Author:\r
-// Alexander Klyubin (klyubin@aqris.com)\r
-// Dietmar Maurer (dietmar@ximian.com)\r
-//\r
-// (C) 2001\r
-//\r
-\r
-using System;\r
-using System.Reflection;\r
-using System.Threading;\r
-using System.Runtime.CompilerServices;\r
-using System.Collections;\r
-\r
-namespace System.Diagnostics {\r
- /// <summary>\r
- /// Stack trace.\r
- /// TODO: more information.\r
- /// </summary>\r
- [Serializable]\r
- public class StackTrace {\r
- /// <value>\r
- /// Uses a constant to define the number of methods that are\r
- /// to be omitted from the stack trace.\r
- /// </value>\r
- public const int METHODS_TO_SKIP = 0;\r
- \r
- /// <value>\r
- /// Frames. First frame is the last stack frame pushed.\r
- /// </value>\r
- private StackFrame[] frames;\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class.\r
- /// </summary>\r
- [MonoTODO]\r
- public StackTrace() {\r
- init_frames (METHODS_TO_SKIP, false);\r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class.\r
- /// </summary>\r
- /// <param name="needFileInfo">\r
- /// TODO:\r
- /// </param>\r
- public StackTrace(bool needFileInfo) {\r
- init_frames (METHODS_TO_SKIP, needFileInfo);\r
- }\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class\r
- /// from the current location, in a caller's frame.\r
- /// </summary>\r
- /// <param name="skipFrames">\r
- /// The number of frames up the stack to start the trace\r
- /// from.\r
- /// </param>\r
- public StackTrace(int skipFrames) {\r
- init_frames (skipFrames, false);\r
- }\r
-\r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class\r
- /// from the current location, in a caller's frame.\r
- /// </summary>\r
- /// <param name="skipFrames">\r
- /// The number of frames up the stack to start the trace\r
- /// from.\r
- /// </param>\r
- /// <param name="needFileInfo">\r
- /// TODO:\r
- /// </param>\r
- public StackTrace(int skipFrames, bool needFileInfo) {\r
- init_frames (skipFrames, needFileInfo);\r
- }\r
-\r
- void init_frames (int skipFrames, bool needFileInfo)\r
- {\r
- StackFrame sf;\r
- ArrayList al = new ArrayList ();\r
-\r
- skipFrames += 2;\r
- \r
- while ((sf = new StackFrame (skipFrames, needFileInfo)) != null &&\r
- sf.GetMethod () != null) {\r
- \r
- al.Add (sf);\r
- skipFrames++;\r
- };\r
-\r
- frames = (StackFrame [])al.ToArray (typeof (StackFrame));\r
- }\r
-#if TARGET_JVM\r
- static StackFrame [] get_trace (Exception e, int skipFrames, bool needFileInfo)\r
- {\r
- return null;\r
- }\r
-#else\r
- [MethodImplAttribute(MethodImplOptions.InternalCall)]\r
- extern static StackFrame [] get_trace (Exception e, int skipFrames, bool needFileInfo);\r
-#endif\r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class.\r
- /// </summary>\r
- /// <param name="e">\r
- /// TODO:\r
- /// </param>\r
- public StackTrace(Exception e) \r
- {\r
- frames = get_trace (e, METHODS_TO_SKIP, false);\r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class,\r
- /// using the provided exception object. The resulting stack\r
- /// trace describes the stack at the time of the exception.\r
- /// </summary>\r
- /// <param name="e">\r
- /// TODO:\r
- /// </param>\r
- /// <param name="needFileInfo">\r
- /// TODO:\r
- /// </param>\r
- public StackTrace(Exception e, bool needFileInfo) {\r
- frames = get_trace (e, METHODS_TO_SKIP, needFileInfo);\r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class,\r
- /// using the provided exception object. The resulting stack\r
- /// trace describes the stack at the time of the exception.\r
- /// </summary>\r
- /// <param name="e">\r
- /// Exception.\r
- /// </param>\r
- /// <param name="skipFrames">\r
- /// The number of frames up the stack to start the trace\r
- /// from.\r
- /// </param>\r
- public StackTrace(Exception e, int skipFrames) {\r
- frames = get_trace (e, skipFrames, false);\r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class,\r
- /// using the provided exception object. The resulting stack\r
- /// trace describes the stack at the time of the exception.\r
- /// </summary>\r
- /// <param name="e">\r
- /// Exception.\r
- /// </param>\r
- /// <param name="skipFrames">\r
- /// The number of frames up the stack to start the trace\r
- /// from.\r
- /// </param>\r
- /// <param name="needFileInfo">\r
- /// TODO:\r
- /// </param>\r
- public StackTrace(Exception e, int skipFrames, bool needFileInfo) {\r
- frames = get_trace (e, skipFrames, needFileInfo);\r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class\r
- /// containing a single frame.\r
- /// </summary>\r
- /// <param name="frame">\r
- /// The frame that the StackTrace object should contain.\r
- /// </param>\r
- public StackTrace(StackFrame frame) {\r
- this.frames = new StackFrame[1];\r
- this.frames[0] = frame;\r
- }\r
- \r
- /// <summary>\r
- /// Initializes a new instance of the StackTrace class.\r
- /// </summary>\r
- /// <param name="targetThread">\r
- /// TODO:\r
- /// </param>\r
- /// <param name="needFileInfo">\r
- /// TODO:\r
- /// </param>\r
- [MonoTODO]\r
- public StackTrace(Thread targetThread, bool needFileInfo) {\r
- throw new NotImplementedException();\r
- }\r
- \r
- /// <summary>\r
- /// Holds the number of frames in the stack trace.\r
- /// </summary>\r
- public virtual int FrameCount {\r
- get {\r
- return (frames == null) ? 0 : frames.Length;\r
- }\r
- } \r
- \r
- /// <summary>\r
- /// Gets the specified stack frame.\r
- /// </summary>\r
- /// <param name="index">\r
- /// The index of the stack frame requested.\r
- /// </param>\r
- /// <returns>\r
- /// The specified stack frame. Returns <code>null</code> if\r
- /// frame with specified index does not exist in this stack\r
- /// trace.\r
- /// </returns>\r
- /// <remarks>\r
- /// Stack frames are numbered starting at zero, which is the\r
- /// last stack frame pushed.\r
- /// </remarks>\r
- public virtual StackFrame GetFrame(int index) {\r
- if ((index < 0) || (index >= FrameCount)) {\r
- return null;\r
- }\r
- \r
- return frames[index];\r
- } \r
- \r
- /// <summary>\r
- /// Builds a readable representation of the stack trace.\r
- /// </summary>\r
- /// <returns>\r
- /// A readable representation of the stack trace.\r
- /// </returns>\r
- public override string ToString() {\r
- string result = "";\r
- for (int i = 0; i < FrameCount; i++) {\r
- StackFrame frame = GetFrame(i);\r
- result += "\n\tat " + FrameToString(frame);\r
- }\r
- \r
- return result;\r
- }\r
- \r
- public override bool Equals(Object obj) {\r
- if ((obj == null) || (!(obj is StackTrace))) {\r
- return false;\r
- }\r
- \r
- StackTrace rhs = (StackTrace) obj;\r
- \r
- if (FrameCount != rhs.FrameCount) {\r
- return false;\r
- }\r
- \r
- for (int i = 0; i < FrameCount; i++) {\r
- if (!GetFrame(i).Equals(rhs.GetFrame(i))) {\r
- return false;\r
- }\r
- }\r
- \r
- return true;\r
- }\r
- \r
- public override int GetHashCode() {\r
- return FrameCount;\r
- }\r
- \r
- /// <summary>\r
- /// Converts single stack frame to string to be used in\r
- /// ToString method.\r
- /// </summary>\r
- /// <param name="frame">\r
- /// Frame to convert.\r
- /// </param>\r
- /// <returns>\r
- /// A readable representation of stack frame for using\r
- /// ToString.\r
- /// </returns>\r
- private static String FrameToString(StackFrame frame) {\r
- MethodBase method = frame.GetMethod();\r
- if (method != null) {\r
- // Method information available\r
- return method.DeclaringType.FullName\r
- + "." + method.Name + "()";\r
- } else {\r
- // Method information not available\r
- return "<unknown method>";\r
- }\r
- }\r
- }\r
-}\r
protected Switch(string displayName, string description)
{
- this.name = displayName;
- this.description = description;
+ this.name = displayName ?? string.Empty;
+ this.description = description ?? string.Empty;
}
protected Switch(string displayName, string description, string defaultSwitchValue)
+++ /dev/null
-///\r
-/// Stub class \r
-///\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Text;\r
-using System.Threading;\r
-\r
-namespace System.Diagnostics\r
-{\r
- [MonoTODO]\r
- public class TraceEventCache\r
- {\r
- [MonoTODO]\r
- public string Callstack\r
- {\r
- get { throw new NotImplementedException(); }\r
- }\r
-\r
- [MonoTODO]\r
- public DateTime DateTime\r
- {\r
- get { throw new NotImplementedException(); }\r
- }\r
-\r
- [MonoTODO]\r
- public Stack LogicalOperationStack\r
- {\r
- get { throw new NotImplementedException(); }\r
- }\r
-\r
- [MonoTODO]\r
- public int ProcessId\r
- {\r
- get { throw new NotImplementedException(); }\r
- }\r
-\r
- [MonoTODO]\r
- public string ThreadId\r
- {\r
- get { throw new NotImplementedException(); }\r
- }\r
-\r
- [MonoTODO]\r
- public long Timestamp\r
- {\r
- get { throw new NotImplementedException(); }\r
- }\r
- }\r
-}\r
-\r
public abstract class TraceListener : MarshalByRefObject, IDisposable {
-#if TARGET_JVM
- readonly LocalDataStoreSlot _indentLevelStore = System.Threading.Thread.AllocateDataSlot ();
- readonly LocalDataStoreSlot _indentSizeStore = System.Threading.Thread.AllocateDataSlot ();
- readonly LocalDataStoreSlot _attributesStore = System.Threading.Thread.AllocateDataSlot ();
- readonly LocalDataStoreSlot _filterStore = System.Threading.Thread.AllocateDataSlot ();
- readonly LocalDataStoreSlot _optionsStore = System.Threading.Thread.AllocateDataSlot ();
-
- private int indentLevel {
- get {
- object o = System.Threading.Thread.GetData (_indentLevelStore);
- if (o == null)
- return 0;
- return (int) o;
- }
- set { System.Threading.Thread.SetData (_indentLevelStore, value); }
- }
-
- private int indentSize {
- get {
- object o = System.Threading.Thread.GetData (_indentSizeStore);
- if (o == null)
- return 4;
- return (int) o;
- }
- set { System.Threading.Thread.SetData (_indentSizeStore, value); }
- }
-
- private StringDictionary attributes {
- get { return (StringDictionary) System.Threading.Thread.GetData (_attributesStore); }
- set { System.Threading.Thread.SetData (_attributesStore, value); }
- }
-
-#if !MOBILE
- private TraceFilter filter {
- get { return (TraceFilter) System.Threading.Thread.GetData (_filterStore); }
- set { System.Threading.Thread.SetData (_filterStore, value); }
- }
-#endif
-
- private TraceOptions options {
- get {
- object o = System.Threading.Thread.GetData (_optionsStore);
- if (o == null)
- return TraceOptions.None;
- return (TraceOptions) o;
- }
- set { System.Threading.Thread.SetData (_optionsStore, value); }
- }
-#else
[ThreadStatic]
private int indentLevel = 0;
#endif
[ThreadStatic]
private TraceOptions options;
-#endif
private string name;
private bool needIndent = true;
+++ /dev/null
-//
-// DeflateStream.cs
-//
-// Authors:
-// Konstantin Triger <kostat@mainsoft.com>
-//
-// (c) 2008 Mainsoft corp. <http://www.mainsoft.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Runtime.Remoting.Messaging;
-using java.io;
-using java.util.zip;
-using vmw.common;
-
-namespace System.IO.Compression
-{
- public class DeflateStream : Stream
- {
- readonly Stream _baseStream;
- readonly InflaterInputStream _reader;
- readonly DeflaterOutputStream _writer;
-
- readonly bool _leaveOpen;
- bool _open;
-
- delegate int ReadMethod (byte [] array, int offset, int count);
- delegate void WriteMethod (byte [] array, int offset, int count);
-
- internal DeflateStream (Stream compressedStream, CompressionMode mode, bool leaveOpen, bool gzip) {
- if (compressedStream == null)
- throw new ArgumentNullException ("compressedStream");
-
- switch (mode) {
- case CompressionMode.Compress:
- if (!compressedStream.CanWrite)
- throw new ArgumentException ("The base stream is not writeable.");
- OutputStream outStream = new OutputStreamImpl(compressedStream);
- _writer = gzip ? new GZIPOutputStream (outStream) : new DeflaterOutputStream (outStream, new Deflater (Deflater.DEFAULT_COMPRESSION, true));
- break;
- case CompressionMode.Decompress:
- if (!compressedStream.CanRead)
- throw new ArgumentException ("The base stream is not readable.");
- InputStream inStream = new InputStreamImpl (compressedStream);
- _reader = gzip ? new GZIPInputStream (inStream) : new InflaterInputStream (inStream, new Inflater (true));
- break;
- default:
- throw new ArgumentException ("mode");
- }
-
- _baseStream = compressedStream;
- _leaveOpen = leaveOpen;
- _open = true;
- }
-
- public DeflateStream (Stream compressedStream, CompressionMode mode)
- :
- this (compressedStream, mode, false, false) { }
-
- public DeflateStream (Stream compressedStream, CompressionMode mode, bool leaveOpen)
- :
- this (compressedStream, mode, leaveOpen, false) { }
-
- protected override void Dispose (bool disposing) {
- if (!_open) {
- base.Dispose (disposing);
- return;
- }
-
- try {
- FlushInternal (true);
- base.Dispose (disposing);
- }
- finally {
- _open = false;
- if (!_leaveOpen)
- _baseStream.Close ();
- }
- }
-
- private int ReadInternal (byte [] array, int offset, int count) {
- int r = _reader.read (TypeUtils.ToSByteArray (array), offset, count);
- return r < 0 ? 0 : r;
- }
-
- public override int Read (byte [] dest, int dest_offset, int count) {
- if (!_open)
- throw new ObjectDisposedException ("DeflateStream");
- if (dest == null)
- throw new ArgumentNullException ("Destination array is null.");
- if (!CanRead)
- throw new InvalidOperationException ("Stream does not support reading.");
- int len = dest.Length;
- if (dest_offset < 0 || count < 0)
- throw new ArgumentException ("Dest or count is negative.");
- if (dest_offset > len)
- throw new ArgumentException ("destination offset is beyond array size");
- if ((dest_offset + count) > len)
- throw new ArgumentException ("Reading would overrun buffer");
-
- return ReadInternal (dest, dest_offset, count);
- }
-
- private void WriteInternal (byte [] array, int offset, int count) {
- _writer.write (TypeUtils.ToSByteArray (array), offset, count);
- }
-
- public override void Write (byte [] src, int src_offset, int count) {
- if (!_open)
- throw new ObjectDisposedException ("DeflateStream");
-
- if (src == null)
- throw new ArgumentNullException ("src");
-
- if (src_offset < 0)
- throw new ArgumentOutOfRangeException ("src_offset");
-
- if (count < 0)
- throw new ArgumentOutOfRangeException ("count");
-
- if (!CanWrite)
- throw new NotSupportedException ("Stream does not support writing");
-
- WriteInternal (src, src_offset, count);
- }
-
- private void FlushInternal (bool finish) {
- if (!_open)
- throw new ObjectDisposedException ("DeflateStream");
-
- if (_writer != null) {
- _writer.flush ();
-
- if (finish)
- _writer.finish ();
- }
- }
-
- public override void Flush () {
- FlushInternal (false);
- }
-
- public override long Seek (long offset, SeekOrigin origin) {
- throw new System.NotSupportedException ();
- }
-
- public override void SetLength (long value) {
- throw new System.NotSupportedException ();
- }
-
- public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state) {
- if (!_open)
- throw new ObjectDisposedException ("DeflateStream");
-
- if (!CanRead)
- throw new NotSupportedException ("This stream does not support reading");
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (count < 0)
- throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
-
- if (offset < 0)
- throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
-
- if (count + offset > buffer.Length)
- throw new ArgumentException ("Buffer too small. count/offset wrong.");
-
- ReadMethod r = new ReadMethod (ReadInternal);
- return r.BeginInvoke (buffer, offset, count, cback, state);
- }
-
- public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state) {
- if (!_open)
- throw new ObjectDisposedException ("DeflateStream");
-
- if (!CanWrite)
- throw new InvalidOperationException ("This stream does not support writing");
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (count < 0)
- throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
-
- if (offset < 0)
- throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
-
- if (count + offset > buffer.Length)
- throw new ArgumentException ("Buffer too small. count/offset wrong.");
-
- WriteMethod w = new WriteMethod (WriteInternal);
- return w.BeginInvoke (buffer, offset, count, cback, state);
- }
-
- public override int EndRead (IAsyncResult async_result) {
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
-
- AsyncResult ares = async_result as AsyncResult;
- if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
-
- ReadMethod r = ares.AsyncDelegate as ReadMethod;
- if (r == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
-
- return r.EndInvoke (async_result);
- }
-
- public override void EndWrite (IAsyncResult async_result) {
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
-
- AsyncResult ares = async_result as AsyncResult;
- if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
-
- WriteMethod w = ares.AsyncDelegate as WriteMethod;
- if (w == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
-
- w.EndInvoke (async_result);
- }
-
- public Stream BaseStream {
- get {
- return _baseStream;
- }
- }
- public override bool CanRead {
- get {
- return _open && _reader != null;
- }
- }
- public override bool CanSeek {
- get {
- return false;
- }
- }
- public override bool CanWrite {
- get {
- return _open && _writer != null;
- }
- }
- public override long Length {
- get {
- throw new NotSupportedException ();
- }
- }
- public override long Position {
- get {
- throw new NotSupportedException ();
- }
- set {
- throw new NotSupportedException ();
- }
- }
-
- #region InputStreamImpl
-
- sealed class InputStreamImpl : InputStream
- {
- readonly Stream _stream;
-
- public InputStreamImpl (Stream stream) {
- _stream = stream;
- }
-
- public override void close () {
- BaseStream.Close ();
- }
-
- public override int read () {
- return BaseStream.ReadByte ();
- }
-
- public override int read (sbyte [] b, int off, int len) {
- int r = BaseStream.Read ((byte []) TypeUtils.ToByteArray (b), off, len);
- return r == 0 ? -1 : r;
- }
-
- public override long skip (long n) {
- return BaseStream.Seek (n, SeekOrigin.Current);
- }
-
- public override bool Equals (object obj) {
- return (obj is InputStreamImpl) &&
- BaseStream.Equals (((InputStreamImpl) obj).BaseStream);
- }
-
- public override int GetHashCode () {
- return _stream.GetHashCode ();
- }
-
- public Stream BaseStream {
- get { return _stream; }
- }
- }
-
- #endregion
-
- #region OutputStreamImpl
-
- sealed class OutputStreamImpl : OutputStream
- {
- readonly Stream _stream;
-
- public OutputStreamImpl (Stream stream) {
- _stream = stream;
- }
-
- public override void close () {
- BaseStream.Close ();
- }
-
- public override void flush () {
- BaseStream.Flush ();
- }
-
- public override void write (int b) {
- BaseStream.WriteByte ((byte) (b & 0xFF));
- }
-
- public override void write (sbyte [] b, int off, int len) {
- BaseStream.Write ((byte []) TypeUtils.ToByteArray (b), off, len);
- }
-
- public override bool Equals (object obj) {
- return (obj is OutputStreamImpl) &&
- BaseStream.Equals (((OutputStreamImpl) obj).BaseStream);
- }
-
- public override int GetHashCode () {
- return _stream.GetHashCode ();
- }
-
- public Stream BaseStream {
- get { return _stream; }
- }
- }
-
- #endregion
- }
-}
}
#if NET_4_5
- [MonoTODO]
public DeflateStream (Stream stream, CompressionLevel compressionLevel)
- : this (stream, CompressionMode.Compress)
+ : this (stream, compressionLevel, false, false)
{
- throw new NotImplementedException ();
}
- [MonoTODO]
public DeflateStream (Stream stream, CompressionLevel compressionLevel, bool leaveOpen)
- : this (stream, CompressionMode.Compress, leaveOpen)
+ : this (stream, compressionLevel, leaveOpen, false)
{
- throw new NotImplementedException ();
}
+
+ internal DeflateStream (Stream stream, CompressionLevel compressionLevel, bool leaveOpen, bool gzip)
+ : this (stream, CompressionMode.Compress, leaveOpen, gzip)
+ {
+ }
#endif
protected override void Dispose (bool disposing)
int UnmanagedRead (IntPtr buffer, int length)
{
- int total = 0;
- int n = 1;
- while (length > 0 && n > 0) {
- if (io_buffer == null)
- io_buffer = new byte [BufferSize];
+ if (io_buffer == null)
+ io_buffer = new byte [BufferSize];
- int count = Math.Min (length, io_buffer.Length);
- n = base_stream.Read (io_buffer, 0, count);
- if (n > 0) {
- Marshal.Copy (io_buffer, 0, buffer, n);
- unsafe {
- buffer = new IntPtr ((byte *) buffer.ToPointer () + n);
- }
- length -= n;
- total += n;
- }
- }
- return total;
+ int count = Math.Min (length, io_buffer.Length);
+ int n = base_stream.Read (io_buffer, 0, count);
+ if (n > 0)
+ Marshal.Copy (io_buffer, 0, buffer, n);
+
+ return n;
}
#if MONOTOUCH
#if NET_4_5
- [MonoTODO]
public GZipStream (Stream stream, CompressionLevel compressionLevel)
- : this (stream, CompressionMode.Compress)
+ : this (stream, compressionLevel, false)
{
- throw new NotImplementedException ();
}
- [MonoTODO]
public GZipStream (Stream stream, CompressionLevel compressionLevel, bool leaveOpen)
- : this (stream, CompressionMode.Compress, leaveOpen)
{
- throw new NotImplementedException ();
+ this.deflateStream = new DeflateStream (stream, compressionLevel, leaveOpen, true);
}
#endif
if (is_open)
throw new InvalidOperationException ("Port is already open");
-#if !TARGET_JVM
if (IsWindows) // Use windows kernel32 backend
stream = new WinSerialStream (port_name, baud_rate, data_bits, parity, stop_bits, dtr_enable,
rts_enable, handshake, read_timeout, write_timeout, readBufferSize, writeBufferSize);
else // Use standard unix backend
-#endif
stream = new SerialPortStream (port_name, baud_rate, data_bits, parity, stop_bits, dtr_enable,
rts_enable, handshake, read_timeout, write_timeout, readBufferSize, writeBufferSize);
~SerialPortStream ()
{
- Dispose (false);
+ try {
+ Dispose (false);
+ } catch (IOException) {
+ }
}
void CheckDisposed ()
throw new NotSupportedException();
}
-#if !TARGET_JVM
[DllImport("kernel32", SetLastError = true)]
static extern unsafe bool ReadFile (int handle, byte* buffer, int bytes_to_read,
out int bytes_read, IntPtr overlapped);
[DllImport("kernel32", SetLastError = true)]
static extern unsafe bool GetOverlappedResult (int handle, IntPtr overlapped,
ref int bytes_transfered, bool wait);
-#endif
public override int Read ([In, Out] byte [] buffer, int offset, int count)
{
return bytes_read;
}
-#if !TARGET_JVM
[DllImport("kernel32", SetLastError = true)]
static extern unsafe bool WriteFile (int handle, byte* buffer, int bytes_to_write,
out int bytes_written, IntPtr overlapped);
-#endif
public override void Write (byte [] buffer, int offset, int count)
{
sfre.Add (new SmtpFailedRecipientException (status.StatusCode, message.Bcc [i].Address));
}
-#if TARGET_JVM // List<T>.ToArray () is not supported
- if (sfre.Count > 0) {
- SmtpFailedRecipientException[] xs = new SmtpFailedRecipientException[sfre.Count];
- sfre.CopyTo (xs);
- throw new SmtpFailedRecipientsException ("failed recipients", xs);
- }
-#else
if (sfre.Count >0)
throw new SmtpFailedRecipientsException ("failed recipients", sfre.ToArray ());
-#endif
// DATA
status = SendCommand ("DATA");
case TransferEncoding.Base64:
byte [] content = new byte [av.ContentStream.Length];
av.ContentStream.Read (content, 0, content.Length);
-#if TARGET_JVM
- SendData (Convert.ToBase64String (content));
-#else
SendData (Convert.ToBase64String (content, Base64FormattingOptions.InsertLineBreaks));
-#endif
break;
case TransferEncoding.QuotedPrintable:
byte [] bytes = new byte [av.ContentStream.Length];
case TransferEncoding.Base64:
byte [] content = new byte [lr.ContentStream.Length];
lr.ContentStream.Read (content, 0, content.Length);
-#if TARGET_JVM
- SendData (Convert.ToBase64String (content));
-#else
SendData (Convert.ToBase64String (content, Base64FormattingOptions.InsertLineBreaks));
-#endif
break;
case TransferEncoding.QuotedPrintable:
byte [] bytes = new byte [lr.ContentStream.Length];
att.ContentStream.Read (content, 0, content.Length);
switch (att.TransferEncoding) {
case TransferEncoding.Base64:
-#if TARGET_JVM
- SendData (Convert.ToBase64String (content));
-#else
SendData (Convert.ToBase64String (content, Base64FormattingOptions.InsertLineBreaks));
-#endif
break;
case TransferEncoding.QuotedPrintable:
SendData (ToQuotedPrintable (content));
throw new SmtpException (SmtpStatusCode.GeneralFailure, "Server does not support secure connections.");
}
-#if TARGET_JVM
- ((NetworkStream) stream).ChangeToSSLSocket ();
-#elif SECURITY_DEP
+#if SECURITY_DEP
SslStream sslStream = new SslStream (stream, false, callback, null);
CheckCancellation ();
sslStream.AuthenticateAsClient (Host, this.ClientCertificates, SslProtocols.Default, false);
base.GetObjectData (info, context);
info.AddValue ("Status", statusCode, typeof (int));
}
-#if !TARGET_JVM //remove private implementation
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
GetObjectData (info, context);
}
-#endif
}
}
base.GetObjectData (serializationInfo, streamingContext);
serializationInfo.AddValue ("failedRecipient", failedRecipient);
}
-#if !TARGET_JVM //remove private implementation
void ISerializable.GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
GetObjectData (serializationInfo, streamingContext);
}
-#endif
#endregion // Methods
}
info.AddValue ("innerExceptions", innerExceptions);
}
-#if !TARGET_JVM //remove private implementation
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
GetObjectData (info, context);
}
-#endif
#endregion // Methods
}
public ushort sll_hatype;
public byte sll_pkttype;
public byte sll_halen;
-
+#if MONODROID
+ // In MonoDroid the structure has larger space allocated for the address part since there exist
+ // addresses (Infiniband, ipv6 tunnels) which exceed the standard 8 bytes. In fact, glibc's
+ // getifaddrs implementation also uses the bigger size, but for compatibility with other libc
+ // implementations we use the standard address size
+ [MarshalAs (UnmanagedType.ByValArray, SizeConst=24)]
+#else
[MarshalAs (UnmanagedType.ByValArray, SizeConst=8)]
+#endif
public byte[] sll_addr;
}
PRONET = 4,
ATM = 19,
SLIP = 256,
+ CSLIP = 257,
+ SLIP6 = 258,
+ CSLIP6 = 259,
PPP = 512,
LOOPBACK = 772,
FDDI = 774,
TUNNEL = 768,
- TUNNEL6 = 769
+ TUNNEL6 = 769,
+ SIT = 776, // IPv6-in-IPv4 tunnel
+ IPDDP = 777, // IP over DDP tunnel
+ IPGRE = 778, // GRE over IP
+ IP6GRE = 823 // GRE over IPv6
}
}
get { return iface_path; }
}
+ static int GetInterfaceAddresses (out IntPtr ifap)
+ {
+#if MONODROID
+ return AndroidPlatform.GetInterfaceAddresses (out ifap);
+#else
+ return getifaddrs (out ifap);
+#endif
+ }
+
+ static void FreeInterfaceAddresses (IntPtr ifap)
+ {
+#if MONODROID
+ AndroidPlatform.FreeInterfaceAddresses (ifap);
+#else
+ freeifaddrs (ifap);
+#endif
+ }
+
public static NetworkInterface [] ImplGetAllNetworkInterfaces ()
{
var interfaces = new Dictionary <string, LinuxNetworkInterface> ();
IntPtr ifap;
- if (getifaddrs (out ifap) != 0)
+ if (GetInterfaceAddresses (out ifap) != 0)
throw new SystemException ("getifaddrs() failed");
try {
int index = -1;
byte[] macAddress = null;
NetworkInterfaceType type = NetworkInterfaceType.Unknown;
+ int nullNameCount = 0;
if (addr.ifa_addr != IntPtr.Zero) {
sockaddr_in sockaddr = (sockaddr_in) Marshal.PtrToStructure (addr.ifa_addr, typeof (sockaddr_in));
break;
case LinuxArpHardware.SLIP:
+ case LinuxArpHardware.CSLIP:
+ case LinuxArpHardware.SLIP6:
+ case LinuxArpHardware.CSLIP6:
type = NetworkInterfaceType.Slip;
break;
type = NetworkInterfaceType.Fddi;
break;
+ case LinuxArpHardware.SIT:
+ case LinuxArpHardware.IPDDP:
+ case LinuxArpHardware.IPGRE:
+ case LinuxArpHardware.IP6GRE:
case LinuxArpHardware.TUNNEL6:
- goto case LinuxArpHardware.TUNNEL;
-
case LinuxArpHardware.TUNNEL:
type = NetworkInterfaceType.Tunnel;
break;
LinuxNetworkInterface iface = null;
+ if (String.IsNullOrEmpty (name))
+ name = "\0" + (++nullNameCount).ToString ();
+
if (!interfaces.TryGetValue (name, out iface)) {
iface = new LinuxNetworkInterface (name);
interfaces.Add (name, iface);
next = addr.ifa_next;
}
} finally {
- freeifaddrs (ifap);
+ FreeInterfaceAddresses (ifap);
}
NetworkInterface [] result = new NetworkInterface [interfaces.Count];
+++ /dev/null
-/GHSocket.jvm.cs -crlf
-/GHSocketFactory.jvm.cs -crlf
-/GHStreamSocket.jvm.cs -crlf
-/GHStreamSocketSSL.jvm.cs -crlf
+++ /dev/null
-using System;\r
-using System.Net;\r
-\r
-namespace System.Net.Sockets\r
-{\r
- /// <summary>\r
- /// Summary description for GHSocket.\r
- /// </summary>\r
- internal interface GHSocket\r
- {\r
- int Available_internal(out int error);\r
-\r
- void Blocking_internal(bool block, out int error);\r
-\r
- EndPoint LocalEndPoint_internal(out int error);\r
-\r
- EndPoint RemoteEndPoint_internal(out int error);\r
-\r
- GHSocket Accept_internal(out int error);\r
-\r
- void Bind_internal(EndPoint sa, out int error);\r
-\r
- void Close_internal(out int error);\r
-\r
- void Connect_internal(EndPoint sa, out int error);\r
-\r
- void GetSocketOption_obj_internal(SocketOptionLevel level, SocketOptionName name, \r
- out object obj_val, out int error);\r
- \r
- void GetSocketOption_arr_internal(SocketOptionLevel level, SocketOptionName name, \r
- ref byte[] byte_val, out int error);\r
-\r
- int WSAIoctl (int ioctl_code, byte [] input, byte [] output, out int error);\r
-\r
- void Listen_internal(int backlog, out int error);\r
-\r
- bool Poll_internal (SelectMode mode, int timeout, Socket source, out int error);\r
-\r
- int Receive_internal(byte[] buffer, int offset, int count, SocketFlags flags,\r
- out int error);\r
-\r
- int RecvFrom_internal(byte[] buffer, int offset, int count, SocketFlags flags,\r
- ref SocketAddress sockaddr, out int error);\r
-\r
- int Send_internal(byte[] buf, int offset, int count, SocketFlags flags,\r
- out int error);\r
-\r
- int SendTo_internal(byte[] buffer, int offset, int count,\r
- SocketFlags flags, SocketAddress sa, out int error);\r
-\r
- void SetSocketOption_internal (SocketOptionLevel level,\r
- SocketOptionName name, object obj_val,\r
- byte [] byte_val, int int_val, out int error);\r
-\r
- void Shutdown_internal(SocketShutdown how, out int error);\r
-\r
- void RegisterSelector(java.nio.channels.Selector selector, int mode, Socket source, out int error);\r
-\r
- bool CheckConnectionFinished();\r
-\r
- GHSocket ChangeToSSL(EndPoint remote_end);\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Net;\r
-\r
-namespace System.Net.Sockets\r
-{\r
- /// <summary>\r
- /// Summary description for GHSocketFactory.\r
- /// </summary>\r
- public class GHSocketFactory\r
- {\r
- internal static GHSocket Socket_internal(AddressFamily family,\r
- SocketType type,\r
- ProtocolType proto,\r
- out int error)\r
- {\r
- if ( family == AddressFamily.InterNetwork &&\r
- //(family == AddressFamily.InterNetwork || family == AddressFamily.InterNetworkV6) &&\r
- (type == SocketType.Stream || type == SocketType.Unknown) &&\r
- (proto == ProtocolType.Tcp || proto == ProtocolType.Unknown || proto == ProtocolType.Unspecified) )\r
- {\r
- error = 0;\r
- return new GHStreamSocket();\r
- }\r
-\r
- error = 10044; //WSAESOCKTNOSUPPORT (Socket type not supported)\r
- return null;\r
- }\r
-\r
- internal static void Select_internal (ref Socket [] sockets, int microSeconds, out int error)\r
- {\r
- error = 0;\r
-\r
- java.nio.channels.Selector selector = java.nio.channels.Selector.open();\r
-\r
- int mode = 0;\r
- int count = sockets.Length;\r
- for (int i = 0; i < count; i++) \r
- {\r
- if (sockets [i] == null) \r
- { // separator\r
- mode++;\r
- continue;\r
- }\r
-\r
- GHSocket sock = sockets [i].GHHandle;\r
- if (sock == null)\r
- {\r
- throw new ArgumentNullException ("GHSocket handle is null");\r
- }\r
-\r
- sock.RegisterSelector(selector, mode, sockets [i], out error);\r
- if (error != 0)\r
- {\r
- error = 0;\r
- sockets = null;\r
- CloseSelector(selector);\r
- return;\r
- }\r
- }\r
- \r
- sockets = null;\r
-\r
- long timeOutMillis = 1;\r
- if (microSeconds < 0)\r
- {\r
- timeOutMillis = 0;\r
- } \r
- else if (microSeconds > 999)\r
- {\r
- timeOutMillis = (long)(microSeconds / 1000);\r
- }\r
-\r
- int readyCount = 0;\r
- try\r
- {\r
- readyCount = selector.select(timeOutMillis);\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Select_internal selector.select - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- if (readyCount > 0)\r
- {\r
- try\r
- {\r
- sockets = new Socket[readyCount+2];\r
- Socket[] writeList = new Socket[readyCount];\r
- Socket[] errorList = new Socket[readyCount];\r
-\r
- int readListCount = 0;\r
- int writeListCount = 0;\r
- int errorListCount = 0;\r
-\r
- java.util.Set readyKeys = selector.selectedKeys();\r
- java.util.Iterator it = readyKeys.iterator();\r
-\r
- while (it.hasNext()) \r
- {\r
- java.nio.channels.SelectionKey key = (java.nio.channels.SelectionKey)it.next();\r
- \r
- if (key.isAcceptable() || key.isReadable()) \r
- {\r
- sockets[readListCount] = (Socket)key.attachment();\r
- readListCount++;\r
- }\r
- if (key.isWritable()) \r
- {\r
- writeList[writeListCount] = (Socket)key.attachment();\r
- writeListCount++;\r
- }\r
- if (key.isConnectable()) \r
- {\r
- Socket source = (Socket)key.attachment();\r
- if (source.GHHandle.CheckConnectionFinished())\r
- {\r
- writeList[writeListCount] = source;\r
- writeListCount++;\r
- }\r
- else\r
- {\r
- errorList[errorListCount] = source;\r
- errorListCount++;\r
- }\r
- }\r
- }\r
-\r
- sockets[readListCount] = null;\r
- readListCount++;\r
- for (int i = 0; i < writeListCount; i++, readListCount++)\r
- {\r
- sockets[readListCount] = writeList[i];\r
- }\r
- sockets[readListCount] = null;\r
- readListCount++;\r
- for (int i = 0; i < errorListCount; i++, readListCount++)\r
- {\r
- sockets[readListCount] = errorList[i];\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Select_internal iterate selected keys - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- CloseSelector(selector);\r
- }\r
-\r
- internal static void CloseSelector (java.nio.channels.Selector selector)\r
- {\r
- java.util.Set keys = selector.keys();\r
- java.util.Iterator it = keys.iterator();\r
-\r
- try\r
- {\r
- selector.close();\r
- }\r
- catch (Exception e)\r
- {\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during CloseSelector selector.close - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- while (it.hasNext()) \r
- {\r
- java.nio.channels.SelectionKey key = (java.nio.channels.SelectionKey)it.next();\r
- Socket source = (Socket)key.attachment();\r
- key.cancel ();\r
- try\r
- {\r
- if (source.Blocking)\r
- {\r
- /*\r
- A channel must be placed into non-blocking mode before being registered \r
- with a selector, and may not be returned to blocking mode until it has been \r
- deregistered. So, I need set the channel back to the blocking mode, if it was\r
- in blocking mode before select operation\r
- */\r
- source.Blocking = true;\r
- }\r
- }\r
- catch (Exception be)\r
- {\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during CloseSelector source.Blocking - {0}: {1}\n{2}", be.GetType(), be.Message, be.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- try\r
- {\r
- selector.close();\r
- }\r
- catch (Exception e)\r
- {\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during CloseSelector selector.close - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-using java.nio.channels;\r
-using java.security;\r
-using javax.net.ssl;\r
-\r
-namespace System.Net.Sockets\r
-{\r
- /// <summary>\r
- /// Summary description for GHStreamSocket.\r
- /// </summary>\r
- internal class GHStreamSocket : GHSocket\r
- {\r
- java.net.ServerSocket jServerSocket;\r
- java.net.Socket jSocket;\r
- java.nio.channels.ServerSocketChannel jServerSocketChannel;\r
- java.nio.channels.SocketChannel jSocketChannel;\r
-\r
- // This field I need because a bug in the java.nio.channels.SocketAdapter, which \r
- // returns local port 0 if the socket is not connected (even if the socket is bound)\r
- // so I need temporary use regular socket (not channel socket) to bind it to the \r
- // local address and use this address in the LocalPoint property and to create the \r
- // actual client/server channel sockets\r
- // The bug #5076965 (SocketChannel does not report local address after binding to a wildcard )\r
- // See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5076965\r
- java.net.InetSocketAddress jTempLocalSocketAddress;\r
-\r
- public GHStreamSocket()\r
- {\r
- jSocketChannel = java.nio.channels.SocketChannel.open();\r
- jSocket = jSocketChannel.socket();\r
- }\r
-\r
- public GHStreamSocket(java.nio.channels.SocketChannel socketChannel)\r
- {\r
- jSocketChannel = socketChannel;\r
- jSocket = jSocketChannel.socket();\r
- }\r
-\r
- public override int GetHashCode ()\r
- {\r
- if (jSocket == null && jServerSocket == null)\r
- return -1;\r
-\r
- if (jServerSocket != null) {\r
- return jServerSocket.ToString ().GetHashCode ();\r
- }\r
-\r
- return jSocket.ToString ().GetHashCode ();\r
- }\r
-\r
- public int Available_internal(out int error)\r
- {\r
- error = 0;\r
- int r = 0;\r
-\r
- if (jSocket == null || !jSocket.isConnected())\r
- {\r
- return r;\r
- }\r
-\r
- try\r
- {\r
- r = jSocket.getInputStream().available();\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10054; //WSAECONNRESET (Connection reset by peer)\r
- r = 0;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Available_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- return r;\r
- }\r
-\r
- public void Blocking_internal(bool block, out int error)\r
- {\r
- error = 0;\r
-\r
- if (jSocket == null && jServerSocket == null)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- try\r
- {\r
- if (jServerSocket != null)\r
- {\r
- jServerSocketChannel.configureBlocking(block);\r
- }\r
- else\r
- {\r
- jSocketChannel.configureBlocking(block);\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Blocking_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- public EndPoint LocalEndPoint_internal(out int error)\r
- {\r
- error = 0;\r
- java.net.InetSocketAddress localAddr = null;\r
-\r
- try\r
- {\r
- if (jTempLocalSocketAddress != null)\r
- {\r
- localAddr = jTempLocalSocketAddress;\r
- }\r
- else if (jServerSocket != null)\r
- {\r
- localAddr = (java.net.InetSocketAddress)jServerSocket.getLocalSocketAddress();\r
- }\r
- else\r
- {\r
- localAddr = (java.net.InetSocketAddress)jSocket.getLocalSocketAddress();\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- localAddr = null;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during LocalEndPoint_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- if (localAddr == null || localAddr.getAddress() == null || localAddr.getPort() < 0)\r
- {\r
- return null;\r
- }\r
-\r
- IPHostEntry lipa = Dns.Resolve(localAddr.getHostName());\r
- IPEndPoint ret = new IPEndPoint(lipa.AddressList[0], localAddr.getPort());\r
- return ret;\r
- }\r
-\r
- public EndPoint RemoteEndPoint_internal(out int error)\r
- {\r
- error = 0;\r
- java.net.InetSocketAddress remoteAddr = null;\r
-\r
- if (jSocket == null || !jSocket.isBound())\r
- {\r
- return null;\r
- }\r
-\r
- try\r
- {\r
- remoteAddr = (java.net.InetSocketAddress)jSocket.getRemoteSocketAddress();\r
- }\r
- catch (Exception e)\r
- {\r
- remoteAddr = null;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during RemoteEndPoint_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- if (remoteAddr == null || remoteAddr.getAddress() == null || remoteAddr.getPort() <= 0)\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return null;\r
- }\r
-\r
- IPHostEntry lipa = Dns.Resolve(remoteAddr.getHostName());\r
- IPEndPoint ret = new IPEndPoint(lipa.AddressList[0], remoteAddr.getPort());\r
- return ret;\r
- }\r
-\r
- public GHSocket Accept_internal(out int error)\r
- {\r
- error = 0;\r
-\r
- if (jServerSocket == null)\r
- {\r
- throw new InvalidOperationException("You must call Bind and Listen before calling Accept.");\r
- }\r
-\r
- try\r
- {\r
- /*\r
- If this channel is in non-blocking mode then this method will immediately \r
- return null if there are no pending connections. \r
- Otherwise it will block indefinitely until a new connection is \r
- available or an I/O error occurs. \r
- */\r
- java.nio.channels.SocketChannel acceptedSocket = jServerSocketChannel.accept();\r
- if (acceptedSocket == null) \r
- {\r
- error = 10035; //WSAEWOULDBLOCK (Resource temporarily unavailable)\r
-#if DEBUG\r
- Console.WriteLine("The Accept_internal is in non-blocking mode and no pending connections are available");\r
-#endif\r
- return null;\r
- }\r
-\r
- return new GHStreamSocket(acceptedSocket);\r
- }\r
- catch (AsynchronousCloseException) {\r
- error = 10004;\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10061; //WSAECONNREFUSED (Connection refused)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Accept_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- return null;\r
- }\r
-\r
- public void Bind_internal(EndPoint sa, out int error)\r
- {\r
- error = 0;\r
- IPEndPoint addr = sa as IPEndPoint;\r
- if (addr == null)\r
- {\r
- error = 10044; //WSAESOCKTNOSUPPORT (Socket type not supported)\r
- return;\r
- }\r
-\r
- if (jSocket == null || jSocket.isBound() || jSocket.isConnected() || jSocketChannel.isConnectionPending())\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- try\r
- {\r
- // This code I need because a bug in the java.nio.channels.SocketAdapter, which \r
- // returns local port 0 if the socket is not connected (even if the socket is bound)\r
- // so I need temporary use regular socket (not channel socket) to bind it to the \r
- // local address and use this address in the LocalPoint property and to create the \r
- // actual client/server channel sockets\r
- // The bug #5076965 (SocketChannel does not report local address after binding to a wildcard )\r
- // See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5076965\r
- java.net.Socket jTempSocket = new java.net.Socket();\r
- jTempSocket.bind(new java.net.InetSocketAddress(java.net.InetAddress.getByName(addr.Address.ToString()),\r
- addr.Port));\r
- jTempLocalSocketAddress = (java.net.InetSocketAddress)jTempSocket.getLocalSocketAddress();\r
- jTempSocket.close();\r
- jSocket.bind(jTempLocalSocketAddress);\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10048; //WSAEADDRINUSE (Address already in use)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Bind_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- public void Close_internal(out int error)\r
- {\r
- error = 0;\r
-\r
- if (jServerSocket != null)\r
- {\r
- try\r
- {\r
- jServerSocket.close();\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Close_internal jServerSocket - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- try\r
- {\r
- jServerSocketChannel.close();\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Close_internal jServerSocketChannel - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- jServerSocket = null;\r
- jServerSocketChannel = null;\r
- }\r
- else if (jSocket != null)\r
- {\r
- try\r
- {\r
- jSocket.close();\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Close_internal jSocket - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- try\r
- {\r
- jSocketChannel.close();\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Close_internal jSocketChannel - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- jSocket = null;\r
- jSocketChannel = null;\r
- }\r
- }\r
-\r
- public void Connect_internal(EndPoint sa, out int error)\r
- {\r
- error = 0;\r
-\r
- IPEndPoint addr = sa as IPEndPoint;\r
- if (addr == null)\r
- {\r
- error = 10044; //WSAESOCKTNOSUPPORT (Socket type not supported)\r
- return;\r
- }\r
-\r
- if (jSocket == null)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- if (jSocket.isConnected() || jSocketChannel.isConnectionPending())\r
- {\r
- error = 10056; //WSAEISCONN (Socket is already connected)\r
- return;\r
- }\r
-\r
- try\r
- {\r
- /*\r
- If this channel is in non-blocking mode then an invocation of this method\r
- initiates a non-blocking connection operation. If the connection is \r
- established immediately, as can happen with a local connection, then this \r
- method returns true. Otherwise this method returns false. \r
- If this channel is in blocking mode then an invocation of this method \r
- will block until the connection is established or an I/O error occurs. \r
- */\r
- bool status = jSocketChannel.connect(new java.net.InetSocketAddress(\r
- java.net.InetAddress.getByName(addr.Address.ToString()), \r
- addr.Port));\r
- if (!status)\r
- {\r
- error = 10035; //WSAEWOULDBLOCK (Resource temporarily unavailable)\r
- }\r
- }\r
- catch (java.nio.channels.AlreadyConnectedException ae)\r
- { \r
- error = 10056; //WSAEISCONN (Socket is already connected)\r
- }\r
- catch (java.nio.channels.ConnectionPendingException cpe)\r
- { \r
- error = 10036; //WSAEINPROGRESS (Operation now in progress)\r
- }\r
- catch (java.nio.channels.UnresolvedAddressException uae)\r
- { \r
- error = 10039; //WSAEDESTADDRREQ (Destination address required)\r
- }\r
- catch (java.nio.channels.UnsupportedAddressTypeException uate)\r
- { \r
- error = 10041; //WSAEPROTOTYPE (Protocol wrong type for socket)\r
- }\r
- catch (AsynchronousCloseException) {\r
- error = 10004;\r
- }\r
- catch (Exception e)\r
- { \r
- error = 10061; //WSAECONNREFUSED (Connection refused)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Connect_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- public void Listen_internal(int backlog, out int error)\r
- {\r
- error = 0;\r
-\r
- if (jSocket == null || !jSocket.isBound())\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- if (jSocket.isConnected() || jSocketChannel.isConnectionPending())\r
- {\r
- error = 10056; //WSAEISCONN (Socket is already connected)\r
- return;\r
- }\r
-\r
- bool blockMode = jSocketChannel.isBlocking();\r
- bool reuseAddr = jSocket.getReuseAddress();\r
-\r
- try\r
- {\r
- jSocket.close();\r
- }\r
- catch (Exception e)\r
- {\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Listen_internal close old jSocket - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- try\r
- {\r
- jSocketChannel.close();\r
- }\r
- catch (Exception e)\r
- {\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Listen_internal close old jSocketChannel - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- jSocket = null;\r
- jSocketChannel = null;\r
-\r
- try\r
- {\r
- jServerSocketChannel = java.nio.channels.ServerSocketChannel.open();\r
- jServerSocket = jServerSocketChannel.socket();\r
- jServerSocket.bind(jTempLocalSocketAddress, backlog);\r
- jServerSocketChannel.configureBlocking(blockMode);\r
- jServerSocket.setReuseAddress(reuseAddr);\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10048; //WSAEADDRINUSE (Address already in use)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Listen_internal create server socket - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- public bool Poll_internal (SelectMode mode, int timeout, Socket source, out int error)\r
- {\r
- error = 0;\r
-\r
- if (mode == SelectMode.SelectError && !jSocketChannel.isConnectionPending())\r
- {\r
- return false;\r
- }\r
-\r
- java.nio.channels.Selector selector = java.nio.channels.Selector.open();\r
- RegisterSelector(selector, ((mode == SelectMode.SelectRead)?0:1), source, out error);\r
-\r
- if (error != 0)\r
- {\r
- error = 0;\r
- GHSocketFactory.CloseSelector(selector);\r
- return (mode == SelectMode.SelectError);\r
- }\r
-\r
- bool retVal = false;\r
-\r
- long timeOutMillis = 1;\r
- if (timeout < 0)\r
- {\r
- timeOutMillis = 0;\r
- } \r
- else if (timeout > 999)\r
- {\r
- timeOutMillis = (long)(timeout / 1000);\r
- }\r
-\r
- int readyCount = 0;\r
- try\r
- {\r
- readyCount = selector.select(timeOutMillis);\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Poll_internal selector.select - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- if (readyCount > 0)\r
- {\r
- if (jSocket != null && jSocketChannel.isConnectionPending())\r
- {\r
- bool status = false;\r
- try\r
- {\r
- status = jSocketChannel.finishConnect();\r
- }\r
- catch (Exception e)\r
- {\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Poll_internal, finishConnect - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- if (status)\r
- {\r
- retVal = (mode != SelectMode.SelectError);\r
- }\r
- else \r
- {\r
- retVal = (mode == SelectMode.SelectError);\r
- }\r
- }\r
- else\r
- {\r
- retVal = true;\r
- }\r
- }\r
-\r
- GHSocketFactory.CloseSelector(selector);\r
-\r
- return retVal;\r
- }\r
-\r
- public void RegisterSelector(java.nio.channels.Selector selector, int mode, Socket source, out int error)\r
- {\r
- error = 0;\r
- if (jServerSocket != null)\r
- {\r
- // only accept operation, which included to the read list, is allowed for server sockets\r
- if (mode != 0)\r
- {\r
-// error = 10038; //WSAENOTSOCK (Socket operation on nonsocket)\r
-#if DEBUG\r
- Console.WriteLine("RegisterSelector, invalid mode {0} for the server socket", mode);\r
-#endif\r
- return;\r
- }\r
-\r
- try\r
- {\r
- if (jServerSocketChannel.isBlocking())\r
- {\r
- /*\r
- A channel must be placed into non-blocking mode before being registered \r
- with a selector, and may not be returned to blocking mode until it has been \r
- deregistered. \r
- */\r
- jServerSocketChannel.configureBlocking(false);\r
- }\r
-\r
- jServerSocketChannel.register(selector, java.nio.channels.SelectionKey.OP_ACCEPT, source);\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during RegisterSelector, register server socket - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
- else\r
- {\r
- try\r
- {\r
- int ops = java.nio.channels.SelectionKey.OP_READ;\r
- if (mode > 0)\r
- {\r
- if (jSocketChannel.isConnectionPending())\r
- {\r
- ops = java.nio.channels.SelectionKey.OP_CONNECT;\r
- }\r
- else\r
- {\r
- ops = java.nio.channels.SelectionKey.OP_WRITE;\r
- }\r
- }\r
- \r
- if (jSocketChannel.isBlocking())\r
- {\r
- /*\r
- A channel must be placed into non-blocking mode before being registered \r
- with a selector, and may not be returned to blocking mode until it has been \r
- deregistered. \r
- */\r
- jSocketChannel.configureBlocking(false);\r
- }\r
-\r
- jSocketChannel.register(selector, ops, source);\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during RegisterSelector, register client socket - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
- }\r
-\r
- public bool CheckConnectionFinished()\r
- {\r
- bool status = true;\r
- if (jSocket != null && jSocketChannel.isConnectionPending())\r
- {\r
- try\r
- {\r
- status = jSocketChannel.finishConnect();\r
- }\r
- catch (Exception e)\r
- {\r
- status = false;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Poll_internal, finishConnect - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- return status;\r
- }\r
-\r
- public int Receive_internal(byte[] buffer, int offset, int count, SocketFlags flags,\r
- out int error)\r
- {\r
- error = 0;\r
- int ret = 0;\r
-\r
- if (jSocket == null)\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return ret;\r
- }\r
-\r
- try\r
- {\r
- if (jSocketChannel.isConnectionPending())\r
- {\r
- bool status = jSocketChannel.finishConnect();\r
- if (!status)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Receive_internal, jSocketChannel.finishConnect return false");\r
-#endif\r
- return 0;\r
- }\r
- }\r
- else if (!jSocketChannel.isConnected())\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return ret;\r
- }\r
-\r
- java.nio.ByteBuffer readBuff = java.nio.ByteBuffer.wrap(vmw.common.TypeUtils.ToSByteArray(buffer), offset, count);\r
- ret = jSocketChannel.read(readBuff);\r
- if (ret < 0) ret = 0;\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10054; //WSAECONNRESET (Connection reset by peer)\r
- ret = 0;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Receive_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- if (ret == 0 && !jSocketChannel.isBlocking())\r
- {\r
- error = 10035; //WSAEWOULDBLOCK (Resource temporarily unavailable)\r
- }\r
- return ret;\r
- }\r
-\r
- public int RecvFrom_internal(byte[] buffer, int offset, int count, SocketFlags flags,\r
- ref SocketAddress sockaddr, out int error)\r
- {\r
- return Receive_internal(buffer, offset, count, flags, out error);\r
- }\r
-\r
- public int Send_internal(byte[] buf, int offset, int count, SocketFlags flags,\r
- out int error)\r
- {\r
- error = 0;\r
- int ret = 0;\r
-\r
- if (jSocket == null)\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return ret;\r
- }\r
-\r
- try\r
- {\r
- if (jSocketChannel.isConnectionPending())\r
- {\r
- bool status = jSocketChannel.finishConnect();\r
- if (!status)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Send_internal, jSocketChannel.finishConnect return false");\r
-#endif\r
- return 0;\r
- }\r
- }\r
- else if (!jSocketChannel.isConnected())\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return ret;\r
- }\r
-\r
- java.nio.ByteBuffer writeBuff = java.nio.ByteBuffer.wrap(vmw.common.TypeUtils.ToSByteArray(buf), offset, count);\r
- ret = jSocketChannel.write(writeBuff);\r
- if (ret < 0) ret = 0;\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10054; //WSAECONNRESET (Connection reset by peer)\r
- ret = 0;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Send_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- if (ret == 0 && !jSocketChannel.isBlocking())\r
- {\r
- error = 10035; //WSAEWOULDBLOCK (Resource temporarily unavailable)\r
- }\r
- return ret;\r
- }\r
-\r
- public int SendTo_internal(byte[] buffer, int offset, int count,\r
- SocketFlags flags, SocketAddress sa, out int error)\r
- {\r
- return Send_internal(buffer, offset, count, flags, out error);\r
- }\r
-\r
- public void SetSocketOption_internal (SocketOptionLevel level,\r
- SocketOptionName name, object obj_val,\r
- byte [] byte_val, int int_val, out int error)\r
- {\r
- error = 0;\r
-\r
- if (byte_val != null)\r
- {\r
- error = -1;\r
- throw new NotImplementedException();\r
- }\r
-\r
- if (jSocket == null && jServerSocket == null)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- switch (level)\r
- {\r
- case SocketOptionLevel.IPv6:\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- return;\r
- case SocketOptionLevel.IP:\r
- if (name != SocketOptionName.NoDelay)\r
- {\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- return;\r
- }\r
- break;\r
- case SocketOptionLevel.Udp:\r
- if (name == SocketOptionName.NoDelay)\r
- {\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- }\r
- else\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- }\r
- return;\r
- case SocketOptionLevel.Tcp:\r
- if (name != SocketOptionName.NoDelay)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
- break;\r
- }\r
-\r
- try\r
- {\r
- bool bval = false;\r
- int ival = 0;\r
- switch (name)\r
- {\r
- case SocketOptionName.DontLinger:\r
- jSocket.setSoLinger(false, 0);\r
- break;\r
- case SocketOptionName.Linger:\r
- LingerOption lval = obj_val as LingerOption;\r
- if (lval != null)\r
- {\r
- jSocket.setSoLinger(lval.Enabled, lval.LingerTime);\r
- }\r
- else\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- }\r
- break;\r
- case SocketOptionName.KeepAlive:\r
- if (obj_val != null)\r
- {\r
- bval = ((int)obj_val == 0)?false:true;\r
- }\r
- else\r
- {\r
- bval = (int_val == 0)?false:true;\r
- }\r
- jSocket.setKeepAlive(bval);\r
- break;\r
- case SocketOptionName.NoDelay:\r
- if (obj_val != null)\r
- {\r
- bval = ((int)obj_val == 0)?false:true;\r
- }\r
- else\r
- {\r
- bval = (int_val == 0)?false:true;\r
- }\r
- jSocket.setTcpNoDelay(bval);\r
- break;\r
- case SocketOptionName.ReceiveBuffer:\r
- ival = int_val;\r
- if (obj_val != null)\r
- {\r
- ival = (int) obj_val;\r
- }\r
- if (jServerSocket != null)\r
- {\r
- jServerSocket.setReceiveBufferSize(ival);\r
- }\r
- else\r
- {\r
- jSocket.setReceiveBufferSize(ival);\r
- }\r
- break;\r
- case SocketOptionName.ReceiveTimeout:\r
- ival = int_val;\r
- if (obj_val != null)\r
- {\r
- ival = (int) obj_val;\r
- }\r
- if (jServerSocket != null)\r
- {\r
- jServerSocket.setSoTimeout(ival);\r
- }\r
- else\r
- {\r
- jSocket.setSoTimeout(ival);\r
- }\r
- break;\r
- case SocketOptionName.ReuseAddress:\r
- if (obj_val != null)\r
- {\r
- bval = ((int)obj_val == 0)?false:true;\r
- }\r
- else\r
- {\r
- bval = (int_val == 0)?false:true;\r
- }\r
- if (jServerSocket != null)\r
- {\r
- jServerSocket.setReuseAddress(bval);\r
- }\r
- else\r
- {\r
- jSocket.setReuseAddress(bval);\r
- }\r
- break;\r
- case SocketOptionName.SendBuffer:\r
- ival = int_val;\r
- if (obj_val != null)\r
- {\r
- ival = (int) obj_val;\r
- }\r
- jSocket.setSendBufferSize(ival);\r
- break;\r
- case SocketOptionName.OutOfBandInline:\r
- if (obj_val != null)\r
- {\r
- bval = ((int)obj_val == 0)?false:true;\r
- }\r
- else\r
- {\r
- bval = (int_val == 0)?false:true;\r
- }\r
- jSocket.setOOBInline(bval);\r
- break;\r
- default:\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- break;\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- obj_val = null;\r
- }\r
- }\r
-\r
- public void GetSocketOption_obj_internal(SocketOptionLevel level, SocketOptionName name, \r
- out object obj_val, out int error)\r
- {\r
- obj_val = null;\r
- error = 0;\r
-\r
- if (jSocket == null && jServerSocket == null)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- switch (level)\r
- {\r
- case SocketOptionLevel.IPv6:\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- return;\r
- case SocketOptionLevel.IP:\r
- if (name != SocketOptionName.NoDelay)\r
- {\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- return;\r
- }\r
- break;\r
- case SocketOptionLevel.Udp:\r
- if (name == SocketOptionName.NoDelay)\r
- {\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- }\r
- else\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- }\r
- return;\r
- case SocketOptionLevel.Tcp:\r
- if (name != SocketOptionName.NoDelay)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
- break;\r
- }\r
-\r
- try\r
- {\r
- bool bval = false;\r
- int ival = 0;\r
- switch (name)\r
- {\r
- case SocketOptionName.DontLinger:\r
- ival = jSocket.getSoLinger();\r
- if (ival == -1)\r
- {\r
- obj_val = 1;\r
- }\r
- else\r
- {\r
- obj_val = 0;\r
- }\r
- break;\r
- case SocketOptionName.Linger:\r
- ival = jSocket.getSoLinger();\r
- if (ival == -1)\r
- {\r
- ival = 0;\r
- }\r
- LingerOption ret = new LingerOption((ival != 0), ival);\r
- obj_val = ret;\r
- break;\r
- case SocketOptionName.KeepAlive:\r
- bval = jSocket.getKeepAlive();\r
- obj_val = ((bval)?1:0);\r
- break;\r
- case SocketOptionName.NoDelay:\r
- bval = jSocket.getTcpNoDelay();\r
- obj_val = ((bval)?1:0);\r
- break;\r
- case SocketOptionName.ReceiveBuffer:\r
- if (jServerSocket != null)\r
- {\r
- ival = jServerSocket.getReceiveBufferSize();\r
- }\r
- else\r
- {\r
- ival = jSocket.getReceiveBufferSize();\r
- }\r
- obj_val = ival;\r
- break;\r
- case SocketOptionName.ReceiveTimeout:\r
- if (jServerSocket != null)\r
- {\r
- ival = jServerSocket.getSoTimeout();\r
- }\r
- else\r
- {\r
- ival = jSocket.getSoTimeout();\r
- }\r
- obj_val = ival;\r
- break;\r
- case SocketOptionName.ReuseAddress:\r
- if (jServerSocket != null)\r
- {\r
- bval = jServerSocket.getReuseAddress();\r
- }\r
- else\r
- {\r
- bval = jSocket.getReuseAddress();\r
- }\r
- obj_val = ((bval)?1:0);\r
- break;\r
- case SocketOptionName.SendBuffer:\r
- ival = jSocket.getSendBufferSize();\r
- obj_val = ival;\r
- break;\r
- case SocketOptionName.OutOfBandInline:\r
- bval = jSocket.getOOBInline();\r
- obj_val = ((bval)?1:0);\r
- break;\r
- default:\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- break;\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- obj_val = null;\r
- }\r
- }\r
- \r
- public void GetSocketOption_arr_internal(SocketOptionLevel level, SocketOptionName name, \r
- ref byte[] byte_val, out int error)\r
- {\r
- error = -1;\r
- throw new NotImplementedException();\r
- }\r
-\r
- public int WSAIoctl (int ioctl_code, byte [] input, byte [] output, out int error)\r
- {\r
- error = -1;\r
- throw new NotImplementedException();\r
- }\r
-\r
- public void Shutdown_internal(SocketShutdown how, out int error)\r
- {\r
- error = 0;\r
-\r
- if (jServerSocket != null || jSocket == null || !jSocket.isConnected())\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return;\r
- }\r
-\r
- try\r
- {\r
- switch (how)\r
- {\r
- case SocketShutdown.Receive: \r
- jSocket.shutdownInput();\r
- break;\r
- case SocketShutdown.Send: \r
- jSocket.shutdownOutput();\r
- break;\r
- case SocketShutdown.Both: \r
- jSocket.shutdownInput();\r
- jSocket.shutdownOutput();\r
- break;\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Shutdown_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- private java.io.FileInputStream searchDefaultCacerts()\r
- {\r
- try\r
- {\r
- string javaHome = java.lang.System.getProperty("java.home");\r
- if(javaHome == null)\r
- return null;\r
-\r
- string keyStorePath = javaHome + "/lib/security/cacerts";\r
- //Console.WriteLine("keyStorePath = {0}", keyStorePath);\r
-\r
- java.io.File f = new java.io.File(keyStorePath);\r
- if(!f.exists())\r
- return null;\r
- return new java.io.FileInputStream(f);\r
- }\r
- catch(Exception e)\r
- {\r
-#if DEBUG\r
- //todo log it\r
- Console.WriteLine(e.GetType() + ":" + e.Message + "\n" + e.StackTrace);\r
-#endif\r
- return null;\r
- }\r
- }\r
-\r
- private SSLSocketFactory getSSLSocketFactory()\r
- {\r
- SSLSocketFactory factory = null;\r
-\r
- try\r
- {\r
- //reading the keyStore path and password from the environment properties\r
- string keyStorePath = java.lang.System.getProperty("javax.net.ssl.keyStore");\r
- java.io.FileInputStream keyStoreStream = null;\r
- if (keyStorePath != null)\r
- {\r
- java.io.File file = new java.io.File(keyStorePath);\r
- if(file.exists())\r
- keyStoreStream = new java.io.FileInputStream(file);\r
- else\r
- keyStoreStream = searchDefaultCacerts();\r
- }\r
- else\r
- keyStoreStream = searchDefaultCacerts();\r
-\r
- string keyStorePassWord = java.lang.System.getProperty("javax.net.ssl.keyStorePassword");\r
- if (keyStorePassWord == null)\r
- keyStorePassWord = "changeit";\r
- char[] passphrase = keyStorePassWord.ToCharArray(); \r
- \r
- //initiating SSLContext\r
- SSLContext ctx = SSLContext.getInstance("TLS");\r
- KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\r
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\r
- KeyStore ks = KeyStore.getInstance("JKS");\r
- if (keyStoreStream != null)\r
- ks.load(keyStoreStream,passphrase);\r
- else\r
- ks.load(null,null);\r
- kmf.init(ks, passphrase);\r
- tmf.init(ks);\r
- ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);\r
-\r
- factory = ctx.getSocketFactory();\r
- }\r
- catch (Exception e)\r
- {\r
- factory = null;\r
-#if DEBUG\r
- Console.WriteLine("Can't get SSL Socket Factory, the exception is {0}, {1}", e.GetType(), e.Message);\r
-#endif\r
- }\r
-\r
- return factory;\r
- }\r
-\r
- public GHSocket ChangeToSSL(EndPoint remote_end)\r
- {\r
- if (jSocket == null)\r
- {\r
- throw new InvalidOperationException("The underlying socket is null");\r
- }\r
-\r
- if (!jSocketChannel.isBlocking())\r
- {\r
- throw new NotImplementedException("The SSL Socket for non-blocking mode is not supported");\r
- }\r
-\r
- SSLSocketFactory factory = getSSLSocketFactory();\r
- if (factory == null)\r
- {\r
- throw new ApplicationException("Can't get SSL Socket Factory");\r
- }\r
-\r
- int err;\r
-\r
- // The problem with local address, when I closed the socket and try to create the new one\r
- // bounded to the given local address, I receive exception "Address already in use"\r
- IPEndPoint localEndPoint = null;\r
-// IPEndPoint localEndPoint = (IPEndPoint) LocalEndPoint_internal(out err);\r
-// if (err != 0)\r
-// localEndPoint = null;\r
-\r
- IPEndPoint remoteEndPoint = remote_end as IPEndPoint;\r
- if (remoteEndPoint == null)\r
- {\r
- remoteEndPoint = (IPEndPoint) RemoteEndPoint_internal(out err);\r
- if (err != 0)\r
- remoteEndPoint = null;\r
- }\r
-\r
- java.net.Socket sslSocket = null;\r
- try\r
- {\r
- if (remoteEndPoint != null)\r
- {\r
- if (localEndPoint != null)\r
- {\r
- sslSocket = factory.createSocket(\r
- java.net.InetAddress.getByName(remoteEndPoint.Address.ToString()),\r
- remoteEndPoint.Port,\r
- java.net.InetAddress.getByName(localEndPoint.Address.ToString()),\r
- localEndPoint.Port);\r
- }\r
- else\r
- {\r
- sslSocket = factory.createSocket(\r
- jSocket, \r
- remoteEndPoint.Address.ToString(),\r
- remoteEndPoint.Port,\r
- false);\r
- }\r
-\r
- if (sslSocket != null)\r
- {\r
- String[] protocols = { "TLSv1", "SSLv3" };\r
- ((SSLSocket)sslSocket).setUseClientMode(true);\r
- ((SSLSocket)sslSocket).startHandshake();\r
- }\r
-\r
- }\r
- else\r
- {\r
- sslSocket = factory.createSocket();\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- sslSocket = null;\r
-#if DEBUG\r
- Console.WriteLine("Can't create SSL Socket, the exception is {0}, {1}", e.GetType(), e.Message);\r
-#endif\r
- }\r
-\r
- if (sslSocket == null)\r
- {\r
-// throw new ApplicationException("Can't create SSL Socket");\r
- // it is important to the Socket class to distinguish if the underlying \r
- // handle (GHSocket) is still valid and can be used as non-SSL, or it is already\r
- // closed by this function and can't be used any more.\r
- return null;\r
- }\r
-\r
-/*\r
- string[] arr = ((SSLSocket)sslSocket).getEnabledProtocols();\r
- if (arr != null)\r
- {\r
- foreach (string s in arr)\r
- Console.WriteLine("s:"+s);\r
- }\r
- string [] arr1 = ((SSLSocket)sslSocket).getEnabledCipherSuites();\r
- if (arr1 != null)\r
- {\r
- foreach (string s in arr1)\r
- Console.WriteLine("s:"+s);\r
- }\r
-*/\r
-\r
- return new GHStreamSocketSSL(sslSocket);\r
- }\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Net;\r
-\r
-namespace System.Net.Sockets\r
-{\r
- /// <summary>\r
- /// Summary description for GHStreamSocket.\r
- /// </summary>\r
- internal class GHStreamSocketSSL : GHSocket\r
- {\r
- java.net.Socket jSocket;\r
-\r
- public GHStreamSocketSSL(java.net.Socket sslSocket)\r
- {\r
- jSocket = sslSocket;\r
- }\r
-\r
- public override int GetHashCode ()\r
- {\r
- if (jSocket == null)\r
- return -1;\r
-\r
- return jSocket.ToString().GetHashCode();\r
- }\r
-\r
- public int Available_internal(out int error)\r
- {\r
- error = 0;\r
- int r = 0;\r
-\r
- if (jSocket == null || !jSocket.isConnected())\r
- {\r
- return r;\r
- }\r
-\r
- try\r
- {\r
- r = jSocket.getInputStream().available();\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10054; //WSAECONNRESET (Connection reset by peer)\r
- r = 0;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Available_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- return r;\r
- }\r
-\r
- public void Blocking_internal(bool block, out int error)\r
- {\r
- //SVETA: see in the non-blocking io\r
- error = 0;\r
-\r
- if (block == false)\r
- throw new NotSupportedException();\r
- }\r
-\r
- public EndPoint LocalEndPoint_internal(out int error)\r
- {\r
- error = 0;\r
- java.net.InetSocketAddress localAddr = null;\r
-\r
- try\r
- {\r
- localAddr = (java.net.InetSocketAddress)jSocket.getLocalSocketAddress();\r
- }\r
- catch (Exception e)\r
- {\r
- localAddr = null;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during LocalEndPoint_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- if (localAddr == null || localAddr.getAddress() == null || localAddr.getPort() < 0)\r
- {\r
- return null;\r
- }\r
-\r
- IPHostEntry lipa = Dns.Resolve(localAddr.getHostName());\r
- IPEndPoint ret = new IPEndPoint(lipa.AddressList[0], localAddr.getPort());\r
- return ret;\r
- }\r
-\r
- public EndPoint RemoteEndPoint_internal(out int error)\r
- {\r
- error = 0;\r
- java.net.InetSocketAddress remoteAddr = null;\r
-\r
- if (jSocket == null || !jSocket.isBound())\r
- {\r
- return null;\r
- }\r
-\r
- try\r
- {\r
- remoteAddr = (java.net.InetSocketAddress)jSocket.getRemoteSocketAddress();\r
- }\r
- catch (Exception e)\r
- {\r
- remoteAddr = null;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during RemoteEndPoint_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- if (remoteAddr == null || remoteAddr.getAddress() == null || remoteAddr.getPort() <= 0)\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return null;\r
- }\r
-\r
- IPHostEntry lipa = Dns.Resolve(remoteAddr.getHostName());\r
- IPEndPoint ret = new IPEndPoint(lipa.AddressList[0], remoteAddr.getPort());\r
- return ret;\r
- }\r
-\r
- public GHSocket Accept_internal(out int error)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return null;\r
- }\r
-\r
- public void Bind_internal(EndPoint sa, out int error)\r
- {\r
- error = 0;\r
- IPEndPoint addr = sa as IPEndPoint;\r
- if (addr == null)\r
- {\r
- error = 10044; //WSAESOCKTNOSUPPORT (Socket type not supported)\r
- return;\r
- }\r
-\r
- if (jSocket == null || jSocket.isBound() || jSocket.isConnected())\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- try\r
- {\r
- jSocket.bind(new java.net.InetSocketAddress(java.net.InetAddress.getByName(addr.Address.ToString()),\r
- addr.Port));\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10048; //WSAEADDRINUSE (Address already in use)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Bind_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- public void Close_internal(out int error)\r
- {\r
- error = 0;\r
-\r
- try\r
- {\r
- if (jSocket != null)\r
- {\r
- jSocket.close();\r
- jSocket = null;\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Close_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- public void Connect_internal(EndPoint sa, out int error)\r
- {\r
- error = 0;\r
-\r
- IPEndPoint addr = sa as IPEndPoint;\r
- if (addr == null)\r
- {\r
- error = 10044; //WSAESOCKTNOSUPPORT (Socket type not supported)\r
- return;\r
- }\r
-\r
- if (jSocket == null)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- if (jSocket.isConnected())\r
- {\r
- error = 10056; //WSAEISCONN (Socket is already connected)\r
- return;\r
- }\r
-\r
- try\r
- {\r
- jSocket.connect(new java.net.InetSocketAddress(\r
- java.net.InetAddress.getByName(addr.Address.ToString()), \r
- addr.Port));\r
- }\r
- catch (Exception e)\r
- { \r
- error = 10061; //WSAECONNREFUSED (Connection refused)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Connect_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- public void Listen_internal(int backlog, out int error)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- public bool Poll_internal (SelectMode mode, int timeout, Socket source, out int error)\r
- {\r
- error = 0;\r
- throw new NotImplementedException();\r
- }\r
-\r
- public int Receive_internal(byte[] buffer, int offset, int count, SocketFlags flags,\r
- out int error)\r
- {\r
- error = 0;\r
- int ret = 0;\r
-\r
- if (jSocket == null || !jSocket.isConnected())\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return ret;\r
- }\r
-\r
- try\r
- {\r
- ret = jSocket.getInputStream().read(vmw.common.TypeUtils.ToSByteArray(buffer), offset, count);\r
- if (ret < 0) ret = 0;\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10054; //WSAECONNRESET (Connection reset by peer)\r
- ret = 0;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Receive_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- return ret;\r
- }\r
-\r
- public int RecvFrom_internal(byte[] buffer, int offset, int count, SocketFlags flags,\r
- ref SocketAddress sockaddr, out int error)\r
- {\r
- return Receive_internal(buffer, offset, count, flags, out error);\r
- }\r
-\r
- public int Send_internal(byte[] buf, int offset, int count, SocketFlags flags,\r
- out int error)\r
- {\r
- error = 0;\r
- int ret = 0;\r
-\r
- if (jSocket == null || !jSocket.isConnected())\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return ret;\r
- }\r
-\r
- try\r
- {\r
- jSocket.getOutputStream().write(vmw.common.TypeUtils.ToSByteArray(buf), offset, count);\r
- ret = count;\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10054; //WSAECONNRESET (Connection reset by peer)\r
- ret = 0;\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Send_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
-\r
- return ret;\r
- }\r
-\r
- public int SendTo_internal(byte[] buffer, int offset, int count,\r
- SocketFlags flags, SocketAddress sa, out int error)\r
- {\r
- return Send_internal(buffer, offset, count, flags, out error);\r
- }\r
-\r
- public void SetSocketOption_internal (SocketOptionLevel level,\r
- SocketOptionName name, object obj_val,\r
- byte [] byte_val, int int_val, out int error)\r
- {\r
- error = 0;\r
-\r
- if (byte_val != null)\r
- {\r
- error = -1;\r
- throw new NotImplementedException();\r
- }\r
-\r
- if (jSocket == null)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- switch (level)\r
- {\r
- case SocketOptionLevel.IPv6:\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- return;\r
- case SocketOptionLevel.IP:\r
- if (name != SocketOptionName.NoDelay)\r
- {\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- return;\r
- }\r
- break;\r
- case SocketOptionLevel.Udp:\r
- if (name == SocketOptionName.NoDelay)\r
- {\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- }\r
- else\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- }\r
- return;\r
- case SocketOptionLevel.Tcp:\r
- if (name != SocketOptionName.NoDelay)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
- break;\r
- }\r
-\r
- try\r
- {\r
- bool bval = false;\r
- int ival = 0;\r
- switch (name)\r
- {\r
- case SocketOptionName.DontLinger:\r
- jSocket.setSoLinger(false, 0);\r
- break;\r
- case SocketOptionName.Linger:\r
- LingerOption lval = obj_val as LingerOption;\r
- if (lval != null)\r
- {\r
- jSocket.setSoLinger(lval.Enabled, lval.LingerTime);\r
- }\r
- else\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- }\r
- break;\r
- case SocketOptionName.KeepAlive:\r
- if (obj_val != null)\r
- {\r
- bval = ((int)obj_val == 0)?false:true;\r
- }\r
- else\r
- {\r
- bval = (int_val == 0)?false:true;\r
- }\r
- jSocket.setKeepAlive(bval);\r
- break;\r
- case SocketOptionName.NoDelay:\r
- if (obj_val != null)\r
- {\r
- bval = ((int)obj_val == 0)?false:true;\r
- }\r
- else\r
- {\r
- bval = (int_val == 0)?false:true;\r
- }\r
- jSocket.setTcpNoDelay(bval);\r
- break;\r
- case SocketOptionName.ReceiveBuffer:\r
- ival = int_val;\r
- if (obj_val != null)\r
- {\r
- ival = (int) obj_val;\r
- }\r
- jSocket.setReceiveBufferSize(ival);\r
- break;\r
- case SocketOptionName.ReceiveTimeout:\r
- ival = int_val;\r
- if (obj_val != null)\r
- {\r
- ival = (int) obj_val;\r
- }\r
- jSocket.setSoTimeout(ival);\r
- break;\r
- case SocketOptionName.ReuseAddress:\r
- if (obj_val != null)\r
- {\r
- bval = ((int)obj_val == 0)?false:true;\r
- }\r
- else\r
- {\r
- bval = (int_val == 0)?false:true;\r
- }\r
- jSocket.setReuseAddress(bval);\r
- break;\r
- case SocketOptionName.SendBuffer:\r
- ival = int_val;\r
- if (obj_val != null)\r
- {\r
- ival = (int) obj_val;\r
- }\r
- jSocket.setSendBufferSize(ival);\r
- break;\r
- case SocketOptionName.OutOfBandInline:\r
- if (obj_val != null)\r
- {\r
- bval = ((int)obj_val == 0)?false:true;\r
- }\r
- else\r
- {\r
- bval = (int_val == 0)?false:true;\r
- }\r
- jSocket.setOOBInline(bval);\r
- break;\r
- default:\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- break;\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- obj_val = null;\r
- }\r
- }\r
-\r
- public void GetSocketOption_obj_internal(SocketOptionLevel level, SocketOptionName name, \r
- out object obj_val, out int error)\r
- {\r
- obj_val = null;\r
- error = 0;\r
-\r
- if (jSocket == null)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
-\r
- switch (level)\r
- {\r
- case SocketOptionLevel.IPv6:\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- return;\r
- case SocketOptionLevel.IP:\r
- if (name != SocketOptionName.NoDelay)\r
- {\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- return;\r
- }\r
- break;\r
- case SocketOptionLevel.Udp:\r
- if (name == SocketOptionName.NoDelay)\r
- {\r
- error = 10042; //WSAENOPROTOOPT (Bad protocol option)\r
- }\r
- else\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- }\r
- return;\r
- case SocketOptionLevel.Tcp:\r
- if (name != SocketOptionName.NoDelay)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- return;\r
- }\r
- break;\r
- }\r
-\r
- try\r
- {\r
- bool bval = false;\r
- int ival = 0;\r
- switch (name)\r
- {\r
- case SocketOptionName.DontLinger:\r
- ival = jSocket.getSoLinger();\r
- if (ival == -1)\r
- {\r
- obj_val = 1;\r
- }\r
- else\r
- {\r
- obj_val = 0;\r
- }\r
- break;\r
- case SocketOptionName.Linger:\r
- ival = jSocket.getSoLinger();\r
- if (ival == -1)\r
- {\r
- ival = 0;\r
- }\r
- LingerOption ret = new LingerOption((ival != 0), ival);\r
- obj_val = ret;\r
- break;\r
- case SocketOptionName.KeepAlive:\r
- bval = jSocket.getKeepAlive();\r
- obj_val = ((bval)?1:0);\r
- break;\r
- case SocketOptionName.NoDelay:\r
- bval = jSocket.getTcpNoDelay();\r
- obj_val = ((bval)?1:0);\r
- break;\r
- case SocketOptionName.ReceiveBuffer:\r
- ival = jSocket.getReceiveBufferSize();\r
- obj_val = ival;\r
- break;\r
- case SocketOptionName.ReceiveTimeout:\r
- ival = jSocket.getSoTimeout();\r
- obj_val = ival;\r
- break;\r
- case SocketOptionName.ReuseAddress:\r
- bval = jSocket.getReuseAddress();\r
- obj_val = ((bval)?1:0);\r
- break;\r
- case SocketOptionName.SendBuffer:\r
- ival = jSocket.getSendBufferSize();\r
- obj_val = ival;\r
- break;\r
- case SocketOptionName.OutOfBandInline:\r
- bval = jSocket.getOOBInline();\r
- obj_val = ((bval)?1:0);\r
- break;\r
- default:\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- break;\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
- obj_val = null;\r
- }\r
- }\r
- \r
- public void GetSocketOption_arr_internal(SocketOptionLevel level, SocketOptionName name, \r
- ref byte[] byte_val, out int error)\r
- {\r
- error = -1;\r
- throw new NotImplementedException();\r
- }\r
-\r
- public int WSAIoctl (int ioctl_code, byte [] input, byte [] output, out int error)\r
- {\r
- error = -1;\r
- throw new NotImplementedException();\r
- }\r
-\r
- public void Shutdown_internal(SocketShutdown how, out int error)\r
- {\r
- error = 0;\r
-\r
- if (jSocket == null || !jSocket.isConnected())\r
- {\r
- error = 10057; //WSAENOTCONN (Socket is not connected)\r
- return;\r
- }\r
-\r
- try\r
- {\r
- switch (how)\r
- {\r
- case SocketShutdown.Receive: \r
- jSocket.shutdownInput();\r
- break;\r
- case SocketShutdown.Send: \r
- jSocket.shutdownOutput();\r
- break;\r
- case SocketShutdown.Both: \r
- jSocket.shutdownInput();\r
- jSocket.shutdownOutput();\r
- break;\r
- }\r
- }\r
- catch (Exception e)\r
- {\r
- error = 10022; //WSAEINVAL (Invalid argument)\r
-#if DEBUG\r
- Console.WriteLine("Caught exception during Shutdown_internal - {0}: {1}\n{2}", e.GetType(), e.Message, e.StackTrace);\r
-#endif\r
- }\r
- }\r
-\r
- public void RegisterSelector(java.nio.channels.Selector selector, int mode, Socket source, out int error)\r
- {\r
- throw new InvalidOperationException();\r
- }\r
-\r
- public bool CheckConnectionFinished()\r
- {\r
- throw new InvalidOperationException();\r
- }\r
-\r
- public GHSocket ChangeToSSL(EndPoint remote_end)\r
- {\r
- return this;\r
- }\r
-\r
- }\r
-}\r
}
#if !NET_2_1 || MOBILE
-#if TARGET_JVM
- [MonoNotSupported ("Not supported since Socket.ReceiveTimeout is not supported")]
-#endif
public override int ReadTimeout
{
get {
}
#if !NET_2_1 || MOBILE
-#if TARGET_JVM
- [MonoNotSupported ("Not supported since Socket.SendTimeout is not supported")]
-#endif
public override int WriteTimeout
{
get {
throw new ObjectDisposedException (GetType().FullName);
}
-#if TARGET_JVM
- public void ChangeToSSLSocket()
- {
- socket.ChangeToSSL();
- }
-#endif
}
}
sockets.Add (null);
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void Select_internal (ref Socket [] sockets,
int microSeconds,
out int error);
-#endif
public static void Select (IList checkRead, IList checkWrite, IList checkError, int microSeconds)
{
var list = new List<Socket> ();
}
#endif
-#if !TARGET_JVM
// Returns the amount of data waiting to be read on socket
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static int Available_internal(IntPtr socket, out int error);
-#endif
public int Available {
get {
}
}
-#if !TARGET_JVM
// Returns the local endpoint details in addr and port
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static SocketAddress LocalEndPoint_internal(IntPtr socket, int family, out int error);
-#endif
// Wish: support non-IP endpoints.
public EndPoint LocalEndPoint {
+++ /dev/null
-// System.Net.Sockets.Socket.cs
-//
-// Authors:
-// Phillip Pearson (pp@myelin.co.nz)
-// Dick Porter <dick@ximian.com>
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// Copyright (C) 2001, 2002 Phillip Pearson and Ximian, Inc.
-// http://www.myelin.co.nz
-// (c) 2004 Novell, Inc. (http://www.novell.com)
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-using System.Collections.Generic;
-using System.Net.Configuration;
-using System.Runtime.InteropServices;
-using System.Threading;
-
-namespace System.Net.Sockets
-{
- public class Socket : IDisposable
- {
- enum SocketOperation
- {
- Accept,
- Connect,
- Receive,
- ReceiveFrom,
- Send,
- SendTo
- }
-
- [StructLayout (LayoutKind.Sequential)]
- private sealed class SocketAsyncResult: IAsyncResult
- {
- /* Same structure in the runtime */
- public Socket Sock;
-#if !TARGET_JVM
- public IntPtr handle;
-#else
- public GHSocket handle;
-#endif
- object state;
- AsyncCallback callback;
- WaitHandle waithandle;
-
- Exception delayedException;
-
- public EndPoint EndPoint; // Connect,ReceiveFrom,SendTo
- public byte [] Buffer; // Receive,ReceiveFrom,Send,SendTo
- public int Offset; // Receive,ReceiveFrom,Send,SendTo
- public int Size; // Receive,ReceiveFrom,Send,SendTo
- public SocketFlags SockFlags; // Receive,ReceiveFrom,Send,SendTo
-
- // Return values
- Socket acc_socket;
- int total;
-
- bool completed_sync;
- bool completed;
- public bool blocking;
- internal int error;
- SocketOperation operation;
- public object ares;
-
- public SocketAsyncResult (Socket sock, object state, AsyncCallback callback, SocketOperation operation)
- {
- this.Sock = sock;
- this.blocking = sock.blocking;
- this.handle = sock.socket;
- this.state = state;
- this.callback = callback;
- this.operation = operation;
- SockFlags = SocketFlags.None;
- }
-
- public void CheckIfThrowDelayedException ()
- {
- if (delayedException != null)
- throw delayedException;
-
- if (error != 0)
- throw new SocketException (error);
- }
-
- void CompleteAllOnDispose (Queue queue)
- {
- object [] pending = queue.ToArray ();
- queue.Clear ();
-
- WaitCallback cb;
- for (int i = 0; i < pending.Length; i++)
- {
- SocketAsyncResult ares = (SocketAsyncResult) pending [i];
- cb = new WaitCallback (ares.CompleteDisposed);
- ThreadPool.QueueUserWorkItem (cb, null);
- }
- }
-
- void CompleteDisposed (object unused)
- {
- Complete ();
- }
-
- public void Complete ()
- {
- if (operation != SocketOperation.Receive && Sock.disposed)
- delayedException = new ObjectDisposedException (Sock.GetType ().ToString ());
-
- IsCompleted = true;
-
- Queue queue = null;
- if (operation == SocketOperation.Receive || operation == SocketOperation.ReceiveFrom)
- {
- queue = Sock.readQ;
- }
- else if (operation == SocketOperation.Send || operation == SocketOperation.SendTo)
- {
- queue = Sock.writeQ;
- }
-
- if (queue != null)
- {
- SocketAsyncCall sac = null;
- SocketAsyncResult req = null;
- lock (queue)
- {
- queue.Dequeue (); // remove ourselves
- if (queue.Count > 0)
- {
- req = (SocketAsyncResult) queue.Peek ();
- if (!Sock.disposed)
- {
- Worker worker = new Worker (req);
- sac = GetDelegate (worker, req.operation);
- }
- else
- {
- CompleteAllOnDispose (queue);
- }
- }
- }
-
- if (sac != null)
- sac.BeginInvoke (null, req);
- }
-
- if (callback != null)
- callback (this);
- }
-
- SocketAsyncCall GetDelegate (Worker worker, SocketOperation op)
- {
- switch (op)
- {
- case SocketOperation.Receive:
- return new SocketAsyncCall (worker.Receive);
- case SocketOperation.ReceiveFrom:
- return new SocketAsyncCall (worker.ReceiveFrom);
- case SocketOperation.Send:
- return new SocketAsyncCall (worker.Send);
- case SocketOperation.SendTo:
- return new SocketAsyncCall (worker.SendTo);
- default:
- return null; // never happens
- }
- }
-
- public void Complete (bool synch)
- {
- completed_sync = synch;
- Complete ();
- }
-
- public void Complete (int total)
- {
- this.total = total;
- Complete ();
- }
-
- public void Complete (Exception e, bool synch)
- {
- completed_sync = synch;
- delayedException = e;
- Complete ();
- }
-
- public void Complete (Exception e)
- {
- delayedException = e;
- Complete ();
- }
-
- public void Complete (Socket s)
- {
- acc_socket = s;
- Complete ();
- }
-
- public object AsyncState
- {
- get
- {
- return state;
- }
- }
-
- public WaitHandle AsyncWaitHandle
- {
- get
- {
- lock (this)
- {
- if (waithandle == null)
- waithandle = new ManualResetEvent (completed);
- }
-
- return waithandle;
- }
- set
- {
- waithandle=value;
- }
- }
-
- public bool CompletedSynchronously
- {
- get
- {
- return(completed_sync);
- }
- }
-
- public bool IsCompleted
- {
- get
- {
- return(completed);
- }
- set
- {
- completed=value;
- lock (this)
- {
- if (waithandle != null && value)
- {
- ((ManualResetEvent) waithandle).Set ();
- }
- }
- }
- }
-
- public Socket Socket
- {
- get
- {
- return acc_socket;
- }
- }
-
- public int Total
- {
- get
- {
- return total;
- }
- set
- {
- total = value;
- }
- }
- }
-
- private sealed class Worker
- {
- SocketAsyncResult result;
-
- public Worker (SocketAsyncResult ares)
- {
- this.result = ares;
- }
-
- public void Accept ()
- {
- Socket acc_socket = null;
- try
- {
- acc_socket = result.Sock.Accept ();
- }
- catch (Exception e)
- {
- result.Complete (e);
- return;
- }
-
- result.Complete (acc_socket);
- }
-
- public void Connect ()
- {
- try
- {
- result.Sock.Connect (result.EndPoint);
- result.Sock.connected = true;
- }
- catch (Exception e)
- {
- result.Complete (e);
- return;
- }
-
- result.Complete ();
- }
-
-#if !TARGET_JVM
- public void Receive ()
- {
- // Actual recv() done in the runtime
- result.Complete ();
- }
-#else
- public void Receive ()
- {
- int total = 0;
- try
- {
- total = result.Sock.Receive_nochecks (result.Buffer,
- result.Offset,
- result.Size,
- result.SockFlags);
- }
- catch (Exception e)
- {
- result.Complete (e);
- return;
- }
-
- result.Complete (total);
- }
-#endif
-
- public void ReceiveFrom ()
- {
- int total = 0;
- try
- {
- total = result.Sock.ReceiveFrom_nochecks (result.Buffer,
- result.Offset,
- result.Size,
- result.SockFlags,
- ref result.EndPoint);
- }
- catch (Exception e)
- {
- result.Complete (e);
- return;
- }
-
- result.Complete (total);
- }
-
- int send_so_far;
-
- void UpdateSendValues (int last_sent)
- {
- if (result.error == 0)
- {
- send_so_far += last_sent;
- result.Offset += last_sent;
- result.Size -= last_sent;
- }
- }
-
-#if !TARGET_JVM
- public void Send ()
- {
- // Actual send() done in the runtime
- if (result.error == 0)
- {
- UpdateSendValues (result.Total);
- if (result.Sock.disposed)
- {
- result.Complete ();
- return;
- }
-
- if (result.Size > 0)
- {
- SocketAsyncCall sac = new SocketAsyncCall (this.Send);
- sac.BeginInvoke (null, result);
- return; // Have to finish writing everything. See bug #74475.
- }
- result.Total = send_so_far;
- }
- result.Complete ();
- }
-#else
- public void Send ()
- {
- int total = 0;
- try
- {
- total = result.Sock.Send_nochecks (result.Buffer,
- result.Offset,
- result.Size,
- result.SockFlags);
-
- UpdateSendValues (total);
- if (result.Size > 0)
- {
- SocketAsyncCall sac = new SocketAsyncCall (this.SendTo);
- sac.BeginInvoke (null, result);
- return; // Have to finish writing everything. See bug #74475.
- }
- result.Total = send_so_far;
- }
- catch (Exception e)
- {
- result.Complete (e);
- return;
- }
-
- result.Complete ();
- }
-#endif
-
- public void SendTo ()
- {
- int total = 0;
- try
- {
- total = result.Sock.SendTo_nochecks (result.Buffer,
- result.Offset,
- result.Size,
- result.SockFlags,
- result.EndPoint);
-
- UpdateSendValues (total);
- if (result.Size > 0)
- {
- SocketAsyncCall sac = new SocketAsyncCall (this.SendTo);
- sac.BeginInvoke (null, result);
- return; // Have to finish writing everything. See bug #74475.
- }
- result.Total = send_so_far;
- }
- catch (Exception e)
- {
- result.Complete (e);
- return;
- }
-
- result.Complete ();
- }
- }
-
-
- /* the field "socket" is looked up by name by the runtime */
-#if !TARGET_JVM
- private IntPtr socket;
-#else
- private GHSocket socket;
-#endif
- private AddressFamily address_family;
- private SocketType socket_type;
- private ProtocolType protocol_type;
- internal bool blocking=true;
- private Queue readQ = new Queue (2);
- private Queue writeQ = new Queue (2);
-
-
- delegate void SocketAsyncCall ();
- /*
- * These two fields are looked up by name by the runtime, don't change
- * their name without also updating the runtime code.
- */
- private static int ipv4Supported = -1, ipv6Supported = -1;
-
- /* When true, the socket was connected at the time of
- * the last IO operation
- */
- private bool connected=false;
- /* true if we called Close_internal */
- private bool closed;
- internal bool disposed;
-
- /* Used in LocalEndPoint and RemoteEndPoint if the
- * Mono.Posix assembly is available
- */
- private static object unixendpoint=null;
- private static Type unixendpointtype=null;
-
- static void AddSockets (ArrayList sockets, IList list, string name)
- {
- if (list != null)
- {
- foreach (Socket sock in list)
- {
- if (sock == null) // MS throws a NullRef
- throw new ArgumentNullException (name, "Contains a null element");
- sockets.Add (sock);
- }
- }
-
- sockets.Add (null);
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Select_internal (ref Socket [] sockets,
- int microSeconds,
- out int error);
-#else
- private static void Select_internal (ref Socket [] sockets, int microSeconds, out int error)
- {
- GHSocketFactory.Select_internal(ref sockets, microSeconds, out error);
- }
-#endif
-
- public static void Select (IList checkRead, IList checkWrite, IList checkError, int microSeconds)
- {
- ArrayList list = new ArrayList ();
- AddSockets (list, checkRead, "checkRead");
- AddSockets (list, checkWrite, "checkWrite");
- AddSockets (list, checkError, "checkError");
-
- if (list.Count == 3)
- {
- throw new ArgumentNullException ("checkRead, checkWrite, checkError",
- "All the lists are null or empty.");
- }
-
- int error;
- /*
- * The 'sockets' array contains: READ socket 0-n, null,
- * WRITE socket 0-n, null,
- * ERROR socket 0-n, null
- */
- Socket [] sockets = (Socket []) list.ToArray (typeof (Socket));
- Select_internal (ref sockets, microSeconds, out error);
-
- if (error != 0)
- throw new SocketException (error);
-
- if (checkRead != null)
- checkRead.Clear ();
-
- if (checkWrite != null)
- checkWrite.Clear ();
-
- if (checkError != null)
- checkError.Clear ();
-
- if (sockets == null)
- return;
-
- int mode = 0;
- int count = sockets.Length;
- IList currentList = checkRead;
- for (int i = 0; i < count; i++)
- {
- Socket sock = sockets [i];
- if (sock == null)
- { // separator
- currentList = (mode == 0) ? checkWrite : checkError;
- mode++;
- continue;
- }
-
- if (currentList != null)
- {
- sock.connected = true;
- currentList.Add (sock);
- }
- }
- }
-
-#if !TARGET_JVM
- static Socket()
- {
- Assembly ass;
-
- try {
- ass = Assembly.Load (Consts.AssemblyMono_Posix);
- } catch (FileNotFoundException) {
- return;
- }
-
- unixendpointtype=ass.GetType("Mono.Posix.UnixEndPoint");
-
- /* The endpoint Create() method is an instance
- * method :-(
- */
- Type[] arg_types=new Type[1];
- arg_types[0]=typeof(string);
- ConstructorInfo cons=unixendpointtype.GetConstructor(arg_types);
-
- object[] args=new object[1];
- args[0]="";
-
- unixendpoint=cons.Invoke(args);
- }
-#endif
-
-#if !TARGET_JVM
- // private constructor used by Accept, which already
- // has a socket handle to use
- private Socket(AddressFamily family, SocketType type,
- ProtocolType proto, IntPtr sock)
-#else
- // private constructor used by Accept, which already
- // has a socket handle to use
- private Socket(AddressFamily family, SocketType type,
- ProtocolType proto, GHSocket sock)
- {
-#endif
- address_family=family;
- socket_type=type;
- protocol_type=proto;
-
- socket=sock;
- connected=true;
- }
-
-
-#if !TARGET_JVM
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern IntPtr Socket_internal(AddressFamily family,
- SocketType type,
- ProtocolType proto,
- out int error);
-#else
- private GHSocket Socket_internal(AddressFamily family,
- SocketType type,
- ProtocolType proto,
- out int error)
- {
- return GHSocketFactory.Socket_internal(family, type, proto, out error);
- }
-#endif
-
- public Socket(AddressFamily family, SocketType type,
- ProtocolType proto)
- {
- address_family=family;
- socket_type=type;
- protocol_type=proto;
- int error;
-
- socket=Socket_internal(family, type, proto, out error);
- if (error != 0) {
- throw new SocketException (error);
- }
- }
-
- public AddressFamily AddressFamily
- {
- get
- {
- return(address_family);
- }
- }
-
-#if !TARGET_JVM
- // Returns the amount of data waiting to be read on socket
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Available_internal(IntPtr socket,
- out int error);
-#else
- private int Available_internal(GHSocket socket, out int error)
- {
- return socket.Available_internal(out error);
- }
-#endif
-
- public int Available
- {
- get
- {
- EnsureStillUsable();
-
- int ret, error;
-
- ret = Available_internal(socket, out error);
-
- if (error != 0)
- {
- throw new SocketException (error);
- }
-
- return(ret);
- }
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Blocking_internal(IntPtr socket,
- bool block,
- out int error);
-#else
- private void Blocking_internal(GHSocket socket, bool block, out int error)
- {
- socket.Blocking_internal(block, out error);
- }
-#endif
-
- public bool Blocking
- {
- get
- {
- return(blocking);
- }
- set
- {
- EnsureStillUsable();
-
- int error;
-
- Blocking_internal(socket, value, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
-
- blocking=value;
- }
- }
-
- public bool Connected
- {
- get
- {
- return(connected);
- }
- }
-
-#if !TARGET_JVM
- public IntPtr Handle
- {
- get
- {
- return(socket);
- }
- }
-#else
- public IntPtr Handle
- {
- get
- {
- throw new NotImplementedException ();
- }
- }
-
- internal GHSocket GHHandle
- {
- get
- {
- return socket;
- }
- }
-#endif
-
-#if !TARGET_JVM
- // Returns the local endpoint details in addr and port
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static SocketAddress LocalEndPoint_internal(IntPtr socket, out int error);
-
- [MonoTODO("Support non-IP endpoints")]
- public EndPoint LocalEndPoint
- {
- get
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- SocketAddress sa;
- int error;
-
- sa=LocalEndPoint_internal(socket, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
-
- if(sa.Family==AddressFamily.InterNetwork || sa.Family==AddressFamily.InterNetworkV6) {
- // Stupidly, EndPoint.Create() is an
- // instance method
- return new IPEndPoint(0, 0).Create(sa);
- } else if (sa.Family==AddressFamily.Unix &&
- unixendpoint!=null) {
- return((EndPoint)unixendpointtype.InvokeMember("Create", BindingFlags.InvokeMethod|BindingFlags.Instance|BindingFlags.Public, null, unixendpoint, new object[] {sa}));
- } else {
- throw new NotImplementedException();
- }
- }
- }
-#else
- private EndPoint LocalEndPoint_internal(GHSocket socket, out int error)
- {
- return socket.LocalEndPoint_internal(out error);
- }
-
- public EndPoint LocalEndPoint
- {
- get
- {
- EnsureStillUsable();
-
- int error;
-
- EndPoint ret = LocalEndPoint_internal(socket, out error);
-
- if (error != 0)
- {
- throw new SocketException (error);
- }
-
- return ret;
- }
- }
-#endif
-
- public ProtocolType ProtocolType
- {
- get
- {
- return(protocol_type);
- }
- }
-
-#if !TARGET_JVM
- // Returns the remote endpoint details in addr and port
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static SocketAddress RemoteEndPoint_internal(IntPtr socket, out int error);
-
- [MonoTODO("Support non-IP endpoints")]
- public EndPoint RemoteEndPoint
- {
- get
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- SocketAddress sa;
- int error;
-
- sa=RemoteEndPoint_internal(socket, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
-
- if(sa.Family==AddressFamily.InterNetwork || sa.Family==AddressFamily.InterNetworkV6 ) {
- // Stupidly, EndPoint.Create() is an
- // instance method
- return new IPEndPoint(0, 0).Create(sa);
- } else if (sa.Family==AddressFamily.Unix &&
- unixendpoint!=null) {
- return((EndPoint)unixendpointtype.InvokeMember("Create", BindingFlags.InvokeMethod|BindingFlags.Instance|BindingFlags.Public, null, unixendpoint, new object[] {sa}));
- } else {
- throw new NotImplementedException();
- }
- }
- }
-#else
- private EndPoint RemoteEndPoint_internal(GHSocket socket, out int error)
- {
- return socket.RemoteEndPoint_internal(out error);
- }
-
- public EndPoint RemoteEndPoint
- {
- get
- {
- EnsureStillUsable();
-
- int error;
-
- EndPoint ret = RemoteEndPoint_internal(socket, out error);
-
- if (error != 0)
- {
- throw new SocketException (error);
- }
-
- return ret;
- }
- }
-#endif
-
- public SocketType SocketType
- {
- get
- {
- return(socket_type);
- }
- }
-
- public static bool SupportsIPv4
- {
- get
- {
- CheckProtocolSupport();
- return ipv4Supported == 1;
- }
- }
-
- public static bool SupportsIPv6
- {
- get
- {
- CheckProtocolSupport();
- return ipv6Supported == 1;
- }
- }
-
- internal static void CheckProtocolSupport()
- {
- if(ipv4Supported == -1)
- {
- try
- {
- Socket tmp = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- tmp.Close();
-
- ipv4Supported = 1;
- }
- catch
- {
- ipv4Supported = 0;
- }
- }
-
- if(ipv6Supported == -1)
- {
-#if CONFIGURATION_DEP
- SettingsSection config;
- config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
- if (config != null)
- ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
-#else
- NetConfig config = (NetConfig)System.Configuration.ConfigurationSettings.GetConfig("system.net/settings");
-
- if(config != null)
- ipv6Supported = config.ipv6Enabled?-1:0;
-#endif
- if(ipv6Supported != 0)
- {
- try
- {
- Socket tmp = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
- tmp.Close();
-
- ipv6Supported = 1;
- }
- catch { }
- }
- }
- }
-
-#if !TARGET_JVM
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static IntPtr Accept_internal(IntPtr sock,
- out int error);
-#else
- private GHSocket Accept_internal(GHSocket sock, out int error)
- {
- return sock.Accept_internal(out error);
- }
-#endif
-
- public Socket Accept()
- {
- EnsureStillUsable();
-
- int error = 0;
-#if !TARGET_JVM
- IntPtr sock = (IntPtr) (-1);
-#else
- GHSocket sock = null;
-#endif
- sock = Accept_internal(socket, out error);
- if (error != 0) {
- throw new SocketException (error);
- }
-
- Socket accepted = new Socket(this.AddressFamily,
- this.SocketType,
- this.ProtocolType, sock);
-
- accepted.Blocking = this.Blocking;
- return(accepted);
- }
-
- public IAsyncResult BeginAccept(AsyncCallback callback,
- object state)
- {
-
- EnsureStillUsable();
-
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Accept);
- Worker worker = new Worker (req);
- SocketAsyncCall sac = new SocketAsyncCall (worker.Accept);
- sac.BeginInvoke (null, req);
- return(req);
- }
-
- public IAsyncResult BeginConnect(EndPoint end_point,
- AsyncCallback callback,
- object state)
- {
-
- EnsureStillUsable();
-
- if (end_point == null)
- throw new ArgumentNullException ("end_point");
-
- SocketAsyncResult req = new SocketAsyncResult (this, state, callback, SocketOperation.Connect);
- req.EndPoint = end_point;
-
- // Bug #75154: Connect() should not succeed for .Any addresses.
- if (end_point is IPEndPoint)
- {
- IPEndPoint ep = (IPEndPoint) end_point;
- if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any))
- {
- req.Complete (new SocketException (10049), true);
- return req;
- }
- }
-
- int error = 0;
- if (!blocking)
- {
-#if !TARGET_JVM
- SocketAddress serial = end_point.Serialize ();
- Connect_internal (socket, serial, out error);
-#else
- Connect_internal (socket, end_point, out error);
-#endif
- if (error == 0)
- {
- // succeeded synch
- connected = true;
- req.Complete (true);
- }
- else if (error != 10036 && error != 10035)
- {
- // error synch
- connected = false;
- req.Complete (new SocketException (error), true);
- }
- }
-
- if (blocking || error == 10036 || error == 10035)
- {
- // continue asynch
- connected = false;
- Worker worker = new Worker (req);
- SocketAsyncCall sac = new SocketAsyncCall (worker.Connect);
- sac.BeginInvoke (null, req);
- }
-
- return(req);
- }
-
- public IAsyncResult BeginReceive(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- AsyncCallback callback,
- object state)
- {
-
- EnsureStillUsable();
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (offset < 0 || offset > buffer.Length)
- throw new ArgumentOutOfRangeException ("offset");
-
- if (size < 0 || offset + size > buffer.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- SocketAsyncResult req;
- lock (readQ)
- {
- req = new SocketAsyncResult (this, state, callback, SocketOperation.Receive);
- req.Buffer = buffer;
- req.Offset = offset;
- req.Size = size;
- req.SockFlags = socket_flags;
- readQ.Enqueue (req);
- if (readQ.Count == 1)
- {
- Worker worker = new Worker (req);
- SocketAsyncCall sac = new SocketAsyncCall (worker.Receive);
- sac.BeginInvoke (null, req);
- }
- }
-
- return req;
- }
-
- public IAsyncResult BeginReceiveFrom(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- ref EndPoint remote_end,
- AsyncCallback callback,
- object state)
- {
- EnsureStillUsable();
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (offset < 0)
- throw new ArgumentOutOfRangeException ("offset must be >= 0");
-
- if (size < 0)
- throw new ArgumentOutOfRangeException ("size must be >= 0");
-
- if (offset + size > buffer.Length)
- throw new ArgumentOutOfRangeException ("offset + size exceeds the buffer length");
-
- SocketAsyncResult req;
- lock (readQ)
- {
- req = new SocketAsyncResult (this, state, callback, SocketOperation.ReceiveFrom);
- req.Buffer = buffer;
- req.Offset = offset;
- req.Size = size;
- req.SockFlags = socket_flags;
- req.EndPoint = remote_end;
- readQ.Enqueue (req);
- if (readQ.Count == 1)
- {
- Worker worker = new Worker (req);
- SocketAsyncCall sac = new SocketAsyncCall (worker.ReceiveFrom);
- sac.BeginInvoke (null, req);
- }
- }
- return req;
- }
-
- public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socket_flags,
- AsyncCallback callback, object state)
- {
- EnsureStillUsable();
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (offset < 0)
- throw new ArgumentOutOfRangeException ("offset must be >= 0");
-
- if (size < 0)
- throw new ArgumentOutOfRangeException ("size must be >= 0");
-
- if (offset + size > buffer.Length)
- throw new ArgumentOutOfRangeException ("offset + size exceeds the buffer length");
-
- SocketAsyncResult req;
- lock (writeQ)
- {
- req = new SocketAsyncResult (this, state, callback, SocketOperation.Send);
- req.Buffer = buffer;
- req.Offset = offset;
- req.Size = size;
- req.SockFlags = socket_flags;
- writeQ.Enqueue (req);
- if (writeQ.Count == 1)
- {
- Worker worker = new Worker (req);
- SocketAsyncCall sac = new SocketAsyncCall (worker.Send);
- sac.BeginInvoke (null, req);
- }
- }
- return req;
- }
-
- public IAsyncResult BeginSendTo(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- EndPoint remote_end,
- AsyncCallback callback,
- object state)
- {
- EnsureStillUsable();
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (offset < 0)
- throw new ArgumentOutOfRangeException ("offset must be >= 0");
-
- if (size < 0)
- throw new ArgumentOutOfRangeException ("size must be >= 0");
-
- if (offset + size > buffer.Length)
- throw new ArgumentOutOfRangeException ("offset + size exceeds the buffer length");
-
- SocketAsyncResult req;
- lock (writeQ)
- {
- req = new SocketAsyncResult (this, state, callback, SocketOperation.SendTo);
- req.Buffer = buffer;
- req.Offset = offset;
- req.Size = size;
- req.SockFlags = socket_flags;
- req.EndPoint = remote_end;
- writeQ.Enqueue (req);
- if (writeQ.Count == 1)
- {
- Worker worker = new Worker (req);
- SocketAsyncCall sac = new SocketAsyncCall (worker.SendTo);
- sac.BeginInvoke (null, req);
- }
- }
- return req;
- }
-
-#if !TARGET_JVM
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Bind_internal(IntPtr sock,
- SocketAddress sa,
- out int error);
-
- public void Bind(EndPoint local_end)
- {
- if (disposed && closed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- if(local_end==null) {
- throw new ArgumentNullException("local_end");
- }
-
- int error;
-
- Bind_internal(socket, local_end.Serialize(),
- out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
- }
-#else
- private void Bind_internal(GHSocket sock,
- EndPoint sa,
- out int error)
- {
- sock.Bind_internal(sa, out error);
- }
-
- public void Bind(EndPoint local_end)
- {
- EnsureStillUsable();
-
- if(local_end==null) {
- throw new ArgumentNullException("local_end");
- }
-
- int error;
-
- Bind_internal(socket, local_end,
- out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
- }
-#endif
-
-#if !TARGET_JVM
- // Closes the socket
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Close_internal(IntPtr socket,
- out int error);
-#else
- private void Close_internal(GHSocket socket, out int error)
- {
- socket.Close_internal(out error);
- }
-#endif
-
- public void Close()
- {
- ((IDisposable) this).Dispose ();
- }
-
-#if !TARGET_JVM
- // Connects to the remote address
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Connect_internal(IntPtr sock,
- SocketAddress sa,
- out int error);
-#else
- private void Connect_internal(GHSocket sock,
- EndPoint sa,
- out int error)
- {
- sock.Connect_internal(sa, out error);
- }
-#endif
-
- public void Connect(EndPoint remote_end)
- {
- EnsureStillUsable();
-
- if(remote_end==null) {
- throw new ArgumentNullException("remote_end");
- }
-
- if (remote_end is IPEndPoint) {
- IPEndPoint ep = (IPEndPoint) remote_end;
- if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any))
- throw new SocketException (10049);
- }
-
- int error = 0;
-
-#if !TARGET_JVM
- Connect_internal (socket, remote_end.Serialize(), out error);
-#else
- Connect_internal (socket, remote_end, out error);
-#endif
- if (error != 0) {
- throw new SocketException (error);
- }
-
- connected=true;
- }
-
-#if TARGET_JVM
- public void ChangeToSSL()
- {
- try
- {
- GHSocket tmp = socket.ChangeToSSL(null);
- if (tmp != null)
- {
- socket = tmp;
- }
- }
- catch (Exception e)
- {
-#if DEBUG
- Console.WriteLine("Caught exception during ChangeToSSL: {0}, {1}", e.GetType(), e.Message);
-#endif
- throw new SocketException(10045);
- }
- }
-#endif
-
- public Socket EndAccept(IAsyncResult result)
- {
- EnsureStillUsable();
-
- if (result == null)
- throw new ArgumentNullException ("result");
-
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
-
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
-
- req.CheckIfThrowDelayedException();
- return req.Socket;
- }
-
- public void EndConnect(IAsyncResult result) {
- EnsureStillUsable();
-
- if (result == null)
- throw new ArgumentNullException ("result");
-
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
-
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
-
- req.CheckIfThrowDelayedException();
- }
-
- [MonoNotSupported ("")]
- public void EndDisconnect (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
-
- public int EndReceive(IAsyncResult result) {
- EnsureStillUsable();
-
- if (result == null)
- throw new ArgumentNullException ("result");
-
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
-
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
-
- req.CheckIfThrowDelayedException();
- return req.Total;
- }
-
- public int EndReceiveFrom(IAsyncResult result,
- ref EndPoint end_point)
- {
- EnsureStillUsable();
-
- if (result == null)
- throw new ArgumentNullException ("result");
-
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
-
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
-
- req.CheckIfThrowDelayedException();
- end_point = req.EndPoint;
- return req.Total;
- }
-
- public int EndSend(IAsyncResult result) {
- EnsureStillUsable();
-
- if (result == null)
- throw new ArgumentNullException ("result");
-
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
-
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
-
- req.CheckIfThrowDelayedException();
- return req.Total;
- }
-
- public int EndSendTo(IAsyncResult result) {
- EnsureStillUsable();
-
- if (result == null)
- throw new ArgumentNullException ("result");
-
- SocketAsyncResult req = result as SocketAsyncResult;
- if (req == null)
- throw new ArgumentException ("Invalid IAsyncResult", "result");
-
- if (!result.IsCompleted)
- result.AsyncWaitHandle.WaitOne();
-
- req.CheckIfThrowDelayedException();
- return req.Total;
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void GetSocketOption_obj_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, out object obj_val, out int error);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void GetSocketOption_arr_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val, out int error);
-#else
- private void GetSocketOption_obj_internal(GHSocket socket, SocketOptionLevel level,
- SocketOptionName name, out object obj_val, out int error)
- {
- EnsureStillUsable();
-
- socket.GetSocketOption_obj_internal(level, name, out obj_val, out error);
- }
- private void GetSocketOption_arr_internal(GHSocket socket, SocketOptionLevel level,
- SocketOptionName name, ref byte[] byte_val, out int error)
- {
- EnsureStillUsable();
-
- socket.GetSocketOption_arr_internal(level, name, ref byte_val, out error);
- }
-#endif
-
- public object GetSocketOption(SocketOptionLevel level,
- SocketOptionName name) {
- object obj_val;
- int error;
-
- GetSocketOption_obj_internal(socket, level, name,
- out obj_val, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
-
- if(name==SocketOptionName.Linger) {
- return((LingerOption)obj_val);
- } else if (name==SocketOptionName.AddMembership ||
- name==SocketOptionName.DropMembership) {
- return((MulticastOption)obj_val);
- } else if (obj_val is int) {
- return((int)obj_val);
- } else {
- return(obj_val);
- }
- }
-
- public void GetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- byte[] opt_value) {
- int error;
-
- GetSocketOption_arr_internal(socket, level, name,
- ref opt_value, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
- }
-
- public byte[] GetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- int length) {
- byte[] byte_val=new byte[length];
- int error;
-
- GetSocketOption_arr_internal(socket, level, name,
- ref byte_val, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
-
- return(byte_val);
- }
-
-#if !TARGET_JVM
- // See Socket.IOControl, WSAIoctl documentation in MSDN. The
- // common options between UNIX and Winsock are FIONREAD,
- // FIONBIO and SIOCATMARK. Anything else will depend on the
- // system.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static int WSAIoctl (IntPtr sock, int ioctl_code,
- byte [] input, byte [] output,
- out int error);
-#else
- int WSAIoctl (GHSocket sock, int ioctl_code,
- byte [] input, byte [] output,
- out int error)
- {
- return sock.WSAIoctl(ioctl_code, input, output, out error);
- }
-#endif
-
- public int IOControl (int ioctl_code, byte [] in_value, byte [] out_value)
- {
- if (disposed)
- throw new ObjectDisposedException (GetType ().ToString ());
-
- int error;
- int result = WSAIoctl (socket, ioctl_code, in_value,
- out_value, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
-
- if (result == -1)
- throw new InvalidOperationException ("Must use Blocking property instead.");
-
- return result;
- }
-
- [MonoNotSupported ("")]
- public int IOControl (IOControlCode ioControlCode, byte [] optionInValue, byte [] optionOutValue)
- {
- throw new NotImplementedException ();
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Listen_internal(IntPtr sock,
- int backlog,
- out int error);
-#else
- private void Listen_internal(GHSocket sock,
- int backlog,
- out int error)
- {
- EnsureStillUsable();
-
- sock.Listen_internal(backlog, out error);
- }
-#endif
-
- public void Listen(int backlog)
- {
- int error;
-
- Listen_internal(socket, backlog, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static bool Poll_internal (IntPtr socket, SelectMode mode, int timeout, out int error);
-#else
- bool Poll_internal (GHSocket socket, SelectMode mode, int timeout, out int error)
- {
- return socket.Poll_internal(mode, timeout, this, out error);
- }
-#endif
-
- public bool Poll(int time_us, SelectMode mode)
- {
- EnsureStillUsable();
-
- if (mode != SelectMode.SelectRead &&
- mode != SelectMode.SelectWrite &&
- mode != SelectMode.SelectError)
- throw new NotSupportedException ("'mode' parameter is not valid.");
-
- int error;
- bool result = Poll_internal (socket, mode, time_us, out error);
- if (error != 0)
- throw new SocketException (error);
-
- if (result == true) {
- /* Update the connected state; for
- * non-blocking Connect()s this is
- * when we can find out that the
- * connect succeeded.
- */
- connected = true;
- }
-
- return result;
- }
-
- public int Receive (byte [] buf)
- {
- EnsureStillUsable();
-
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- return Receive_nochecks (buf, 0, buf.Length, SocketFlags.None);
- }
-
- public int Receive (byte [] buf, SocketFlags flags)
- {
- EnsureStillUsable();
-
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- return Receive_nochecks (buf, 0, buf.Length, flags);
- }
-
- public int Receive (byte [] buf, int size, SocketFlags flags)
- {
- EnsureStillUsable();
-
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- if (size < 0 || size > buf.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- return Receive_nochecks (buf, 0, size, flags);
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Receive_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- out int error);
-#else
- private int Receive_internal(GHSocket sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- out int error)
- {
- return sock.Receive_internal(buffer, offset, count, flags, out error);
- }
-#endif
-
- public int Receive (byte [] buf, int offset, int size, SocketFlags flags)
- {
- EnsureStillUsable();
-
- if(buf==null)
- throw new ArgumentNullException ("buf");
-
- if (offset < 0 || offset > buf.Length)
- throw new ArgumentOutOfRangeException ("offset");
-
- if (size < 0 || offset + size > buf.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- return Receive_nochecks (buf, offset, size, flags);
- }
-
- int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags)
- {
- int ret, error;
- ret = Receive_internal (socket, buf, offset, size, flags, out error);
-
- if(error != 0) {
- if (error != 10035 && error != 10036) // WSAEWOULDBLOCK && WSAEINPROGRESS
- connected=false;
-
- throw new SocketException (error);
- }
-
- connected=true;
-
- return ret;
- }
-
- public int ReceiveFrom (byte [] buf, ref EndPoint remote_end)
- {
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
-
- return ReceiveFrom_nochecks (buf, 0, buf.Length, SocketFlags.None, ref remote_end);
- }
-
- public int ReceiveFrom (byte [] buf, SocketFlags flags, ref EndPoint remote_end)
- {
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
-
-
- return ReceiveFrom_nochecks (buf, 0, buf.Length, flags, ref remote_end);
- }
-
- public int ReceiveFrom(byte[] buf, int size, SocketFlags flags,
- ref EndPoint remote_end)
- {
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
-
- if (size < 0 || size > buf.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- return ReceiveFrom_nochecks (buf, 0, size, flags, ref remote_end);
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int RecvFrom_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- ref SocketAddress sockaddr,
- out int error);
-#else
- private int RecvFrom_internal(GHSocket sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- ref SocketAddress sockaddr,
- out int error)
- {
- return sock.RecvFrom_internal(buffer, offset, count, flags, ref sockaddr, out error);
- }
-
-#endif
-
- public int ReceiveFrom(byte[] buf, int offset, int size, SocketFlags flags,
- ref EndPoint remote_end)
- {
- EnsureStillUsable();
-
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
-
- if (offset < 0 || offset > buf.Length)
- throw new ArgumentOutOfRangeException ("offset");
-
- if (size < 0 || offset + size > buf.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- return ReceiveFrom_nochecks (buf, offset, size, flags, ref remote_end);
- }
-
- int ReceiveFrom_nochecks (byte [] buf, int offset, int size, SocketFlags flags,
- ref EndPoint remote_end)
- {
- EnsureStillUsable();
-
- SocketAddress sockaddr=remote_end.Serialize();
- int cnt, error;
-
- cnt = RecvFrom_internal (socket, buf, offset, size, flags, ref sockaddr, out error);
-
- if (error != 0) {
- if (error != 10035 && error != 10036) // WSAEWOULDBLOCK && WSAEINPROGRESS
- connected=false;
-
- throw new SocketException (error);
- }
-
- connected=true;
-
- // If sockaddr is null then we're a connection
- // oriented protocol and should ignore the
- // remote_end parameter (see MSDN
- // documentation for Socket.ReceiveFrom(...) )
-
- if ( sockaddr != null ) {
- // Stupidly, EndPoint.Create() is an
- // instance method
- remote_end=remote_end.Create(sockaddr);
- }
-
- return cnt;
- }
-
- public int Send (byte [] buf)
- {
- EnsureStillUsable();
-
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- return Send_nochecks (buf, 0, buf.Length, SocketFlags.None);
- }
-
- public int Send (byte [] buf, SocketFlags flags)
- {
- EnsureStillUsable();
-
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- return Send_nochecks (buf, 0, buf.Length, flags);
- }
-
- public int Send (byte [] buf, int size, SocketFlags flags)
- {
- EnsureStillUsable();
-
- if (buf == null)
- throw new ArgumentNullException ("buf");
-
- if (size < 0 || size > buf.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- return Send_nochecks (buf, 0, size, flags);
- }
-
- [MonoNotSupported ("")]
- public int Send (byte [] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public int Send (IList<ArraySegment<byte>> buffers)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
- {
- throw new NotImplementedException ();
- }
-
- //[CLSCompliantAttribute (false)]
- [MonoNotSupported ("")]
- public int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public int Receive (byte [] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public int Receive (IList<ArraySegment<byte>> buffers)
- {
- throw new NotImplementedException ();
- }
-
- //[CLSCompliantAttribute (false)]
- [MonoNotSupported ("")]
- public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
- {
- throw new NotImplementedException ();
- }
-
- //[CLSCompliantAttribute (false)]
- [MonoNotSupported ("")]
- public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public int ReceiveMessageFrom (byte [] buffer, int offset, int size, ref SocketFlags socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public IAsyncResult BeginReceiveMessageFrom (byte [] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, AsyncCallback callback, Object state)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public int EndReceiveMessageFrom (IAsyncResult asyncResult, ref SocketFlags socketFlags, ref EndPoint endPoint, out IPPacketInformation ipPacketInformation)
- {
- throw new NotImplementedException ();
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Send_internal(IntPtr sock,
- byte[] buf, int offset,
- int count,
- SocketFlags flags,
- out int error);
-#else
- private int Send_internal(GHSocket sock,
- byte[] buf, int offset,
- int count,
- SocketFlags flags,
- out int error)
- {
- return sock.Send_internal(buf, offset, count, flags, out error);
- }
-#endif
-
- public int Send (byte[] buf, int offset, int size, SocketFlags flags)
- {
- EnsureStillUsable();
-
- if (buf == null)
- throw new ArgumentNullException ("buffer");
-
- if (offset < 0 || offset > buf.Length)
- throw new ArgumentOutOfRangeException ("offset");
-
- if (size < 0 || offset + size > buf.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- return Send_nochecks (buf, offset, size, flags);
- }
-
- int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags)
- {
- if (size == 0)
- return 0;
-
- int ret, error;
-
- ret = Send_internal (socket, buf, offset, size, flags, out error);
-
- if (error != 0) {
- if (error != 10035 && error != 10036) // WSAEWOULDBLOCK && WSAEINPROGRESS
- connected = false;
-
- throw new SocketException (error);
- }
- connected = true;
-
- return ret;
- }
-
- public int SendTo (byte [] buffer, EndPoint remote_end)
- {
- EnsureStillUsable();
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
-
- return SendTo_nochecks (buffer, 0, buffer.Length, SocketFlags.None, remote_end);
- }
-
- public int SendTo (byte [] buffer, SocketFlags flags, EndPoint remote_end)
- {
- EnsureStillUsable();
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
-
- return SendTo_nochecks (buffer, 0, buffer.Length, flags, remote_end);
- }
-
- public int SendTo (byte [] buffer, int size, SocketFlags flags, EndPoint remote_end)
- {
- EnsureStillUsable();
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
-
- if (size < 0 || size > buffer.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- return SendTo_nochecks (buffer, 0, size, flags, remote_end);
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int SendTo_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- SocketAddress sa,
- out int error);
-#else
- private int SendTo_internal(GHSocket sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- SocketAddress sa,
- out int error)
- {
- return sock.SendTo_internal(buffer, offset, count, flags, sa, out error);
- }
-#endif
-
- public int SendTo(byte[] buffer, int offset, int size, SocketFlags flags,
- EndPoint remote_end)
- {
- EnsureStillUsable();
-
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
-
- if (remote_end == null)
- throw new ArgumentNullException("remote_end");
-
- if (offset < 0 || offset > buffer.Length)
- throw new ArgumentOutOfRangeException ("offset");
-
- if (size < 0 || offset + size > buffer.Length)
- throw new ArgumentOutOfRangeException ("size");
-
- return SendTo_nochecks (buffer, offset, size, flags, remote_end);
- }
-
- int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags,
- EndPoint remote_end)
- {
- SocketAddress sockaddr=remote_end.Serialize();
-
- int ret, error;
-
- ret = SendTo_internal (socket, buffer, offset, size, flags, sockaddr, out error);
-
- if (error != 0) {
- if (error != 10035 && error != 10036) // WSAEWOULDBLOCK && WSAEINPROGRESS
- connected=false;
-
- throw new SocketException (error);
- }
-
- connected=true;
-
- return ret;
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void SetSocketOption_internal (IntPtr socket, SocketOptionLevel level,
- SocketOptionName name, object obj_val,
- byte [] byte_val, int int_val,
- out int error);
-#else
- private void SetSocketOption_internal (GHSocket socket, SocketOptionLevel level,
- SocketOptionName name, object obj_val,
- byte [] byte_val, int int_val,
- out int error)
- {
- socket.SetSocketOption_internal(level, name, obj_val, byte_val, int_val, out error);
- }
-#endif
-
- public void SetSocketOption (SocketOptionLevel level, SocketOptionName name, byte[] opt_value)
- {
- EnsureStillUsable();
-
- int error;
-
- SetSocketOption_internal(socket, level, name, null,
- opt_value, 0, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
- }
-
- public void SetSocketOption (SocketOptionLevel level, SocketOptionName name, int opt_value)
- {
- EnsureStillUsable();
-
- int error;
-
- SetSocketOption_internal(socket, level, name, null,
- null, opt_value, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
- }
-
- public void SetSocketOption (SocketOptionLevel level, SocketOptionName name, object opt_value)
- {
-
- EnsureStillUsable();
-
- if(opt_value==null) {
- throw new ArgumentNullException();
- }
-
- int error;
- /* From MS documentation on SetSocketOption: "For an
- * option with a Boolean data type, specify a nonzero
- * value to enable the option, and a zero value to
- * disable the option."
- * Booleans are only handled in 2.0
- */
-
- if (opt_value is System.Boolean) {
- 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 {
- SetSocketOption_internal (socket, level, name, opt_value, null, 0, out error);
- }
-
- if (error != 0)
- throw new SocketException (error);
- }
-
- public void SetSocketOption (SocketOptionLevel level, SocketOptionName name, bool optionValue) {
- EnsureStillUsable();
-
- int error;
- int int_val = (optionValue) ? 1 : 0;
- SetSocketOption_internal (socket, level, name, null, null, int_val, out error);
- if (error != 0)
- throw new SocketException (error);
- }
-
-#if !TARGET_JVM
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Shutdown_internal(IntPtr socket, SocketShutdown how, out int error);
-#else
- private void Shutdown_internal(GHSocket socket, SocketShutdown how, out int error)
- {
- socket.Shutdown_internal(how, out error);
- }
-#endif
-
- public void Shutdown(SocketShutdown how)
- {
- EnsureStillUsable();
-
- int error;
-
- Shutdown_internal(socket, how, out error);
-
- if (error != 0) {
- throw new SocketException (error);
- }
- }
-
-#if !TARGET_JVM
- public override int GetHashCode ()
- {
- return (int) socket;
- }
-#else
- public override int GetHashCode ()
- {
- if (socket == null)
- return -1;
-
- return socket.GetHashCode();
- }
-#endif
-
-#if !TARGET_JVM
- protected virtual void Dispose (bool explicitDisposing)
- {
- if (disposed)
- return;
-
- disposed = true;
- connected = false;
- if ((int) socket != -1)
- {
- int error;
- closed = true;
- IntPtr x = socket;
- socket = (IntPtr) (-1);
- Close_internal (x, out error);
- if (blocking_thread != null)
- {
- blocking_thread.Abort ();
- blocking_thread = null;
- }
-
- if (error != 0)
- throw new SocketException (error);
- }
- }
-#else
- private void EnsureStillUsable()
- {
- if (disposed && closed)
- throw new ObjectDisposedException(this.GetType().ToString());
- }
- protected virtual void Dispose (bool explicitDisposing)
- {
- if (disposed)
- return;
-
- disposed = true;
- connected = false;
- if (socket != null)
- {
- int error;
- closed = true;
- GHSocket x = socket;
- socket = null;
- Close_internal (x, out error);
-
- if (error != 0)
- throw new SocketException (error);
- }
- }
-#endif
-
- #region .Net 2.0 properties and methods
-
- #region Properties
- [MonoTODO]
- public int ReceiveBufferSize
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public int SendBufferSize
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public bool UseOnlyOverlappedIO
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public bool NoDelay
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public bool IsBound
- {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public bool ExclusiveAddressUse
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO("udp sockets are not supported")]
- public bool DontFragment
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public bool EnableBroadcast
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public bool MulticastLoopback
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public short Ttl
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public int ReceiveTimeout
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public int SendTimeout
- {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- #endregion //Properties
-
- #region Methods
-
- [MonoTODO]
- public IAsyncResult BeginConnect(IPAddress address, int port,
- AsyncCallback requestCallback,
- object state)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IAsyncResult BeginConnect(IPAddress[] addresses, int port,
- AsyncCallback requestCallback,
- object state)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IAsyncResult BeginConnect(string host, int port,
- AsyncCallback requestCallback,
- object state)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IAsyncResult BeginAccept(int receiveSize, AsyncCallback callback, object state)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public IAsyncResult BeginAccept( Socket acceptSocket,int receiveSize,
- AsyncCallback callback, object state)
- {
- throw new NotImplementedException();
- }
-
- [MonoNotSupported ("")]
- public Socket EndAccept (out byte [] buffer, IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public Socket EndAccept (out byte [] buffer, out int bytesTransferred, IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IAsyncResult BeginDisconnect(bool reuseSocket, AsyncCallback callback, object state)
- {
- throw new NotImplementedException();
- }
-
- [MonoNotSupported ("")]
- public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- [CLSCompliantAttribute (false)]
- public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags,
- out SocketError errorCode, AsyncCallback callback,
- object state)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IAsyncResult BeginSend(byte[] buffer, int offset, int size,
- SocketFlags socketFlags, out SocketError errorCode,
- AsyncCallback callback, object state)
- {
- throw new NotImplementedException();
- }
-
- [MonoNotSupported ("")]
- public int EndSend (IAsyncResult asyncResult, out SocketError errorCode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public IAsyncResult BeginReceive (byte [] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, Object state)
- {
- throw new NotImplementedException ();
- }
-
- [CLSCompliantAttribute (false)]
- [MonoNotSupported ("")]
- public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, Object state)
- {
- throw new NotImplementedException ();
- }
-
- [CLSCompliantAttribute (false)]
- [MonoNotSupported ("")]
- public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, Object state)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void SendFile (string fileName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void SendFile (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public IAsyncResult BeginSendFile (string fileName, AsyncCallback callback, object state)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public IAsyncResult BeginSendFile (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags, AsyncCallback callback, object state)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public void EndSendFile (IAsyncResult asyncResult)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Close(int timeout)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void Connect(IPAddress address, int port)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void Connect(IPAddress[] address, int port)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public void Connect(string host, int port)
- {
- throw new NotImplementedException();
- }
-
- [MonoNotSupported ("")]
- public void Disconnect (bool reuseSocket)
- {
- throw new NotImplementedException ();
- }
-
- [MonoNotSupported ("")]
- public SocketInformation DuplicateAndClose (int targetProcessId)
- {
- throw new NotImplementedException ();
- }
- #endregion //Methods
-
- #endregion
-
- void IDisposable.Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- ~Socket () {
- Dispose(false);
- }
-
- }
-}
[Serializable]
public class SocketException : Win32Exception
{
-#if TARGET_JVM
- public SocketException ()
- : base (-2147467259)
-#else
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern int WSAGetLastError_internal ();
public SocketException ()
: base (WSAGetLastError_internal ())
-#endif
{
}
}
}
-#if !TARGET_JVM
// Creates a new system socket, returning the handle
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern IntPtr Socket_internal(AddressFamily family,
SocketType type,
ProtocolType proto,
out int error);
-#endif
public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
{
get { return address_family; }
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static void Blocking_internal(IntPtr socket,
bool block,
out int error);
-#endif
public bool Blocking {
get {
get { return client.Connected; }
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.ExclusiveAddressUse is not supported")]
-#endif
public bool ExclusiveAddressUse {
get {
return(client.ExclusiveAddressUse);
client.EndConnect (asyncResult);
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.BeginConnect is not supported")]
-#endif
public IAsyncResult BeginConnect (IPAddress address, int port, AsyncCallback requestCallback, object state)
{
return client.BeginConnect (address, port, requestCallback, state);
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.BeginConnect is not supported")]
-#endif
public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
{
return client.BeginConnect (addresses, port, requestCallback, state);
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.BeginConnect is not supported")]
-#endif
public IAsyncResult BeginConnect (string host, int port, AsyncCallback requestCallback, object state)
{
return client.BeginConnect (host, port, requestCallback, state);
/// Specifies whether the TcpListener allows only one
/// underlying socket to listen to a specific port
/// </summary>
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.ExclusiveAddressUse is not supported")]
-#endif
public bool ExclusiveAddressUse
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.DontFragment is not supported")]
-#endif
public bool DontFragment
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.EnableBroadcast is not supported")]
-#endif
public bool EnableBroadcast
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.ExclusiveAddressUse is not supported")]
-#endif
public bool ExclusiveAddressUse
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.MulticastLoopback is not supported")]
-#endif
public bool MulticastLoopback
{
get {
}
}
-#if TARGET_JVM
- [MonoNotSupported ("Not supported as Socket.Ttl is not supported")]
-#endif
public short Ttl
{
get {
const int HeaderMaxLength = 14;
byte[] headerBuffer;
byte[] sendBuffer;
+ long remaining;
public ClientWebSocket ()
{
ValidateArraySegment (buffer);
return Task.Run (() => {
EnsureWebSocketState (WebSocketState.Open, WebSocketState.CloseSent);
- // First read the two first bytes to know what we are doing next
- connection.Read (req, headerBuffer, 0, 2);
- var isLast = (headerBuffer[0] >> 7) > 0;
- var isMasked = (headerBuffer[1] >> 7) > 0;
- int mask = 0;
- var type = WireToMessageType ((byte)(headerBuffer[0] & 0xF));
- long length = headerBuffer[1] & 0x7F;
- int offset = 0;
- if (length == 126) {
- offset = 2;
- connection.Read (req, headerBuffer, 2, offset);
+
+ bool isLast;
+ WebSocketMessageType type;
+ long length;
+
+ if (remaining == 0) {
+ // First read the two first bytes to know what we are doing next
+ connection.Read (req, headerBuffer, 0, 2);
+ isLast = (headerBuffer[0] >> 7) > 0;
+ var isMasked = (headerBuffer[1] >> 7) > 0;
+ int mask = 0;
+ type = WireToMessageType ((byte)(headerBuffer[0] & 0xF));
+ length = headerBuffer[1] & 0x7F;
+ int offset = 0;
+ if (length == 126) {
+ offset = 2;
+ connection.Read (req, headerBuffer, 2, offset);
length = (headerBuffer[2] << 8) | headerBuffer[3];
- } else if (length == 127) {
- offset = 8;
- connection.Read (req, headerBuffer, 2, offset);
- length = 0;
- for (int i = 2; i <= 9; i++)
- length = (length << 8) | headerBuffer[i];
- }
+ } else if (length == 127) {
+ offset = 8;
+ connection.Read (req, headerBuffer, 2, offset);
+ length = 0;
+ for (int i = 2; i <= 9; i++)
+ length = (length << 8) | headerBuffer[i];
+ }
- if (isMasked) {
- connection.Read (req, headerBuffer, 2 + offset, 4);
- for (int i = 0; i < 4; i++) {
- var pos = i + offset + 2;
- mask = (mask << 8) | headerBuffer[pos];
+ if (isMasked) {
+ connection.Read (req, headerBuffer, 2 + offset, 4);
+ for (int i = 0; i < 4; i++) {
+ var pos = i + offset + 2;
+ mask = (mask << 8) | headerBuffer[pos];
+ }
}
+ } else {
+ isLast = (headerBuffer[0] >> 7) > 0;
+ type = WireToMessageType ((byte)(headerBuffer[0] & 0xF));
+ length = remaining;
}
if (type == WebSocketMessageType.Close) {
} else {
var readLength = (int)(buffer.Count < length ? buffer.Count : length);
connection.Read (req, buffer.Array, buffer.Offset, readLength);
+ remaining = length - readLength;
- return new WebSocketReceiveResult ((int)length, type, isLast);
+ return new WebSocketReceiveResult ((int)readLength, type, isLast && remaining == 0);
}
});
}
/FileWebResponse.cs -crlf
/FtpStatus.cs -crlf
/HttpContinueDelegate.cs -crlf
-/HttpProvider.jvm.cs -crlf
-/HttpStateCache.jvm.cs -crlf
/HttpVersion.cs -crlf
-/HttpWebRequest.jvm.cs -crlf
-/HttpWebResponse.jvm.cs -crlf
/IPv6Address.cs -crlf
/MonoHttpDate.cs -crlf
/ProtocolViolationException.cs -crlf
/SocketPermission.cs -crlf
-/VMWHttpProvider.jvm.cs -crlf
/WebException.cs -crlf
/WebResponse.cs -crlf
/WebUtility.cs -crlf
{ \r
}\r
\r
-#if !TARGET_JVM\r
// Methods\r
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)\r
{\r
base.GetObjectData (info, context);\r
}\r
-#endif\r
\r
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
{\r
}
-#if !TARGET_JVM
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static bool GetHostByName_internal(string host, out string h_name, out string[] h_aliases, out string[] h_addr_list);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static bool GetHostName_internal(out string h_name);
-#endif
static void Error_11001 (string hostName)
{
string h_name;
string[] h_aliases, h_addrlist;
-#if TARGET_JVM
- h_name = null;
- h_aliases = null;
- h_addrlist = null;
- try {
- java.net.InetAddress[] iaArr =
- java.net.InetAddress.getAllByName(address);
- if (iaArr != null && iaArr.Length > 0)
- h_name = iaArr[0].getHostName();
- if (iaArr != null && iaArr.Length > 0)
- {
- h_addrlist = new String[iaArr.Length];
- for (int i = 0; i < h_addrlist.Length; i++)
- h_addrlist[i] = iaArr[i].getHostAddress();
- }
- } catch (java.net.UnknownHostException jUHE) {
- throw new SocketException((int)SocketError.HostNotFound, jUHE.Message);
- }
-#else
bool ret = GetHostByAddr_internal(address, out h_name, out h_aliases, out h_addrlist);
if (!ret)
Error_11001 (address);
-#endif
return (hostent_to_IPHostEntry (address, h_name, h_aliases, h_addrlist));
}
{
if (hostName == null)
throw new ArgumentNullException ("hostName");
-#if TARGET_JVM
- if (hostName.Length == 0)
- hostName = "localhost";
- try {
- java.net.InetAddress[] iaArr = java.net.InetAddress.getAllByName(hostName);
- IPHostEntry host = new IPHostEntry();
- if (iaArr != null && iaArr.Length > 0)
- {
- host.HostName = iaArr[0].getHostName();
- IPAddress[] ipArr = new IPAddress[iaArr.Length];
- for (int i = 0; i < iaArr.Length; i++)
- ipArr[i] = IPAddress.Parse(iaArr[i].getHostAddress());
-
- host.AddressList = ipArr;
- }
- return host;
- } catch (java.net.UnknownHostException jUHE) {
- throw new SocketException((int)SocketError.HostNotFound, jUHE.Message);
- }
-#else
string h_name;
string[] h_aliases, h_addrlist;
Error_11001 (hostName);
return(hostent_to_IPHostEntry(hostName, h_name, h_aliases, h_addrlist));
-#endif
}
public static string GetHostName ()
{
-#if TARGET_JVM
- return java.net.InetAddress.getLocalHost ().getHostName ();
-#else
string hostName;
bool ret = GetHostName_internal(out hostName);
Error_11001 (hostName);
return hostName;
-#endif
}
[Obsolete ("Use GetHostEntry instead")]
((IDisposable) this).Dispose ();\r
}\r
\r
-#if TARGET_JVM //enable overrides for extenders\r
- public override void Dispose()\r
-#else\r
void IDisposable.Dispose()\r
-#endif\r
{\r
Dispose (true);\r
\r
#endif
internal bool ChangeToSSLSocket (ref Stream stream) {
-#if TARGET_JVM
- stream.ChangeToSSLSocket ();
- return true;
-#elif SECURITY_DEP
+#if SECURITY_DEP
SslStream sslStream = new SslStream (stream, true, callback, null);
//sslStream.AuthenticateAsClient (Host, this.ClientCertificates, SslProtocols.Default, false);
//TODO: client certificates
using System.IO;
using System.Security.Principal;
using System.Text;
+#if NET_4_5
+using System.Threading.Tasks;
+using System.Net.WebSockets;
+#endif
+
namespace System.Net {
public sealed class HttpListenerContext {
HttpListenerRequest request;
return null;
}
}
+
+#if NET_4_5
+ public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval, ArraySegment<byte> internalBuffer)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
}
}
#endif
+++ /dev/null
-using System;\r
-using System.Security.Cryptography.X509Certificates;\r
-using System.IO;\r
-\r
-namespace System.Net\r
-{\r
- [Serializable]\r
- internal abstract class HttpProvider\r
- {\r
- #region Fields\r
-\r
- protected static int _defaultMaxResponseHeadersLength;\r
- protected static int _defaultMaxRedirectsNum = 50;\r
- \r
- protected Uri _originalUri;\r
- protected WebHeaderCollection _headers;\r
- protected bool _allowAutoRedirect;\r
- protected bool _allowWriteStreamBuffering = true;\r
- protected X509CertificateCollection _certificates;\r
- protected string _connectionGroupName;\r
- protected HttpContinueDelegate _continueDelegate;\r
- protected CookieContainer _cookieContainer;\r
- protected ICredentials _credentials;\r
- protected bool _keepAlive = true;\r
- protected int _maxResponseHeadersLength = _defaultMaxResponseHeadersLength;\r
- protected int _maxAutoRedirections = _defaultMaxRedirectsNum;\r
- protected int _readWriteTimeout = 300000;\r
- protected string _mediaType = string.Empty;\r
- protected string _methodName = "GET";\r
- protected bool _pipelined = true;\r
- protected bool _preAuthenticate;\r
- protected Version _version = HttpVersion.Version11;\r
- protected IWebProxy _proxy;\r
- protected bool _sendChunked;\r
- protected ServicePoint _servicePoint;\r
- protected int _timeout = 100000;\r
-\r
- protected bool _isAborted;\r
- protected long _contentLength = -1L;\r
-\r
- \r
- \r
-\r
- #endregion /* Fields */\r
-\r
- #region Constructors and Factory Methods\r
- protected HttpProvider(Uri uri)\r
- {\r
- _originalUri = uri;\r
- _headers = new WebHeaderCollection(true);\r
- _allowAutoRedirect = true;\r
- _proxy = GlobalProxySelection.Select;\r
- }\r
-\r
- public static HttpProvider GetHttpProvider(Uri uri)\r
- {\r
- return new VMWHttpProvider(uri);\r
- }\r
-\r
- public static HttpProvider GetHttpProvider(string provider, Uri uri)\r
- {\r
- Type type = Type.GetType(provider, true);\r
- if(type != null)\r
- return GetHttpProvider(type, uri);\r
- //log it as an error\r
- return new VMWHttpProvider(uri);\r
- }\r
-\r
- public static HttpProvider GetHttpProvider(Type provider, Uri uri)\r
- {\r
- try\r
- {\r
- return (HttpProvider)Activator.CreateInstance(provider, \r
- new object[]{uri}); \r
- }\r
- catch\r
- {\r
- //log it as an error\r
- return new VMWHttpProvider(uri);\r
- }\r
- }\r
-\r
- #endregion\r
-\r
- #region Properties\r
- internal virtual WebHeaderCollection Headers\r
- {\r
- get{return _headers;}\r
- set\r
- {\r
- if(IsRequestStarted ())\r
- throw new InvalidOperationException("Connection already opened");\r
- WebHeaderCollection newHeaders = new WebHeaderCollection (true);\r
- int count = value.Count;\r
- for (int i = 0; i < count; i++) \r
- newHeaders.Add (value.GetKey (i), value.Get (i));\r
-\r
- _headers = newHeaders;\r
- }\r
- }\r
-\r
- internal virtual bool AllowAutoRedirect\r
- {\r
- get{return _allowAutoRedirect;}\r
- set{_allowAutoRedirect = value;}\r
- }\r
-\r
- internal virtual bool AllowWriteStreamBuffering\r
- {\r
- get{return _allowWriteStreamBuffering;}\r
- set{_allowWriteStreamBuffering = value;}\r
- }\r
-\r
- internal virtual string ConnectionGroupName\r
- {\r
- get{return _connectionGroupName;}\r
- set{_connectionGroupName = value;}\r
- }\r
-\r
- internal virtual HttpContinueDelegate ContinueDelegate\r
- {\r
- get{return _continueDelegate;}\r
- set{_continueDelegate = value;}\r
- }\r
-\r
- internal virtual CookieContainer CookieContainer\r
- {\r
- get{return _cookieContainer;}\r
- set{_cookieContainer = value;}\r
- }\r
-\r
- internal virtual ICredentials Credentials\r
- {\r
- get{return _credentials;}\r
- set{_credentials = value;}\r
- }\r
- internal static int DefaultMaxResponseHeadersLength\r
- {\r
- get{return _defaultMaxResponseHeadersLength;}\r
- set\r
- {\r
- if (value < 0 && value != -1)\r
- throw new ArgumentOutOfRangeException("Argument should be positive");\r
- _defaultMaxResponseHeadersLength = value;\r
- }\r
- }\r
-\r
- internal virtual bool KeepAlive\r
- {\r
- get{return _keepAlive;}\r
- set{_keepAlive = value;}\r
- }\r
-\r
- internal virtual int MaxAutoRedirections\r
- {\r
- get{return _maxAutoRedirections;}\r
- set\r
- {\r
- if (value <= 0)\r
- throw new ArgumentException("Must be > 0", "value");\r
- _maxAutoRedirections = value;\r
- }\r
- }\r
-\r
- internal virtual int MaximumResponseHeadersLength\r
- {\r
- get{return _maxResponseHeadersLength;}\r
- set\r
- {\r
- if (IsRequestStarted())\r
- {\r
- throw new InvalidOperationException("Request has been already submitted.");\r
- }\r
- if (value < 0 && value != -1)\r
- throw new ArgumentOutOfRangeException("The argument must be positive or -1");\r
- _maxResponseHeadersLength = value;\r
- }\r
- }\r
- \r
- internal virtual string MediaType\r
- {\r
- get{return _mediaType;}\r
- set{_mediaType = value;}\r
- }\r
-\r
- internal virtual string MethodName\r
- {\r
- get{return _methodName;}\r
- set\r
- {\r
- if (value == null || value.Trim () == "")\r
- throw new ArgumentException ("not a valid method");\r
-\r
- _methodName = value;\r
- }\r
- }\r
- internal virtual bool Pipelined\r
- {\r
- get{return _pipelined;}\r
- set{_pipelined = value;}\r
- }\r
-\r
- internal virtual bool PreAuthenticate \r
- { \r
- get { return _preAuthenticate; }\r
- set { _preAuthenticate = value; }\r
- }\r
-\r
- internal virtual Version ProtocolVersion\r
- {\r
- get{return _version;}\r
- set\r
- {\r
- if (value != HttpVersion.Version10 && value != HttpVersion.Version11)\r
- throw new ArgumentException ("value");\r
-\r
- _version = value; \r
- }\r
- }\r
- internal virtual IWebProxy Proxy\r
- {\r
- get{return _proxy;}\r
- set\r
- {\r
- if(IsRequestStarted())\r
- throw new InvalidOperationException("Request already has been submitted");\r
- if(value == null)\r
- throw new ArgumentNullException("value");\r
- if(!(value is WebProxy))\r
- throw new NotImplementedException("The supported proxy objects only of type System.Net.WebProxy");\r
- _proxy = value;\r
- }\r
- }\r
- internal virtual int ReadWriteTimeout\r
- {\r
- get{return _readWriteTimeout;}\r
- set\r
- {\r
- if (IsRequestStarted())\r
- throw new InvalidOperationException("Request has been submitted.");\r
-\r
- if (value < 0 && value != -1)\r
- throw new ArgumentOutOfRangeException("value");\r
-\r
- _readWriteTimeout = value;\r
- }\r
- }\r
-\r
- internal virtual bool SendChunked\r
- {\r
- get{return _sendChunked;}\r
- set\r
- {\r
- if(IsRequestStarted ())\r
- throw new InvalidOperationException("Request has been submitted.");\r
- _sendChunked = value;\r
- }\r
- }\r
-\r
- internal virtual ServicePoint ServicePoint\r
- {\r
- get{return _servicePoint;}\r
- }\r
-\r
- internal virtual int Timeout\r
- {\r
- get{return _timeout;}\r
- set\r
- {\r
- if (value < -1)\r
- throw new ArgumentOutOfRangeException ("value");\r
-\r
- _timeout = value;\r
- }\r
- }\r
-\r
- internal virtual long ContentLength\r
- {\r
- get{return _contentLength;}\r
- set\r
- {\r
- if(value < 0)\r
- throw new ArgumentOutOfRangeException("value", "The Content-Length property value must be positive");\r
- _contentLength = value;\r
- }\r
- }\r
-\r
-\r
-\r
- #endregion\r
-\r
- #region Methods\r
-\r
- public virtual Uri GetOriginalAddress()\r
- {\r
- return _originalUri;\r
- }\r
-\r
- public virtual X509CertificateCollection GetX509Certificates()\r
- {\r
- if(_certificates == null)\r
- _certificates = new X509CertificateCollection();\r
- return _certificates;\r
- }\r
-\r
- public abstract bool IsRequestStarted();\r
-\r
- public abstract Uri GetAddress();\r
-\r
- public abstract bool IsHaveResponse();\r
-\r
- public abstract void Abort();\r
-\r
- public abstract Stream GetRequestStream();\r
-\r
- public abstract WebResponse GetResponse();\r
-\r
- public abstract IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state);\r
-\r
- public abstract Stream EndGetRequestStream(IAsyncResult asyncResult);\r
-\r
- public abstract IAsyncResult BeginGetResponse(AsyncCallback callback, object state);\r
-\r
- public abstract WebResponse EndGetResponse(IAsyncResult asyncResult);\r
-\r
-\r
- #endregion\r
-\r
-\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections;\r
-\r
-using mainsoft.apache.commons.httpclient;\r
-\r
-namespace System.Net\r
-{\r
- \r
- class HttpStateCache\r
- {\r
- private static readonly int MAX_SIZE = 30;\r
-\r
- private Stack _states;\r
- private int _currentSize;\r
-\r
- internal HttpStateCache()\r
- {\r
- _states = new Stack(20);\r
- }\r
-\r
- internal HttpState GetHttpState()\r
- {\r
- lock(this)\r
- {\r
- if(_states.Count > 0)\r
- return (HttpState) _states.Pop();\r
- }\r
- return new HttpState();\r
- }\r
-\r
- internal void ReleaseHttpState(HttpState state)\r
- {\r
- lock(this)\r
- {\r
- if(_states.Count < MAX_SIZE)\r
- {\r
- state.clear();\r
- _states.Push(state);\r
- }\r
- }\r
- }\r
- }\r
-}\r
// MS starts encoding with &# from 160 and stops at 255.
// We don't do that. One reason is the 65308/65310 unicode
// characters that look like '<' and '>'.
-#if TARGET_JVM
- if (c > 159 && c < 256) {
-#else
if (c > 159) {
-#endif
output.Append ("&#");
if (char.IsSurrogate (c))
output.Append (char.ConvertToUtf32 (s, i++));
+++ /dev/null
-\r
-using System;\r
-using System.Collections;\r
-using System.Collections.Specialized;\r
-using System.Configuration;\r
-using System.Globalization;\r
-using System.IO;\r
-using System.Runtime;\r
-using System.Runtime.CompilerServices;\r
-using System.Runtime.Serialization;\r
-using System.Security;\r
-using System.Security.Cryptography.X509Certificates;\r
-using System.Security.Permissions;\r
-using System.Text;\r
-using System.Threading;\r
-using System.Net;\r
-\r
-namespace System.Net\r
-{\r
- [Serializable]\r
- public class HttpWebRequest : WebRequest\r
- {\r
- #region Fields\r
-\r
-\r
- private static readonly int DEFAULT_MAX_RESP_HEADER_LEN = 64;\r
-\r
- private static int _defaultMaxResponseHeadersLength = DEFAULT_MAX_RESP_HEADER_LEN;\r
-\r
-\r
- private HttpProvider _provider;\r
-\r
- #endregion\r
-\r
- #region Constructors\r
-\r
- internal HttpWebRequest(Uri uri)\r
- {\r
- _provider = HttpProvider.GetHttpProvider(uri);\r
-// Console.WriteLine("uri to string: " + uri.ToString());\r
- }\r
-\r
-\r
- #endregion\r
-\r
- #region Properties\r
-\r
-\r
- public string Accept\r
- {\r
- get{return Headers["Accept"];}\r
- set\r
- {\r
- if(_provider.IsRequestStarted ())\r
- throw new InvalidOperationException ("request started");\r
- _provider.Headers.RemoveAndAdd ("Accept", value);\r
- }\r
- }\r
-\r
- public Uri Address\r
- {\r
- get{return _provider.GetAddress();}\r
- }\r
-\r
- public bool AllowAutoRedirect\r
- {\r
- get{return _provider.AllowAutoRedirect;}\r
- set{_provider.AllowAutoRedirect = value;}\r
- }\r
-\r
- public bool AllowWriteStreamBuffering\r
- {\r
- get{return _provider.AllowWriteStreamBuffering;}\r
- set{_provider.AllowWriteStreamBuffering = value;}\r
- }\r
-\r
- [MonoTODO] //documentation related\r
- public X509CertificateCollection ClientCertificates\r
- {\r
- [MonoTODO]\r
- get{return _provider.GetX509Certificates();}\r
- [MonoNotSupported("")]\r
- set { throw new NotImplementedException (); }\r
- }\r
-\r
- public string Connection\r
- {\r
- get { return Headers["Connection"]; }\r
- set\r
- {\r
- if(_provider.IsRequestStarted())\r
- throw new InvalidOperationException ("request started");\r
-\r
- string val = value;\r
- if (val != null)\r
- val = val.Trim ().ToLower (CultureInfo.InvariantCulture);\r
-\r
- if (val == null || val.Length == 0)\r
- {\r
- Headers.RemoveInternal ("Connection");\r
- return;\r
- }\r
-\r
- if (val == "keep-alive" || val == "close")\r
- throw new ArgumentException ("Keep-Alive and Close may not be set with this property");\r
-\r
-// if (this.KeepAlive && val.IndexOf ("keep-alive") == -1)\r
-// value = value + ", Keep-Alive";\r
-\r
- Headers.RemoveAndAdd ("Connection", value);\r
- }\r
- }\r
-\r
- public override string ConnectionGroupName\r
- {\r
- get{return _provider.ConnectionGroupName;}\r
- set{_provider.ConnectionGroupName = value;}\r
- }\r
-\r
- public override long ContentLength\r
- {\r
- get{return _provider.ContentLength;}\r
- set\r
- {\r
- if(_provider.IsRequestStarted())\r
- throw new InvalidOperationException("Connection already opened");\r
- _provider.ContentLength = value;\r
- }\r
- }\r
-\r
- public override string ContentType\r
- {\r
- get { return Headers["Content-Type"]; }\r
- set\r
- {\r
- if (value == null || value.Trim().Length == 0)\r
- {\r
- Headers.RemoveInternal ("Content-Type");\r
- return;\r
- }\r
- Headers.RemoveAndAdd ("Content-Type", value);\r
- }\r
- }\r
- [MonoTODO] //needed for automatic documentation tools,\r
- //since currently we don't support this feature\r
- public HttpContinueDelegate ContinueDelegate\r
- {\r
- [MonoTODO]\r
- get{return _provider.ContinueDelegate;}\r
- [MonoTODO]\r
- set{_provider.ContinueDelegate = value;}\r
- }\r
-\r
- public CookieContainer CookieContainer\r
- {\r
- get{return _provider.CookieContainer;}\r
- set{_provider.CookieContainer = value;}\r
- }\r
-\r
- public override ICredentials Credentials\r
- {\r
- get{return _provider.Credentials;}\r
- set{_provider.Credentials = value;}\r
- }\r
-\r
- public static int DefaultMaximumResponseHeadersLength\r
- {\r
- get{return HttpProvider.DefaultMaxResponseHeadersLength;}\r
- set{HttpProvider.DefaultMaxResponseHeadersLength = value;}\r
- }\r
-\r
- public string Expect\r
- {\r
- get{return Headers["Expect"];}\r
- set\r
- {\r
- if(_provider.IsRequestStarted ())\r
- throw new InvalidOperationException("Connection already opened");\r
- string val = value;\r
- if (val != null)\r
- val = val.Trim ().ToLower (CultureInfo.InvariantCulture);\r
-\r
- if (val == null || val.Length == 0)\r
- {\r
- Headers.RemoveInternal ("Expect");\r
- return;\r
- }\r
-\r
- if (val == "100-continue")\r
- throw new ArgumentException ("100-Continue cannot be set with this property.",\r
- "value");\r
- Headers.RemoveAndAdd ("Expect", value);\r
- }\r
- }\r
-\r
- public bool HaveResponse\r
- {\r
- get{return _provider.IsHaveResponse();}\r
- }\r
-\r
- public override WebHeaderCollection Headers\r
- {\r
- get{return _provider.Headers;}\r
- set{_provider.Headers = value;}\r
- }\r
-\r
- public DateTime IfModifiedSince\r
- {\r
- get\r
- {\r
- string str = Headers["If-Modified-Since"];\r
- if (str == null)\r
- return DateTime.Now;\r
- try\r
- {\r
- return MonoHttpDate.Parse (str);\r
- }\r
- catch (Exception)\r
- {\r
- return DateTime.Now;\r
- }\r
- }\r
- set\r
- {\r
- if(_provider.IsRequestStarted ())\r
- throw new InvalidOperationException("Connection already started");\r
- // rfc-1123 pattern\r
- Headers.SetInternal ("If-Modified-Since",\r
- value.ToUniversalTime ().ToString ("r", null));\r
- // TODO: check last param when using different locale\r
- }\r
- }\r
-\r
- public bool KeepAlive\r
- {\r
- get{return _provider.KeepAlive;}\r
- set{_provider.KeepAlive = value;}\r
- }\r
-\r
- public int MaximumAutomaticRedirections\r
- {\r
- get{return _provider.MaxAutoRedirections;}\r
- set{_provider.MaxAutoRedirections = value;}\r
- }\r
-\r
- [MonoTODO] //documentation\r
- public int MaximumResponseHeadersLength\r
- {\r
- [MonoTODO]\r
- get{return _provider.MaximumResponseHeadersLength;}\r
- [MonoTODO]\r
- set{_provider.MaximumResponseHeadersLength = value;}\r
- }\r
-\r
- public string MediaType\r
- {\r
- get{return _provider.MediaType;}\r
- set{_provider.MediaType = value;}\r
- }\r
-\r
- public override string Method\r
- {\r
- get{return _provider.MethodName;}\r
- set{_provider.MethodName = value;}\r
- }\r
- [MonoTODO] //for documentation related - limited.\r
- public bool Pipelined\r
- {\r
- [MonoTODO]\r
- get{return _provider.Pipelined;}\r
- [MonoTODO]\r
- set{_provider.Pipelined = value;}\r
- }\r
-\r
- public override bool PreAuthenticate\r
- {\r
- get{return _provider.PreAuthenticate;}\r
- set{_provider.PreAuthenticate = value;}\r
- }\r
-\r
- public Version ProtocolVersion\r
- {\r
- get{return _provider.ProtocolVersion;}\r
- set{_provider.ProtocolVersion = value;}\r
- }\r
-\r
- public override IWebProxy Proxy\r
- {\r
- get{return _provider.Proxy;}\r
- set{_provider.Proxy = value;}\r
- }\r
-\r
- public int ReadWriteTimeout\r
- {\r
- get{return _provider.ReadWriteTimeout;}\r
- set{_provider.ReadWriteTimeout = value;}\r
- }\r
-\r
- public string Referer\r
- {\r
- get {return Headers["Referer"];}\r
- set\r
- {\r
- if(_provider.IsRequestStarted ())\r
- throw new InvalidOperationException("Connection already opened");\r
- if (value == null || value.Trim().Length == 0)\r
- {\r
- Headers.RemoveInternal ("Referer");\r
- return;\r
- }\r
- Headers.SetInternal ("Referer", value);\r
- }\r
- }\r
- internal Uri AuthUri\r
- {\r
- get { return RequestUri; }\r
- }\r
- public override Uri RequestUri\r
- {\r
- get{return _provider.GetOriginalAddress();}\r
- }\r
-\r
- public bool SendChunked\r
- {\r
- get{return _provider.SendChunked;}\r
- set{_provider.SendChunked = value;}\r
- }\r
-\r
- public ServicePoint ServicePoint\r
- {\r
- get{return _provider.ServicePoint;}\r
- }\r
- [MonoTODO] //once again - needed since our impl. still\r
- //doesn't support this feature we need document it..\r
- public override int Timeout\r
- {\r
- [MonoTODO]\r
- get{return _provider.Timeout;}\r
- [MonoTODO]\r
- set{_provider.Timeout = value;}\r
- }\r
-\r
-\r
- public string TransferEncoding\r
- {\r
- get { return Headers ["Transfer-Encoding"]; }\r
- set\r
- {\r
- if(_provider.IsRequestStarted ())\r
- {\r
- throw new InvalidOperationException("Connection has been already opened");\r
- }\r
- string val = value;\r
- if (val != null)\r
- val = val.Trim ().ToLower (CultureInfo.InvariantCulture);\r
-\r
- if (val == null || val.Length == 0)\r
- {\r
- Headers.RemoveInternal ("Transfer-Encoding");\r
- return;\r
- }\r
-\r
- if (val == "chunked")\r
- throw new ArgumentException ("Chunked encoding must be set with the SendChunked property");\r
-\r
- if (!this.SendChunked)\r
- throw new InvalidOperationException ("SendChunked must be True");\r
-\r
- Headers.RemoveAndAdd ("Transfer-Encoding", value);\r
- }\r
- }\r
-\r
-\r
- public bool UnsafeAuthenticatedConnectionSharing\r
- {\r
- get { throw new NotImplementedException (); }\r
- set { throw new NotImplementedException (); }\r
- }\r
-\r
- public string UserAgent\r
- {\r
- get { return Headers ["User-Agent"]; }\r
- set { Headers.SetInternal ("User-Agent", value); }\r
- }\r
-\r
-\r
-\r
-\r
- #endregion\r
-\r
- #region Methods\r
-\r
- //todo\r
- public override void Abort()\r
- {\r
- _provider.Abort();\r
-// _connection.disconnect();\r
-// _haveResponse = true;\r
-// //aborted = true;\r
-// if (_asyncWrite != null)\r
-// {\r
-// GHWebAsyncResult r = _asyncWrite;\r
-// WebException wexc = new WebException ("Aborted.", WebExceptionStatus.RequestCanceled);\r
-// r.SetCompleted (false, wexc);\r
-// r.DoCallback ();\r
-// _asyncWrite = null;\r
-// }\r
-//\r
-// if (_asyncRead != null)\r
-// {\r
-// GHWebAsyncResult r = _asyncRead;\r
-// WebException wexc = new WebException ("Aborted.", WebExceptionStatus.RequestCanceled);\r
-// r.SetCompleted (false, wexc);\r
-// r.DoCallback ();\r
-// _asyncRead = null;\r
-// }\r
-//\r
-//// if (abortHandler != null)\r
-//// {\r
-//// try\r
-//// {\r
-//// abortHandler (this, EventArgs.Empty);\r
-//// }\r
-//// catch {}\r
-//// abortHandler = null;\r
-//// }\r
-//\r
-// if (_writeStream != null)\r
-// {\r
-// try\r
-// {\r
-// _writeStream.Close ();\r
-// _writeStream = null;\r
-// }\r
-// catch {}\r
-// }\r
-//\r
-// if (_response != null)\r
-// {\r
-// try\r
-// {\r
-// _response.Close ();\r
-// _response = null;\r
-// }\r
-// catch {}\r
-// }\r
- }\r
-\r
- public void AddRange (int range)\r
- {\r
- AddRange ("bytes", range);\r
- }\r
-\r
- public void AddRange (int from, int to)\r
- {\r
- AddRange ("bytes", from, to);\r
- }\r
-\r
- public void AddRange (string rangeSpecifier, int range)\r
- {\r
- if (rangeSpecifier == null)\r
- throw new ArgumentNullException ("rangeSpecifier");\r
- string value = Headers ["Range"];\r
- if (value == null || value.Length == 0)\r
- value = rangeSpecifier + "=";\r
- else if (value.StartsWith (rangeSpecifier.ToLower () + "=", StringComparison.InvariantCultureIgnoreCase))\r
- value += ",";\r
- else\r
- throw new InvalidOperationException ("rangeSpecifier");\r
- Headers.RemoveAndAdd ("Range", value + range + "-");\r
- }\r
-\r
- public void AddRange (string rangeSpecifier, int from, int to)\r
- {\r
- if (rangeSpecifier == null)\r
- throw new ArgumentNullException ("rangeSpecifier");\r
- if (from < 0 || to < 0 || from > to)\r
- throw new ArgumentOutOfRangeException ();\r
- string value = Headers ["Range"];\r
- if (value == null || value.Length == 0)\r
- value = rangeSpecifier + "=";\r
- else if (value.StartsWith (rangeSpecifier.ToLower () + "=", StringComparison.InvariantCultureIgnoreCase))\r
- value += ",";\r
- else\r
- throw new InvalidOperationException ("rangeSpecifier");\r
- Headers.RemoveAndAdd ("Range", value + from + "-" + to);\r
- }\r
-\r
- public override Stream GetRequestStream()\r
- {\r
- return _provider.GetRequestStream();\r
-// lock(this)\r
-// {\r
-// Type t = Type.GetType("System.IO.ConsoleWriteStream", true);\r
-// _connection.setDoOutput(true);\r
-//\r
-//\r
-//// Console.WriteLine("Request is sent with following headers:");\r
-//// java.util.Map map = _connection.getRequestProperties();\r
-//// for(java.util.Iterator iter = map.keySet().iterator(); iter.hasNext();)\r
-//// {\r
-//// string key = (string) iter.next();\r
-//// Console.WriteLine(key + ": " + map.get(key));\r
-//// }\r
-//\r
-// foreach(string k in Headers)\r
-// {\r
-// string val = Headers[k];\r
-// val = (val == null) ? "" : val;\r
-// _connection.setRequestProperty(k, val);\r
-// }\r
-//\r
-// _writeStream = (Stream) Activator.CreateInstance(t, new object[]{_connection.getOutputStream()});\r
-// _haveRequest = true;\r
-// return _writeStream;\r
-// }\r
- }\r
-\r
- public override WebResponse GetResponse()\r
- {\r
- return _provider.GetResponse();\r
- }\r
- /*\r
- private void CommonChecks (bool putpost)\r
- {\r
- string method = _connection.getRequestMethod();\r
-\r
- if (method == null)\r
- throw new ProtocolViolationException ("Method is null.");\r
-\r
- bool keepAlive = _headers["Keep-Alive"] == null;\r
- bool allowBuffering = true;\r
- bool sendChunked = true;\r
- long contentLength = _connection.getContentLength();\r
-\r
- if (putpost && ((!keepAlive || (contentLength == -1 && !sendChunked)) && !allowBuffering))\r
- throw new ProtocolViolationException ("Content-Length not set");\r
-\r
- string transferEncoding = TransferEncoding;\r
- if (!sendChunked && transferEncoding != null && transferEncoding.Trim () != "")\r
- throw new ProtocolViolationException ("SendChunked should be true.");\r
- }\r
- */\r
-\r
- public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state)\r
- {\r
- return _provider.BeginGetRequestStream(callback, state);\r
- }\r
-\r
- public override Stream EndGetRequestStream(IAsyncResult asyncResult)\r
- {\r
- return _provider.EndGetRequestStream(asyncResult);\r
- }\r
-\r
- public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state)\r
- {\r
- //todo check input, http headers etc.\r
-\r
- return _provider.BeginGetResponse(callback, state);\r
- }\r
-\r
- public override WebResponse EndGetResponse(IAsyncResult asyncResult)\r
- {\r
- return _provider.EndGetResponse(asyncResult);\r
- }\r
-\r
-\r
-\r
-\r
- #endregion\r
-\r
- #region Inner Classes\r
-\r
-// #region JavaHeaders class\r
-// [Serializable]\r
-// internal sealed class JavaHeaders : WebHeaderCollection\r
-// {\r
-// private java.net.HttpURLConnection _connection;\r
-//\r
-// internal JavaHeaders(java.net.HttpURLConnection con)\r
-// {\r
-// _connection = con;\r
-// }\r
-//\r
-// public string this[string key]\r
-// {\r
-// get\r
-// {\r
-// return _connection.getHeaderField(key);\r
-// }\r
-// set\r
-// {\r
-// _connection.addRequestProperty(key, value);\r
-// }\r
-// }\r
-// }\r
-// #endregion\r
-\r
-\r
-\r
-\r
- #endregion\r
- public DecompressionMethods AutomaticDecompression\r
- {\r
- get {\r
- throw new NotSupportedException ();\r
- }\r
- set {\r
- throw new NotSupportedException ();\r
- }\r
- }\r
-\r
- }\r
-}\r
+++ /dev/null
-using System;\r
-using System.Collections.Specialized;\r
-using System.Globalization;\r
-using System.IO;\r
-using System.Runtime;\r
-using System.Runtime.Serialization;\r
-using System.Security.Cryptography.X509Certificates;\r
-\r
-namespace System.Net\r
-{\r
- [Serializable]\r
- public class HttpWebResponse : WebResponse, IDisposable\r
- {\r
- #region Fields\r
- private mainsoft.apache.commons.httpclient.HttpMethod _httpMethod;\r
- private CookieCollection _cookies;\r
- private WebHeaderCollection _headers;\r
- private string _statusDescription;\r
- private Version _version = null;\r
- private Uri _uri;\r
- private string _method;\r
- private Stream _responseStream;\r
- private mainsoft.apache.commons.httpclient.HttpState _state;\r
- private HttpStateCache _stateCache;\r
- private HttpStatusCode _statusCode;\r
- private bool _isStatusCodeInitialized = false;\r
-\r
- private Type _httpStatusCodeType = typeof(HttpStatusCode);\r
-\r
- private sbyte [] _responseBody;\r
- private bool _isHttpMethodClosed = false;\r
- #endregion\r
-\r
- #region Constructors\r
-\r
- internal HttpWebResponse(mainsoft.apache.commons.httpclient.HttpMethod httpMethod,\r
- mainsoft.apache.commons.httpclient.HttpState state,\r
- HttpStateCache stateCache,\r
- Uri uri, string method)\r
- {\r
- _httpMethod = httpMethod;\r
- _uri = uri;\r
- _method = method;\r
- _state = state;\r
- _stateCache = stateCache;\r
- }\r
-\r
- #endregion\r
-\r
- #region Properties\r
-\r
- public CookieCollection Cookies\r
- {\r
- get\r
- {\r
- if(_cookies == null)\r
- {\r
- _cookies = new CookieCollection();\r
- FillCookies();\r
-\r
- }\r
- return _cookies;\r
- }\r
-\r
- set\r
- {\r
- _cookies = value;\r
- }\r
- }\r
-\r
- public override WebHeaderCollection Headers\r
- {\r
- get\r
- {\r
- if(_headers == null)\r
- {\r
- _headers = new WebHeaderCollection();\r
- FillHeaders();\r
- }\r
- return _headers;\r
- }\r
- }\r
- public override long ContentLength\r
- {\r
- get\r
- {\r
- string val = Headers["Content-Length"];\r
- if(val == null || val.Trim().Equals(""))\r
- return -1L;\r
- try\r
- {\r
- return Int64.Parse(val);\r
- }\r
- catch\r
- {\r
- return -1L;\r
- }\r
- }\r
- }\r
-\r
-\r
- public string ContentEncoding\r
- {\r
- get\r
- {\r
- return Headers["Content-Encoding"];\r
- }\r
- }\r
-\r
- public override string ContentType\r
- {\r
- get\r
- {\r
- return Headers["Content-Type"];\r
- }\r
- }\r
-\r
- public string CharacterSet\r
- {\r
- get\r
- {\r
- string contentType = ContentType;\r
- if (contentType == null)\r
- return "ISO-8859-1";\r
- int pos = contentType.IndexOf ("charset=", StringComparison.OrdinalIgnoreCase);\r
- if (pos == -1)\r
- return "ISO-8859-1";\r
- pos += 8;\r
- int pos2 = contentType.IndexOf (';', pos);\r
- return (pos2 == -1)\r
- ? contentType.Substring (pos) \r
- : contentType.Substring (pos, pos2 - pos);\r
- }\r
- }\r
-\r
- public string Server\r
- {\r
- get\r
- {\r
- return Headers ["Server"];\r
- }\r
- }\r
-\r
- public DateTime LastModified\r
- {\r
- get\r
- {\r
- try\r
- {\r
- string val = Headers["Last-Modified"];\r
- return MonoHttpDate.Parse(val);\r
- }\r
- catch\r
- {\r
- return DateTime.Now;\r
- }\r
- }\r
- }\r
-\r
- public HttpStatusCode StatusCode\r
- {\r
- get\r
- {\r
- if(_isStatusCodeInitialized == false)\r
- {\r
- int status = _httpMethod.getStatusCode();\r
- _statusCode = (HttpStatusCode)Enum.Parse(_httpStatusCodeType, \r
- Enum.GetName(_httpStatusCodeType, status));\r
- _isStatusCodeInitialized = true;\r
- }\r
-\r
- return _statusCode;\r
- }\r
- }\r
-\r
- public string StatusDescription\r
- {\r
- get\r
- {\r
- if(_statusDescription == null)\r
- _statusDescription = _httpMethod.getStatusText();\r
- return _statusDescription;\r
- }\r
- }\r
-\r
- public Version ProtocolVersion\r
- {\r
- get\r
- {\r
- if(_version == null)\r
- ParseVersion();\r
- return _version;\r
- }\r
- }\r
-\r
- public override Uri ResponseUri\r
- {\r
- get\r
- {\r
- return _uri;\r
- }\r
- }\r
-\r
- public string Method\r
- {\r
- get\r
- {\r
- return _method;\r
- }\r
- }\r
- #endregion\r
-\r
- #region Methods\r
-\r
- internal void ReadAllAndClose()\r
- {\r
- if (_responseBody != null)\r
- return;\r
-\r
- object temp = null;\r
- if(_cookies == null)\r
- {\r
- temp = this.Cookies;\r
- }\r
- if(_headers == null)\r
- {\r
- temp = this.Headers;\r
- }\r
- if(_isStatusCodeInitialized == false)\r
- {\r
- temp = this.StatusCode;\r
- }\r
- if(_statusDescription == null)\r
- {\r
- temp = this.StatusDescription;\r
- }\r
- if(_version == null)\r
- {\r
- temp = this.ProtocolVersion;\r
- }\r
-\r
- _responseBody = _httpMethod.getResponseBody();\r
-#if DEBUG\r
- Console.WriteLine("The response body as string == {0}", System.Text.Encoding.UTF8.GetString((byte[])vmw.common.TypeUtils.ToByteArray(_responseBody)));\r
-#endif\r
- this.Close();\r
- }\r
-\r
- public override Stream GetResponseStream()\r
- {\r
- try\r
- {\r
- if(_responseStream == null)\r
- {\r
- Type t = Type.GetType("System.IO.ConsoleReadStream", true);\r
- object [] param = null;\r
- if (_responseBody == null)\r
- {\r
- param = new object[]{_httpMethod.getResponseBodyAsStream()};\r
- }\r
- else\r
- {\r
- param = new object[]{new java.io.ByteArrayInputStream(_responseBody)};\r
- }\r
- _responseStream = (Stream) Activator.CreateInstance(t, param);\r
- }\r
- return _responseStream;\r
- }\r
- catch(Exception e)\r
- {\r
- Console.WriteLine("Exception caught!");\r
- Console.WriteLine(e.GetType() + ":" + e.Message + "\n" + e.StackTrace);\r
- throw e;\r
- }\r
- }\r
-\r
- public override void Close()\r
- {\r
- try\r
- {\r
- if(_responseStream != null)\r
- _responseStream.Close();\r
- }\r
- finally\r
- {\r
- _responseStream = null;\r
-\r
- if (!_isHttpMethodClosed)\r
- {\r
- _httpMethod.releaseConnection();\r
- if(_stateCache != null && _state != null)\r
- {\r
- _stateCache.ReleaseHttpState(_state);\r
- _state = null;\r
- _stateCache = null;\r
- }\r
- _isHttpMethodClosed = true;\r
- }\r
- }\r
- }\r
-\r
- public string GetResponseHeader(string headerName)\r
- {\r
- return Headers[headerName];\r
- }\r
-\r
- public override int GetHashCode()\r
- {\r
- return base.GetHashCode();\r
- }\r
-\r
-\r
- protected virtual void Dispose(bool disposing)\r
- {\r
- try\r
- {\r
- if(_responseStream != null)\r
- _responseStream.Close();\r
- }\r
- finally\r
- {\r
- _responseStream = null;\r
-\r
- if (!_isHttpMethodClosed)\r
- {\r
- _httpMethod.releaseConnection();\r
- _isHttpMethodClosed = true;\r
- }\r
- }\r
- }\r
-\r
- private void FillHeaders()\r
- {\r
- mainsoft.apache.commons.httpclient.Header[] respHeaders =\r
- _httpMethod.getResponseHeaders();\r
- if(respHeaders == null)\r
- return;\r
- for(int i = 0; i < respHeaders.Length; i++)\r
- {\r
- \r
- mainsoft.apache.commons.httpclient.HeaderElement[] elements = respHeaders[i].getElements(); \r
- for(int j = 0; j < elements.Length; j++)\r
- {\r
- string key = elements[j].getName();\r
- string val = elements[j].getValue();\r
- string pair = (key == null) ? ((val == null) ? "" : val) : ((val==null) ? key : key + "=" + val);\r
- _headers.Add(respHeaders[i].getName(), pair); \r
- }\r
-\r
- }\r
- ParseVersion();\r
- }\r
-\r
- private void ParseVersion()\r
- {\r
- mainsoft.apache.commons.httpclient.StatusLine statusLine =\r
- _httpMethod.getStatusLine();\r
- string ver = statusLine.getHttpVersion().Trim().ToUpper();\r
- if(ver == "HTTP/1.1")\r
- _version = HttpVersion.Version11;\r
- else if(ver == "HTTP/1.0")\r
- _version = HttpVersion.Version10;\r
- else\r
- _version = null;\r
- }\r
-\r
- private mainsoft.apache.commons.httpclient.Cookie FindCookie (mainsoft.apache.commons.httpclient.Cookie [] cookies, string name) {\r
- for (int i = 0; i < cookies.Length; ++i)\r
- if (cookies [i].getName () == name)\r
- return cookies [i];\r
- return null;\r
- }\r
-\r
- private mainsoft.apache.commons.httpclient.Cookie [] FetchResponseCookies (mainsoft.apache.commons.httpclient.Header [] headers,\r
- mainsoft.apache.commons.httpclient.Cookie [] stateCookies) {\r
- System.Collections.ArrayList list = new System.Collections.ArrayList();\r
- foreach (mainsoft.apache.commons.httpclient.Header h in headers) {\r
- foreach (mainsoft.apache.commons.httpclient.HeaderElement element in h.getValues ()) {\r
- mainsoft.apache.commons.httpclient.Cookie c = FindCookie (stateCookies, element.getName ());\r
- if (c != null)\r
- list.Add(c);\r
- }\r
- }\r
-\r
- return (mainsoft.apache.commons.httpclient.Cookie[]) list.ToArray(typeof(mainsoft.apache.commons.httpclient.Cookie));\r
- }\r
-\r
- private void FillCookies ()\r
- {\r
- if(_state == null)\r
- return;\r
-\r
- mainsoft.apache.commons.httpclient.Cookie[] javaCookies =\r
- _state.getCookies();\r
-\r
- if(javaCookies == null)\r
- return;\r
-\r
- mainsoft.apache.commons.httpclient.Header [] headers = _httpMethod.getResponseHeaders ("Set-Cookie");\r
- if (headers != null)\r
- javaCookies = FetchResponseCookies (headers, javaCookies); \r
-\r
- for(int i = 0; i < javaCookies.Length; i++)\r
- {\r
- bool httpsProtocol = _httpMethod.getURI().ToString().StartsWith("https");\r
- if(!httpsProtocol && javaCookies[i].getSecure())\r
- continue;\r
- Cookie c = new Cookie(javaCookies[i].getName(), \r
- javaCookies[i].getValue(), \r
- (javaCookies[i].getPath() == null) ? "" : javaCookies[i].getPath(),\r
- (javaCookies[i].getDomain() == null) ? "" : javaCookies[i].getDomain());\r
- java.util.Calendar jCalendar = java.util.Calendar.getInstance();\r
- java.util.Date jDate = javaCookies[i].getExpiryDate();\r
- if(jDate != null)\r
- {\r
- jCalendar.setTime(javaCookies[i].getExpiryDate());\r
- c.Expires = (DateTime) vmw.common.DateTimeUtils.CalendarToDateTime(jCalendar);\r
- }\r
- \r
- _cookies.Add(c);\r
- }\r
-\r
- }\r
-\r
- //todo remove unused methods\r
- private void FillCookies_old ()\r
- {\r
- \r
- string val = Headers["Set-Cookie"];\r
- if (val != null && val.Trim () != "")\r
- SetCookie (val);\r
-\r
- val = Headers["Set-Cookie2"];\r
- if (val != null && val.Trim () != "")\r
- SetCookie2 (val);\r
- }\r
-\r
- static string [] SplitValue (string input)\r
- {\r
- string [] result = new string [2];\r
- int eq = input.IndexOf ('=');\r
- if (eq == -1) \r
- {\r
- result [0] = "invalid";\r
- } \r
- else \r
- {\r
- result [0] = input.Substring (0, eq).Trim ().ToUpper ();\r
- result [1] = input.Substring (eq + 1);\r
- }\r
- \r
- return result;\r
- }\r
-\r
- private void SetCookie(string val)\r
- {\r
-// Console.WriteLine("in set cookie 1 - got value : " + val);\r
- string[] parts = null;\r
- Collections.Queue options = null;\r
- Cookie cookie = null;\r
-\r
- options = new Collections.Queue (val.Split (';'));\r
- parts = SplitValue ((string) options.Dequeue()); // NAME=VALUE must be first\r
-\r
- cookie = new Cookie (parts[0], parts[1]);\r
-\r
- while (options.Count > 0) \r
- {\r
- parts = SplitValue ((string) options.Dequeue());\r
- switch (parts [0]) \r
- {\r
- case "COMMENT":\r
- if (cookie.Comment == null)\r
- cookie.Comment = parts[1];\r
- break;\r
- case "COMMENTURL":\r
- if (cookie.CommentUri == null)\r
- cookie.CommentUri = new Uri(parts[1]);\r
- break;\r
- case "DISCARD":\r
- cookie.Discard = true;\r
- break;\r
- case "DOMAIN":\r
- if (cookie.Domain == "")\r
- cookie.Domain = parts[1];\r
- break;\r
- case "MAX-AGE": // RFC Style Set-Cookie2\r
- if (cookie.Expires == DateTime.MinValue)\r
- cookie.Expires = cookie.TimeStamp.AddSeconds (Int32.Parse (parts[1]));\r
- break;\r
- case "EXPIRES": // Netscape Style Set-Cookie\r
- if (cookie.Expires == DateTime.MinValue) \r
- {\r
- //FIXME: Does DateTime parse something like: "Sun, 17-Jan-2038 19:14:07 GMT"?\r
- //cookie.Expires = DateTime.ParseExact (parts[1]);\r
- cookie.Expires = DateTime.Now.AddDays (1);\r
- }\r
- break;\r
- case "PATH":\r
- cookie.Path = parts[1];\r
- break;\r
- case "PORT":\r
- if (cookie.Port == null)\r
- cookie.Port = parts[1];\r
- break;\r
- case "SECURE":\r
- cookie.Secure = true;\r
- break;\r
- case "VERSION":\r
- cookie.Version = Int32.Parse (parts[1]);\r
- break;\r
- } // switch\r
- } // while\r
-\r
- if (_cookies == null)\r
- _cookies = new CookieCollection();\r
-\r
- if (cookie.Domain == "")\r
- cookie.Domain = _uri.Host;\r
-\r
-// Console.WriteLine("adding cookie " + cookie + " to collection");\r
- _cookies.Add (cookie);\r
-// Console.WriteLine("exit from method...");\r
- } \r
- \r
- private void SetCookie2 (string cookies_str)\r
- {\r
- string [] cookies = cookies_str.Split (',');\r
- foreach (string cookie_str in cookies)\r
- SetCookie (cookie_str);\r
- }\r
- #endregion\r
- }\r
-}\r
}\r
\r
// Methods\r
-#if !TARGET_JVM\r
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)\r
{\r
base.GetObjectData (info, context);\r
}\r
-#endif\r
\r
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
{\r
protocolVersion = version;
}
-#if !TARGET_JVM
internal EventHandler SendRequest (HttpWebRequest request, string groupName)
{
WebConnection cnc;
return cnc.SendRequest (request);
}
-#endif
public bool CloseConnectionGroup (string connectionGroupName)
{
lock (this) {
private static bool _checkCRL = false;
private static SecurityProtocolType _securityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
-#if TARGET_JVM
- static bool expectContinue = false;
-#else
static bool expectContinue = true;
-#endif
static bool useNagle;
static RemoteCertificateValidationCallback server_cert_cb;
static bool tcp_keepalive;
return sp;
}
+
+ internal static void CloseConnectionGroup (string connectionGroupName)
+ {
+ lock (servicePoints) {
+ foreach (ServicePoint sp in servicePoints.Values) {
+ sp.CloseConnectionGroup (connectionGroupName);
+ }
+ }
+ }
#if SECURITY_DEP
internal class ChainValidationHelper {
+++ /dev/null
-using System;\r
-using System.IO;\r
-using System.Threading;\r
-\r
-using mainsoft.apache.commons.httpclient;\r
-using mainsoft.apache.commons.httpclient.methods;\r
-using mainsoft.apache.commons.httpclient.@params;\r
-using mainsoft.apache.commons.httpclient.auth;\r
-using mainsoft.apache.commons.httpclient.auth.negotiate;\r
-using javax.security.auth;\r
-using org.ietf.jgss;\r
-using java.security;\r
-using System.Collections.Specialized;\r
-using System.Collections;\r
-using mainsoft.apache.commons.httpclient.cookie;\r
-\r
-namespace System.Net\r
-{\r
- /// <summary>\r
- /// Summary description for VMWHttpProvider.\r
- /// </summary>\r
- internal class VMWHttpProvider : HttpProvider\r
- {\r
- protected static HttpClient _sclient;\r
- protected static HttpStateCache _stateCache = new HttpStateCache();\r
-\r
- protected static object LOCK_OBJECT = new object();\r
- \r
- protected HttpClient _client;\r
- protected bool _disableHttpConnectionPooling = false;\r
-\r
- protected HttpMethod _method;\r
- protected HttpState _state;\r
- protected HostConfiguration _hostConfig;\r
- \r
- protected HttpWebResponse _response;\r
- protected bool _hasResponse;\r
- protected bool _hasRequest;\r
- protected Stream _writeStream;\r
- private GHWebAsyncResult _asyncWrite; \r
-\r
- private bool _isConnectionOpened;\r
- \r
- static VMWHttpProvider()\r
- {\r
- if(java.lang.System.getProperty("mainsoft.apache.commons.logging.Log") == null)\r
- java.lang.System.setProperty("mainsoft.apache.commons.logging.Log",\r
- "mainsoft.apache.commons.logging.impl.SimpleLog");\r
- if(java.lang.System.getProperty("mainsoft.apache.commons.logging.simplelog.showdatetime") == null)\r
- java.lang.System.setProperty("mainsoft.apache.commons.logging.simplelog.showdatetime",\r
- "true");\r
- if(java.lang.System.getProperty("mainsoft.apache.commons.logging.simplelog.log.httpclient.wire") == null)\r
- java.lang.System.setProperty("mainsoft.apache.commons.logging.simplelog.log.httpclient.wire",\r
- "error");\r
- if(java.lang.System.getProperty("mainsoft.apache.commons.logging.simplelog.log.mainsoft.apache.commons.httpclient")\r
- == null)\r
- java.lang.System.setProperty("mainsoft.apache.commons.logging.simplelog.log.mainsoft.apache.commons.httpclient",\r
- "error");\r
- if(java.lang.System.getProperty("mainsoft.apache.commons.logging.simplelog.log.httpclient.wire.header")\r
- == null)\r
- java.lang.System.setProperty("mainsoft.apache.commons.logging.simplelog.log.httpclient.wire.header", \r
- "error");\r
-\r
- }\r
- public VMWHttpProvider(Uri uri) : base (uri)\r
- {\r
- string s = System.Configuration.ConfigurationSettings.AppSettings["disableHttpConnectionPooling"];\r
- if (s != null) \r
- {\r
- _disableHttpConnectionPooling = bool.Parse(s);\r
- }\r
- InitDefaultCredentialsProvider ();\r
- InitSPNProviders ();\r
- }\r
-\r
- internal override ServicePoint ServicePoint\r
- {\r
- get {throw new NotImplementedException();}\r
- }\r
-\r
-\r
-\r
- public override bool IsRequestStarted()\r
- {\r
- if(_method == null)\r
- return false;\r
- return _method.isRequestSent();\r
- }\r
-\r
- public override Uri GetAddress()\r
- {\r
- if(_method == null)\r
- return GetOriginalAddress();\r
- mainsoft.apache.commons.httpclient.URI javaURI = _method.getURI();\r
- return new Uri(javaURI.ToString());\r
- }\r
-\r
- public override bool IsHaveResponse()\r
- {\r
- return _hasResponse;\r
- }\r
-\r
- private void SetJavaCredential(NetworkCredential nc, string type)\r
- {\r
- SetJavaCredential(nc, type, false);\r
- }\r
-\r
- private void SetJavaCredential(NetworkCredential nc, string type, bool proxyCredentials)\r
- {\r
- string host = null;\r
- \r
- if(!proxyCredentials)\r
- host = GetOriginalAddress().Host;\r
- else\r
- host = ((WebProxy)this.Proxy).Address.Host;\r
-\r
- string domain = (nc.Domain == null) ? host : nc.Domain;\r
-\r
- if(String.Compare (type, "any", StringComparison.InvariantCultureIgnoreCase) == 0)\r
- {\r
- if(!proxyCredentials)\r
- {\r
- _state.setCredentials(AuthScope.ANY,\r
- new UsernamePasswordCredentials(nc.UserName, nc.Password));\r
- _state.setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM, "Ntlm"),\r
- new NTCredentials(nc.UserName, nc.Password, host, domain));\r
- }\r
- else\r
- {\r
- _state.setProxyCredentials(AuthScope.ANY,\r
- new UsernamePasswordCredentials(nc.UserName, nc.Password));\r
- _state.setProxyCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM, "Ntlm"),\r
- new NTCredentials(nc.UserName, nc.Password, host, domain));\r
- }\r
- }\r
- else if(String.Compare (type, "basic", StringComparison.InvariantCultureIgnoreCase) == 0)\r
- {\r
- if(!proxyCredentials)\r
- {\r
- _state.setCredentials(new AuthScope(AuthScope.ANY_HOST,\r
- AuthScope.ANY_PORT, AuthScope.ANY_REALM, "basic"),\r
- new UsernamePasswordCredentials(nc.UserName, nc.Password));\r
- }\r
- else\r
- {\r
- _state.setProxyCredentials(new AuthScope(AuthScope.ANY_HOST,\r
- AuthScope.ANY_PORT, AuthScope.ANY_REALM, "basic"),\r
- new UsernamePasswordCredentials(nc.UserName, nc.Password));\r
- }\r
- }\r
- else if(String.Compare (type, "digest", StringComparison.InvariantCultureIgnoreCase) == 0)\r
- {\r
- if(!proxyCredentials)\r
- {\r
- _state.setCredentials(new AuthScope(AuthScope.ANY_HOST,\r
- AuthScope.ANY_PORT, AuthScope.ANY_REALM, "digest"),\r
- new UsernamePasswordCredentials(nc.UserName, nc.Password));\r
- }\r
- else\r
- {\r
- _state.setProxyCredentials(new AuthScope(AuthScope.ANY_HOST,\r
- AuthScope.ANY_PORT, AuthScope.ANY_REALM, "digest"),\r
- new UsernamePasswordCredentials(nc.UserName, nc.Password));\r
- }\r
- }\r
- else if(String.Compare (type, "ntlm", StringComparison.InvariantCultureIgnoreCase) == 0)\r
- {\r
- if(!proxyCredentials)\r
- {\r
- _state.setCredentials(new AuthScope(AuthScope.ANY_HOST,\r
- AuthScope.ANY_PORT, AuthScope.ANY_REALM, "ntlm"),\r
- new NTCredentials(nc.UserName, nc.Password, host, domain));\r
- }\r
- else\r
- {\r
- _state.setProxyCredentials(new AuthScope(AuthScope.ANY_HOST,\r
- AuthScope.ANY_PORT, AuthScope.ANY_REALM, "ntlm"),\r
- new NTCredentials(nc.UserName, nc.Password, host, domain));\r
- }\r
- }\r
- else if(String.Compare (type, "negotiate", StringComparison.InvariantCultureIgnoreCase) == 0)\r
- {\r
- SetAuthenticationScheme (AuthPolicy.NEGOTIATE);\r
- }\r
- else\r
- {\r
- if(!proxyCredentials)\r
- {\r
- _state.setCredentials(new AuthScope(AuthScope.ANY_HOST,\r
- AuthScope.ANY_PORT, AuthScope.ANY_REALM, type),\r
- new UsernamePasswordCredentials(nc.UserName, nc.Password));\r
- }\r
- else\r
- {\r
- _state.setProxyCredentials(new AuthScope(AuthScope.ANY_HOST,\r
- AuthScope.ANY_PORT, AuthScope.ANY_REALM, type),\r
- new UsernamePasswordCredentials(nc.UserName, nc.Password));\r
- }\r
- } \r
- }\r
-\r
- private void SetAuthenticationScheme (string type) { \r
- _method.getHostAuthState ().setAuthScheme (AuthPolicy.getAuthScheme (type)); \r
- if (type != null && type.ToLower () == AuthPolicy.NEGOTIATE.ToLower ()) { \r
- _method.getParams ().setParameter (CredentialsProvider__Finals.PROVIDER, new HTTPClientCredentialsBridge( DefaultCredentialsProvider));\r
- _method.getParams ().setParameter (NegotiateScheme.SPN_LIST_PARAM, SPNProviders);\r
- } \r
- }\r
-\r
- private java.util.ArrayList SPNProviders {\r
- get {\r
- return (java.util.ArrayList) AppDomain.CurrentDomain.GetData ("GH$SPNProviders");\r
- }\r
- set {\r
- AppDomain.CurrentDomain.SetData ("GH$SPNProviders", value);\r
- }\r
- }\r
-\r
- private void InitSPNProviders () {\r
- if (SPNProviders != null)\r
- return;\r
- java.util.ArrayList spnProviders = new java.util.ArrayList ();\r
- NameValueCollection configAttributes = System.Configuration.ConfigurationSettings.AppSettings;\r
- string providersList = configAttributes ["SPNProviders"];\r
- if (providersList == null)\r
- return;\r
- string[] tokens = providersList.Split (',');\r
- foreach (string spnClass in tokens) {\r
- try {\r
- spnProviders.add (Activator.CreateInstance (Type.GetType (spnClass)));\r
- }\r
- catch (Exception) { }\r
- }\r
- SPNProviders = spnProviders;\r
- }\r
-\r
- private vmw.@internal.auth.CredentialsProvider DefaultCredentialsProvider {\r
- get {\r
- return (vmw.@internal.auth.CredentialsProvider) AppDomain.CurrentDomain.GetData ("GH$DefaultCredentialsProvider");\r
- }\r
- set {\r
- AppDomain.CurrentDomain.SetData ("GH$DefaultCredentialsProvider", value);\r
- }\r
- }\r
-\r
- private void InitDefaultCredentialsProvider () {\r
- if (DefaultCredentialsProvider != null)\r
- return;\r
- vmw.@internal.auth.CredentialsProvider defaultProvider = null;\r
- NameValueCollection configAttributes = System.Configuration.ConfigurationSettings.AppSettings;\r
- \r
- string defaultProviderClass = configAttributes ["DefaultCredentialsProvider"];\r
- if (defaultProviderClass != null) {\r
- try { \r
- defaultProvider = (vmw.@internal.auth.CredentialsProvider)\r
- Activator.CreateInstance (Type.GetType (defaultProviderClass));\r
- }\r
- catch (Exception e) {\r
- Console.WriteLine ("Failed to initialize Credentials Provider: " + defaultProviderClass + " Message: " + e.Message); \r
- }\r
- } \r
-\r
- if (defaultProvider == null) \r
- defaultProvider = new vmw.@internal.auth.SubjectCredentialsPrvider ();\r
-\r
- defaultProvider.init (ConvertToTable (configAttributes));\r
- DefaultCredentialsProvider = defaultProvider;\r
- }\r
-\r
- private java.util.Properties ConvertToTable (NameValueCollection col) {\r
- java.util.Properties table = new java.util.Properties ();\r
- foreach (String key in col.Keys)\r
- table.put (key, col [key]);\r
- return table;\r
- }\r
-\r
- private void InitProxyCredentials () {\r
- if (this.Proxy == null)\r
- return;\r
-\r
- if (!(this.Proxy is WebProxy))\r
- return;\r
-\r
- WebProxy proxy = (WebProxy) this.Proxy;\r
- ICredentials creds = proxy.Credentials;\r
-\r
- if(creds == null)\r
- return;\r
-\r
- if(creds is CredentialCache)\r
- {\r
- string type = "basic";\r
- NetworkCredential nc = ((CredentialCache)creds).GetCredential(proxy.Address, "basic");\r
- if(nc == null)\r
- {\r
- type = "digest";\r
- nc = ((CredentialCache)creds).GetCredential(proxy.Address, "digest");\r
- if(nc == null)\r
- {\r
- type = "ntlm";\r
- nc = ((CredentialCache)creds).GetCredential(proxy.Address, "ntlm");\r
- if (nc == null) {\r
- nc = ((CredentialCache) _credentials).GetCredential (GetOriginalAddress (), "negotiate");\r
- type = "negotiate";\r
- }\r
- }\r
- }\r
- if(nc != null)\r
- {\r
- SetJavaCredential(nc, type, true);\r
- }\r
- }\r
- else if (creds is NetworkCredential)\r
- {\r
- SetJavaCredential((NetworkCredential)creds, "any", true);\r
- }\r
-\r
- _method.setDoAuthentication(true);\r
- }\r
-\r
- private void InitCredentials()\r
- {\r
- if(_credentials == null)\r
- return;\r
- if (_credentials == CredentialCache.DefaultCredentials) {\r
- SetAuthenticationScheme (AuthPolicy.NEGOTIATE);\r
- }\r
- else if (_credentials is CredentialCache) {\r
- NetworkCredential nc = ((CredentialCache) _credentials).GetCredential (GetOriginalAddress (), "basic");\r
- string type = "basic";\r
- if(nc == null)\r
- {\r
- nc = ((CredentialCache)_credentials).GetCredential(GetOriginalAddress(), "digest");\r
- type = "digest";\r
- if(nc == null)\r
- {\r
- nc = ((CredentialCache)_credentials).GetCredential(GetOriginalAddress(), "ntlm");\r
- type = "ntlm";\r
- if (nc == null) {\r
- nc = ((CredentialCache) _credentials).GetCredential (GetOriginalAddress (), "negotiate");\r
- type = "negotiate";\r
- }\r
- }\r
- }\r
- if(nc != null)\r
- {\r
- SetJavaCredential(nc, type);\r
- }\r
- }\r
- else if(_credentials is NetworkCredential)\r
- {\r
- SetJavaCredential((NetworkCredential)_credentials, "any");\r
- }\r
-\r
- _method.setDoAuthentication(true);\r
- }\r
-\r
- private void InitHostConfig()\r
- {\r
- if (this.Proxy == null || this.Proxy == WebRequest.DefaultWebProxy)\r
- return;\r
- if(this.Proxy.IsBypassed(GetOriginalAddress()))\r
- return;\r
-\r
- _hostConfig = new HostConfiguration(); \r
- _hostConfig.setHost(new HttpHost(_method.getURI()));\r
-\r
- \r
- if(this.Proxy is WebProxy)\r
- {\r
- WebProxy wp = (WebProxy) this.Proxy;\r
- _hostConfig.setProxyHost(new ProxyHost(wp.Address.Host, wp.Address.Port));\r
- }\r
- else\r
- throw new NotImplementedException("Cannot accept Proxy which is not System.Net.WebProxy instance");\r
-\r
- \r
- }\r
-\r
- private void SetConnectionHeader(string val)\r
- {\r
- string connectionHeader = (this.Proxy != null) ? "Proxy-Connection" : "Connection";\r
- Headers.RemoveInternal ((this.Proxy != null) ? "Proxy-Connection" : "Connection");\r
- \r
- if(val != null)\r
- _method.setRequestHeader(connectionHeader, val);\r
-\r
- if (_keepAlive) \r
- {\r
- _method.addRequestHeader (connectionHeader, "keep-alive");\r
- Headers.SetInternal(connectionHeader,"keep-alive");\r
- }\r
- else if (!_keepAlive && _version == HttpVersion.Version11) \r
- {\r
- _method.addRequestHeader (connectionHeader, "close");\r
- Headers.SetInternal(connectionHeader,"close");\r
- }\r
-\r
- }\r
- private bool OpenConnection()\r
- {\r
- lock(this)\r
- {\r
- if(_isConnectionOpened)\r
- return false;\r
- _isConnectionOpened = true;\r
- }\r
- InitClient();\r
- InitMethod();\r
-\r
- _state = _stateCache.GetHttpState();\r
-\r
- //todo insert needed Authontication, Cookies info to state!\r
- _method.setDoAuthentication(this.PreAuthenticate);\r
- \r
- InitHostConfig();\r
- InitCredentials();\r
- InitProxyCredentials();\r
- \r
- if(this.ProtocolVersion == HttpVersion.Version11)\r
- _method.getParams().setVersion(mainsoft.apache.commons.httpclient.HttpVersion.HTTP_1_1);\r
- else if(ProtocolVersion == HttpVersion.Version10)\r
- _method.getParams().setVersion(mainsoft.apache.commons.httpclient.HttpVersion.HTTP_1_0);\r
- else \r
- throw new ProtocolViolationException("Unsupported protocol version: " + ProtocolVersion);\r
-\r
- if(!(_method is mainsoft.apache.commons.httpclient.methods.EntityEnclosingMethod))\r
- {\r
- _method.setFollowRedirects(this.AllowAutoRedirect);\r
- }\r
- else\r
- {\r
- if(!AllowWriteStreamBuffering && _contentLength < 0 && !SendChunked)\r
- throw new ProtocolViolationException();\r
- if(SendChunked)\r
- ((EntityEnclosingMethod)_method).setContentChunked(SendChunked); \r
- }\r
- if(MaxAutoRedirections != _defaultMaxRedirectsNum)\r
- {\r
- _method.getParams().setParameter(HttpClientParams.MAX_REDIRECTS,\r
- new java.lang.Integer(MaxAutoRedirections));\r
- }\r
- \r
- \r
- \r
- foreach(string k in Headers)\r
- { \r
- if(String.Compare (k, "connection", StringComparison.InvariantCultureIgnoreCase) == 0)\r
- continue;\r
- string val = Headers[k];\r
- val = (val == null) ? "" : val;\r
- _method.setRequestHeader(k, val);\r
- }\r
-\r
- if (this.CookieContainer != null) \r
- {\r
- string cookieHeader = this.CookieContainer.GetCookieHeader (this.GetOriginalAddress());\r
- if (cookieHeader != "")\r
- _method.setRequestHeader("Cookie", cookieHeader);\r
- }\r
- SetConnectionHeader(Headers["Connection"]);\r
- \r
- _method.getParams().setSoTimeout(ReadWriteTimeout);\r
-\r
- return true;\r
- \r
- }\r
-\r
- private void InitClient()\r
- {\r
- lock(LOCK_OBJECT)\r
- {\r
- if((!_disableHttpConnectionPooling) && (_client == null))\r
- {\r
- _client = _sclient;\r
- }\r
- if(_client == null)\r
- {\r
- mainsoft.apache.commons.httpclient.MultiThreadedHttpConnectionManager manager =\r
- new mainsoft.apache.commons.httpclient.MultiThreadedHttpConnectionManager();\r
- manager.setConnectionStaleCheckingEnabled(false);\r
- manager.setMaxTotalConnections(200);\r
- //by some reasons RFC something - the default \r
- //value will be 2 , so we need to change it ...\r
- manager.setMaxConnectionsPerHost(20);\r
- _client = new HttpClient(manager);\r
- _client.getParams().setIntParameter(HttpClientParams.MAX_REDIRECTS, _defaultMaxRedirectsNum);\r
- _client.getParams().setParameter(HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, new java.lang.Boolean(true));\r
- _client.getParams().setParameter(HttpClientParams.CONNECTION_MANAGER_TIMEOUT, new java.lang.Long(30000));\r
- _client.getParams().setParameter(HttpClientParams.USER_AGENT, \r
- "VMW4J HttpClient (based on Jakarta Commons HttpClient)");\r
- _client.getParams ().setBooleanParameter (HttpClientParams.SINGLE_COOKIE_HEADER, true);\r
- java.util.ArrayList schemas = new java.util.ArrayList ();\r
- schemas.add ("Ntlm");\r
- schemas.add ("Digest");\r
- schemas.add ("Basic");\r
- schemas.add ("Negotiate");\r
- _client.getParams ().setParameter (AuthPolicy.AUTH_SCHEME_PRIORITY, schemas);\r
- if (!_disableHttpConnectionPooling) {\r
- _sclient = _client;\r
- }\r
- }\r
- }\r
- }\r
-\r
- private void InitMethod()\r
- {\r
- lock(this)\r
- {\r
- if(_method == null)\r
- {\r
- string uriString = this.GetOriginalAddress().AbsoluteUri;\r
-\r
- if(this.MethodName == null || this.MethodName == "")\r
- {\r
- this.MethodName = "GET";\r
- }\r
- \r
- string name = this.MethodName.ToUpper().Trim();\r
-\r
- switch(name)\r
- {\r
- case "GET" : _method = new GetMethod(uriString); break;\r
- case "PUT" : _method = new PutMethod(uriString);\r
- if (ServicePointManager.Expect100Continue)\r
- _method.getParams ().setBooleanParameter (HttpMethodParams.USE_EXPECT_CONTINUE, true);\r
- break;\r
- case "POST": _method = new PostMethod(uriString);\r
- if (ServicePointManager.Expect100Continue)\r
- _method.getParams ().setBooleanParameter (HttpMethodParams.USE_EXPECT_CONTINUE, true);\r
- break;\r
- case "HEAD": _method = new HeadMethod(uriString); break;\r
- case "TRACE": _method = new TraceMethod(uriString);break;\r
- case "DELETE": _method = new DeleteMethod(uriString);break;\r
- case "OPTIONS": _method = new OptionsMethod(uriString);break;\r
- default: _method = new GenericMethod(uriString, MethodName); break;\r
- }\r
- }\r
- }\r
- }\r
-\r
- private void InitHostConfiguration()\r
- {\r
- lock(this)\r
- {\r
- if(_hostConfig == null)\r
- {\r
- _hostConfig = new HostConfiguration();\r
- }\r
- }\r
- }\r
-\r
- \r
-\r
- public override Stream GetRequestStream()\r
- {\r
- bool isPutPost = String.Compare("post", MethodName, true) == 0 \r
- || String.Compare("put", MethodName, true) == 0;\r
- if(!isPutPost)\r
- throw new ProtocolViolationException();\r
- lock(this)\r
- {\r
- if (_isAborted)\r
- throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);\r
- if(_writeStream != null)\r
- return _writeStream;\r
- this.OpenConnection();\r
-\r
- //java.io.PipedInputStream inJavaStream = new java.io.PipedInputStream();\r
- //java.io.PipedOutputStream outJavaStream = new java.io.PipedOutputStream(inJavaStream);\r
- \r
- long contLen = _contentLength;\r
- \r
- OutputStreamRequestEntity reqEntity = new OutputStreamRequestEntity(contLen);\r
-\r
- _writeStream = new VMWRequestStream(reqEntity, contLen);\r
- \r
- EntityEnclosingMethod method = (EntityEnclosingMethod)_method;\r
- if(AllowWriteStreamBuffering )\r
- method.setRequestEntity(reqEntity);\r
- else if(!AllowWriteStreamBuffering && contLen < 0 && !SendChunked)\r
- throw new ProtocolViolationException();\r
- else\r
- method.setRequestEntity(reqEntity);\r
- \r
- _hasRequest = true;\r
- return _writeStream;\r
- }\r
- }\r
- private static bool isRedirectNeeded(HttpMethod method)\r
- {\r
- switch (method.getStatusCode()) \r
- {\r
- case 302:\r
- case 301:\r
- case 303:\r
- case 307:\r
- return true;\r
- default:\r
- return false;\r
- } //end of switch\r
- }\r
-\r
- private void synchHeaders()\r
- {\r
- foreach(string k in Headers)\r
- {\r
- if (String.Compare (k, "connection", StringComparison.InvariantCultureIgnoreCase) == 0)\r
- continue;\r
- string val = Headers[k];\r
- val = (val == null) ? "" : val;\r
- _method.setRequestHeader(k, val);\r
- }\r
- }\r
-\r
- delegate WebResponse GetResponseDelegate();\r
- private sealed class AsyncContext\r
- {\r
- public readonly AsyncCallback AsyncCallback;\r
- public readonly Delegate AsyncDelegate;\r
- public readonly object AsyncState;\r
- public readonly DelegateAsyncResult DelegateAsyncResult;\r
-\r
- public AsyncContext (Delegate @delegate, DelegateAsyncResult delegateAsyncResult, AsyncCallback asyncCallback, object userState) {\r
- AsyncDelegate = @delegate;\r
- AsyncCallback = asyncCallback;\r
- AsyncState = userState;\r
- DelegateAsyncResult = delegateAsyncResult;\r
- }\r
- }\r
- private sealed class DelegateAsyncResult : IAsyncResult\r
- {\r
- \r
- IAsyncResult _asyncResult;\r
-\r
- public IAsyncResult AsyncResult {\r
- get { return _asyncResult; }\r
- set { _asyncResult = value; }\r
- }\r
-\r
- AsyncContext AsyncContext {\r
- get { return (AsyncContext) _asyncResult.AsyncState; }\r
- }\r
-\r
- public static void Callback (IAsyncResult result) {\r
- AsyncContext context = (AsyncContext) result.AsyncState;\r
- context.AsyncCallback.Invoke (context.DelegateAsyncResult);\r
- }\r
-\r
- public Delegate AsyncDelegate {\r
- get { return AsyncContext.AsyncDelegate; }\r
- }\r
-\r
- #region IAsyncResult Members\r
-\r
- public object AsyncState {\r
- get { return AsyncContext.AsyncState; }\r
- }\r
-\r
- public WaitHandle AsyncWaitHandle {\r
- get { return _asyncResult.AsyncWaitHandle; }\r
- }\r
-\r
- public bool CompletedSynchronously {\r
- get { return _asyncResult.CompletedSynchronously; }\r
- }\r
-\r
- public bool IsCompleted {\r
- get { return _asyncResult.IsCompleted; }\r
- }\r
-\r
- #endregion\r
- }\r
- \r
- WebResponse GetAsyncResponse()\r
- {\r
- try {\r
- return GetResponse ();\r
- }\r
- catch {\r
- return null;\r
- }\r
- }\r
-\r
- public override WebResponse GetResponse()\r
- {\r
- lock(this)\r
- {\r
- if (_isAborted)\r
- throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);\r
- if(!_isConnectionOpened)\r
- OpenConnection();\r
- if(_response == null)\r
- {\r
- try\r
- { \r
- synchHeaders();\r
- InternalExecuteMethod (); \r
- int numOfRedirects = 0;\r
- while (isRedirectNeeded (_method) && _allowAutoRedirect && numOfRedirects < MaxAutoRedirections) {\r
- if (!HandleManualyRedirect ())\r
- break;\r
- numOfRedirects++;\r
- }\r
- \r
- //todo right place to re-put all headers again...\r
- mainsoft.apache.commons.httpclient.Header hostHeader =\r
- _method.getRequestHeader("Host");\r
- if(hostHeader != null)\r
- Headers.SetInternal("Host", hostHeader.getValue());\r
-\r
- _response = new HttpWebResponse(_method, _state, _stateCache, GetAddress(), this.MethodName);\r
- \r
- if(_response != null && \r
- _response.Cookies != null && \r
- _response.Cookies.Count > 0)\r
- {\r
- if(CookieContainer != null)\r
- {\r
- foreach(Cookie cooky in _response.Cookies)\r
- {\r
- CookieContainer.Add(GetAddress(), cooky);\r
- }\r
- }\r
- }\r
-\r
- _hasResponse = true;\r
- int respCodeAsInt = (int) _response.StatusCode;\r
- if(respCodeAsInt >= 400)\r
- {\r
- // The WebException contains the readable (not closed) response stream.\r
- // So, in case of WebException, we should read all data from the \r
- // network response stream into the memory stream, and after that\r
- // close the underlying network stream. The following requests to read\r
- // from the stream will actually read from the memory stream.\r
- // So, the this.Abort() should not be called in this case.\r
- _response.ReadAllAndClose();\r
- //this.Abort();\r
- throw new WebException("The remote server returned an error: (" + respCodeAsInt +") " +_response.StatusCode, null, WebExceptionStatus.ProtocolError, _response);\r
- }\r
- Header location = _method.getResponseHeader ("location");\r
- if (isRedirectNeeded (_method) && location == null && _method.getFollowRedirects ())\r
- {\r
- // See comments above for the error >= 400\r
- _response.ReadAllAndClose();\r
- //this.Abort();\r
- throw new WebException("Got response code "+_response.StatusCode+", but no location provided", null, WebExceptionStatus.ProtocolError, _response);\r
- }\r
- }\r
- catch(ProtocolException e)\r
- {\r
- throw new WebException("", e);\r
- }\r
- catch(java.net.ConnectException e)\r
- {\r
- throw new WebException("Unable to connect to the remote server.", e);\r
- }\r
- catch(java.net.SocketTimeoutException e)\r
- {\r
- throw new WebException("Timeout exceeded", e);\r
- }\r
- catch(java.io.IOException e)\r
- {\r
- throw new WebException("", e);\r
- }\r
- }\r
- return _response;\r
- }\r
-\r
- }\r
-\r
- private void InternalExecuteMethod () {\r
- _client.executeMethod (_hostConfig, _method, _state); \r
- } \r
-\r
- private bool HandleManualyRedirect () { \r
- Header redirectHeader = _method.getResponseHeader ("location");\r
- if (redirectHeader == null) {\r
- // See comments above for the error >= 400\r
- _response.ReadAllAndClose ();\r
- //this.Abort();\r
- throw new WebException ("Got response code " + _response.StatusCode + ", but no location provided", null, WebExceptionStatus.ProtocolError, _response);\r
- }\r
-\r
- mainsoft.apache.commons.httpclient.HttpMethod originalMethod = _method;\r
- try {\r
- string location = redirectHeader.getValue ();\r
- URI currentUri = _method.getURI ();\r
- URI redirectUri = null;\r
-\r
- redirectUri = new URI (location, true);\r
- if (redirectUri.isRelativeURI ()) {\r
- //location is incomplete, use current values for defaults \r
- redirectUri = new URI (currentUri, redirectUri);\r
- }\r
- \r
- _method = new GetMethod ();\r
- foreach(Header h in originalMethod.getRequestHeaders())\r
- _method.addRequestHeader(h); \r
- _method.setURI (redirectUri); \r
- InternalExecuteMethod ();\r
- return true;\r
- }\r
- catch (URIException e) {\r
- _method = originalMethod;\r
- return false;\r
- }\r
- }\r
-\r
- public override void Abort()\r
- {\r
- lock (this) {\r
- if (_isAborted)\r
- return;\r
- _isAborted = true;\r
- try {\r
- if (_hasResponse) {\r
- _response.Close ();\r
- }\r
- }\r
- finally {\r
- if (_method != null)\r
- _method.releaseConnection ();\r
- _method = null;\r
- _hasResponse = false;\r
- _response = null;\r
- }\r
- }\r
- }\r
-\r
- public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state)\r
- {\r
- lock(this)\r
- {\r
- if(_asyncWrite != null)\r
- {\r
- throw new InvalidOperationException ("Cannot re-call start of asynchronous " +\r
- "method while a previous call is still in progress.");\r
- }\r
- \r
- _asyncWrite = new GHWebAsyncResult (this, callback, state);\r
- if (_hasRequest) \r
- {\r
- if (_writeStream != null) \r
- {\r
- _asyncWrite.SetCompleted (true, _writeStream);\r
- _asyncWrite.DoCallback ();\r
- return _asyncWrite;\r
- }\r
- }\r
- \r
- \r
- try\r
- {\r
- this.GetRequestStream(); \r
- }\r
- catch(Exception e)\r
- {\r
- _asyncWrite.SetCompleted(false, e);\r
- _asyncWrite.DoCallback ();\r
- return _asyncWrite;\r
- }\r
-\r
- _asyncWrite.SetCompleted (true, _writeStream);\r
- _asyncWrite.DoCallback ();\r
- return _asyncWrite;\r
- \r
- }\r
- } \r
-\r
- public override Stream EndGetRequestStream(IAsyncResult asyncResult)\r
- {\r
- if (asyncResult == null)\r
- throw new ArgumentNullException ("asyncResult");\r
-\r
- GHWebAsyncResult result = asyncResult as GHWebAsyncResult;\r
- if (result == null)\r
- throw new ArgumentException ("Invalid IAsyncResult");\r
-\r
- _asyncWrite = result;\r
-\r
- result.WaitUntilComplete ();\r
-\r
- Exception e = result.Exception;\r
- \r
- if (e != null)\r
- throw e;\r
-\r
- return result.WriteStream;\r
- }\r
-\r
- public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state)\r
- {\r
- GetResponseDelegate d = new GetResponseDelegate (GetAsyncResponse);\r
- DelegateAsyncResult result = new DelegateAsyncResult ();\r
- AsyncContext userContext = new AsyncContext (d, result, callback, state);\r
- result.AsyncResult = d.BeginInvoke (new AsyncCallback (DelegateAsyncResult.Callback), userContext);\r
- return result;\r
- }\r
-\r
- public override WebResponse EndGetResponse(IAsyncResult asyncResult)\r
- {\r
- if (_isAborted)\r
- throw new WebException ("The operation has been aborted.", WebExceptionStatus.RequestCanceled);\r
- if (asyncResult == null)\r
- throw new ArgumentNullException ("asyncResult");\r
-\r
- DelegateAsyncResult result = asyncResult as DelegateAsyncResult;\r
- if (result == null)\r
- throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");\r
-\r
- return ((GetResponseDelegate) result.AsyncDelegate).EndInvoke (result.AsyncResult);\r
- }\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
- \r
-\r
-\r
-\r
-\r
- #region VMWRequestStream class\r
- internal class VMWRequestStream : Stream, IDisposable\r
- {\r
-\r
- private java.io.OutputStream _javaOutput;\r
- private long _len;\r
- private long _contentLength;\r
-\r
- internal VMWRequestStream (java.io.OutputStream stream) :\r
- this(stream , -1L)\r
- {\r
- }\r
-\r
- internal VMWRequestStream (java.io.OutputStream stream, long contentLength)\r
- {\r
- _javaOutput = stream;\r
- _contentLength = contentLength;\r
- _len = 0;\r
- }\r
- public override bool CanRead\r
- {\r
- get {return false;}\r
- }\r
-\r
- public override bool CanWrite\r
- {\r
- get{return true;}\r
- }\r
-\r
- public override bool CanSeek\r
- {\r
- get { return false;}\r
- }\r
-\r
- public override long Length\r
- {\r
- get{ return _len;}\r
- }\r
-\r
- public override long Position\r
- {\r
- get\r
- {\r
- return _len;\r
- }\r
-\r
- set\r
- {\r
- throw new NotSupportedException();\r
- }\r
- }\r
-\r
- private volatile bool _closed = false;\r
-\r
- public override void Close()\r
- {\r
- if(!_closed)\r
- {\r
- lock(this)\r
- {\r
- if(!_closed)\r
- {\r
- try {\r
- _closed = true;\r
- _javaOutput.close ();\r
- }\r
- catch (Exception e) {\r
- throw new WebException ("The request was aborted: The request was canceled.",\r
- e, WebExceptionStatus.RequestCanceled, null);\r
- }\r
- }\r
- }\r
- }\r
- }\r
-\r
- public override void Flush()\r
- {\r
- _javaOutput.flush();\r
- }\r
-\r
- public override int ReadByte()\r
- {\r
- throw new NotSupportedException();\r
- }\r
-\r
- public override int Read(byte[] buffer, int offset, int count)\r
- {\r
- throw new NotSupportedException();\r
- }\r
-\r
- public override void Write(byte[] buffer, int offset, int count)\r
- {\r
- if(_contentLength >= 0)\r
- {\r
- _len += count;\r
- if(_len > _contentLength)\r
- {\r
- throw new System.Net.ProtocolViolationException(\r
- "Bytes to be written to the stream exceed Content-Length bytes size specified.");\r
- }\r
- }\r
- _javaOutput.write(vmw.common.TypeUtils.ToSByteArray(buffer), offset, count);\r
-\r
- if(_contentLength == _len)\r
- {\r
- _javaOutput.flush();\r
- _javaOutput.close();\r
- }\r
- }\r
-\r
- public override long Seek(long offset, SeekOrigin origin)\r
- {\r
- throw new NotSupportedException();\r
- }\r
-\r
- public override void SetLength(long length)\r
- {\r
- throw new NotSupportedException();\r
- }\r
-\r
- void IDisposable.Dispose()\r
- {\r
- Close ();\r
- }\r
- }\r
- \r
- #endregion\r
-\r
- #region GHWebAsyncResult\r
- internal class GHWebAsyncResult : IAsyncResult\r
- {\r
- private object _state;\r
- private AsyncCallback _callback;\r
- private ManualResetEvent _handle;\r
- private bool _isCompleted = false;\r
- private bool _callbackDone;\r
- private Stream _writeStream;\r
- private HttpProvider _provider;\r
-\r
- private Exception _exception;\r
-\r
- #region Constructors\r
-\r
- public GHWebAsyncResult(HttpProvider provider, \r
- AsyncCallback callback, object state) : \r
- this(state, callback)\r
- {\r
- _provider = provider;\r
- }\r
-\r
- public GHWebAsyncResult(object state, AsyncCallback callback)\r
- {\r
- _state = state;\r
- _callback = callback;\r
- }\r
- #endregion\r
-\r
- #region IAsyncResult Members\r
-\r
- public object AsyncState\r
- {\r
- get\r
- {\r
- return _state;\r
- }\r
- }\r
-\r
- public bool CompletedSynchronously\r
- {\r
- get\r
- {\r
- // TODO: Add HWebAsyncResult.CompletedSynchronously getter implementation\r
- return false;\r
- }\r
- }\r
-\r
- public WaitHandle AsyncWaitHandle \r
- {\r
- get \r
- {\r
- if (_handle == null) \r
- {\r
- lock (this) \r
- {\r
- if (_handle == null)\r
- _handle = new ManualResetEvent (_isCompleted);\r
- }\r
- }\r
- \r
- return _handle;\r
- }\r
- }\r
-\r
- public bool IsCompleted\r
- {\r
- get\r
- {\r
- return _isCompleted; \r
- }\r
- }\r
-\r
- #endregion\r
-\r
- #region Internal Properties\r
-\r
- internal Stream WriteStream\r
- {\r
- get\r
- {\r
- return _writeStream;\r
- }\r
- }\r
-\r
- internal Exception Exception\r
- {\r
- get\r
- {\r
- return _exception;\r
- }\r
- }\r
-\r
- internal HttpWebResponse Response\r
- {\r
- get\r
- {\r
- return ((VMWHttpProvider)_provider)._response;\r
- }\r
- }\r
-\r
- #endregion\r
-\r
- #region Internal Methods\r
-\r
- internal void SetCompleted(bool res, Stream writeStream)\r
- {\r
- _isCompleted = res;\r
- _writeStream = writeStream;\r
- ((ManualResetEvent) AsyncWaitHandle).Set ();\r
- }\r
-\r
- internal void SetCompleted(bool res, Exception exc)\r
- {\r
- _isCompleted = res;\r
- _exception = exc;\r
- ((ManualResetEvent) AsyncWaitHandle).Set ();\r
- }\r
-\r
- internal void DoCallback()\r
- {\r
- if (!_callbackDone && _callback != null) \r
- {\r
- _callbackDone = true;\r
- _callback (this);\r
- }\r
- }\r
-\r
- internal void WaitUntilComplete()\r
- {\r
- if(_isCompleted)\r
- return;\r
- AsyncWaitHandle.WaitOne ();\r
- }\r
-\r
- internal bool WaitUntilComplete (int timeout, bool exitContext)\r
- {\r
- if (_isCompleted)\r
- return true;\r
-\r
- return AsyncWaitHandle.WaitOne (timeout, exitContext);\r
- }\r
- #endregion\r
-\r
- }\r
-\r
- #endregion\r
-\r
- #region OutputStreamRequestEntity\r
-\r
- internal class OutputStreamRequestEntity : java.io.OutputStream, RequestEntity\r
- {\r
- private long _contentLength;\r
- private java.io.ByteArrayOutputStream _out;\r
- private sbyte[] _buffer;\r
-\r
- internal OutputStreamRequestEntity(): this(-1)\r
- {\r
- }\r
-\r
- internal OutputStreamRequestEntity(long length)\r
- {\r
- _contentLength = length;\r
- int tmp = (int) _contentLength;\r
-\r
- if(tmp <=0)\r
- tmp = 4096;\r
- _out = new java.io.ByteArrayOutputStream(tmp);\r
- }\r
-\r
- #region RequestEntity Members\r
-\r
- public bool isRepeatable()\r
- {\r
- return ((_out != null) || (_buffer != null));\r
- }\r
-\r
- public long getContentLength()\r
- {\r
- if(_out != null)\r
- {\r
- _buffer = _out.toByteArray();\r
- }\r
- if(_buffer != null)\r
- {\r
- _contentLength = _buffer.Length;\r
- _out = null;\r
- }\r
- return _contentLength;\r
- }\r
-\r
- public void writeRequest(java.io.OutputStream output)\r
- {\r
- if(_out != null)\r
- _buffer = _out.toByteArray();\r
- if(_buffer != null)\r
- {\r
- output.write(_buffer, 0, _buffer.Length);\r
- _out = null;\r
- }\r
- else throw new ApplicationException();\r
- }\r
-\r
- public string getContentType()\r
- {\r
- return null;\r
- }\r
-\r
- #endregion\r
-\r
- public override void write(int i)\r
- {\r
- _out.write(i);\r
- }\r
-\r
- public override void close () \r
- {\r
- int size = _out.size ();\r
- _out.close ();\r
-\r
- if (size < _contentLength) {\r
- throw new IOException ("Cannot close stream until all bytes are written.");\r
- }\r
- }\r
- }\r
-\r
- #endregion\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
- }\r
-\r
- class HTTPClientCredentialsBridge : CredentialsProvider\r
- {\r
- private vmw.@internal.auth.CredentialsProvider m_internalProvider;\r
-\r
- public HTTPClientCredentialsBridge (vmw.@internal.auth.CredentialsProvider internalProvider) {\r
- m_internalProvider = internalProvider;\r
- }\r
-\r
- public Credentials getCredentials (AuthScheme scheme, string __p2, int __p3, bool __p4) {\r
- if (scheme.isComplete ())\r
- return null; \r
- GSSCredential creds = m_internalProvider.getCredentials (); \r
- return new DelegatedCredentials (creds);\r
- }\r
- }\r
-}\r
SetBusy ();
async = false;
WebRequest request = SetupRequest (address, method, true);
- return request.GetRequestStream ();
+ return OpenWriteStream (request);
} catch (WebException) {
throw;
} catch (Exception ex) {
}
}
+ Stream OpenWriteStream (WebRequest request)
+ {
+ var stream = request.GetRequestStream ();
+ var wcs = stream as WebConnectionStream;
+ if (wcs != null)
+ wcs.GetResponseOnClose = true;
+ return stream;
+ }
+
private string DetermineMethod (Uri address, string method, bool is_upload)
{
if (method != null)
WebRequest request = null;
try {
request = SetupRequest ((Uri) args [0], (string) args [1], true);
- Stream stream = request.GetRequestStream ();
+ var stream = OpenWriteStream (request);
OnOpenWriteCompleted (
new OpenWriteCompletedEventArgs (stream, null, false, args [2]));
} catch (ThreadInterruptedException){
try {
SetBusy ();
cts = new CancellationTokenSource ();
- request = SetupRequest (address);
- return await request.GetRequestStreamAsync ().ConfigureAwait (false);
+ request = await SetupRequestAsync (address, method, true).ConfigureAwait (false);
+ var stream = await request.GetRequestStreamAsync ();
+ var wcs = stream as WebConnectionStream;
+ if (wcs != null)
+ wcs.GetResponseOnClose = true;
+ return stream;
} catch (WebException) {
throw;
} catch (OperationCanceledException) {
if (data == null)
throw new ArgumentNullException ("data");
+ 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.");
+ Headers ["Content-Type"] = urlEncodedCType;
+
WebRequest request = null;
try {
SetBusy ();
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) {
if (e == null) { // At least we now where it comes from
try {
-#if TARGET_JVM
- throw new Exception ();
-#else
throw new Exception (new System.Diagnostics.StackTrace ().ToString ());
-#endif
} catch (Exception e2) {
e = e2;
}
disposed = true;
}
+ internal bool GetResponseOnClose {
+ get; set;
+ }
+
public override void Close ()
{
+ if (GetResponseOnClose) {
+ if (disposed)
+ return;
+ disposed = true;
+ var response = (HttpWebResponse)request.GetResponse ();
+ response.ReadAll ();
+ response.Close ();
+ return;
+ }
+
if (sendChunked) {
if (disposed)
return;
}\r
\r
// Methods\r
-#if !TARGET_JVM\r
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)\r
{\r
base.GetObjectData (info, context);\r
}\r
-#endif \r
\r
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
{\r
return sb.Append("\r\n").ToString();
}
-#if !TARGET_JVM
void ISerializable.GetObjectData (SerializationInfo serializationInfo,
StreamingContext streamingContext)
{
GetObjectData (serializationInfo, streamingContext);
}
-#endif
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
int count = base.Count;
{\r
throw new NotSupportedException ();\r
}\r
-#if TARGET_JVM //enable overrides for extenders\r
- public virtual void Dispose()\r
-#elif NET_4_0\r
+#if NET_4_0\r
public void Dispose ()\r
#else\r
void IDisposable.Dispose()\r
/BaseMachine.cs -crlf
-/LookBehindWithUndefinedLength.jvm.cs -crlf
-/NotAllowedConstruct.jvm.cs -crlf
/RegexRunnerFactory.cs -crlf
/cache.cs -crlf
/category.cs -crlf
+++ /dev/null
-//
-// AlternationBackReferenceConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class AlternationBackReferenceConstruct : IConstructType
- {
- private const string DEFINITION = @"\(\?\(\w+\).*\|?.*\)";
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- return JavaUtils.IsMatch (pattern, DEFINITION);
- }
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
- throw new NotImplementedException ("Reformat for alternation construct with back reference is not implemented.");
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// AlternationExpressionConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class AlternationExpressionConstruct : IConstructType
- {
- private const string DEFINITION = @"\(\?\([^\)]+\).*\|?.*\)";
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- return JavaUtils.IsMatch (pattern, DEFINITION);
- }
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
- throw new NotImplementedException ("Reformat for alternation construct with expression is not implemented.");
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// BackReferenceConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class BackReferenceConstruct : IConstructType
- {
- private const string NUMBER_BACK_REFERENCE_PATTERN = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823})\\(\d+)";
- private const string NAME_1_BACK_REFERENCE_PATTERN = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823})\\k<(\w+)>";
- private const string NAME_2_BACK_REFERENCE_PATTERN = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823})\\k'(\w+)'";
- private const string NUMBER = @"\d+";
-
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- if (JavaUtils.IsMatch (pattern, NUMBER_BACK_REFERENCE_PATTERN)) {
- return true;
- }
-
- if (JavaUtils.IsMatch (pattern, NAME_1_BACK_REFERENCE_PATTERN)) {
- return true;
- }
-
- return JavaUtils.IsMatch (pattern, NAME_2_BACK_REFERENCE_PATTERN);
- }
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
- if (!HasConstruct (reformattedPattern, options)) {
- return reformattedPattern;
- }
-
- if (patternGrouping.GroupCount >= 0 && patternGrouping.SameGroupsFlag) {
- return null;
- }
-
- Matcher m = JavaUtils.Matcher (reformattedPattern, NUMBER_BACK_REFERENCE_PATTERN);
- if (m.find ()) {
- reformattedPattern = ReplaceGroupNumber (m, reformattedPattern, patternGrouping, options);
- if (reformattedPattern == null)
- return null;
- }
-
- m = JavaUtils.Matcher(reformattedPattern, NAME_1_BACK_REFERENCE_PATTERN);
- if (m.find ()) {
- reformattedPattern = ReplaceGroupName (m, reformattedPattern, patternGrouping, options);
- if (reformattedPattern == null)
- return null;
- }
-
- m = JavaUtils.Matcher(reformattedPattern, NAME_2_BACK_REFERENCE_PATTERN);
- if (m.find ()) {
- reformattedPattern = ReplaceGroupName (m, reformattedPattern, patternGrouping, options);
- if (reformattedPattern == null)
- return null;
- }
-
- return reformattedPattern;
- }
-
- private string ReplaceGroupNumber (Matcher match,
- string reformattedPattern,
- PatternGrouping patternGrouping,
- RegexOptions options) {
- int groupNumber = int.Parse (match.group (1));
- int javaGroupNumber = groupNumber;
- int groupCount = patternGrouping.GroupCount;
-
- if (groupCount == -1) {
- if ((options & RegexOptions.ExplicitCapture) == RegexOptions.ExplicitCapture) {
- groupCount = 0;
- }
- else {
- groupCount = JavaUtils.GroupCount (reformattedPattern);
- }
- }
- else {
- javaGroupNumber = patternGrouping.NetToJavaNumbersMap [groupNumber];
- }
-
- if (groupNumber > groupCount) {
- return null;
- }
-
- return match.replaceFirst (@"\\" + javaGroupNumber);
- }
-
- private string ReplaceGroupName (Matcher match,
- string reformattedPattern,
- PatternGrouping patternGrouping,
- RegexOptions options) {
-
- if (patternGrouping.GroupCount == -1){
- return null;
- }
-
- string groupName = match.group (1);
- Pattern p = Pattern.compile (NUMBER);
- Matcher m = p.matcher ((CharSequence) (object) groupName);
- if (m.matches ()) {
- return ReplaceGroupNumber (match, reformattedPattern, patternGrouping, options);
- }
-
- if (!patternGrouping.GroupNameToNumberMap.Contains (groupName)) {
- return null;
- }
-
- int javaGroupNumber = patternGrouping.NetToJavaNumbersMap [(int) patternGrouping.GroupNameToNumberMap [groupName]];
- return match.replaceFirst (@"\\" + javaGroupNumber);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// BalancingGroupConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using java.util.regex;
-using java.lang;
-
-
-namespace System.Text.RegularExpressions
-{
- sealed class BalancingGroupConstruct : IConstructType
- {
- private const string DEFINITION1 = @"\(\?<[A-Za-z]\w*-[A-Za-z]\w*>.*\)";
- private const string DEFINITION2 = @"\(\?'[A-Za-z]\w*-[A-Za-z]\w*'.*\)";
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- if (JavaUtils.IsMatch (pattern, DEFINITION1)) {
- return true;
- }
- if (JavaUtils.IsMatch (pattern, DEFINITION2)) {
- return true;
- }
-
- return false;
- }
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
- throw new NotImplementedException ("Reformat for balancing group is not implemented.");
- }
- }
-}
\ No newline at end of file
if (!regex.RightToLeft && ptr <= input.Length)\r
splits.Add (input.Substring (ptr));\r
\r
- return splits.ToArray ();
+ return splits.ToArray ();\r
}\r
\r
- virtual public Match Scan (Regex regex, string text, int start, int end)\r
+ public Match Scan (Regex regex, string text, int start, int end)\r
{\r
- throw new NotImplementedException ("Scan method must be implemented in derived classes");\r
+ return Scan (regex, text, start, end, false);\r
}\r
\r
+ public abstract Match Scan (Regex regex, string text, int start, int end, bool substring_mode);\r
+\r
virtual public string Result (string replacement, Match match)\r
{\r
return ReplacementEvaluator.Evaluate (replacement, match);\r
+++ /dev/null
-//
-// CategoryConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class CategoryConstruct : IConstructType
- {
- private const string DEFINITION = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823}\\[pP]\{)Is(?=\w+\})";
- private const string IS_CATEGORY = @"In";
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- return JavaUtils.IsMatch (pattern, DEFINITION);
- }
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
-
- return JavaUtils.ReplaceAll (reformattedPattern, DEFINITION, IS_CATEGORY);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// CommentsConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class CommentsConstruct : IConstructType
- {
- private const string INLINE_COMMENT_PATTERN = @"\(\?#[^\)]*\)";
- private const string COMMENT_PATTERN = @"\#[^\n\r]*";
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- if (JavaUtils.IsMatch (pattern, INLINE_COMMENT_PATTERN))
- return true;
-
- if ((options & RegexOptions.IgnorePatternWhitespace) == 0)
- return false;
-
- return JavaUtils.IsMatch (pattern, COMMENT_PATTERN);
- }
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
-
- reformattedPattern = JavaUtils.ReplaceAll (reformattedPattern, INLINE_COMMENT_PATTERN, String.Empty);
-
- if ((options & RegexOptions.IgnorePatternWhitespace) == 0)
- return reformattedPattern;
-
- reformattedPattern = JavaUtils.ReplaceAll (reformattedPattern, COMMENT_PATTERN, String.Empty);
-
- return reformattedPattern;
- }
- }
-}
\ No newline at end of file
}
internal static Group Fail = new Group ();
-#if !TARGET_JVM
public CaptureCollection Captures {
get { return captures; }
}
-#endif
public bool Success {
get { return success; }
}
+++ /dev/null
-//
-// Group.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace System.Text.RegularExpressions
-{
- public partial class Group : Capture
- {
- readonly Match _match;
- readonly object _capturesLock = new object ();
- readonly int _groupNumber;
-
- internal int GroupNumber {
- get { return _groupNumber; }
- }
-
- public CaptureCollection Captures {
- get {
- lock (_capturesLock) {
- if (captures != null)
- return captures;
- _match.FillMonoCaptures (this);
- }
-
- return captures;
- }
-
- internal set { captures = value; }
- }
-
- // internal
- internal Group (string text, int index, int length, Match match, int groupNumber)
- : base (text, index, length) {
- success = true;
- _match = match;
- _groupNumber = groupNumber;
- }
-
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// IConstructType.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace System.Text.RegularExpressions
-{
- internal interface IConstructType
- {
- bool HasConstruct (string pattern, RegexOptions options);
-
- string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping);
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// InlineExplicitCaptureConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class InlineExplicitCaptureConstruct : IConstructType
- {
- private const string DEFINITION = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823}\()\?[imsx]*n[-imsx]*:[^\)]+\)";
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- return JavaUtils.IsMatch (pattern, DEFINITION);
- }
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
- throw new NotImplementedException("Reformat for inline explicit capture construct is not implemented.");
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// JavaUtils.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class JavaUtils
- {
- private const string ASTERISK_PATTERN = @"\*";
- private static readonly Pattern _asteriskPattern = Pattern.compile (ASTERISK_PATTERN);
-
- internal static bool IsMatch (string input, string pattern) {
- Pattern p = Pattern.compile (pattern);
- Matcher m = p.matcher ((CharSequence) (object) input);
-
- return m.find ();
- }
-
- internal static Matcher Matcher (string input, string pattern) {
- Pattern p = Pattern.compile (pattern);
- return p.matcher ((CharSequence) (object) input);
- }
-
- internal static string ReplaceAll (string input, string pattern, string replacement) {
- Pattern p = Pattern.compile (pattern);
- Matcher m = p.matcher ((CharSequence) (object) input);
- return m.replaceAll (replacement);
- }
-
- internal static string ReplaceAllAdvanced (string input, string pattern, string replacement) {
- Matcher m = _asteriskPattern.matcher ((CharSequence) (object) pattern);
- string readyPattern = m.replaceAll ("{0," + pattern.Length + "}");
-
- return ReplaceAll (input, readyPattern, replacement);
- }
-
- internal static int GroupCount (string pattern) {
- Pattern javaPattern = Pattern.compile (pattern);
- Matcher emptyMatcher = javaPattern.matcher ((CharSequence) (object) String.Empty);
- return emptyMatcher.groupCount ();
- }
-
- internal static string ReplaceWithLookBehind (string input, string pattern, string lookBehindPattern, string replacement) {
- Pattern p = Pattern.compile (pattern);
- Pattern behindPattern = Pattern.compile (lookBehindPattern);
-
- Matcher m = p.matcher ((CharSequence) (object) input);
- StringBuffer sb = new StringBuffer ();
-
- while (m.find ()) {
- Matcher pm = behindPattern.matcher ((CharSequence) (object) input.Substring (0, m.start()));
- if(pm.find())
- m.appendReplacement(sb, replacement);
- }
-
- m.appendTail (sb);
- return sb.ToString();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// JvmReMachine.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Collections;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class JvmReMachine : BaseMachine
- {
- readonly PatternData _patternData;
-
- internal JvmReMachine (PatternData patternData) {
- this._patternData = patternData;
- }
-
- #region Properties
-
- internal PatternData PatternData {
- get { return _patternData; }
- }
-
- internal Pattern JavaPattern {
- get { return _patternData.JavaPattern; }
- }
-
- internal IDictionary Mapping {
- get { return _patternData.GroupNameToNumberMap; }
- set { throw new NotImplementedException ("Mapping setter of JvmReMachine should not be called."); }//We must implement the setter of interface but it is not in use
- }
-
- internal string [] NamesMapping {
- get { return _patternData.GroupNumberToNameMap; }
- set { throw new NotImplementedException ("NamesMapping setter of JvmReMachine should not be called."); }//We must implement the setter of interface but it is not in use
- }
-
- internal int GroupCount {
- get { return _patternData.GroupCount; }
- }
-
- #endregion Properties
-
- #region Implementations of IMachine Interface
-
- public override Match Scan (Regex regex, string text, int start, int end) {
-
- if (start > end)
- return Match.Empty;
-
- Matcher m = JavaPattern.matcher (((CharSequence) (object) text).subSequence(0, end));
-
- if (!m.find (start)) {
- return System.Text.RegularExpressions.Match.Empty;
- }
-
- GroupCollection groups = new GroupCollection (regex.GroupCount + 1);
- Match match = new Match (regex, this, groups, text, text.Length,
- m.start (), m.end () - m.start ());
- for (int javaGroupNumber = 1; javaGroupNumber <= m.groupCount (); ++javaGroupNumber) {
- AddGroup (m, groups, javaGroupNumber, text, match);
- }
-
- return match;
- }
-
- public override string [] Split (Regex regex, string input, int count, int startat) {
-
- string [] splitArray = JavaPattern.split ((CharSequence) (object) input.Substring (startat), count);
-
- if (regex.GroupCount == 0 || splitArray.Length == 1) {
- return splitArray;
- }
-
- if (count == 0)
- count = Int32.MaxValue;
-
- Matcher m = JavaPattern.matcher ((CharSequence) (object) input.Substring (startat));
-
- int splitArrayIndex = 1;
-
- List<string> splits = new List<string> (splitArray.Length * (1 + regex.GroupCount));
- splits.Add (splitArray [0]);
-
- for (int number = 0; number < count; ++number) {
-
- if (!m.find ())
- break;
-
- for (int i = 1; i <= m.groupCount (); ++i) {
- splits.Add (m.group (i));
- }
-
- splits.Add (splitArray [splitArrayIndex++]);
- }
-
- return splits.ToArray ();
- }
-
- public override string Replace (Regex regex, string input, string replacement, int count, int startat) {
-
- if (regex.SameGroupNamesFlag) {
- return base.Replace (regex, input, replacement, count, startat);
- }
-
- if (count < 0) {
- count = Int32.MaxValue;
- }
-
- string replacementPattern = ReplacementData.Reformat (regex, replacement);
- Matcher m = JavaPattern.matcher ((CharSequence) (object) input);
-
- StringBuffer sb = new StringBuffer ();
- if (count > 0 && m.find (startat)) {
- ReplacementData.ReplaceMatch (replacementPattern, m, sb, input, _patternData);
- }
-
- for (int matchesCounter = 1; matchesCounter < count; ++matchesCounter) {
- if (!m.find ()) {
- break;
- }
- ReplacementData.ReplaceMatch (replacementPattern, m, sb, input, _patternData);
- }
-
-
- m.appendTail (sb);
- return sb.ToString ();
-
- }
-
- public override string Result (string replacement, Match match) {
- if (match.Length == 0)
- return String.Empty;
-
- string result = Replace (match.Regex, match.Text, replacement, 1, 0);
- return result.Substring (match.Index, result.Length - (match.Text.Length - match.Length));
-
- }
-
- #endregion Implementations of IMachine Interface
-
- private void AddGroup (Matcher m, GroupCollection groups, int javaGroupNumber, string text, Match match) {
- int netGroupNumber = _patternData.JavaToNetGroupNumbersMap [javaGroupNumber];
- if (netGroupNumber == -1) {
- return;
- }
-
- int index = m.start (javaGroupNumber);
-
- if (index < 0){
- if(groups[netGroupNumber] == null)
- groups.SetValue (new Group (), netGroupNumber);
- return;
- }
-
- Group group = new Group (text, index, m.end (javaGroupNumber) - index, match, netGroupNumber);
-
- groups.SetValue (group, netGroupNumber);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using java.util.regex;\r
-using java.lang;\r
-\r
-namespace System.Text.RegularExpressions\r
-{\r
- sealed class LookBehindWithUndefinedLength : IConstructType\r
- {\r
- //private const string DEFINITION = @"\(\?<[=!].*(?:[\*\+]|\{\d+,\}).*\)";\r
- private const string DEFINITION = @"\(\?<[=!][^\)]*\)";\r
-\r
- public bool HasConstruct (string pattern, RegexOptions options) {\r
- return JavaUtils.IsMatch (pattern, DEFINITION);\r
- }\r
-\r
- public string Reformat (RegexOptions options,\r
- string reformattedPattern,\r
- PatternGrouping patternGrouping) {\r
- throw new NotImplementedException ("Reformat for look ahead with undefined length construct is not implemented.");\r
- }\r
- }\r
-}\r
this.machine = machine;
this.text_length = text_length;
}
-#if !TARGET_JVM
internal Match (Regex regex, IMachine machine, string text, int text_length, int n_groups,
int index, int length, int n_caps) :
base (text, index, length, n_caps)
this.groups = new GroupCollection (n_groups, regex.Gap);
groups.SetValue (this, 0);
}
-#endif
internal Regex Regex {
get { return regex; }
}
+++ /dev/null
-//
-// Match.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
-
- public partial class Match : Group
- {
- #region Fields
-
- GroupCollection _monoGroups;
- readonly object _monoGroupsLock = new object ();
-
- #endregion Fields
-
- #region Ctors
-
- internal Match (Regex regex, IMachine machine, string text, int text_length, int n_groups,
- int index, int length, int n_caps)
- : this (regex, machine, new GroupCollection (n_groups), text,
- text_length, index, length, n_caps) { }
-
- internal Match (Regex regex, IMachine machine,
- GroupCollection groups,
- string text, int text_length,
- int index, int length)
- : this (regex, machine, groups, text, text_length, index, length, 1) { }
-
- private Match (Regex regex, IMachine machine,
- GroupCollection groups,
- string text, int text_length,
- int index, int length, int n_caps)
- : base (text, index, length, n_caps) {
- this.regex = regex;
- this.machine = machine;
- this.text_length = text_length;
-
- this.groups = groups;
- groups.SetValue (this, 0);
- }
-
- #endregion Ctors
-
- #region Properties
- private GroupCollection MonoGroups {
- get {
- lock (_monoGroupsLock) {
- if (_monoGroups != null)
- return _monoGroups;
-
- Match monoMatch = regex.GetMonoMachine ().Scan (regex, text, index, index + length);
- _monoGroups = monoMatch.Groups;
- }
-
- return _monoGroups;
- }
- }
-
- #endregion Properties
-
- internal void FillMonoCaptures (Group group) {
- group.Captures = MonoGroups [group.GroupNumber].Captures;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// NamingGroupsConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class NamingGroupsConstruct : IConstructType
- {
- private const string NAMED_GROUP_PATTERN_1 = @"\(\?<[A-Za-z]\w*>.*\)";
- private const string NAMED_GROUP_PATTERN_2 = @"\(\?'[A-Za-z]\w*'.*\)";
- private const string NUMBERED_GROUP_PATTERN_1 = @"\(\?<\d+>.*\)";
- private const string NUMBERED_GROUP_PATTERN_2 = @"\(\?'\d+'.*\)";
- private const string LEFT_PAREN = @"\(";
- private const string ESCAPED_LEFT_PAREN_TEMPL = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823})\\\(";
- private const string NON_CAPTURED_GROUP_PATTERN = @"(?:^\?[:imnsx=!>-]|^\?<[!=])";
- private const string NAMED_GROUP_PATTERN1 = @"^\?<([A-Za-z]\w*)>";
- private const string NAMED_GROUP_PATTERN2 = @"^\?'([A-Za-z]\w*)'";
- private const string NUMBERED_GROUP_PATTERN1 = @"^\?<(\d+)>";
- private const string NUMBERED_GROUP_PATTERN2 = @"^\?'(\d+)'";
- private const string QUESTION = "?";
- private const string REMOVED_NAME_PATTERN_TEMPL1 = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823}\()\?<[A-Za-z]\w*>";
- private const string REMOVED_NAME_PATTERN_TEMPL2 = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823}\()\?'[A-Za-z]\w*'";
- private const string REMOVED_NUMBERED_PATTERN_TEMPL1 = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823}\()\?<\d+>";
- private const string REMOVED_NUMBERED_PATTERN_TEMPL2 = @"(?<=(?:[^\\]|\A)(?:[\\]{2}){0,1073741823}\()\?'\d+'";
-
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- if (JavaUtils.IsMatch (pattern, NAMED_GROUP_PATTERN_1)) {
- return true;
- }
- if (JavaUtils.IsMatch (pattern, NAMED_GROUP_PATTERN_2)) {
- return true;
- }
- if (JavaUtils.IsMatch (pattern, NUMBERED_GROUP_PATTERN_1)) {
- return true;
- }
- if (JavaUtils.IsMatch (pattern, NUMBERED_GROUP_PATTERN_2)) {
- return true;
- }
- return false;
- }
-
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
- if (!HasConstruct (reformattedPattern, options)) {
- return reformattedPattern;
- }
-
- UpdateGroupMapping (reformattedPattern, options, patternGrouping);
-
- return ReformatPattern (reformattedPattern);
- }
-
- private static string ReformatPattern (string reformattedPattern) {
- //Reformat pattern
- reformattedPattern = JavaUtils.ReplaceAll (reformattedPattern, REMOVED_NAME_PATTERN_TEMPL1, String.Empty);
- reformattedPattern = JavaUtils.ReplaceAll (reformattedPattern, REMOVED_NAME_PATTERN_TEMPL2, String.Empty);
- reformattedPattern = JavaUtils.ReplaceAll (reformattedPattern, REMOVED_NUMBERED_PATTERN_TEMPL1, String.Empty);
- reformattedPattern = JavaUtils.ReplaceAll (reformattedPattern, REMOVED_NUMBERED_PATTERN_TEMPL2, String.Empty);
-
- return reformattedPattern;
- }
-
- private static void UpdateGroupMapping (string reformattedPattern,
- RegexOptions options,
- PatternGrouping patternGrouping) {
-
- CharSequence workString = (CharSequence) (object) JavaUtils.ReplaceAll (reformattedPattern, ESCAPED_LEFT_PAREN_TEMPL, String.Empty);
-
- //Split pattern by left parenthesis
- Pattern p = Pattern.compile (LEFT_PAREN);
- string [] parts = p.split (workString);
-
- Pattern nonCapturedGroupPattern = Pattern.compile (NON_CAPTURED_GROUP_PATTERN);
- Pattern groupNamePattern1 = Pattern.compile (NAMED_GROUP_PATTERN1);
- Pattern groupNamePattern2 = Pattern.compile (NAMED_GROUP_PATTERN2);
- Pattern groupNumPattern1 = Pattern.compile (NUMBERED_GROUP_PATTERN1);
- Pattern groupNumPattern2 = Pattern.compile (NUMBERED_GROUP_PATTERN2);
-
- int enoughLength = parts.Length;
- string [] namedGroups = new string [enoughLength];
- int [] javaGroupNumberToNetGroupNumber = new int [enoughLength];
- int capturedGroupsCount = 0;
- int namedGroupsCount = 0;
- int nonamedGroupsCount = 0;
- int sameGroupsCounter = 0;
-
- //Scan of groups
- for (int i = 1; i < parts.Length; ++i) {
- //nonamed group
- if (parts [i].StartsWith (QUESTION) == false) {
- javaGroupNumberToNetGroupNumber [++capturedGroupsCount] = ++nonamedGroupsCount;
- continue;
- }
-
- //Skip non captured groups
- Matcher partMatcher =
- nonCapturedGroupPattern.matcher ((CharSequence) (object) parts [i]);
- if (partMatcher.find ()) {
- continue;
- }
-
- //Find named groups by 2 patterns
- partMatcher = groupNamePattern1.matcher ((CharSequence) (object) parts [i]);
- if (partMatcher.find ()) {
- namedGroups [namedGroupsCount++] = partMatcher.group (1);
- javaGroupNumberToNetGroupNumber [++capturedGroupsCount] = -1;
- continue;
- }
- partMatcher = groupNamePattern2.matcher ((CharSequence) (object) parts [i]);
- if (partMatcher.find ()) {
- namedGroups [namedGroupsCount++] = partMatcher.group (1);
- javaGroupNumberToNetGroupNumber [++capturedGroupsCount] = -1;
- continue;
- }
-
- //Find explicitly numbered groups by 2 patterns
- partMatcher = groupNumPattern1.matcher ((CharSequence) (object) parts [i]);
- if (partMatcher.find ()) {
- int netGroupNumber = int.Parse (partMatcher.group (1));
- if ((options & RegexOptions.ExplicitCapture) == RegexOptions.ExplicitCapture) {
- namedGroups [namedGroupsCount++] = partMatcher.group (1);
- javaGroupNumberToNetGroupNumber [++capturedGroupsCount] = -1;
- }
- else {
- javaGroupNumberToNetGroupNumber [++capturedGroupsCount] = netGroupNumber;
- if (javaGroupNumberToNetGroupNumber [capturedGroupsCount] != netGroupNumber) {
- ++sameGroupsCounter;
- }
- }
- continue;
- }
- partMatcher = groupNumPattern2.matcher ((CharSequence) (object) parts [i]);
- if (partMatcher.find ()) {
- int netGroupNumber = int.Parse (partMatcher.group (1));
- if ((options & RegexOptions.ExplicitCapture) == RegexOptions.ExplicitCapture) {
- namedGroups [namedGroupsCount++] = partMatcher.group (1);
- javaGroupNumberToNetGroupNumber [++capturedGroupsCount] = -1;
- }
- else {
- javaGroupNumberToNetGroupNumber [++capturedGroupsCount] = netGroupNumber;
- if (javaGroupNumberToNetGroupNumber [capturedGroupsCount] != netGroupNumber) {
- ++sameGroupsCounter;
- }
- }
- continue;
- }
- }
-
- //Filling grouping
- patternGrouping.SetGroups (namedGroups,
- javaGroupNumberToNetGroupNumber,
- nonamedGroupsCount,
- capturedGroupsCount,
- sameGroupsCounter,
- options);
-
- return;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using java.util.regex;\r
-using java.lang;\r
-\r
-namespace System.Text.RegularExpressions\r
-{\r
- sealed class NotAllowedConstruct : IConstructType\r
- {\r
- private const string DEFINITION = @"(\A|((\A|[^\\])([\\]{2})*\((\?([:>=!]|<([=!]|(\w+>))))?))\{\d+(,(\d+)?)?\}";\r
-\r
- public bool HasConstruct (string pattern, RegexOptions options) {\r
- return JavaUtils.IsMatch (pattern, DEFINITION);\r
- }\r
-\r
- public string Reformat (RegexOptions options,\r
- string reformattedPattern,\r
- PatternGrouping patternGrouping) {\r
- throw new NotImplementedException ("Reformat for not allowed constructs is not implemented.");\r
- }\r
- }\r
-}\r
+++ /dev/null
-//
-// PatternData.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Collections;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
-
- sealed class PatternData
- {
- readonly Pattern _javaPattern;
- readonly PatternGrouping _patternGrouping;
-
- #region Properties
-
- internal int [] NetToJavaNumbersMap {
- get { return _patternGrouping.NetToJavaNumbersMap; }
- }
-
- internal IDictionary GroupNameToNumberMap {
- get { return _patternGrouping.GroupNameToNumberMap; }
- }
-
- internal string [] GroupNumberToNameMap {
- get { return _patternGrouping.GroupNumberToNameMap; }
- }
-
- internal int [] JavaToNetGroupNumbersMap {
- get { return _patternGrouping.JavaToNetGroupNumbersMap; }
- }
-
- internal int GroupCount {
- get { return _patternGrouping.GroupCount; }
- }
-
- internal Pattern JavaPattern {
- get { return _javaPattern; }
- }
-
- internal bool SameGroupsFlag {
- get { return _patternGrouping.SameGroupsFlag; }
- }
-
- #endregion Properties
-
- #region Ctors
-
- internal PatternData (
- RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
-
- this._patternGrouping = patternGrouping;
-
- _javaPattern = Pattern.compile (reformattedPattern, GetJavaFlags (options));
-
- FillGroups (options);
- }
-
-
- #endregion Ctors
-
- #region Private methods
-
- private void FillGroups (RegexOptions options) {
- if (_patternGrouping.GroupCount >= 0) {
- return;
- }
-
- Matcher m = JavaPattern.matcher ((CharSequence) (object) String.Empty);
-
- if ((options & RegexOptions.ExplicitCapture) == RegexOptions.ExplicitCapture) {
- _patternGrouping.SetGroups (0, m.groupCount());
- }
- else {
- _patternGrouping.SetGroups (m.groupCount(), m.groupCount ());
- }
- }
-
- private int GetJavaFlags (RegexOptions options) {
- int flags = Pattern.UNIX_LINES; // .NET treats only the "\n" character as newline, UNIX_LINES implies the same behavior in Java.
-
- if ((options & RegexOptions.IgnoreCase) == RegexOptions.IgnoreCase) {
- flags |= Pattern.CASE_INSENSITIVE;
- }
- if ((options & RegexOptions.Multiline) == RegexOptions.Multiline) {
- flags |= Pattern.MULTILINE;
- }
- if ((options & RegexOptions.Singleline) == RegexOptions.Singleline) {
- flags |= Pattern.DOTALL;
- }
- if ((options & RegexOptions.IgnorePatternWhitespace) == RegexOptions.IgnorePatternWhitespace) {
- flags |= Pattern.COMMENTS;
- }
- return flags;
- }
-
- #endregion Private methods
- }
-}
+++ /dev/null
-//
-// PatternDataBuilder.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Collections;
-
-namespace System.Text.RegularExpressions
-{
- sealed class PatternDataBuilder
- {
- private static readonly List<IConstructType> _monoConstructTypesList = new List<IConstructType>();
- private static readonly List<IConstructType> _jvmOrderedConstructTypesList = new List<IConstructType> ();
-
- static PatternDataBuilder () {
- FillMonoConstructTypesList ();
- FillJvmOrderedConstructTypesList ();
- }
-
- internal static PatternData GetPatternData (string pattern, RegexOptions options) {
-
- foreach (IConstructType construct in _monoConstructTypesList) {
- if (construct.HasConstruct (pattern, options)) {
- return null;
- }
- }
-
- PatternGrouping patternGrouping = new PatternGrouping ();
- string reformattedPattern = pattern;
-
- foreach (IConstructType construct in _jvmOrderedConstructTypesList) {
-
- reformattedPattern = construct.Reformat (options, reformattedPattern, patternGrouping);
-
- if (reformattedPattern == null)
- return null;
- }
-
- return new PatternData (options, reformattedPattern, patternGrouping);
- }
-
- private static void FillMonoConstructTypesList () {
- _monoConstructTypesList.Add (new CategoryConstruct ());
- _monoConstructTypesList.Add (new BalancingGroupConstruct ());
- _monoConstructTypesList.Add (new AlternationBackReferenceConstruct ());
- _monoConstructTypesList.Add (new AlternationExpressionConstruct ());
- _monoConstructTypesList.Add (new RightToLeftOptionConstruct ());
- _monoConstructTypesList.Add (new InlineExplicitCaptureConstruct ());
- _monoConstructTypesList.Add (new LookBehindWithUndefinedLength ());
- _monoConstructTypesList.Add (new NotAllowedConstruct ());
- }
-
- private static void FillJvmOrderedConstructTypesList () {
-
- //The order is meaningful
- _jvmOrderedConstructTypesList.Add (new CommentsConstruct ());
- _jvmOrderedConstructTypesList.Add (new NamingGroupsConstruct ());
- _jvmOrderedConstructTypesList.Add (new ReplacedRegularCharacterConstruct ());
- _jvmOrderedConstructTypesList.Add (new BackReferenceConstruct ());
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// PatternGrouping.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Collections;
-
-namespace System.Text.RegularExpressions
-{
- sealed class PatternGrouping
- {
- int _groupCount;
- IDictionary _groupNameToNumberMap;
- int [] _javaToNetGroupNumbersMap;
- string [] _groupNumberToNameMap;
- int [] _netToJavaNumbersMap;
- bool _sameGroupsFlag;
-
- internal string [] GroupNumberToNameMap {
- get { return _groupNumberToNameMap; }
- }
-
- internal int [] JavaToNetGroupNumbersMap {
- get { return _javaToNetGroupNumbersMap; }
- }
-
- internal IDictionary GroupNameToNumberMap {
- get { return _groupNameToNumberMap; }
- }
-
- internal int [] NetToJavaNumbersMap {
- get { return _netToJavaNumbersMap; }
- }
-
- internal bool SameGroupsFlag {
- get { return _sameGroupsFlag; }
- }
-
- internal int GroupCount {
- get { return _groupCount; }
- }
-
- internal PatternGrouping () {
- this._groupCount = -1;
- }
-
- internal void SetGroups (int netGroupCount, int javaGroupCount) {
- this._groupCount = netGroupCount;
-
- _groupNameToNumberMap = new Hashtable (_groupCount + 1);
- _javaToNetGroupNumbersMap = new int [javaGroupCount + 1];
- _groupNumberToNameMap = new string [_groupCount + 1];
- _netToJavaNumbersMap = new int [_groupCount + 1];
-
- for (int i = 0; i <= _groupCount; ++i) {
- _groupNameToNumberMap.Add (i.ToString (), i);
- _javaToNetGroupNumbersMap [i] = i;
- _groupNumberToNameMap [i] = i.ToString ();
- _netToJavaNumbersMap [i] = i;
- }
- for (int i = _groupCount + 1; i <= javaGroupCount; ++i) {
- _javaToNetGroupNumbersMap [i] = -1;
- }
- }
-
- internal void SetGroups (string [] namedGroups,
- int [] javaGroupNumberToNetGroupNumber,
- int noNamedGroupNumber,
- int capturedGroupsCount,
- int sameGroupsCounter,
- RegexOptions options) {
- _groupNumberToNameMap = new string [capturedGroupsCount + 1];
- _groupNameToNumberMap = new Hashtable (capturedGroupsCount + 1);
- _netToJavaNumbersMap = new int [capturedGroupsCount + 1];
-
- _javaToNetGroupNumbersMap = javaGroupNumberToNetGroupNumber;
-
- if ((options & RegexOptions.ExplicitCapture) == RegexOptions.ExplicitCapture) {
- FillExplicitGroupMaps (namedGroups,
- capturedGroupsCount,
- sameGroupsCounter,
- options);
- return;
- }
- else {
- FillImplicitGroupMaps (namedGroups,
- noNamedGroupNumber + 1,
- capturedGroupsCount,
- sameGroupsCounter,
- options);
- }
-
- }
-
- private void FillImplicitGroupMaps (string [] namedGroups,
- int namedGroupNumber,
- int capturedGroupsCount,
- int sameGroupsCounter,
- RegexOptions options) {
- int addedNamedGroupsCount = 0;
-
- for (int i = 0; i < capturedGroupsCount + 1; ++i) {
- int netGroupNumber = _javaToNetGroupNumbersMap [i];
- if (netGroupNumber == -1) {
- if (_groupNameToNumberMap.Contains (namedGroups [addedNamedGroupsCount])) {
- _javaToNetGroupNumbersMap [i] = (int) _groupNameToNumberMap [namedGroups [addedNamedGroupsCount]];
- ++sameGroupsCounter;
- }
- else {
- _javaToNetGroupNumbersMap [i] = namedGroupNumber;
- _groupNumberToNameMap [namedGroupNumber] = namedGroups [addedNamedGroupsCount];
- ++namedGroupNumber;
- }
-
- netGroupNumber = _javaToNetGroupNumbersMap [i];
- ++addedNamedGroupsCount;
- }
- else {
- _groupNumberToNameMap [netGroupNumber] =
- netGroupNumber.ToString ();
- }
- _groupNameToNumberMap [_groupNumberToNameMap [netGroupNumber]] = netGroupNumber;
- _netToJavaNumbersMap [_javaToNetGroupNumbersMap [i]] = i;
- }
- _groupCount = capturedGroupsCount - sameGroupsCounter;
- _sameGroupsFlag = (sameGroupsCounter != 0);
-
- }
-
- private void FillExplicitGroupMaps (string [] namedGroups,
- int capturedGroupsCount,
- int sameGroupsCounter,
- RegexOptions options) {
- int addedNamedGroupsCount = 0;
- int namedGroupNumber = 1;
- int nonCapturedGroupsNumber = 0;
-
- for (int i = 1; i < capturedGroupsCount + 1; ++i) {
- int netGroupNumber = _javaToNetGroupNumbersMap [i];
- if (netGroupNumber >= 0) {
- _javaToNetGroupNumbersMap [i] = -1;
- ++nonCapturedGroupsNumber;
- continue;
- }
-
- if (_groupNameToNumberMap.Contains (namedGroups [addedNamedGroupsCount])) {
- _javaToNetGroupNumbersMap [i] = (int) _groupNameToNumberMap [namedGroups [addedNamedGroupsCount]];
- ++sameGroupsCounter;
- }
- else {
- _javaToNetGroupNumbersMap [i] = namedGroupNumber;
- _groupNumberToNameMap [namedGroupNumber] = namedGroups [addedNamedGroupsCount];
- ++namedGroupNumber;
- }
-
- netGroupNumber = _javaToNetGroupNumbersMap [i];
- ++addedNamedGroupsCount;
-
- _groupNameToNumberMap [_groupNumberToNameMap [netGroupNumber]] = netGroupNumber;
- _netToJavaNumbersMap [_javaToNetGroupNumbersMap [i]] = i;
- }
- _groupCount = capturedGroupsCount - sameGroupsCounter - nonCapturedGroupsNumber;
- _sameGroupsFlag = (sameGroupsCounter != 0);
- }
- }
-}
\ No newline at end of file
[Serializable]
public partial class Regex : ISerializable {
-#if !TARGET_JVM && !FULL_AOT_RUNTIME
+#if !FULL_AOT_RUNTIME
[MonoTODO]
public static void CompileToAssembly (RegexCompilationInfo [] regexes, AssemblyName aname)
{
throw new ArgumentOutOfRangeException ("options");
}
-#if !TARGET_JVM
private void Init ()
{
this.machineFactory = cache.Lookup (this.pattern, this.roptions);
this.group_names = this.machineFactory.NamesMapping;
}
}
-#endif
private void InitNewRegex ()
{
throw new ArgumentNullException ("input");
if (startat < 0 || startat > input.Length)
throw new ArgumentOutOfRangeException ("startat");
- return CreateMachine ().Scan (this, input, startat, input.Length);
+ return CreateMachine ().Scan (this, input, startat, input.Length, false);
}
public Match Match (string input, int beginning, int length)
throw new ArgumentOutOfRangeException ("beginning");
if (length < 0 || length > input.Length - beginning)
throw new ArgumentOutOfRangeException ("length");
- return CreateMachine ().Scan (this, input, beginning, beginning + length);
+ return CreateMachine ().Scan (this, input, beginning, beginning + length, true);
}
public MatchCollection Matches (string input)
+++ /dev/null
-//
-// Regex.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, 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.Runtime.Serialization;
-
-namespace System.Text.RegularExpressions
-{
- public partial class Regex : ISerializable
- {
- IMachineFactory _monoFactory;
- readonly object _monoFactoryLock = new object ();
-
- internal bool SameGroupNamesFlag {
- get {
- return GetJvmMachine ().PatternData.SameGroupsFlag;
- }
- }
-
- internal IMachine GetMonoMachine () {
-
- lock (_monoFactoryLock) {
- if (_monoFactory != null)
- return _monoFactory.NewInstance ();
-
- _monoFactory = CreateMachineFactory (this.pattern, this.Options);
- }
-
- return _monoFactory.NewInstance ();
- }
-
- internal JvmReMachine GetJvmMachine () {
- if (machineFactory is InterpreterFactory)
- return null;
-
- return ((JvmReMachineFactory) machineFactory).GetMachine ();
- }
-
- internal int GetJavaNumberByNetNumber (int netNumber) {
- if (netNumber < 0 || netNumber > group_count) {
- return netNumber;
- }
-
- return GetJvmMachine ().PatternData.NetToJavaNumbersMap [netNumber];
- }
-
- private void Init () {
-
- this.machineFactory = cache.Lookup (this.pattern, this.roptions);
-
- if (this.machineFactory != null) {
-
- this.group_count = this.machineFactory.GroupCount;
- this.mapping = this.machineFactory.Mapping;
- this._groupNumberToNameMap = this.machineFactory.NamesMapping;
-
- return;
- }
-
- PatternData patternData = null;
- string errorMessage = null;
- try{
- patternData = PatternDataBuilder.GetPatternData(pattern, roptions);
- }catch(Exception e){
-#if DEBUG
- throw;
-#endif
- errorMessage = "Creating pattern on JVM failed for pattern " + pattern
- + "\n" + e.Message;
- }
-
- if (patternData == null){
- InitNewRegex();
- if (errorMessage != null)
- Console.WriteLine (errorMessage);
- }
- else
- InitJvmRegex (patternData);
-
- cache.Add (this.pattern, this.roptions, this.machineFactory);
- return;
- }
-
- private void InitJvmRegex (PatternData patternData) {
-
- machineFactory = new JvmReMachineFactory (patternData);
- this.group_count = this.machineFactory.GroupCount;
- this.mapping = this.machineFactory.Mapping;
- this._groupNumberToNameMap = this.machineFactory.NamesMapping;
- }
-
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// ReplacedRegularCharacterConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class ReplacedRegularCharacterConstruct : IConstructType
- {
- private const string BACKSLASH_IN_CC_PATTERN = @"(?<=(?:[^\\]|\A)(?:[\\]{2})*(?:\[|\[[^\[\]]*[^\[\]\\])(?:[\\]{2})*)\\b(?=[^\[\]]*\])";
- private const string BRACKET_IN_CC_PATTERN = @"(?<=(?:[^\\]|\A)(?:[\\]{2})*(?:\[|\[[^\[\]]*[^\[\]\\])(?:[\\]{2})*)\[(?=[^\[\]]*\])";
- private const string BACKSLASH_PATTERN = @"\\b(?=[^\[\]]*\])";
- private const string BRACKET_PATTERN = @"\[(?=[^\[\]]*\])";
- private const string BACKSLASH_BEHIND_PATTERN = @"(?:[^\\]|\A)(?:[\\]{2})*\[(?:[^\[\]\\]*(\\[^b])*)*(?:[\\]{2})*$";
- private const string BRACKET_BEHIND_PATTERN = @"(?:[^\\]|\A)(?:[\\]{2})*(?:\[(?:[^\[\]]*[^\[\]\\])?)(?:[\\]{2})*$";
- private const string BACKSLASH = @"\\u0008";
- private const string BRACKET = @"\\[";
-
- private const string LEFT_FIGURE_PAREN = @"(?<=(?:[^\\\{]|\A)(?:[\\]{2})*)(?<!(?:[^\\]|\A)(?:[\\]{2})*\\[pP])\{(?!\d\d*(,(\d\d*)?)?\})";
- private const string RIGHT_FIGURE_PAREN = @"(?<!(?:[^\\]|\A)(\\{2})*(?:\\(?:[pP]\{\w\w*)?|(?:\{\d\d*(,(\d\d*)?)?)))\}";
- private const string ESC_LEFT_FIGURE = @"\\{";
- private const string ESC_RIGHT_FIGURE = @"\\}";
- private const string NULL_PATTERN = @"(?<=(?:[^\\]|\A)(?:[\\]{2})*)\\0(?!\d)";
- private const string JAVA_NULL = @"\\u0000";
-
- public bool HasConstruct (string pattern, RegexOptions options) {
- if (JavaUtils.IsMatch (pattern, BACKSLASH_IN_CC_PATTERN)) {
- //TODO Store result
- return true;
- }
- if (JavaUtils.IsMatch (pattern, LEFT_FIGURE_PAREN)) {
- //TODO Store result
- return true;
- }
- if (JavaUtils.IsMatch (pattern, RIGHT_FIGURE_PAREN)) {
- //TODO Store result
- return true;
- }
- if (JavaUtils.IsMatch (pattern, BRACKET_IN_CC_PATTERN)) {
- //TODO Store result
- return true;
- }
- if (JavaUtils.IsMatch (pattern, NULL_PATTERN)) {
- //TODO Store result
- return true;
- }
-
- return false;
- }
-
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
- reformattedPattern = JavaUtils.ReplaceWithLookBehind (reformattedPattern, BACKSLASH_PATTERN, BACKSLASH_BEHIND_PATTERN, BACKSLASH);
- reformattedPattern = JavaUtils.ReplaceAllAdvanced (reformattedPattern, LEFT_FIGURE_PAREN, ESC_LEFT_FIGURE);
- reformattedPattern = JavaUtils.ReplaceAllAdvanced (reformattedPattern, RIGHT_FIGURE_PAREN, ESC_RIGHT_FIGURE);
- reformattedPattern = JavaUtils.ReplaceWithLookBehind (reformattedPattern, BRACKET_PATTERN, BRACKET_BEHIND_PATTERN, BRACKET);
- reformattedPattern = JavaUtils.ReplaceAllAdvanced (reformattedPattern, NULL_PATTERN, JAVA_NULL);
-
- return reformattedPattern;
- }
- }
-}
+++ /dev/null
-//
-// ReplacementData.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class ReplacementData
- {
- private const string SINGLE_DOLLAR_PATTERN = @"(?<=(?:\A|[^\\])(?:\\{2}){0,1073741823})\$(?:\{(\w+)\}|(\d+))?";
- private const string DOUBLE_DOLLAR_PATTERN = @"(?<=(?:\A|[^\\])(?:\\{2}){0,1073741823})\$\$";
- private const string BACKSLASH_PATTERN = @"\\";
- private const string COPY_ENTIRE_MATCH_PATTERN = @"(?<=(?:\A|[^\\])(?:\\{2}){0,1073741823})\\\$\&";
- private const string INPUT_BEFORE_MATCH_PATTERN = @"(?<=(?:\A|[^\\])(?:\\{2}){0,1073741823})\\\$\`";
- private const string INPUT_AFTER_MATCH_PATTERN = @"(?<=(?:\A|[^\\])(?:\\{2}){0,1073741823})\\\$\'";
- private const string LAST_CAPTURED_GROUP_PATTERN = @"(?<=(?:\A|[^\\])(?:\\{2}){0,1073741823})\\\$\+";
- private const string INPUT_PATTERN = @"(?<=(?:\A|[^\\])(?:\\{2}){0,1073741823})\\\$_";
- private const string JAVA_DOLLAR = @"\\\$";
- private const string JAVA_BACKSLASH = @"\\\\";
-
- internal static string Reformat (Regex regex, string replacement) {
-
- replacement = JavaUtils.ReplaceAll (replacement, BACKSLASH_PATTERN, JAVA_BACKSLASH);
- replacement = JavaUtils.ReplaceAll (replacement, DOUBLE_DOLLAR_PATTERN, JAVA_DOLLAR);
-
- Pattern p = Pattern.compile (SINGLE_DOLLAR_PATTERN);
- Matcher m = p.matcher ((CharSequence) (object) replacement);
-
- StringBuffer sb = new StringBuffer ();
- while (m.find ()) {
- if (m.start (1) >= 0) {
- int groupNumber = regex.GroupNumberFromName (m.group (1));
- if (groupNumber >= 0) {
- m.appendReplacement (sb, @"\$" + regex.GetJavaNumberByNetNumber (groupNumber));
- continue;
- }
- if (int.TryParse (m.group (1), out groupNumber) && groupNumber <= regex.GroupCount) {
- m.appendReplacement (sb, @"\$" + regex.GetJavaNumberByNetNumber (groupNumber));
- continue;
- }
-
- m.appendReplacement (sb, JAVA_DOLLAR + "{" + m.group (1) + "}");
- continue;
- }
- if (m.start (2) >= 0) {
- int netGroupNumber = int.Parse (m.group (2));
- if (netGroupNumber > regex.GroupCount) {
- m.appendReplacement (sb, JAVA_DOLLAR + netGroupNumber);
- continue;
- }
-
- m.appendReplacement (sb, @"\$" + regex.GetJavaNumberByNetNumber (netGroupNumber));
- continue;
- }
-
- m.appendReplacement (sb, JAVA_DOLLAR);
- }
-
- m.appendTail (sb);
-
- return sb.ToString ();
- }
-
- internal static void ReplaceMatch (string replacementPattern, Matcher match, StringBuffer sb, string input, PatternData patternData) {
-
- replacementPattern = JavaUtils.ReplaceAll (replacementPattern, COPY_ENTIRE_MATCH_PATTERN, match.group ());
- replacementPattern = JavaUtils.ReplaceAll (replacementPattern, INPUT_BEFORE_MATCH_PATTERN, input.Substring (0, match.start ()));
- replacementPattern = JavaUtils.ReplaceAll (replacementPattern, INPUT_AFTER_MATCH_PATTERN, input.Substring (match.end ()));
- replacementPattern = JavaUtils.ReplaceAll (replacementPattern, INPUT_PATTERN, input);
-
- int groupsNumber = match.groupCount ();
- if (groupsNumber > 0) {
- Pattern p = Pattern.compile (LAST_CAPTURED_GROUP_PATTERN);
- Matcher m = p.matcher ((CharSequence) (object) replacementPattern);
- if (m.find ()) {
- while (groupsNumber > 0) {
- if (match.start (patternData.NetToJavaNumbersMap [groupsNumber]) >= 0) {
- break;
- }
- --groupsNumber;
- }
- if (groupsNumber > 0) {
- replacementPattern = m.replaceAll (match.group (patternData.NetToJavaNumbersMap [groupsNumber]));
- }
- }
- }
-
- match.appendReplacement (sb, replacementPattern);
- }
- }
-}
+++ /dev/null
-//
-// RightToLeftOptionConstruct.jvm.cs
-//
-// Author:
-// Arina Itkes <arinai@mainsoft.com>
-//
-// Copyright (C) 2007 Mainsoft, Inc.
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using java.util.regex;
-using java.lang;
-
-namespace System.Text.RegularExpressions
-{
- sealed class RightToLeftOptionConstruct : IConstructType
- {
- public bool HasConstruct (string pattern, RegexOptions options) {
-
- return (options & RegexOptions.RightToLeft) == RegexOptions.RightToLeft;
- }
-
- public string Reformat (RegexOptions options,
- string reformattedPattern,
- PatternGrouping patternGrouping) {
- throw new NotImplementedException ("RightToLeftOptions Reformat is not implemented");
- }
-
- }
-}
\ No newline at end of file
ResetGroups ();
}
- public override Match Scan (Regex regex, string text, int start, int end) {
+ public override Match Scan (Regex regex, string text, int start, int end, bool substring_mode) {
str = text;
string_start = start;
string_end = end;
interface IMachine {
Match Scan (Regex regex, string text, int start, int end);
+ Match Scan (Regex regex, string text, int start, int end, bool substring_mode);
string [] Split (Regex regex, string input, int count, int startat);
string Replace (Regex regex, string input, string replacement, int count, int startat);
string Result (string replacement, Match match);
// IMachine implementation
- public override Match Scan (Regex regex, string text, int start, int end) {
+ public override Match Scan (Regex regex, string text, int start, int end, bool substring_mode) {
+ this.regex_rtl = (regex.Options & RegexOptions.RightToLeft) != 0;
+
+ if (!initialized)
+ {
+ this.text_start = regex_rtl && substring_mode ? end : start;
+ this.text_end = regex_rtl ? substring_mode ? start : 0 : end;
+ this.initialized = true;
+ }
+ else
+ {
+ this.text_start = start;
+ this.text_end = end;
+ }
this.text = text;
- this.text_end = end;
- this.scan_ptr = start;
+ this.scan_ptr = text_start;
+ this.substring_mode = substring_mode;
if (Eval (Mode.Match, ref scan_ptr, program_start))
return GenerateMatch (regex);
int anch_offset = program[pc + 2];
bool anch_reverse = (flags & OpFlags.RightToLeft) != 0;
int anch_ptr = anch_reverse ? ptr - anch_offset : ptr + anch_offset;
- int anch_end = text_end - match_min + anch_offset; // maximum anchor position
+ int anch_end = (regex_rtl ? text_start : text_end) - match_min + anch_offset; // maximum anchor position
int anch_begin = 0;
if (reverse) {
ptr -= len;
- if (ptr < 0)
+ if ((!regex_rtl && ptr < 0) || (regex_rtl && ptr < text_end))
goto Fail;
}
else
if (reverse) {
ptr -= len;
- if (ptr < 0)
+ if ((!regex_rtl && ptr < 0) || (regex_rtl && ptr < text_end))
goto Fail;
}
else if (ptr + len > text_end)
while (true) {
int p = ptr + coff;
- if (c1 < 0 || (p >= 0 && p < text_end && (c1 == text[p] || c2 == text[p]))) {
+ if (c1 < 0 || (p >= 0 && ((regex_rtl && p >= text_end) || (!regex_rtl && p < text_end)) && (c1 == text[p] || c2 == text[p]))) {
deep = null;
if (Eval (Mode.Match, ref ptr, pc))
break;
while (true) {
int p = ptr + coff;
- if (c1 < 0 || (p >= 0 && p < text_end && (c1 == text[p] || c2 == text[p]))) {
+ if (c1 < 0 || (p >= 0 && ((regex_rtl && p >= text_end) || (!regex_rtl && p < text_end)) && (c1 == text[p] || c2 == text[p]))) {
deep = null;
if (Eval (Mode.Match, ref ptr, pc))
break;
if (!consumed) {
if ((flags & OpFlags.RightToLeft) != 0) {
- if (ptr <= 0)
+ if ((substring_mode && ptr <= (regex_rtl ? text_end : text_start)) || (!substring_mode && ptr <= 0))
return false;
c = text[-- ptr];
}
else {
- if (ptr >= text_end)
+ if ((!regex_rtl && ptr >= text_end) || (regex_rtl && ptr >= text_start))
return false;
c = text[ptr ++];
private bool IsPosition (Position pos, int ptr) {
switch (pos) {
case Position.Start: case Position.StartOfString:
- return ptr == 0;
+ return ptr == 0 || (substring_mode && ((!regex_rtl && ptr == text_start) || (regex_rtl && ptr == text_end)));
case Position.StartOfLine:
- return ptr == 0 || text[ptr - 1] == '\n';
+ return ptr == 0 || text[ptr - 1] == '\n' || (substring_mode && ((!regex_rtl && ptr == text_start) || (regex_rtl && ptr == text_end)));
case Position.StartOfScan:
return ptr == scan_ptr;
case Position.End:
- return ptr == text_end ||
- (ptr == text_end - 1 && text[ptr] == '\n');
+ return (!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start) ||
+ (((!regex_rtl && ptr == text_end - 1) || (regex_rtl && ptr == text_start - 1)) && text[ptr] == '\n');
case Position.EndOfLine:
- return ptr == text_end || text[ptr] == '\n';
+ return (!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start) || text[ptr] == '\n';
case Position.EndOfString:
- return ptr == text_end;
+ return (!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start);
case Position.Boundary:
- if (text_end == 0)
+ if ((!regex_rtl && text_end == 0) || (regex_rtl && text_start == 0))
return false;
if (ptr == 0)
return IsWordChar (text[ptr]);
- else if (ptr == text_end)
+ else if ((!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start))
return IsWordChar (text[ptr - 1]);
else
return IsWordChar (text[ptr]) != IsWordChar (text[ptr - 1]);
case Position.NonBoundary:
- if (text_end == 0)
+ if ((!regex_rtl && text_end == 0) || (regex_rtl && text_start == 0))
return false;
if (ptr == 0)
return !IsWordChar (text[ptr]);
- else if (ptr == text_end)
+ else if ((!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start))
return !IsWordChar (text[ptr - 1]);
else
return IsWordChar (text[ptr]) == IsWordChar (text[ptr - 1]);
private int match_min;//, match_max; // match width information
private QuickSearch qs; // fast substring matcher
+ private bool regex_rtl;
+ private int text_start;
+ private bool substring_mode;
+ private bool initialized;
+
// match state
private int scan_ptr; // start of scan
System.Threading.Timer timer;
object _lock = new object ();
ISynchronizeInvoke so;
+ bool enabled;
[Category("Behavior")]
[TimersDescription("Occurs when the Interval has elapsed.")]
public Timer (double interval)
{
// MSBUG: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296761
- if (interval > 0x7FFFFFFF)
+ if (interval <= 0 || interval > 0x7FFFFFFF)
throw new ArgumentException ("Invalid value: " + interval, "interval");
autoReset = true;
+ timer = new System.Threading.Timer (Callback, this, Timeout.Infinite, Timeout.Infinite); //disabled
Interval = interval;
}
{
get {
lock (_lock)
- return timer != null;
+ return enabled && timer != null;
}
set {
lock (_lock) {
- bool enabled = timer != null;
+ if (timer == null)
+ throw new ObjectDisposedException (GetType ().ToString (), "The object has been disposed");
+
if (enabled == value)
return;
if (value) {
- timer = new System.Threading.Timer (Callback, this, (int)interval, autoReset ? (int)interval: 0);
+ // As per MS docs (throw this only when the timer becomes enabled): http://msdn.microsoft.com/en-us/library/system.timers.timer.enabled(v=vs.110).aspx
+ if (interval > Int32.MaxValue)
+ throw new ArgumentException ("Invalid value: " + interval, "interval");
+ enabled = true;
+ timer.Change ((int)interval, autoReset ? (int)interval : 0);
} else {
- timer.Dispose ();
- timer = null;
+ enabled = false;
+ timer.Change (Timeout.Infinite, Timeout.Infinite);
}
}
}
// The doc says 'less than 0', but 0 also throws the exception
if (value <= 0)
throw new ArgumentException ("Invalid value: " + value);
+ // As per MS docs (throw only if enabled, otherwise postpone throwing until it becomes enabled): http://msdn.microsoft.com/en-us/library/system.timers.timer.interval(v=vs.110).aspx
+ if (value > Int32.MaxValue && enabled)
+ throw new ArgumentException ("Invalid value: " + value);
lock (_lock) {
+ if (timer == null)
+ return;
interval = value;
- if (timer != null)
+ //call Change only if enabled, otherwise it will be called when Enabled = true, see the comment above on throwing ArgumentException
+ if (enabled)
timer.Change ((int)interval, autoReset? (int)interval: 0);
}
}
public void Close ()
{
- Enabled = false;
+ lock (_lock)
+ Dispose (true);
}
public void EndInit ()
protected override void Dispose (bool disposing)
{
+ // Could call Close() twice
+ if (timer == null)
+ return;
+
// If we're disposing explicitly, clear all
// fields. If not, all fields will have been
// nulled by the GC during finalization, so
// trying to lock on _lock will blow up.
if (disposing)
- Close ();
+ {
+ timer.Dispose ();
+ timer = null;
+ }
base.Dispose (disposing);
}
if (timer.Enabled == false)
return;
ElapsedEventHandler events = timer.Elapsed;
- if (!timer.autoReset)
- timer.Enabled = false;
+
+ try
+ {
+ if (!timer.autoReset)
+ timer.Enabled = false; //this could throw ObjectDisposed if timer.Close() was just called, after the check for Enabled above
+ }
+ catch (ObjectDisposedException) {
+ //Probably the Elapsed event should not fire if this Timer is found here to be closed
+ return;
+ }
+
+ //If another thread calls Close() when this thread is right here (of further down), the Elapsed event might get called once more after this Timer was Closed()
+ //It's not a problem, it happens with all Timers, but it's good to know...
+
if (events == null)
return;
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'basic|AnyCPU' ">
- <DefineConstants>BOOTSTRAP_BASIC,NET_1_1,NET_2_0,CONFIGURATION_2_0</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'basic_XML_DEP|AnyCPU' ">
- <DefineConstants>BOOTSTRAP_BASIC,NET_1_1,NET_2_0,CONFIGURATION_2_0,XML_DEP</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0,CONFIGURATION_2_0</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0_XML_DEP|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0,CONFIGURATION_2_0,XML_DEP,SECURITY_DEP</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0_ALL_DEP|AnyCPU' ">
- <DefineConstants>NET_1_1,NET_2_0,CONFIGURATION_2_0,XML_DEP,SECURITY_DEP,CONFIGURATION_DEP</DefineConstants>
- </PropertyGroup>
- <ItemGroup>
- <EmbeddedResource Include="resources\Asterisk.wav"/>
- <EmbeddedResource Include="resources\Beep.wav"/>
- <EmbeddedResource Include="resources\Exclamation.wav"/>
- <EmbeddedResource Include="resources\Hand.wav"/>
- <EmbeddedResource Include="resources\Question.wav"/>
- </ItemGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0_ALL_DEP|AnyCPU' ">
- <Reference Include="System.Xml"/>
- <Reference Include="System.Configuration"/>
- <Reference Include="System">
- <Aliases>PrebuiltSystem</Aliases>
- <HintPath>..\lib\net_2_0\System.dll</HintPath>
- </Reference>
- <Reference Include="Mono.Security">
- <HintPath>..\lib\net_2_0\Mono.Security.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0_XML_DEP|AnyCPU' ">
- <Reference Include="System.Xml"/>
- <Reference Include="System">
- <Aliases>PrebuiltSystem</Aliases>
- <HintPath>..\lib\net_2_0\System.dll</HintPath>
- </Reference>
- <Reference Include="Mono.Security">
- <HintPath>..\lib\net_2_0\Mono.Security.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'basic_XML_DEP|AnyCPU' ">
- <Reference Include="System.Xml"/>
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets"/>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
System/UriFormat.cs
System/UriFormatException.cs
System/UriHostNameType.cs
+System/UriHelper.cs
System/UriIdnScope.cs
System/UriKind.cs
System/UriParser.cs
namespace System {
internal static class AndroidPlatform {
-
+ delegate int GetInterfaceAddressesDelegate (out IntPtr ifap);
+ delegate void FreeInterfaceAddressesDelegate (IntPtr ifap);
+
#if SECURITY_DEP
static readonly Converter<List <byte[]>, bool> trustEvaluateSsl;
#endif // SECURITY_DEP
static readonly Func<IWebProxy> getDefaultProxy;
-
+ static readonly GetInterfaceAddressesDelegate getInterfaceAddresses;
+ static readonly FreeInterfaceAddressesDelegate freeInterfaceAddresses;
static AndroidPlatform ()
{
typeof (Func<IWebProxy>), t, "GetDefaultProxy",
ignoreCase:false,
throwOnBindFailure:true);
+
+ getInterfaceAddresses = (GetInterfaceAddressesDelegate)Delegate.CreateDelegate (
+ typeof (GetInterfaceAddressesDelegate), t, "GetInterfaceAddresses",
+ ignoreCase: false,
+ throwOnBindFailure: false);
+
+ freeInterfaceAddresses = (FreeInterfaceAddressesDelegate)Delegate.CreateDelegate (
+ typeof (FreeInterfaceAddressesDelegate), t, "FreeInterfaceAddresses",
+ ignoreCase: false,
+ throwOnBindFailure: false);
}
#if SECURITY_DEP
{
return getDefaultProxy ();
}
+
+ internal static int GetInterfaceAddresses (out IntPtr ifap)
+ {
+ ifap = IntPtr.Zero;
+ if (getInterfaceAddresses == null)
+ return -1;
+
+ return getInterfaceAddresses (out ifap);
+ }
+
+ internal static void FreeInterfaceAddresses (IntPtr ifap)
+ {
+ if (freeInterfaceAddresses == null)
+ return;
+
+ freeInterfaceAddresses (ifap);
+ }
}
}
#endif // MONODROID
// o UNC is supported, as starts with "\\" for windows,
// or "//" with unix.
- private bool isUnixFilePath;
private string source;
private string scheme = String.Empty;
private string host = String.Empty;
private string fragment = String.Empty;
private string userinfo;
private bool isUnc;
- private bool isOpaquePart;
private bool isAbsoluteUri = true;
private long scope_id;
private string cachedToString;
private string cachedLocalPath;
private int cachedHashCode;
+
+ private static bool s_IriParsing;
+
+ internal static bool IriParsing {
+ get { return s_IriParsing; }
+ set { s_IriParsing = value; }
+ }
#if BOOTSTRAP_BASIC
private static readonly string hexUpperChars = "0123456789ABCDEF";
public static readonly string UriSchemeNntp = "nntp";
public static readonly string UriSchemeNetPipe = "net.pipe";
public static readonly string UriSchemeNetTcp = "net.tcp";
-
+
+ internal static readonly string UriSchemeTelnet = "telnet";
+ internal static readonly string UriSchemeLdap = "ldap";
+ internal static readonly string UriSchemeUuid = "uuid";
+
private static readonly string [] knownUriSchemes =
{
UriSchemeFile,
UriSchemeNetTcp
};
- // Constructors
+ // Constructors
+
+ static Uri ()
+ {
+#if NET_4_5
+ IriParsing = true;
+#endif
+
+ var iriparsingVar = Environment.GetEnvironmentVariable ("MONO_URI_IRIPARSING");
+ if (iriparsingVar == "true")
+ IriParsing = true;
+ else if (iriparsingVar == "false")
+ IriParsing = false;
+ }
public Uri (string uriString) : this (uriString, false)
{
string uri = serializationInfo.GetString ("AbsoluteUri");
if (uri.Length > 0) {
source = uri;
- ParseUri(UriKind.Absolute);
+ ParseUri (UriKind.Absolute);
} else {
uri = serializationInfo.GetString ("RelativeUri");
if (uri.Length > 0) {
source = uri;
- ParseUri(UriKind.Relative);
+ ParseUri (UriKind.Relative);
} else {
- throw new ArgumentException("Uri string was null or empty.");
+ throw new ArgumentException ("Uri string was null or empty.");
}
}
}
switch (uriKind) {
case UriKind.Absolute:
if (!IsAbsoluteUri)
- throw new UriFormatException("Invalid URI: The format of the URI could not be "
+ throw new UriFormatException ("Invalid URI: The format of the URI could not be "
+ "determined.");
break;
case UriKind.Relative:
if (IsAbsoluteUri)
- throw new UriFormatException("Invalid URI: The format of the URI could not be "
+ throw new UriFormatException ("Invalid URI: The format of the URI could not be "
+ "determined because the parameter 'uriString' represents an absolute URI.");
break;
case UriKind.RelativeOrAbsolute:
success = false;
break;
}
-
- if (success && isAbsoluteUri && (path.Length > 0))
- path = EscapeString (path);
}
}
source = uriString;
ParseUri (UriKind.Absolute);
if (!isAbsoluteUri)
- throw new UriFormatException("Invalid URI: The format of the URI could not be "
+ throw new UriFormatException ("Invalid URI: The format of the URI could not be "
+ "determined: " + uriString);
}
throw new ArgumentNullException ("baseUri");
if (!baseUri.IsAbsoluteUri)
throw new ArgumentOutOfRangeException ("baseUri");
- if (relativeUri == null)
- relativeUri = String.Empty;
-
- // See RFC 2396 Par 5.2 and Appendix C
-
- // Check Windows UNC (for // it is scheme/host separator)
- if (relativeUri.Length >= 2 && relativeUri [0] == '\\' && relativeUri [1] == '\\') {
- source = relativeUri;
+ if (string.IsNullOrEmpty (relativeUri)) {
+ source = baseUri.OriginalString;
ParseUri (UriKind.Absolute);
return;
}
- int pos = relativeUri.IndexOf (':');
- if (pos != -1) {
-
- int pos2 = relativeUri.IndexOfAny (new char [] {'/', '\\', '?'});
-
- // pos2 < 0 ... e.g. mailto
- // pos2 > pos ... to block ':' in query part
- if (pos2 > pos || pos2 < 0) {
- // in some cases, it is equivanent to new Uri (relativeUri, dontEscape):
- // 1) when the URI scheme in the
- // relative path is different from that
- // of the baseUri, or
- // 2) the URI scheme is non-standard
- // ones (non-standard URIs are always
- // treated as absolute here), or
- // 3) the relative URI path is absolute.
- if (String.CompareOrdinal (baseUri.Scheme, 0, relativeUri, 0, pos) != 0 ||
- !IsPredefinedScheme (baseUri.Scheme) ||
- (relativeUri.Length > pos + 1 && relativeUri [pos + 1] == '/')) {
- Uri tmp = null;
- if (Uri.TryCreate (relativeUri, UriKind.Absolute, out tmp)) {
- source = relativeUri;
- ParseUri (UriKind.Absolute);
- return;
- } else if (pos == 1) {
- // special case as this looks like a windows path
- string msg = ParseAsWindowsAbsoluteFilePath (relativeUri);
- if (msg != null)
- throw new UriFormatException (msg);
- }
- // otherwise continue with 'full' relativeUri
- }
- else
- relativeUri = relativeUri.Substring (pos + 1);
+ string error;
+ bool startsWithSlash = false;
+
+ UriElements baseEl;
+ if (!UriParseComponents.TryParseComponents (baseUri.OriginalString, UriKind.Absolute, out baseEl, out error))
+ throw new UriFormatException (error);
+
+ if (relativeUri.StartsWith (baseEl.scheme + ":", StringComparison.Ordinal))
+ relativeUri = relativeUri.Substring (baseEl.scheme.Length + 1);
+
+ if (relativeUri.Length >= 1 && relativeUri [0] == '/') {
+ if (relativeUri.Length >= 2 && relativeUri [1] == '/') {
+ source = baseEl.scheme + ":" + relativeUri;
+ ParseUri (UriKind.Absolute);
+ return;
}
+
+ relativeUri = relativeUri.Substring (1);
+ startsWithSlash = true;
}
- this.scheme = baseUri.scheme;
- this.host = baseUri.host;
- this.port = baseUri.port;
- this.userinfo = baseUri.userinfo;
- this.isUnc = baseUri.isUnc;
- this.isUnixFilePath = baseUri.isUnixFilePath;
- this.isOpaquePart = baseUri.isOpaquePart;
+ UriElements relativeEl;
+ if (!UriParseComponents.TryParseComponents (relativeUri, UriKind.RelativeOrAbsolute, out relativeEl, out error))
+ throw new UriFormatException (error);
- if (relativeUri.Length == 0) {
- this.path = baseUri.path;
- this.query = baseUri.query;
- this.fragment = baseUri.fragment;
+ if (relativeEl.isAbsoluteUri) {
+ source = relativeUri;
+ ParseUri (UriKind.Absolute);
return;
}
- // 8 fragment
- // Note that in relative constructor, file URI cannot handle '#' as a filename character, but just regarded as a fragment identifier.
- string original_fragment = String.Empty;
- pos = relativeUri.IndexOf ('#');
- if (pos != -1) {
- original_fragment = relativeUri.Substring (pos);
- if (userEscaped)
- fragment = original_fragment;
- else
- fragment = "#" + EscapeString (relativeUri.Substring (pos+1));
- relativeUri = pos == 0 ? String.Empty : relativeUri.Substring (0, pos);
- }
+ source = baseEl.scheme + baseEl.delimiter;
- bool consider_query = false;
+ if (baseEl.user != null)
+ source += baseEl.user + "@";
- // 6 query
- pos = relativeUri.IndexOf ('?');
- if (pos != -1) {
- query = relativeUri.Substring (pos);
- if (!userEscaped)
- query = EscapeString (query);
-#if !NET_4_0 && !MOBILE
- consider_query = query.Length > 0;
-#endif
- relativeUri = pos == 0 ? String.Empty : relativeUri.Substring (0, pos);
- } else if (relativeUri.Length == 0) {
- // if there is no relative path then we keep the Query and Fragment from the absolute
- query = baseUri.query;
- }
+ source += baseEl.host;
- if (relativeUri.Length > 0 && relativeUri [0] == '/') {
- if (relativeUri.Length > 1 && relativeUri [1] == '/') {
- source = scheme + ':' + relativeUri;
- ParseUri (UriKind.Absolute);
- return;
- } else {
- path = relativeUri;
- if (!userEscaped)
- path = EscapeString (path);
- return;
- }
- }
-
- // par 5.2 step 6 a)
- path = baseUri.path;
- if ((relativeUri.Length > 0) || consider_query) {
- pos = path.LastIndexOf ('/');
- if (pos >= 0)
- path = path.Substring (0, pos + 1);
- }
+ if (baseEl.port >= 0)
+ source += ":" + baseEl.port.ToString (CultureInfo.InvariantCulture);
- if (relativeUri.Length == 0) {
- // when merging URI the OriginalString is not quite original
- source = GetLeftPart (UriPartial.Authority) + query + original_fragment;
- return;
- }
-
- // 6 b)
- path += relativeUri;
-
- // 6 c)
- int startIndex = 0;
- while (true) {
- pos = path.IndexOf ("./", startIndex);
- if (pos == -1)
- break;
- if (pos == 0)
- path = path.Remove (0, 2);
- else if (path [pos - 1] != '.')
- path = path.Remove (pos, 2);
- else
- startIndex = pos + 1;
- }
-
- // 6 d)
- if (path.Length > 1 &&
- path [path.Length - 1] == '.' &&
- path [path.Length - 2] == '/')
- path = path.Remove (path.Length - 1, 1);
-
- // 6 e)
- startIndex = 0;
- while (true) {
- pos = path.IndexOf ("/../", startIndex);
- if (pos == -1)
- break;
- if (pos == 0) {
- startIndex = 3;
- continue;
+ var canUseBase = true;
+
+ string path;
+ if (!string.IsNullOrEmpty (relativeEl.path) || startsWithSlash) {
+ canUseBase = false;
+ path = relativeEl.path;
+ if (startsWithSlash)
+ path = relativeEl.path;
+ else {
+ var pathEnd = baseEl.path.LastIndexOf ('/');
+ path = (pathEnd > 0)? baseEl.path.Substring (0, pathEnd+1) : "";
+ path += relativeEl.path;
}
- int pos2 = path.LastIndexOf ('/', pos - 1);
- if (pos2 == -1) {
- startIndex = pos + 1;
- } else {
- if (path.Substring (pos2 + 1, pos - pos2 - 1) != "..")
- path = path.Remove (pos2 + 1, pos - pos2 + 3);
- else
- startIndex = pos + 1;
+ } else {
+ path = baseEl.path;
+#if !NET_4_0
+ if (relativeEl.query != null) {
+ var pathEnd = path.LastIndexOf ('/');
+ path = (pathEnd > 0)? path.Substring (0, pathEnd+1) : "";
}
+#endif
}
-
- // 6 f)
- if (path.Length > 3 && path.EndsWith ("/..")) {
- pos = path.LastIndexOf ('/', path.Length - 4);
- if (pos != -1)
- if (path.Substring (pos + 1, path.Length - pos - 4) != "..")
- path = path.Remove (pos + 1, path.Length - pos - 1);
- }
-
- // 6 g)
- while (path.StartsWith ("/../", StringComparison.Ordinal))
- path = path.Substring (3);
-
- if (!userEscaped)
- path = EscapeString (path);
- // when merging URI the OriginalString is not quite original
- source = GetLeftPart (UriPartial.Authority) + path + query + original_fragment;
+ if ((path.Length == 0 || path [0] != '/') && baseEl.delimiter == SchemeDelimiter)
+ path = "/" + path;
+
+ source += UriHelper.Reduce (path, true);
+
+ if (relativeEl.query != null) {
+ canUseBase = false;
+ source += "?" + relativeEl.query;
+ } else if (canUseBase && baseEl.query != null)
+ source += "?" + baseEl.query;
+
+ if (relativeEl.fragment != null)
+ source += "#" + relativeEl.fragment;
+ else if (canUseBase && baseEl.fragment != null)
+ source += "#" + baseEl.fragment;
+
+ ParseUri (UriKind.Absolute);
+
+ return;
}
// Properties
public string AbsoluteUri {
get {
EnsureAbsoluteUri ();
- if (cachedAbsoluteUri == null) {
- cachedAbsoluteUri = GetLeftPart (UriPartial.Path);
- if (query.Length > 0)
- cachedAbsoluteUri += query;
- if (fragment.Length > 0)
- cachedAbsoluteUri += fragment;
- }
+
+ if (cachedAbsoluteUri == null)
+ cachedAbsoluteUri = GetComponents (UriComponents.AbsoluteUri, UriFormat.UriEscaped);
+
return cachedAbsoluteUri;
}
}
if (cachedLocalPath != null)
return cachedLocalPath;
+ var formatFlags = UriHelper.FormatFlags.NoSlashReplace;
+
+ if (userEscaped)
+ formatFlags |= UriHelper.FormatFlags.UserEscaped;
+
+ string unescapedPath = UriHelper.FormatAbsolute (path, scheme,
+ UriComponents.Path, UriFormat.Unescaped, formatFlags);
+
+ if (path.StartsWith ("/", StringComparison.Ordinal) &&
+ !unescapedPath.StartsWith ("/", StringComparison.Ordinal))
+ unescapedPath = "/" + unescapedPath;
+
if (IsLocalIdenticalToAbsolutePath ()) {
- cachedLocalPath = Unescape (AbsolutePath);
+ cachedLocalPath = unescapedPath;
return cachedLocalPath;
}
if (!IsUnc) {
- string p = Unescape (path);
bool windows = (path.Length > 3 && path [1] == ':' &&
(path [2] == '\\' || path [2] == '/'));
if (windows)
- cachedLocalPath = p.Replace ('/', '\\');
+ cachedLocalPath = unescapedPath.Replace ('/', '\\');
else
- cachedLocalPath = p;
+ cachedLocalPath = unescapedPath;
} else {
// support *nix and W32 styles
if (path.Length > 1 && path [1] == ':')
- cachedLocalPath = Unescape (path.Replace (Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
+ cachedLocalPath = unescapedPath.Replace (Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
// LAMESPEC: ok, now we cannot determine
// if such URI like "file://foo/bar" is
string h = host;
if (path.Length > 0) {
if ((path.Length > 1) || (path[0] != '/')) {
- h += path.Replace ('/', '\\');
+ h += unescapedPath.Replace ('/', '\\');
}
}
- cachedLocalPath = "\\\\" + Unescape (h);
+ cachedLocalPath = "\\\\" + h;
} else
- cachedLocalPath = Unescape (path);
+ cachedLocalPath = unescapedPath;
}
if (cachedLocalPath.Length == 0)
cachedLocalPath = Path.DirectorySeparatorChar.ToString ();
get { return isAbsoluteUri; }
}
- // LAMESPEC: source field is supplied in such case that this
- // property makes sense. For such case that source field is
- // not supplied (i.e. .ctor(Uri, string), this property
- // makes no sense. To avoid silly regression it just returns
- // ToString() value now. See bug #78374.
public string OriginalString {
- get { return source != null ? source : ToString (); }
+ get { return source; }
}
// Methods
}
#if !NET_2_1
- [Obsolete("This method does nothing, it has been obsoleted")]
+ [Obsolete ("This method does nothing, it has been obsoleted")]
protected virtual void Canonicalize ()
{
//
if (segments [k] != segments2 [k])
break;
- for (int i = k; i < segments.Length && segments [i].EndsWith ("/"); i++)
+ for (int i = k; i < segments.Length && segments [i].EndsWith ("/", StringComparison.Ordinal); i++)
result += "../";
for (int i = k; i < segments2.Length; i++)
result += segments2 [i];
return cachedToString;
if (isAbsoluteUri) {
- cachedToString = Unescape (GetLeftPart (UriPartial.Path), true);
- AppendQueryAndFragment (ref cachedToString);
- } else {
- // Everything is contained in path in this case.
- cachedToString = path;
- }
+ if (Parser is DefaultUriParser)
+ cachedToString = Parser.GetComponentsHelper (this, UriComponents.AbsoluteUri, UriHelper.ToStringUnescape);
+ else
+ cachedToString = Parser.GetComponents (this, UriComponents.AbsoluteUri, UriFormat.SafeUnescaped);
+ } else
+ cachedToString = UriHelper.FormatRelative (source, scheme, UriHelper.ToStringUnescape);
return cachedToString;
}
if (this.isAbsoluteUri) {
serializationInfo.AddValue ("AbsoluteUri", this.AbsoluteUri);
} else {
- serializationInfo.AddValue("AbsoluteUri", String.Empty);
- serializationInfo.AddValue("RelativeUri", this.OriginalString);
+ serializationInfo.AddValue ("AbsoluteUri", String.Empty);
+ serializationInfo.AddValue ("RelativeUri", this.OriginalString);
}
}
// or a letter from A-F (case-insensitive).
if (IsHexEncoding (str,i)) {
// if ,yes , copy it as is
- s.Append(str.Substring (i, 3));
+ s.Append (str.Substring (i, 3));
i += 2;
continue;
}
if (userEscaped)
return;
- // non-ascii characters are not escaped for the host name
- host = EscapeString (host, EscapeCommonHex, false);
if (host.Length > 1 && host [0] != '[' && host [host.Length - 1] != ']') {
// host name present (but not an IPv6 address)
host = host.ToLower (CultureInfo.InvariantCulture);
}
-
- if (isAbsoluteUri && (path.Length > 0))
- path = EscapeString (path);
}
[Obsolete]
protected virtual string Unescape (string path)
{
- return Unescape (path, false, false);
+ var formatFlags = UriHelper.FormatFlags.NoSlashReplace | UriHelper.FormatFlags.NoReduce;
+ return UriHelper.FormatAbsolute (path, scheme, UriComponents.Path, UriFormat.Unescaped, formatFlags);
}
internal static string Unescape (string str, bool excludeSpecial)
private void ParseAsUnixAbsoluteFilePath (string uriString)
{
- isUnixFilePath = true;
scheme = UriSchemeFile;
port = -1;
fragment = String.Empty;
private bool SupportsQuery ()
{
- return ((scheme != Uri.UriSchemeNntp) && (scheme != Uri.UriSchemeFtp) && (scheme != Uri.UriSchemeFile));
+ return UriHelper.SupportsQuery (scheme);
}
- //
- // This parse method will not throw exceptions on failure
- //
- // Returns null on success, or a description of the error in the parsing
- //
+
private string ParseNoExceptions (UriKind kind, string uriString)
{
- //
- // From RFC 2396 :
- //
- // ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
- // 12 3 4 5 6 7 8 9
- //
-
- uriString = uriString.Trim();
- int len = uriString.Length;
-
- if (len == 0){
- if (kind == UriKind.Relative || kind == UriKind.RelativeOrAbsolute){
- isAbsoluteUri = false;
- return null;
- }
- }
-
- if (len <= 1 && (kind == UriKind.Absolute))
- return "Absolute URI is too short";
-
- int pos = 0;
-
- // 1, 2
- // Identify Windows path, unix path, or standard URI.
- if (uriString [0] == '/' && Path.DirectorySeparatorChar == '/'){
- //Unix Path
- ParseAsUnixAbsoluteFilePath (uriString);
- if (kind == UriKind.Relative)
- isAbsoluteUri = false;
- return null;
- } else if (uriString.Length >= 2 && uriString [0] == '\\' && uriString [1] == '\\') {
- //Windows UNC
- ParseAsWindowsUNC (uriString);
- return null;
- }
+ UriElements elements;
+ string error;
+ if (!UriParseComponents.TryParseComponents (source, kind, out elements, out error))
+ return error;
+ scheme = elements.scheme;
+ var parser = UriParser.GetParser (scheme);
+ if (parser != null && !(parser is DefaultUriParser)) {
+ userinfo = Parser.GetComponents (this, UriComponents.UserInfo, UriFormat.UriEscaped);
+ host = Parser.GetComponents (this, UriComponents.Host, UriFormat.UriEscaped);
- pos = uriString.IndexOf (':');
- if (pos == 0) {
- if (kind == UriKind.Absolute)
- return "Invalid URI: The format of the URI could not be determined.";
- isAbsoluteUri = false;
- path = uriString;
- return null;
- } else if (pos < 0) {
- /* Relative path */
- isAbsoluteUri = false;
- path = uriString;
- return null;
- } else if (pos == 1) {
- if (!IsAlpha (uriString [0])) {
- if (kind == UriKind.Absolute)
- return "Invalid URI: The URI scheme is not valid.";
- isAbsoluteUri = false;
- path = uriString;
- return null;
- }
- // This means 'a:' == windows full path.
- string msg = ParseAsWindowsAbsoluteFilePath (uriString);
- if (msg != null)
- return msg;
- return null;
- }
+ var portStr = Parser.GetComponents (this, UriComponents.StrongPort, UriFormat.UriEscaped);
+ if (!string.IsNullOrEmpty (portStr))
+ port = int.Parse (portStr);
- // scheme
- scheme = uriString.Substring (0, pos).ToLower (CultureInfo.InvariantCulture);
+ path = Parser.GetComponents (this, UriComponents.Path | UriComponents.KeepDelimiter, UriFormat.UriEscaped);
+ query = Parser.GetComponents (this, UriComponents.Query, UriFormat.UriEscaped);
+ fragment = Parser.GetComponents (this, UriComponents.StrongPort, UriFormat.UriEscaped);
- // Check scheme name characters as specified in RFC2396.
- // Note: different checks in 1.x and 2.0
- if (!CheckSchemeName (scheme)) {
- if (kind == UriKind.Absolute)
- return "Invalid URI: The URI scheme is not valid.";
- isAbsoluteUri = false;
- path = uriString;
return null;
}
-
- scheme = TryGetKnownUriSchemeInstance (scheme);
- // from here we're practically working on uriString.Substring(startpos,endpos-startpos)
- int startpos = pos + 1;
- int endpos = uriString.Length;
+ var formatFlags = UriHelper.FormatFlags.None;
+ if (UriHelper.HasCharactersToNormalize (uriString))
+ formatFlags |= UriHelper.FormatFlags.HasUriCharactersToNormalize;
- // 8 fragment
- pos = uriString.IndexOf ('#', startpos);
- if (!IsUnc && pos != -1) {
- if (userEscaped)
- fragment = uriString.Substring (pos);
- else
- fragment = "#" + EscapeString (uriString.Substring (pos+1));
+ if (userEscaped)
+ formatFlags |= UriHelper.FormatFlags.UserEscaped;
- endpos = pos;
- }
+ if (elements.host != null)
+ formatFlags |= UriHelper.FormatFlags.HasHost;
- // special case: there is no query part for 'news'
- if (scheme == Uri.UriSchemeNews) {
- pos = scheme.Length + 1;
- path = EscapeString (uriString.Substring (pos, endpos - pos), EscapeNews);
- return null;
- }
+ userinfo = elements.user;
- // special case: there is no query part for 'nntp', 'file' and 'ftp' but there is an host, port, user...
- if (SupportsQuery ()) {
- // 6 query
- pos = uriString.IndexOf ('?', startpos, endpos-startpos);
- if (pos != -1) {
- query = uriString.Substring (pos, endpos-pos);
- endpos = pos;
- if (!userEscaped)
- query = EscapeString (query);
- }
+ if (elements.host != null) {
+ host = UriHelper.FormatAbsolute (elements.host, scheme,
+ UriComponents.Host, UriFormat.UriEscaped, formatFlags);
}
- // 3
- if (IsPredefinedScheme (scheme) && scheme != UriSchemeMailto && (
- (endpos-startpos < 2) ||
- (endpos-startpos >= 2 && uriString [startpos] == '/' && uriString [startpos+1] != '/')))
- return "Invalid URI: The Authority/Host could not be parsed.";
-
-
- bool startsWithSlashSlash = endpos-startpos >= 2 && uriString [startpos] == '/' && uriString [startpos+1] == '/';
- bool unixAbsPath = scheme == UriSchemeFile && startsWithSlashSlash && (endpos-startpos == 2 || uriString [startpos+2] == '/');
- bool windowsFilePath = false;
- if (startsWithSlashSlash) {
- if (kind == UriKind.Relative)
- return "Absolute URI when we expected a relative one";
-
- if (scheme != UriSchemeMailto)
- startpos += 2;
-
- if (scheme == UriSchemeFile) {
- int num_leading_slash = 2;
- for (int i = startpos; i < endpos; i++) {
- if (uriString [i] != '/')
- break;
- num_leading_slash++;
- }
- if (num_leading_slash >= 4) {
- unixAbsPath = false;
- while (startpos < endpos && uriString[startpos] == '/') {
- startpos++;
- }
- } else if (num_leading_slash >= 3) {
- startpos += 1;
- }
- }
-
- if (endpos - startpos > 1 && uriString [startpos + 1] == ':') {
- unixAbsPath = false;
- windowsFilePath = true;
- }
+ port = elements.port;
- } else if (!IsPredefinedScheme (scheme)) {
- path = uriString.Substring(startpos, endpos-startpos);
- isOpaquePart = true;
- return null;
- }
+ if (port == -1)
+ port = GetDefaultPort (scheme);
- // 5 path
- if (unixAbsPath) {
- pos = -1;
- } else {
- pos = uriString.IndexOf ('/', startpos, endpos - startpos);
- if (pos == -1 && windowsFilePath)
- pos = uriString.IndexOf ('\\', startpos, endpos - startpos);
- }
- if (pos != -1) {
- path = uriString.Substring (pos, endpos - pos);
- if (!SupportsQuery ()) {
- if (scheme != Uri.UriSchemeNntp)
- path = path.Replace ('\\', '/');
- path = EscapeString (path, EscapeNews);
- }
- endpos = pos;
- } else {
- if (scheme != Uri.UriSchemeMailto)
+ if (elements.path != null) {
+ path = UriHelper.FormatAbsolute (elements.path, scheme,
+ UriComponents.Path, UriFormat.UriEscaped, formatFlags);
+ if (elements.delimiter == SchemeDelimiter && string.IsNullOrEmpty (path))
path = "/";
}
- // 4.a user info
- if (unixAbsPath)
- pos = -1;
- else
- pos = uriString.IndexOf ('@', startpos, endpos-startpos);
- if (pos != -1) {
- // supplying username / password on a file URI is not supported
- if (scheme == UriSchemeFile)
- return "Invalid host";
- userinfo = uriString.Substring (startpos, pos-startpos);
- startpos = pos + 1;
+ if (elements.query != null) {
+ query = "?" + UriHelper.FormatAbsolute (elements.query, scheme,
+ UriComponents.Query, UriFormat.UriEscaped, formatFlags);
}
- // 4.b port
- bool valid_port = true;
- port = -1;
- if (unixAbsPath)
- pos = -1;
- else
- pos = uriString.LastIndexOf (':', endpos-1, endpos-startpos);
- if (pos != -1 && pos != endpos - 1) {
- string portStr = uriString.Substring(pos + 1, endpos - (pos + 1));
- if (portStr.Length > 0 && portStr[portStr.Length - 1] != ']') {
- if (!Int32.TryParse (portStr, NumberStyles.None, CultureInfo.InvariantCulture, out port) ||
- port < 0 || port > UInt16.MaxValue)
- valid_port = false; // delay reporting
- else
- endpos = pos;
- } else {
- if (port == -1) {
- port = GetDefaultPort (scheme);
- }
- }
- } else if (!IsFile) {
- // if no port is specified by a colon ':' is present then we must ignore it
- // since it would be part of the host name and, as such, would be invalid
- if (pos == endpos - 1)
- endpos--;
-
- if (port == -1)
- port = GetDefaultPort (scheme);
+ if (elements.fragment != null) {
+ fragment = "#" + UriHelper.FormatAbsolute (elements.fragment, scheme,
+ UriComponents.Fragment, UriFormat.UriEscaped, formatFlags);
}
-
- // 4 authority
- uriString = uriString.Substring(startpos, endpos-startpos);
- host = uriString;
-
- if (unixAbsPath) {
- path = Reduce ('/' + uriString, true);
- host = String.Empty;
- } else if (host.Length == 2 && host [1] == ':') {
- if (scheme != UriSchemeFile) {
- host = host [0].ToString ();
- } else {
- // windows filepath
- path = host + path;
- host = String.Empty;
- }
- } else if (isUnixFilePath) {
- uriString = "//" + uriString;
- host = String.Empty;
- } else if (scheme == UriSchemeFile) {
- // under Windows all file:// URI are considered UNC, which is not the case other MacOS (e.g. Silverlight)
-#if BOOTSTRAP_BASIC
- isUnc = isWin32;
-#else
- isUnc = Environment.IsRunningOnWindows;
-#endif
- } else if (host.Length == 0 &&
- (scheme == UriSchemeHttp || scheme == UriSchemeGopher || scheme == UriSchemeNntp ||
- scheme == UriSchemeHttps || scheme == UriSchemeFtp)) {
- return "Invalid URI: The Authority/Host could not be parsed.";
- }
-
- if (host.Length > 0) {
- switch (CheckHostName (host)) {
- case UriHostNameType.Unknown:
- if ((host [0] == ':') || (host [0] == '@'))
- return "Invalid URI: The hostname could not be parsed.";
- if (host.IndexOf (':') != -1)
- return "Invalid URI: Invalid port specified.";
- if (Parser is DefaultUriParser || Parser == null)
- return "Invalid URI: The hostname could not be parsed.";
- break;
- case UriHostNameType.IPv6:
- IPv6Address ipv6addr;
- if (IPv6Address.TryParse (host, out ipv6addr)) {
- host = "[" + ipv6addr.ToString (true) + "]";
- scope_id = ipv6addr.ScopeId;
- }
- break;
- }
- }
- // delayed reporting (to throw the expected exception in the right order)
- if (!valid_port)
- return "Invalid URI: Invalid port number";
- UriFormatException ex = null;
- if (Parser != null)
- Parser.InitializeAndValidate (this, out ex);
- if (ex != null)
- return ex.Message;
-
- if ((scheme != Uri.UriSchemeMailto) && (scheme != Uri.UriSchemeFile)) {
- path = Reduce (path, CompactEscaped (scheme));
- }
+ isAbsoluteUri = elements.isAbsoluteUri;
+ isUnc = elements.isUnc;
+ scope_id = elements.scopeId;
return null;
}
} else {
res.Append ('/');
}
- res.Append(part);
+ res.Append (part);
}
if (path [path.Length - 1] == '/')
res.Append ('/');
- return res.ToString();
+ return res.ToString ();
}
// A variant of HexUnescape() which can decode multi-byte escaped
// sequences such as (e.g.) %E3%81%8B into a single character
- private static char HexUnescapeMultiByte (string pattern, ref int index, out char surrogate)
+ internal static char HexUnescapeMultiByte (string pattern, ref int index, out char surrogate)
+ {
+ bool invalidEscape;
+ return HexUnescapeMultiByte (pattern, ref index, out surrogate, out invalidEscape);
+ }
+
+ internal static char HexUnescapeMultiByte (string pattern, ref int index, out char surrogate, out bool invalidEscape)
{
surrogate = char.MinValue;
+ invalidEscape = false;
if (pattern == null)
throw new ArgumentException ("pattern");
// We might be dealing with a single-byte character:
// If there was only 0 or 1 leading ones then we're not dealing
// with a multi-byte character.
- if (num_bytes <= 1)
- return (char) ((msb << 4) | lsb);
+ if (num_bytes <= 1) {
+ var c = (char) ((msb << 4) | lsb);
+ invalidEscape = c > 0x7F;
+ return c;
+ }
// Now that we know how many bytes *should* follow, we'll check them
// to ensure we are dealing with a valid multi-byte character.
// If what looked like a multi-byte character is invalid, then we'll
// just return the first byte as a single byte character.
if (all_invalid) {
+ invalidEscape = true;
index = orig_index + 3;
return (char) chars[0];
}
new UriScheme (UriSchemeFile, SchemeDelimiter, -1),
new UriScheme (UriSchemeMailto, ":", 25),
new UriScheme (UriSchemeNews, ":", 119),
+ new UriScheme (UriSchemeUuid, ":", -1),
new UriScheme (UriSchemeNntp, SchemeDelimiter, 119),
new UriScheme (UriSchemeGopher, SchemeDelimiter, 70),
};
private string GetOpaqueWiseSchemeDelimiter ()
{
- if (isOpaquePart)
- return ":";
- else
- return GetSchemeDelimiter (scheme);
+ return GetSchemeDelimiter (scheme);
}
[Obsolete]
private UriParser Parser {
get {
if (parser == null) {
- parser = UriParser.GetParser (Scheme);
+ parser = UriParser.GetParser (scheme);
// no specific parser ? then use a default one
if (parser == null)
parser = new DefaultUriParser ("*");
public string GetComponents (UriComponents components, UriFormat format)
{
+ if ((components & UriComponents.SerializationInfoString) == 0)
+ EnsureAbsoluteUri ();
+
return Parser.GetComponents (this, components, format);
}
if ((uri1 == null) && (uri2 == null))
return 0;
+ if (uri1 == null)
+ return -1;
+ if (uri2 == null)
+ return 1;
string s1 = uri1.GetComponents (partsToCompare, compareFormat);
string s2 = uri2.GetComponents (partsToCompare, compareFormat);
//
static bool NeedToEscapeDataChar (char b)
{
-#if NET_4_0
- // .NET 4.0 follows RFC 3986 Unreserved Characters
- return !((b >= 'A' && b <= 'Z') ||
- (b >= 'a' && b <= 'z') ||
- (b >= '0' && b <= '9') ||
- b == '-' || b == '.' || b == '_' || b == '~');
-#else
- return !((b >= 'A' && b <= 'Z') ||
- (b >= 'a' && b <= 'z') ||
- (b >= '0' && b <= '9') ||
- b == '_' || b == '~' || b == '!' || b == '\'' ||
- b == '(' || b == ')' || b == '*' || b == '-' || b == '.');
+ if ((b >= 'A' && b <= 'Z') ||
+ (b >= 'a' && b <= 'z') ||
+ (b >= '0' && b <= '9'))
+ return false;
+
+ switch (b) {
+ case '-':
+ case '.':
+ case '_':
+ case '~':
+ return false;
+ }
+
+#if !NET_4_5
+ switch (b) {
+ case '!':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '-':
+ case '.':
+ return false;
+ }
#endif
+
+ return true;
}
public static string EscapeDataString (string stringToEscape)
case '@':
case '_':
case '~':
-#if NET_4_0
- // .NET 4.0 follows RFC 3986
+ return false;
+#if NET_4_5
case '[':
case ']':
-#endif
return false;
- default:
- return true;
+#endif
}
+
+ return true;
}
public static string EscapeUriString (string stringToEscape)
public UriElements()
{
scheme = String.Empty;
- user = String.Empty;
+ delimiter = String.Empty;
host = String.Empty;
- port = String.Empty;
+ port = -1;
path = String.Empty;
- query = String.Empty;
- fragment = String.Empty;
+
+ isAbsoluteUri = true;
}
public string scheme;
+ public string delimiter;
public string user;
public string host;
- public string port;
+ public int port;
public string path;
public string query;
public string fragment;
+
+ public bool isAbsoluteUri;
+ public bool isUnixFilePath;
+ public bool isUnc;
+ public long scopeId;
}
}
--- /dev/null
+using System;
+using System.Globalization;
+using System.Text;
+using System.Collections.Generic;
+
+namespace System {
+ internal static class UriHelper {
+ internal const UriFormat ToStringUnescape = (UriFormat) 0x7FFF;
+
+ internal static bool IriParsing {
+ get { return Uri.IriParsing; }
+ }
+
+ [Flags]
+ internal enum FormatFlags {
+ None = 0,
+ HasComponentCharactersToNormalize = 1 << 0,
+ HasUriCharactersToNormalize = 1 << 1,
+ HasHost = 1 << 2,
+ HasFragmentPercentage = 1 << 3,
+ UserEscaped = 1 << 4,
+ IPv6Host = 1 << 5,
+ NoSlashReplace = 1 << 6,
+ NoReduce = 1 << 7,
+ HasWindowsPath = 1 << 8,
+ }
+
+ [Flags]
+ internal enum UriSchemes {
+ Http = 1 << 0,
+ Https = 1 << 1,
+ File = 1 << 2,
+ Ftp = 1 << 3,
+ Gopher = 1 << 4,
+ Ldap = 1 << 5,
+ Mailto = 1 << 6,
+ NetPipe = 1 << 7,
+ NetTcp = 1 << 8,
+ News = 1 << 9,
+ Nntp = 1 << 10,
+ Telnet = 1 << 11,
+ Uuid = 1 << 12,
+ Custom = 1 << 13,
+ CustomWithHost = 1 << 14,
+ All = ~0,
+ None = 0
+ }
+
+ private static UriSchemes GetScheme (string schemeName)
+ {
+ schemeName = schemeName.ToLowerInvariant ();
+
+ if (schemeName == "")
+ return UriSchemes.None;
+ if (schemeName == Uri.UriSchemeHttp)
+ return UriSchemes.Http;
+ if (schemeName == Uri.UriSchemeHttps)
+ return UriSchemes.Https;
+ if (schemeName == Uri.UriSchemeFile)
+ return UriSchemes.File;
+ if (schemeName == Uri.UriSchemeFtp)
+ return UriSchemes.Ftp;
+ if (schemeName == Uri.UriSchemeGopher)
+ return UriSchemes.Gopher;
+ if (schemeName == Uri.UriSchemeLdap)
+ return UriSchemes.Ldap;
+ if (schemeName == Uri.UriSchemeMailto)
+ return UriSchemes.Mailto;
+ if (schemeName == Uri.UriSchemeNetPipe)
+ return UriSchemes.NetPipe;
+ if (schemeName == Uri.UriSchemeNetTcp)
+ return UriSchemes.NetTcp;
+ if (schemeName == Uri.UriSchemeNews)
+ return UriSchemes.News;
+ if (schemeName == Uri.UriSchemeNntp)
+ return UriSchemes.Nntp;
+ if (schemeName == Uri.UriSchemeTelnet)
+ return UriSchemes.Telnet;
+ if (schemeName == Uri.UriSchemeUuid)
+ return UriSchemes.Uuid;
+
+ return UriSchemes.Custom;
+ }
+
+ internal static bool SchemeContains (UriSchemes keys, UriSchemes flag)
+ {
+ return (keys & flag) != 0;
+ }
+
+ internal static bool IsKnownScheme (string scheme)
+ {
+ return GetScheme (scheme) != UriSchemes.Custom;
+ }
+
+ internal static string HexEscapeMultiByte (char character)
+ {
+ const string hex_upper_chars = "0123456789ABCDEF";
+
+ var sb = new StringBuilder ();
+ byte [] bytes = Encoding.UTF8.GetBytes (new [] {character});
+ foreach (byte b in bytes) {
+ sb.Append ("%");
+ sb.Append (hex_upper_chars [(b & 0xf0) >> 4]);
+ sb.Append (hex_upper_chars [b & 0x0f]);
+ }
+
+ return sb.ToString ();
+ }
+
+ internal static bool SupportsQuery (string scheme)
+ {
+ return SupportsQuery (GetScheme (scheme));
+ }
+
+ internal static bool SupportsQuery (UriSchemes scheme)
+ {
+ if (SchemeContains (scheme, UriSchemes.File))
+ return IriParsing;
+
+ return !SchemeContains (scheme, UriSchemes.Ftp | UriSchemes.Gopher | UriSchemes.Nntp | UriSchemes.Telnet | UriSchemes.News);
+ }
+
+ internal static bool HasCharactersToNormalize (string str)
+ {
+ int len = str.Length;
+ for (int i = 0; i < len; i++) {
+ char c = str [i];
+ if (c != '%')
+ continue;
+
+ int iStart = i;
+ char surrogate;
+ char x = Uri.HexUnescapeMultiByte (str, ref i, out surrogate);
+
+ bool isEscaped = i - iStart > 1;
+ if (!isEscaped)
+ continue;
+
+ if ((x >= 'A' && x <= 'Z') || (x >= 'a' && x <= 'z') || (x >= '0' && x <= '9') ||
+ x == '-' || x == '.' || x == '_' || x == '~')
+ return true;
+
+ if (x > 0x7f)
+ return true;
+ }
+
+ return false;
+ }
+
+ internal static bool HasPercentage (string str)
+ {
+ int len = str.Length;
+ for (int i = 0; i < len; i++) {
+ char c = str [i];
+ if (c != '%')
+ continue;
+
+ int iStart = i;
+ char surrogate;
+ char x = Uri.HexUnescapeMultiByte (str, ref i, out surrogate);
+
+ if (x == '%')
+ return true;
+
+ bool isEscaped = i - iStart > 1;
+ if (!isEscaped)
+ return true;
+ }
+
+ return false;
+ }
+
+ internal static string FormatAbsolute (string str, string schemeName,
+ UriComponents component, UriFormat uriFormat, FormatFlags formatFlags = FormatFlags.None)
+ {
+ return Format (str, schemeName, UriKind.Absolute, component, uriFormat, formatFlags);
+ }
+
+ internal static string FormatRelative (string str, string schemeName, UriFormat uriFormat)
+ {
+ return Format (str, schemeName, UriKind.Relative, UriComponents.Path, uriFormat, FormatFlags.None);
+ }
+
+ private static string Format (string str, string schemeName, UriKind uriKind,
+ UriComponents component, UriFormat uriFormat, FormatFlags formatFlags)
+ {
+ if (string.IsNullOrEmpty (str))
+ return "";
+
+ if (UriHelper.HasCharactersToNormalize (str))
+ formatFlags |= UriHelper.FormatFlags.HasComponentCharactersToNormalize | FormatFlags.HasUriCharactersToNormalize;
+
+ if (component == UriComponents.Fragment && UriHelper.HasPercentage (str))
+ formatFlags |= UriHelper.FormatFlags.HasFragmentPercentage;
+
+ if (component == UriComponents.Host &&
+ str.Length > 1 && str [0] == '[' && str [str.Length - 1] == ']')
+ formatFlags |= UriHelper.FormatFlags.IPv6Host;
+
+ if (component == UriComponents.Path &&
+ str.Length >= 2 && str [1] != ':' &&
+ ('a' <= str [0] && str [0] <= 'z') || ('A' <= str [0] && str [0] <= 'Z'))
+ formatFlags |= UriHelper.FormatFlags.HasWindowsPath;
+
+ UriSchemes scheme = GetScheme (schemeName);
+
+ if (scheme == UriSchemes.Custom && (formatFlags & FormatFlags.HasHost) != 0)
+ scheme = UriSchemes.CustomWithHost;
+
+ var reduceAfter = UriSchemes.Http | UriSchemes.Https | UriSchemes.File | UriSchemes.NetPipe | UriSchemes.NetTcp;
+
+ if (IriParsing) {
+ reduceAfter |= UriSchemes.Ftp;
+ } else if (component == UriComponents.Path &&
+ (formatFlags & FormatFlags.NoSlashReplace) == 0) {
+ if (scheme == UriSchemes.Ftp)
+ str = Reduce (str.Replace ('\\', '/'), !IriParsing);
+ if (scheme == UriSchemes.CustomWithHost)
+ str = Reduce (str.Replace ('\\', '/'), false);
+ }
+
+ str = FormatString (str, scheme, uriKind, component, uriFormat, formatFlags);
+
+ if (component == UriComponents.Path &&
+ (formatFlags & FormatFlags.NoReduce) == 0) {
+ if (SchemeContains (scheme, reduceAfter))
+ str = Reduce (str, !IriParsing);
+ if (IriParsing && scheme == UriSchemes.CustomWithHost)
+ str = Reduce (str, false);
+ }
+
+ return str;
+ }
+
+ private static string FormatString (string str, UriSchemes scheme, UriKind uriKind,
+ UriComponents component, UriFormat uriFormat, FormatFlags formatFlags)
+ {
+ var s = new StringBuilder ();
+ int len = str.Length;
+ for (int i = 0; i < len; i++) {
+ char c = str [i];
+ if (c == '%') {
+ int iStart = i;
+ char surrogate;
+ bool invalidUnescape;
+ char x = Uri.HexUnescapeMultiByte (str, ref i, out surrogate, out invalidUnescape);
+
+
+ if (invalidUnescape
+#if !NET_4_0
+ && uriFormat == UriFormat.SafeUnescaped && char.IsControl (x)
+#endif
+ ) {
+ s.Append (c);
+ i = iStart;
+ continue;
+ }
+
+ string cStr = str.Substring (iStart, i-iStart);
+ s.Append (FormatChar (x, surrogate, cStr, scheme, uriKind, component, uriFormat, formatFlags));
+
+ i--;
+ } else
+ s.Append (FormatChar (c, char.MinValue, "" + c, scheme, uriKind, component, uriFormat, formatFlags));
+ }
+
+ return s.ToString ();
+ }
+
+ private static string FormatChar (char c, char surrogate, string cStr, UriSchemes scheme, UriKind uriKind,
+ UriComponents component, UriFormat uriFormat, FormatFlags formatFlags)
+ {
+ var isEscaped = cStr.Length != 1;
+
+ var userEscaped = (formatFlags & FormatFlags.UserEscaped) != 0;
+ if (!isEscaped && !userEscaped && NeedToEscape (c, scheme, component, uriKind, uriFormat, formatFlags))
+ return HexEscapeMultiByte (c);
+
+ if (isEscaped && (
+#if NET_4_0
+ (userEscaped && c < 0xFF) ||
+#endif
+ !NeedToUnescape (c, scheme, component, uriKind, uriFormat, formatFlags))) {
+ if (IriParsing &&
+ (c == '<' || c == '>' || c == '^' || c == '{' || c == '|' || c == '}' || c > 0x7F) &&
+ (formatFlags & FormatFlags.HasUriCharactersToNormalize) != 0)
+ return cStr.ToUpperInvariant (); //Upper case escape
+
+ return cStr; //Keep original case
+ }
+
+ if ((formatFlags & FormatFlags.NoSlashReplace) == 0 &&
+ c == '\\' && component == UriComponents.Path) {
+ if (!IriParsing && uriFormat != UriFormat.UriEscaped &&
+ SchemeContains (scheme, UriSchemes.Http | UriSchemes.Https))
+ return "/";
+
+ if (SchemeContains (scheme, UriSchemes.Http | UriSchemes.Https | UriSchemes.Ftp | UriSchemes.CustomWithHost))
+ return (isEscaped && uriFormat != UriFormat.UriEscaped) ? "\\" : "/";
+
+ if (SchemeContains (scheme, UriSchemes.NetPipe | UriSchemes.NetTcp | UriSchemes.File))
+ return "/";
+
+ if (SchemeContains (scheme, UriSchemes.Custom) &&
+ (formatFlags & FormatFlags.HasWindowsPath) == 0)
+ return "/";
+ }
+
+ var ret = c.ToString (CultureInfo.InvariantCulture);
+ if (surrogate != char.MinValue)
+ ret += surrogate.ToString (CultureInfo.InvariantCulture);
+
+ return ret;
+ }
+
+ private static bool NeedToUnescape (char c, UriSchemes scheme, UriComponents component, UriKind uriKind,
+ UriFormat uriFormat, FormatFlags formatFlags)
+ {
+ if ((formatFlags & FormatFlags.IPv6Host) != 0)
+ return false;
+
+ if (uriFormat == UriFormat.Unescaped)
+ return true;
+
+ UriSchemes sDecoders = UriSchemes.NetPipe | UriSchemes.NetTcp;
+
+ if (!IriParsing)
+ sDecoders |= UriSchemes.Http | UriSchemes.Https;
+
+ if (c == '/' || c == '\\') {
+ if (!IriParsing && uriKind == UriKind.Absolute && uriFormat != UriFormat.UriEscaped &&
+ uriFormat != UriFormat.SafeUnescaped)
+ return true;
+
+ if (SchemeContains (scheme, UriSchemes.File)) {
+ return component != UriComponents.Fragment &&
+ (component != UriComponents.Query || !IriParsing);
+ }
+
+ return component != UriComponents.Query && component != UriComponents.Fragment &&
+ SchemeContains (scheme, sDecoders);
+ }
+
+ if (c == '?') {
+ //Avoid creating new query
+ if (SupportsQuery (scheme) && component == UriComponents.Path)
+ return false;
+
+ if (!IriParsing && uriFormat == ToStringUnescape) {
+ if (SupportsQuery (scheme))
+ return component == UriComponents.Query || component == UriComponents.Fragment;
+
+ return component == UriComponents.Fragment;
+ }
+
+ return false;
+ }
+
+ if (c == '#')
+ return false;
+
+ if (uriFormat == ToStringUnescape && !IriParsing) {
+ if (uriKind == UriKind.Relative)
+ return false;
+
+ switch (c) {
+ case '$':
+ case '&':
+ case '+':
+ case ',':
+ case ';':
+ case '=':
+ case '@':
+ return true;
+ }
+
+ if (c < 0x20 || c == 0x7f)
+ return true;
+ }
+
+ if (uriFormat == UriFormat.SafeUnescaped || uriFormat == ToStringUnescape) {
+ switch (c) {
+ case '-':
+ case '.':
+ case '_':
+ case '~':
+ return true;
+ case ' ':
+ case '!':
+ case '"':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case '<':
+ case '>':
+ case '^':
+ case '`':
+ case '{':
+ case '}':
+ case '|':
+ return uriKind != UriKind.Relative ||
+ (IriParsing && (formatFlags & FormatFlags.HasUriCharactersToNormalize) != 0);
+ case ':':
+ case '[':
+ case ']':
+ return uriKind != UriKind.Relative;
+ }
+
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))
+ return true;
+
+ if (c > 0x7f)
+ return true;
+
+ return false;
+ }
+
+ if (uriFormat == UriFormat.UriEscaped) {
+ if (!IriParsing) {
+ if (c == '.') {
+ if (SchemeContains (scheme, UriSchemes.File))
+ return component != UriComponents.Fragment;
+
+ return component != UriComponents.Query && component != UriComponents.Fragment &&
+ SchemeContains (scheme, sDecoders);
+ }
+
+ return false;
+ }
+
+ switch (c) {
+ case '-':
+ case '.':
+ case '_':
+ case '~':
+ return true;
+ }
+
+ if ((formatFlags & FormatFlags.HasUriCharactersToNormalize) != 0) {
+ switch (c) {
+ case '!':
+ case '\'':
+ case '(':
+ case ')':
+ case '*':
+ case ':':
+ case '[':
+ case ']':
+ return true;
+ }
+ }
+
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))
+ return true;
+
+ return false;
+ }
+
+ return false;
+ }
+
+ private static bool NeedToEscape (char c, UriSchemes scheme, UriComponents component, UriKind uriKind,
+ UriFormat uriFormat, FormatFlags formatFlags)
+ {
+ if ((formatFlags & FormatFlags.IPv6Host) != 0)
+ return false;
+
+ if (c == '?') {
+ if (uriFormat == UriFormat.Unescaped)
+ return false;
+
+ if (!SupportsQuery (scheme))
+ return component != UriComponents.Fragment;
+
+ return false;
+ }
+
+ if (c == '#') {
+ //Avoid removing fragment
+ if (component == UriComponents.Path || component == UriComponents.Query)
+ return false;
+
+ if (component == UriComponents.Fragment &&
+ (uriFormat == ToStringUnescape || uriFormat == UriFormat.SafeUnescaped) &&
+ (formatFlags & FormatFlags.HasFragmentPercentage) != 0)
+ return true;
+
+#if NET_4_5
+ return false;
+#else
+ return uriFormat == UriFormat.UriEscaped ||
+ (uriFormat != UriFormat.Unescaped && (formatFlags & FormatFlags.HasComponentCharactersToNormalize) != 0);
+#endif
+ }
+
+ if (uriFormat == UriFormat.SafeUnescaped || uriFormat == ToStringUnescape) {
+ if (c == '%')
+ return uriKind != UriKind.Relative;
+ }
+
+ if (uriFormat == UriFormat.SafeUnescaped) {
+ if (c < 0x20 || c == 0x7F)
+ return true;
+ }
+
+ if (uriFormat == UriFormat.UriEscaped) {
+ if (c < 0x20 || c >= 0x7F)
+ return component != UriComponents.Host;
+
+ switch (c) {
+ case ' ':
+ case '"':
+ case '%':
+ case '<':
+ case '>':
+ case '^':
+ case '`':
+ case '{':
+ case '}':
+ case '|':
+ return true;
+ case '[':
+ case ']':
+ return !IriParsing;
+ case '\\':
+ return component != UriComponents.Path ||
+ SchemeContains (scheme,
+ UriSchemes.Gopher | UriSchemes.Ldap | UriSchemes.Mailto | UriSchemes.Nntp |
+ UriSchemes.Telnet | UriSchemes.News | UriSchemes.Custom);
+ }
+ }
+
+ return false;
+ }
+
+ // This is called "compacting" in the MSDN documentation
+ internal static string Reduce (string path, bool trimDots)
+ {
+ // quick out, allocation-free, for a common case
+ if (path == "/")
+ return path;
+
+ bool endWithSlash = false;
+
+ List<string> result = new List<string> ();
+
+ string[] segments = path.Split ('/');
+ int lastSegmentIndex = segments.Length - 1;
+ for (var i = 0; i <= lastSegmentIndex; i++) {
+ string segment = segments [i];
+
+ if (i == lastSegmentIndex &&
+ (segment.Length == 0 || segment == ".." || segment == "."))
+ endWithSlash = true;
+
+ if ((i == 0 || i == lastSegmentIndex) && segment.Length == 0)
+ continue;
+
+ if (segment == "..") {
+ int resultCount = result.Count;
+ // in 2.0 profile, skip leading ".." parts
+ if (resultCount == 0)
+ continue;
+
+ result.RemoveAt (resultCount - 1);
+ continue;
+ }
+
+ if (segment == "." ||
+ (trimDots && segment.EndsWith (".", StringComparison.Ordinal))) {
+ segment = segment.TrimEnd ('.');
+ if (segment == "" && i < lastSegmentIndex)
+ continue;
+ }
+
+ endWithSlash = false;
+
+ result.Add (segment);
+ }
+
+ if (result.Count == 0)
+ return "/";
+
+ StringBuilder res = new StringBuilder ();
+
+ if (path [0] == '/')
+ res.Append ('/');
+
+ bool first = true;
+ foreach (string part in result) {
+ if (first) {
+ first = false;
+ } else {
+ res.Append ('/');
+ }
+ res.Append (part);
+ }
+
+ if (path [path.Length - 1] == '/' || endWithSlash)
+ res.Append ('/');
+
+ return res.ToString ();
+ }
+ }
+}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.IO;
+using System.Net;
using System.Text;
-
+using System.Globalization;
namespace System {
internal class ParserState
{
- public ParserState (string uri)
+ public ParserState (string uri, UriKind kind)
{
remaining = uri;
+ this.kind = kind;
elements = new UriElements ();
}
public string remaining;
+ public UriKind kind;
public UriElements elements;
+ public string error;
}
// 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)
+ public static UriElements ParseComponents (string uri, UriKind kind)
+ {
+ UriElements elements;
+ string error;
+
+ if (!TryParseComponents (uri, kind, out elements, out error))
+ throw new UriFormatException (error);
+
+ return elements;
+ }
+
+ public static bool TryParseComponents (string uri, UriKind kind, out UriElements elements, out string error)
{
- ParserState state = new ParserState (uri);
+ uri = uri.Trim ();
+
+ ParserState state = new ParserState (uri, kind);
+ elements = state.elements;
+ error = null;
+
+ if (uri.Length == 0 && (kind == UriKind.Relative || kind == UriKind.RelativeOrAbsolute)){
+ state.elements.isAbsoluteUri = false;
+ return true;
+ }
- 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);
+ if (uri.Length <= 1 && kind == UriKind.Absolute) {
+ error = "Absolute URI is too short";
+ return false;
+ }
+
+ bool ok = ParseFilePath (state) &&
+ ParseScheme (state);
+
+ var scheme = state.elements.scheme;
+ UriParser parser = null;
+ if (!string.IsNullOrEmpty (scheme)) {
+ parser = UriParser.GetParser (scheme);
+ if (parser != null && !(parser is DefaultUriParser))
+ return true;
+ }
+
+ ok = ok &&
+ ParseAuthority (state) &&
+ ParsePath (state) &&
+ ParseQuery (state) &&
+ ParseFragment (state);
+
+ if (string.IsNullOrEmpty (state.elements.host) &&
+ (scheme == Uri.UriSchemeHttp || scheme == Uri.UriSchemeGopher || scheme == Uri.UriSchemeNntp ||
+ scheme == Uri.UriSchemeHttps || scheme == Uri.UriSchemeFtp))
+ state.error = "Invalid URI: The Authority/Host could not be parsed.";
+
+ if (!string.IsNullOrEmpty (state.elements.host) &&
+ Uri.CheckHostName (state.elements.host) == UriHostNameType.Unknown)
+ state.error = "Invalid URI: The hostname could not be parsed.";
+
+ if (!string.IsNullOrEmpty (state.error)) {
+ elements = null;
+ error = state.error;
+ return false;
+ }
- return state.elements;
+ return true;
}
+
// ALPHA
private static bool IsAlpha (char ch)
{
return (('a' <= ch) && (ch <= 'z')) ||
(('A' <= ch) && (ch <= 'Z'));
}
+
+ private static bool ParseFilePath (ParserState state)
+ {
+ return ParseWindowsFilePath (state) &&
+ ParseWindowsUNC (state) &&
+ ParseUnixFilePath (state);
+ }
+
+ private static bool ParseWindowsFilePath (ParserState state)
+ {
+ var scheme = state.elements.scheme;
+
+ if (!string.IsNullOrEmpty (scheme) &&
+ scheme != Uri.UriSchemeFile && UriHelper.IsKnownScheme (scheme))
+ return state.remaining.Length > 0;
+
+ string part = state.remaining;
+
+ if (part.Length > 0 && (part [0] == '/' || part [0] == '\\'))
+ part = part.Substring (1);
+
+ if (part.Length < 2 || part [1] != ':')
+ return state.remaining.Length > 0;
+
+ if (!IsAlpha (part [0])) {
+ if (state.kind == UriKind.Absolute) {
+ state.error = "Invalid URI: The URI scheme is not valid.";
+ return false;
+ }
+ state.elements.isAbsoluteUri = false;
+ state.elements.path = part;
+ return false;
+ }
+
+ if (part.Length > 2 && part [2] != '\\' && part [2] != '/') {
+ state.error = "Relative file path is not allowed.";
+ return false;
+ }
+
+ if (string.IsNullOrEmpty (scheme)) {
+ state.elements.scheme = Uri.UriSchemeFile;
+ state.elements.delimiter = "://";
+ }
+
+ state.elements.path = part.Replace ("\\", "/");
+
+ return false;
+ }
+
+ private static bool ParseWindowsUNC (ParserState state)
+ {
+ string part = state.remaining;
+
+ if (part.Length < 2 || part [0] != '\\' || part [1] != '\\')
+ return state.remaining.Length > 0;
+
+ state.elements.scheme = Uri.UriSchemeFile;
+ state.elements.delimiter = "://";
+ state.elements.isUnc = true;
+
+ part = part.TrimStart ('\\');
+ int pos = part.IndexOf ('\\');
+ if (pos > 0) {
+ state.elements.path = part.Substring (pos);
+ state.elements.host = part.Substring (0, pos);
+ } else { // "\\\\server"
+ state.elements.host = part;
+ state.elements.path = String.Empty;
+ }
+ state.elements.path = state.elements.path.Replace ("\\", "/");
+
+ return false;
+ }
+
+ private static bool ParseUnixFilePath (ParserState state)
+ {
+ string part = state.remaining;
+
+ if (part.Length < 1 || part [0] != '/' || Path.DirectorySeparatorChar != '/')
+ return state.remaining.Length > 0;
+
+ state.elements.scheme = Uri.UriSchemeFile;
+ state.elements.delimiter = "://";
+ state.elements.isUnixFilePath = true;
+ state.elements.isAbsoluteUri = (state.kind == UriKind.Relative)? false : true;
+
+ if (part.Length >= 2 && part [0] == '/' && part [1] == '/') {
+ part = part.TrimStart (new char [] {'/'});
+ state.elements.path = '/' + part;
+ } else
+ state.elements.path = part;
+
+ return false;
+ }
// 3.1) scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
- private static bool ParseScheme (ref ParserState state)
+ private static bool ParseScheme (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))
+ if (ch != '.' && ch != '-' && ch != '+' && !IsAlpha (ch) && !Char.IsDigit (ch))
break;
sb.Append (ch);
}
- if (index + 1 <= part.Length && part [index] == ':') {
- state.elements.scheme = sb.ToString ();
- state.remaining = part.Substring (index + 1);
+ if (index == 0 || index >= part.Length) {
+ if (state.kind == UriKind.Absolute) {
+ state.error = "Invalid URI: The format of the URI could not be determined.";
+ return false;
+ }
+
+ state.elements.isAbsoluteUri = false;
+ return state.remaining.Length > 0;
+ }
+
+ if (part [index] != ':') {
+ if (state.kind == UriKind.Absolute) {
+ state.error = "Invalid URI: The URI scheme is not valid.";
+ return false;
+ }
+
+ state.elements.isAbsoluteUri = false;
+ return state.remaining.Length > 0;
+ }
+
+ state.elements.scheme = sb.ToString ().ToLowerInvariant ();
+ state.remaining = part.Substring (index);
+
+ // Check scheme name characters as specified in RFC2396.
+ // Note: different checks in 1.x and 2.0
+ if (!Uri.CheckSchemeName (state.elements.scheme)) {
+ if (state.kind == UriKind.Absolute) {
+ state.error = "Invalid URI: The URI scheme is not valid.";
+ return false;
+ }
+
+ state.elements.isAbsoluteUri = false;
+ return state.remaining.Length > 0;
+ }
+
+ if (state.elements.scheme == Uri.UriSchemeFile) {
+ // under Windows all file:// URI are considered UNC, which is not the case other MacOS (e.g. Silverlight)
+#if BOOTSTRAP_BASIC
+ state.elements.isUnc = (Path.DirectorySeparatorChar == '\\');
+#else
+ state.elements.isUnc = Environment.IsRunningOnWindows;
+#endif
+ }
+
+ return ParseDelimiter (state);
+ }
+
+ private static bool ParseDelimiter (ParserState state)
+ {
+ var delimiter = Uri.GetSchemeDelimiter (state.elements.scheme);
+
+ if (!state.remaining.StartsWith (delimiter, StringComparison.Ordinal)) {
+ if (UriHelper.IsKnownScheme (state.elements.scheme)) {
+ state.error = "Invalid URI: The Authority/Host could not be parsed.";
+ return false;
+ }
+
+ delimiter = ":";
}
+ state.elements.delimiter = delimiter;
+
+ state.remaining = state.remaining.Substring (delimiter.Length);
+
return state.remaining.Length > 0;
}
- private static bool ParseAuthority (ref ParserState state)
+ private static bool ParseAuthority (ParserState state)
{
- string part = state.remaining;
+ if (state.elements.delimiter != Uri.SchemeDelimiter && state.elements.scheme != Uri.UriSchemeMailto)
+ return state.remaining.Length > 0;
- 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;
+ return ParseUser (state) &&
+ ParseHost (state) &&
+ ParsePort (state);
}
static bool IsUnreserved (char ch)
}
// userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
- private static bool ParseUser (ref ParserState state)
+ private static bool ParseUser (ParserState state)
{
string part = state.remaining;
StringBuilder sb = null;
if (ch == '%'){
if (!Uri.IsHexEncoding (part, index))
return false;
+ var oldIndex = index;
ch = Uri.HexUnescape (part, ref index);
+ index--;
+ if (ch == '@') {
+ sb.Append (part.Substring (oldIndex, index - oldIndex + 1));
+ continue;
+ }
}
if (Char.IsLetterOrDigit (ch) || IsUnreserved (ch) || IsSubDelim (ch) || ch == ':'){
}
if (index + 1 <= part.Length && part [index] == '@') {
+ if (state.elements.scheme == Uri.UriSchemeFile) {
+ state.error = "Invalid URI: The hostname could not be parsed.";
+ return false;
+ }
+
state.elements.user = sb == null ? "" : sb.ToString ();
state.remaining = state.remaining.Substring (index + 1);
}
}
// host = IP-literal / IPv4address / reg-name
- private static bool ParseHost (ref ParserState state)
+ private static bool ParseHost (ParserState state)
{
string part = state.remaining;
+
+ if (state.elements.scheme == Uri.UriSchemeFile && part.Length >= 2 &&
+ (part [0] == '\\' || part [0] == '/') && part [1] == part [0]) {
+ part = part.TrimStart (part [0]);
+ state.remaining = part;
+ }
+
+ if (!ParseWindowsFilePath (state))
+ return false;
+
StringBuilder sb = new StringBuilder ();
+ var tmpHost = "";
+
+ var possibleIpv6 = false;
+
int index;
for (index = 0; index < part.Length; index++) {
char ch = part [index];
- if (ch == '/' || ch == ':' || ch == '#' || ch == '?')
+ if (ch == '/' || ch == '#' || ch == '?')
break;
+
+ // Possible IPv6
+ if (string.IsNullOrEmpty (tmpHost) && ch == ':') {
+ tmpHost = sb.ToString ();
+ possibleIpv6 = true;
+ }
sb.Append (ch);
+
+ if (possibleIpv6 && ch == ']')
+ break;
}
- if (index <= part.Length)
- state.remaining = part.Substring (index);
-
- state.elements.host = sb.ToString();
+ if (possibleIpv6) {
+ IPv6Address ipv6addr;
+ if (IPv6Address.TryParse (sb.ToString (), out ipv6addr)) {
+#if NET_4_5
+ var ipStr = ipv6addr.ToString (false);
+#else
+ var ipStr = ipv6addr.ToString (true);
+#endif
+ //remove scope
+ ipStr = ipStr.Split ('%') [0];
+
+ state.elements.host = "[" + ipStr + "]";
+ state.elements.scopeId = ipv6addr.ScopeId;
+
+ state.remaining = part.Substring (sb.Length);
+ return state.remaining.Length > 0;
+ }
+ state.elements.host = tmpHost;
+ } else
+ state.elements.host = sb.ToString ();
+
+ state.elements.host = state.elements.host.ToLowerInvariant ();
+
+ state.remaining = part.Substring (state.elements.host.Length);
return state.remaining.Length > 0;
}
// port = *DIGIT
- private static bool ParsePort (ref ParserState state)
+ private static bool ParsePort (ParserState state)
{
string part = state.remaining;
if (part.Length == 0 || part [0] != ':')
for (index = 1; index < part.Length; index++ ) {
char ch = part [index];
- if (!char.IsDigit (ch))
- break;
+ if (!char.IsDigit (ch)) {
+ if (ch == '/' || ch == '#' || ch == '?')
+ break;
+
+ state.error = "Invalid URI: Invalid port specified.";
+ return false;
+ }
sb.Append (ch);
}
-
+
if (index <= part.Length)
state.remaining = part.Substring (index);
+
+ if (sb.Length == 0)
+ return state.remaining.Length > 0;
- state.elements.port = sb.ToString();
+ int port;
+ if (!Int32.TryParse (sb.ToString (), NumberStyles.None, CultureInfo.InvariantCulture, out port) ||
+ port < 0 || port > UInt16.MaxValue) {
+ state.error = "Invalid URI: Invalid port number";
+ return false;
+ }
+
+ state.elements.port = port;
return state.remaining.Length > 0;
}
- private static bool ParsePath (ref ParserState state)
+ private static bool ParsePath (ParserState state)
{
string part = state.remaining;
StringBuilder sb = new StringBuilder ();
char ch = part [index];
- if (ch == '#' || ch == '?')
+ var supportsQuery = UriHelper.SupportsQuery (state.elements.scheme);
+
+ if (ch == '#' || (supportsQuery && ch == '?'))
break;
sb.Append (ch);
return state.remaining.Length > 0;
}
- private static bool ParseQuery (ref ParserState state)
+ private static bool ParseQuery (ParserState state)
{
string part = state.remaining;
+
+ if (!UriHelper.SupportsQuery (state.elements.scheme))
+ return part.Length > 0;
if (part.Length == 0 || part [0] != '?')
return part.Length > 0;
return state.remaining.Length > 0;
}
- private static bool ParseFragment (ref ParserState state)
+ private static bool ParseFragment (ParserState state)
{
string part = state.remaining;
if ((format < UriFormat.UriEscaped) || (format > UriFormat.SafeUnescaped))
throw new ArgumentOutOfRangeException ("format");
- UriElements elements = UriParseComponents.ParseComponents (uri.OriginalString.Trim ());
+ if ((components & UriComponents.SerializationInfoString) != 0) {
+ if (components != UriComponents.SerializationInfoString)
+ throw new ArgumentOutOfRangeException ("components", "UriComponents.SerializationInfoString must not be combined with other UriComponents.");
+
+ if (!uri.IsAbsoluteUri)
+ return UriHelper.FormatRelative (uri.OriginalString, "", format);
+
+ components |= UriComponents.AbsoluteUri;
+ }
+
+ return GetComponentsHelper (uri, components, format);
+ }
+
+ internal string GetComponentsHelper (Uri uri, UriComponents components, UriFormat format)
+ {
+ UriElements elements = UriParseComponents.ParseComponents (uri.OriginalString.Trim (), UriKind.Absolute);
string scheme = scheme_name;
int dp = default_port;
throw new SystemException ("URI Parser: scheme mismatch: " + scheme + " vs. " + elements.scheme);
}
+ var formatFlags = UriHelper.FormatFlags.None;
+ if (UriHelper.HasCharactersToNormalize (uri.OriginalString))
+ formatFlags |= UriHelper.FormatFlags.HasUriCharactersToNormalize;
+
+ if (uri.UserEscaped)
+ formatFlags |= UriHelper.FormatFlags.UserEscaped;
+
+ if (!string.IsNullOrEmpty (elements.host))
+ formatFlags |= UriHelper.FormatFlags.HasHost;
+
// it's easier to answer some case directly (as the output isn't identical
// when mixed with others components, e.g. leading slash, # ...)
switch (components) {
case UriComponents.Scheme:
return scheme;
case UriComponents.UserInfo:
- return elements.user;
+ return elements.user ?? "";
case UriComponents.Host:
return elements.host;
case UriComponents.Port: {
- string p = elements.port;
- if (p != null && p.Length != 0 && p != dp.ToString ())
- return p;
+ int p = elements.port;
+ if (p >= 0 && p != dp)
+ return p.ToString (CultureInfo.InvariantCulture);
return String.Empty;
}
case UriComponents.Path:
- return Format (IgnoreFirstCharIf (elements.path, '/'), format);
+ var path = elements.path;
+ if (scheme != Uri.UriSchemeMailto && scheme != Uri.UriSchemeNews)
+ path = IgnoreFirstCharIf (elements.path, '/');
+ return UriHelper.FormatAbsolute (path, scheme, UriComponents.Path, format, formatFlags);
case UriComponents.Query:
- return Format (elements.query, format);
+ return UriHelper.FormatAbsolute (elements.query, scheme, UriComponents.Query, format, formatFlags);
case UriComponents.Fragment:
- return Format (elements.fragment, format);
+ return UriHelper.FormatAbsolute (elements.fragment, scheme, UriComponents.Fragment, format, formatFlags);
case UriComponents.StrongPort: {
- return elements.port.Length != 0 ? elements.port : dp.ToString ();
+ return elements.port >= 0
+ ? elements.port.ToString (CultureInfo.InvariantCulture)
+ : dp.ToString (CultureInfo.InvariantCulture);
}
case UriComponents.SerializationInfoString:
components = UriComponents.AbsoluteUri;
if ((components & UriComponents.Scheme) != 0) {
sb.Append (scheme);
- sb.Append (Uri.GetSchemeDelimiter (scheme));
+ sb.Append (elements.delimiter);
}
if ((components & UriComponents.UserInfo) != 0) {
string userinfo = elements.user;
- if (!String.IsNullOrEmpty (userinfo)) {
+ if (userinfo != null) {
sb.Append (elements.user);
sb.Append ('@');
}
// otherwise only display if ut's not the default port
if ((components & UriComponents.StrongPort) != 0) {
sb.Append (":");
- if (elements.port.Length != 0) {
+ if (elements.port >= 0) {
sb.Append (elements.port);
} else {
sb.Append (dp);
}
if ((components & UriComponents.Port) != 0) {
- string p = elements.port;
- if (p != null && p.Length != 0 && p != dp.ToString ()) {
+ int p = elements.port;
+ if (p >= 0 && p != dp) {
sb.Append (":");
sb.Append (elements.port);
}
}
if ((components & UriComponents.Path) != 0) {
+ string path = elements.path;
if ((components & UriComponents.PathAndQuery) != 0 &&
- (elements.path.Length == 0 || !elements.path.StartsWith ("/")))
+ (path.Length == 0 || !path.StartsWith ("/", StringComparison.Ordinal)) &&
+ elements.delimiter == Uri.SchemeDelimiter)
sb.Append ("/");
- sb.Append (elements.path);
+ sb.Append (UriHelper.FormatAbsolute (path, scheme, UriComponents.Path, format, formatFlags));
}
if ((components & UriComponents.Query) != 0) {
string query = elements.query;
- if (!String.IsNullOrEmpty (query)) {
+ if (query != null) {
sb.Append ("?");
- sb.Append (elements.query);
+ sb.Append (UriHelper.FormatAbsolute (query, scheme, UriComponents.Query, format, formatFlags));
}
}
- string result = Format (sb.ToString (), format);
if ((components & UriComponents.Fragment) != 0) {
string f = elements.fragment;
- if (!String.IsNullOrEmpty (f)) {
- result += "#" + Format (f, format);
+ if (f != null) {
+ sb.Append ("#");
+ sb.Append (UriHelper.FormatAbsolute (f, scheme, UriComponents.Fragment, format, formatFlags));
}
}
- return result;
+ return sb.ToString ();
}
protected internal virtual void InitializeAndValidate (Uri uri, out UriFormatException parsingError)
protected internal virtual bool IsBaseOf (Uri baseUri, Uri relativeUri)
{
+ if (baseUri == null)
+ throw new ArgumentNullException ("baseUri");
+ if (relativeUri == null)
+ throw new ArgumentNullException ("relativeUri");
+
// compare, not case sensitive, the scheme, host and port (+ user informations)
if (Uri.Compare (baseUri, relativeUri, UriComponents.SchemeAndServer | UriComponents.UserInfo, UriFormat.Unescaped, StringComparison.InvariantCultureIgnoreCase) != 0)
return false;
return s;
}
- private string Format (string s, UriFormat format)
- {
- if (s.Length == 0)
- return String.Empty;
-
- switch (format) {
- case UriFormat.UriEscaped:
- return Uri.EscapeString (s, Uri.EscapeCommonHexBrackets);
- case UriFormat.SafeUnescaped:
- return Uri.UnescapeDataString (s, true);
- case UriFormat.Unescaped:
- return Uri.Unescape (s, false);
- default:
- throw new ArgumentOutOfRangeException ("format");
- }
- }
-
// static methods
private static void CreateDefaults ()
System/NetPipeStyleUriParserTest.cs
System/NetTcpStyleUriParserTest.cs
System/NewsStyleUriParserTest.cs
+System/StringTester.cs
System/UriBuilderTest.cs
System/UriParserTest.cs
System/UriTest.cs
System/UriTest2.cs
System/UriTest3.cs
+System/UriPermutationsTest.cs
System/UriTypeConverterTest.cs
System.CodeDom/CodeArgumentReferenceExpressionTest.cs
System.CodeDom/CodeArrayCreateExpressionTest.cs
System.Diagnostics/EventLogTest.cs
System.Diagnostics/StopwatchTest.cs
System.Diagnostics/SourceSwitchTest.cs
+System.Diagnostics/TextWriterTraceListenerHelper.cs
System.Diagnostics/TextWriterTraceListenerTest.cs
System.Diagnostics/TraceSourceTest.cs
System.Diagnostics/TraceListenerTest.cs
[ExpectedException (typeof (SecurityException))]
public void LinkDemand_IsDefinedExtension_Deny_Anything ()
{
- MethodInfo mi = mi = typeof (CodeDomProvider).GetMethod ("IsDefinedExtension");
+ MethodInfo mi = typeof (CodeDomProvider).GetMethod ("IsDefinedExtension");
Assert.IsNotNull (mi, "IsDefinedExtension");
Assert.IsFalse ((bool) mi.Invoke (null, new object[1] { String.Empty }), "IsDefinedExtension('')");
// requires full trust (i.e. unrestricted permission set)
[ExpectedException (typeof (SecurityException))]
public void LinkDemand_IsDefinedLanguage_Deny_Anything ()
{
- MethodInfo mi = mi = typeof (CodeDomProvider).GetMethod ("IsDefinedLanguage");
+ MethodInfo mi = typeof (CodeDomProvider).GetMethod ("IsDefinedLanguage");
Assert.IsNotNull (mi, "IsDefinedLanguage");
Assert.IsFalse ((bool) mi.Invoke (null, new object[1] { String.Empty }), "IsDefinedLanguage('')");
// requires full trust (i.e. unrestricted permission set)
t = Task.Factory.StartNew (() => {
try {
return BlockingCollection<string>.TakeFromAny (arr, out res, cts.Token);
- } catch (OperationCanceledException WE_GOT_CANCELED) {
+ } catch (OperationCanceledException) {
res = "canceled";
return -10;
}
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void DeserializeTest ()
{
MemoryStream ms = new MemoryStream ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif // TARGET_JVM
public void DeserializeTest ()
{
MemoryStream ms = new MemoryStream ();
}
}
- class InstanceField
+ public class InstanceField
{
public string Name;
}
numbers, (Type) null);
Assert.Fail ("#1");
} catch (ArgumentNullException ex) {
-#if !TARGET_JVM
Assert.AreEqual ("destinationType", ex.ParamName, "#2");
-#endif
}
}
public class CharConverterTest
{
private CharConverter converter;
- private string pattern;
[SetUp]
public void SetUp ()
converter = new CharConverter ();
DateTimeFormatInfo info = CultureInfo.CurrentCulture.DateTimeFormat;
- pattern = info.ShortDatePattern + " " + info.ShortTimePattern;
}
[Test]
container.Add (this);
return container;
}
-
- public Container Container {
- get { return container; }
- }
}
class MyContainer : IContainer
}
[Test]
-#if TARGET_JVM
- [NUnit.Framework.Category("NotWorking")]
-#endif
public void ConvertFrom_String_Flags ()
{
EnumConverter converter = new EnumConverter (typeof (E2));
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7229")]
-#endif
public void Empty ()
{
PropertyDescriptorCollection descriptors = PropertyDescriptorCollection.Empty;
{
#if !MOBILE
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7215, 7216")]
-#endif
public void DefaultType ()
{
ToolboxItemAttribute attr = new ToolboxItemAttribute (true);
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7229")]
-#endif
public void GetProperties ()
{
PropertyDescriptorCollection properties = null;
// This test will fail when there are newer versions
// of the test assemblies - so conditionalize it in
// such cases.
-#if TARGET_JVM
- string expected = "MonoTests.System.Configuration.ProviderPoker, System.Test, Version=0.0.0.0";
-#elif NET_4_5
+#if NET_4_5
string expected = "MonoTests.System.Configuration.ProviderPoker, System_test_net_4_5, Version=0.0.0.0";
#elif NET_4_0
string expected = "MonoTests.System.Configuration.ProviderPoker, System_test_net_4_0, Version=0.0.0.0";
[TestFixture]
public class SettingsBaseTest
{
-#if TARGET_JVM
- class CustomerException : Exception { }
-#endif
class MySettings : SettingsBase
{
[UserScopedSetting] // ignored in non-ApplicationSettingsBase
try {
Assert.AreEqual (100, s.Foo, "#1");
Assert.Fail ("#2");
-#if !TARGET_JVM
} catch (Win32Exception) {
-#else
- } catch (CustomerException) {
-#endif
}
}
{
public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext context, SettingsPropertyCollection props)
{
-#if !TARGET_JVM
throw new Win32Exception (); // unlikely thrown otherwise.
-#else
- throw new CustomerException (); // unlikely thrown otherwise.
-#endif
}
}
ValidateExceptions ("#TAT:BadChildren", "<assert>{0}</assert>", badChildren);
}
+ [Test]
+ [Category ("NotDotNet")]
+ public void PerformanceCountersTag ()
+ {
+ string[] goodAttributes = {
+ "",
+ "filemappingsize=\"1048576\"",
+ "filemappingsize=\"0\""
+ };
+ ValidateSuccess ("#PCT:Good", "<performanceCounters {0}/>", goodAttributes);
+
+ string[] badAttributes = {
+ "FileMappingSize=\"1048576\"",
+ "filemappingsize=\"\"",
+ "filemappingsize=\"non-int-value\""
+ };
+ ValidateExceptions ("#PCT:BadAttrs", "<performanceCounters {0}/>", badAttributes);
+
+ string[] badChildren = {
+ "<any element=\"here\"/>"
+ };
+ ValidateExceptions ("#PCT:BadChildren", "<performanceCounters>{0}</performanceCounters>", badChildren);
+ }
+
[Test]
[Category ("NotDotNet")]
public void TraceTag_Attributes ()
}
}
- int bytesRead = -1;
+ public int bytesRead = -1;
#if NET_2_0
// Not technically a 2.0 only test, but I use lambdas, so I need gmcs
try {
var x = p.Handle;
Assert.Fail ("Handle should throw for unstated procs, but returned " + x);
- } catch (InvalidOperationException ex) {
+ } catch (InvalidOperationException) {
}
}
}
#if !MOBILE
+#define TRACE
+
using NUnit.Framework;
using System;
using System.Text;
[TestFixture]
public class SourceSwitchTest
{
+ internal TraceSource traceSource { get; set; }
+ internal TestTextWriterTraceListener txtTraceListener;
+
+
[Test]
public void ConstructorNullName ()
{
SourceSwitch s = new SourceSwitch (null);
- Assert.IsNull (s.DisplayName);
+ Assert.IsEmpty (s.DisplayName);
}
[Test]
Assert.IsTrue (s.ShouldTrace (TraceEventType.Resume), "#9");
Assert.IsTrue (s.ShouldTrace (TraceEventType.Transfer), "#10");
}
+
+
+ [SetUp]
+ public void InitalizeSourceSwitchTest()
+ {
+ // Initializing the TraceSource instance
+ traceSource = new TraceSource ("LoggingTraceSource");
+ traceSource.Listeners.Remove("Default");
+ traceSource.Switch = new SourceSwitch ("MySwitch");
+
+ // Initializing the TraceListener instance
+ txtTraceListener = new TestTextWriterTraceListener (Console.Out);
+ traceSource.Listeners.Add (txtTraceListener);
+ }
+
+ [Test]
+ public void setSwitchToCritical()
+ {
+ traceSource.Switch.Level = SourceLevels.Critical;
+ LogAllTraceLevels ();
+ // Switch.Level is Critical so it should log Critical
+ Assert.AreEqual (1, txtTraceListener.TotalMessageCount);
+ Assert.AreEqual (1, txtTraceListener.CritialMessageCount);
+ }
+
+ [Test]
+ public void setSwitchToError()
+ {
+ traceSource.Switch.Level = SourceLevels.Error;
+ LogAllTraceLevels ();
+ // Switch.Level is Error so it should log Critical, Error
+ Assert.AreEqual (2, txtTraceListener.TotalMessageCount);
+ Assert.AreEqual (1, txtTraceListener.ErrorMessageCount);
+ }
+
+ [Test]
+ public void setSwitchToWarning()
+ {
+ traceSource.Switch.Level = SourceLevels.Warning;
+ LogAllTraceLevels ();
+ // Switch.Level is Warning so it should log Critical, Error, Warning
+ Assert.AreEqual (3, txtTraceListener.TotalMessageCount);
+ Assert.AreEqual (1, txtTraceListener.WarningMessageCount);
+ }
+
+ [Test]
+ public void setSwitchToInfo()
+ {
+ traceSource.Switch.Level = SourceLevels.Information;
+ LogAllTraceLevels ();
+ // Switch.Level is Information so it should log Critical, Error, Warning, Information
+ Assert.AreEqual (4, txtTraceListener.TotalMessageCount);
+ Assert.AreEqual (1, txtTraceListener.InfoMessageCount);
+ }
+
+ [Test]
+ public void setSwitchToVerbose()
+ {
+ traceSource.Switch.Level = SourceLevels.Verbose;
+ LogAllTraceLevels ();
+ // Switch.Level is Verbose so it should log Critical, Error, Warning, Information, Verbose
+ Assert.AreEqual (5, txtTraceListener.TotalMessageCount);
+ Assert.AreEqual (1, txtTraceListener.VerboseMessageCount);
+ }
+
+ void LogAllTraceLevels ()
+ {
+ traceSource.TraceEvent (TraceEventType.Critical, 123, "Critical Level message.");
+ traceSource.TraceEvent (TraceEventType.Error, 123, "Error Level message.");
+ traceSource.TraceEvent (TraceEventType.Warning, 123, "Warning Level message.");
+ traceSource.TraceEvent (TraceEventType.Information, 123, "Information Level message.");
+ traceSource.TraceEvent (TraceEventType.Verbose, 123, "Verbose Level message.");
+ traceSource.Flush ();
+ }
}
}
}
}
+ class TestNullSwitch : Switch {
+ public TestNullSwitch () : base (null, null)
+ {
+ }
+ }
+
[TestFixture]
public class SwitchesTest {
BooleanSwitch s = new BooleanSwitch ("test", "", "hoge");
Assert.IsTrue (!s.Enabled);
}
+
+ [Test]
+ public void NullSwitchHasEmptyDisplayNameAndDescription ()
+ {
+ var s = new TestNullSwitch ();
+ Assert.IsEmpty (s.DisplayName);
+ Assert.IsEmpty (s.Description);
+ }
#endif
}
}
-#endif
\ No newline at end of file
+#endif
--- /dev/null
+// TextWriterTraceListenerHelper.cs -
+// Test Helper for System.Diagnostics/SourceSwitchTest.cs
+
+//
+// Author:
+// Ramtin Raji Kermani
+//
+// Copyright (C) 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.
+//
+
+#if !MOBILE
+
+using System;
+using System.IO;
+using System.Diagnostics;
+
+namespace MonoTests.System.Diagnostics
+{
+ public class TestTextWriterTraceListener: TextWriterTraceListener
+ {
+ public int TotalMessageCount { set; get;}
+ public int CritialMessageCount { get; set;}
+ public int ErrorMessageCount { get; set;}
+ public int WarningMessageCount { get; set;}
+ public int InfoMessageCount { get; set;}
+ public int VerboseMessageCount { set; get;}
+
+ public TestTextWriterTraceListener(TextWriter textWriter): base(textWriter)
+ {
+ Console.WriteLine ("TextWriterTraceListener is instantiated.");
+ }
+
+
+ public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
+ {
+ base.TraceEvent (eventCache, source, eventType, id, message);
+ TotalMessageCount++;
+
+ switch (eventType) {
+ case TraceEventType.Critical:
+ CritialMessageCount++; break;
+ case TraceEventType.Error:
+ ErrorMessageCount++; break;
+ case TraceEventType.Warning:
+ WarningMessageCount++; break;
+ case TraceEventType.Information:
+ InfoMessageCount++; break;
+ case TraceEventType.Verbose:
+ VerboseMessageCount++; break;
+ default:
+ break;
+ }
+ }
+
+ public void clearMessageCounters()
+ {
+ TotalMessageCount = 0;
+ CritialMessageCount = 0;
+ WarningMessageCount = 0;
+ ErrorMessageCount = 0;
+ InfoMessageCount = 0;
+ VerboseMessageCount = 0;
+ }
+
+ }
+}
+
+#endif
\ No newline at end of file
using System;
using System.IO;
using System.IO.Compression;
+using System.Text;
namespace MonoTests.System.IO.Compression
{
}
}
}
+
+ class Bug19313Stream : MemoryStream
+ {
+ public Bug19313Stream (byte [] buffer)
+ : base (buffer)
+ {
+ }
+
+ public override int Read (byte [] buffer, int offset, int count)
+ {
+ // Thread was blocking when DeflateStream uses a NetworkStream.
+ // Because the NetworkStream.Read calls Socket.Receive that
+ // blocks the thread waiting for at least a byte to return.
+ // This assert guarantees that Read is called only when there
+ // is something to be read.
+ Assert.IsTrue (Position < Length, "Trying to read empty stream.");
+
+ return base.Read (buffer, offset, count);
+ }
+ }
+
+ [Test]
+ public void Bug19313 ()
+ {
+ byte [] buffer = new byte [512];
+ using (var backing = new Bug19313Stream (compressed_data))
+ using (var decompressing = new DeflateStream (backing, CompressionMode.Decompress))
+ decompressing.Read (buffer, 0, buffer.Length);
+ }
+
+ public MemoryStream GenerateStreamFromString(string s)
+ {
+ return new MemoryStream (Encoding.UTF8.GetBytes (s));
+ }
+
+#if NET_4_5
+ [Test]
+ public void CheckNet45Overloads () // Xambug #21982
+ {
+ MemoryStream dataStream = GenerateStreamFromString("Hello");
+ MemoryStream backing = new MemoryStream ();
+ DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
+ CopyStream (dataStream, compressing);
+ dataStream.Close();
+ compressing.Close();
+
+ backing.Seek (0, SeekOrigin.Begin);
+ DeflateStream decompressing = new DeflateStream (backing, CompressionMode.Decompress);
+ StreamReader reader = new StreamReader (decompressing);
+ Assert.AreEqual ("Hello", reader.ReadLine ());
+ decompressing.Close();
+ backing.Close();
+ }
+#endif
}
}
using System;
using System.IO;
using System.IO.Compression;
+using System.Text;
namespace MonoTests.System.IO.Compression
{
0x03, 0x74, 0x65, 0x73, 0x74, 0x00, 0xf3, 0x48, 0xcd,
0xc9, 0xc9, 0xe7, 0x02, 0x00, 0x16, 0x35, 0x96, 0x31,
0x06, 0x00, 0x00, 0x00};
+
+ public MemoryStream GenerateStreamFromString(string s)
+ {
+ return new MemoryStream (Encoding.UTF8.GetBytes (s));
+ }
+
+#if NET_4_5
+ [Test]
+ public void CheckNet45Overloads () // Xambug #21982
+ {
+ MemoryStream dataStream = GenerateStreamFromString("Hello");
+ MemoryStream backing = new MemoryStream ();
+ GZipStream compressing = new GZipStream (backing, CompressionLevel.Fastest, true);
+ CopyStream (dataStream, compressing);
+ dataStream.Close();
+ compressing.Close();
+
+ backing.Seek (0, SeekOrigin.Begin);
+ GZipStream decompressing = new GZipStream (backing, CompressionMode.Decompress);
+ StreamReader reader = new StreamReader (decompressing);
+ Assert.AreEqual ("Hello", reader.ReadLine ());
+ decompressing.Close();
+ backing.Close();
+ }
+#endif
}
}
}
[Test]
- [Category("Test")]
+ [Category("NotWorking")]
public void Connect ()
{
StartServer();
Assert.AreEqual (CFAConnected, false, "ConnectFail");
}
-#if !TARGET_JVM
[Test]
#if !NET_2_0
[ExpectedException (typeof (ArgumentException))]
sock.Close ();
}
}
-#endif
[Test]
public void TestSelect1 ()
{
+++ /dev/null
-// System.Net.Sockets.SocketTest.cs
-//
-// Authors:
-// Brad Fitzpatrick (brad@danga.com)
-// Gonzalo Paniagua Javier (gonzalo@novell.com)
-//
-// (C) Copyright 2003 Brad Fitzpatrick
-// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
-//
-
-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 SocketTest
- {
- // note: also used in SocketCas tests
- public const string BogusAddress = "192.168.244.244";
- public const int BogusPort = 23483;
-
- [Test]
- public void ConnectIPAddressAny ()
- {
- IPEndPoint ep = new IPEndPoint (IPAddress.Any, 0);
-#if !TARGET_JVM
-//udp sockets are not supported
- try {
- using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) {
- s.Connect (ep);
- s.Close ();
- }
- Assert.Fail ("#1");
- } catch (SocketException ex) {
- Assert.AreEqual (10049, ex.ErrorCode, "#2");
- }
-#endif
-
- try {
- using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) {
- s.Connect (ep);
- s.Close ();
- }
- Assert.Fail ("#3");
- } catch (SocketException ex) {
- Assert.AreEqual (10049, ex.ErrorCode, "#4");
- }
- }
-
- [Test]
- [Ignore ("Bug #75158")]
- public void IncompatibleAddress ()
- {
- IPEndPoint epIPv6 = new IPEndPoint (IPAddress.IPv6Any,
- 0);
-
- try {
- using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP)) {
- s.Connect (epIPv6);
- s.Close ();
- }
- Assert.Fail ("#1");
- } catch (SocketException ex) {
-#if !NET_2_0
- // invalid argument
- int expectedError = 10022;
-#else
- // address incompatible with protocol
- int expectedError = 10047;
-#endif
- Assert.AreEqual (expectedError, ex.ErrorCode,
- "#2");
- }
- }
-
- [Test]
- [Category ("InetAccess")]
- public void EndConnect ()
- {
- IPAddress ipOne = IPAddress.Parse (BogusAddress);
- IPEndPoint ipEP = new IPEndPoint (ipOne, BogusPort);
- Socket sock = new Socket (ipEP.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
- IAsyncResult ar = sock.BeginConnect (ipEP, null, null);
- bool gotException = false;
-
- try {
- sock.EndConnect (ar); // should raise an exception because connect was bogus
- } catch {
- gotException = true;
- }
-
- Assertion.AssertEquals ("A01", gotException, true);
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentNullException))]
- public void SelectEmpty ()
- {
- ArrayList list = new ArrayList ();
- Socket.Select (list, list, list, 1000);
- }
-
- private bool BlockingConnect (bool block)
- {
- IPEndPoint ep = new IPEndPoint(IPAddress.Loopback, 1234);
- Socket server = new Socket(AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- server.Bind(ep);
- server.Blocking=block;
-
- server.Listen(0);
-
- Socket conn = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- conn.Connect (ep);
-
- Socket client = server.Accept();
- bool client_block = client.Blocking;
-
- client.Close();
- conn.Close();
- server.Close();
-
- return(client_block);
- }
-
- [Test]
- public void AcceptBlockingStatus()
- {
- bool block;
-
- block = BlockingConnect(true);
- Assertion.AssertEquals ("BlockingStatus01",
- block, true);
-
- block = BlockingConnect(false);
- Assertion.AssertEquals ("BlockingStatus02",
- block, false);
- }
-
- static bool CFAConnected = false;
- static ManualResetEvent CFACalledBack;
-
- private static void CFACallback (IAsyncResult asyncResult)
- {
- Socket sock = (Socket)asyncResult.AsyncState;
- CFAConnected = sock.Connected;
-
- if (sock.Connected) {
- sock.EndConnect (asyncResult);
- }
-
- CFACalledBack.Set ();
- }
-
- [Test]
- public void ConnectFailAsync ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- sock.Blocking = false;
- CFACalledBack = new ManualResetEvent (false);
- CFACalledBack.Reset ();
-
- /* Need a port that is not being used for
- * anything...
- */
- sock.BeginConnect (new IPEndPoint (IPAddress.Loopback,
- 114),
- new AsyncCallback (CFACallback),
- sock);
- CFACalledBack.WaitOne ();
-
- Assertion.AssertEquals ("ConnectFail", CFAConnected,
- false);
- }
-
-#if !TARGET_JVM
- [Test]
-#if !NET_2_0
- [ExpectedException (typeof (ArgumentException))]
-#endif
- public void SetSocketOptionBoolean ()
- {
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 1);
- Socket sock = new Socket (ep.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
- try {
- sock.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
- } finally {
- sock.Close ();
- }
- }
-#endif
- [Test]
-#if TARGET_JVM
- [Ignore ("NMA")]
-#endif
- public void TestSelect1 ()
- {
- Socket srv = CreateServer ();
- ClientSocket clnt = new ClientSocket (srv.LocalEndPoint);
- Thread th = new Thread (new ThreadStart (clnt.ConnectSleepClose));
- Socket acc = null;
- try {
- th.Start ();
- acc = srv.Accept ();
- clnt.Write ();
- ArrayList list = new ArrayList ();
- ArrayList empty = new ArrayList ();
- list.Add (acc);
- Socket.Select (list, empty, empty, 100);
- Assertion.AssertEquals ("#01", 0, empty.Count);
- Assertion.AssertEquals ("#02", 1, list.Count);
- Socket.Select (empty, list, empty, 100);
- Assertion.AssertEquals ("#03", 0, empty.Count);
- Assertion.AssertEquals ("#04", 1, list.Count);
- Socket.Select (list, empty, empty, -1);
- Assertion.AssertEquals ("#05", 0, empty.Count);
- Assertion.AssertEquals ("#06", 1, list.Count);
- } finally {
- if (acc != null)
- acc.Close ();
- srv.Close ();
- }
- }
-
- static Socket CreateServer ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- sock.Bind (new IPEndPoint (IPAddress.Loopback, 0));
- sock.Listen (1);
- return sock;
- }
-
- class ClientSocket {
- Socket sock;
- EndPoint ep;
-
- public ClientSocket (EndPoint ep)
- {
- this.ep = ep;
- sock = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- }
-
- public void ConnectSleepClose ()
- {
- sock.Connect (ep);
- Thread.Sleep (2000);
- sock.Close ();
- }
-
- public void Write ()
- {
- byte [] b = new byte [10];
- sock.Send (b);
- }
- }
-
- byte[] buf = new byte[100];
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed1 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.ReceiveFrom (buf, ref ep);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed2 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Blocking = true;
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed3 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.GetSocketOption (0, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed4 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.GetSocketOption (0, 0, null);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed5 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.GetSocketOption (0, 0, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed6 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Listen (5);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed7 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Poll (100, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed8 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Receive (buf);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed9 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Receive (buf, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed10 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Receive (buf, 10, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed11 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.Receive (buf, 0, 10, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed12 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.ReceiveFrom (buf, 0, ref ep);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed13 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.ReceiveFrom (buf, 10, 0, ref ep);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed14 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.ReceiveFrom (buf, 0, 10, 0, ref ep);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed15 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Send (buf);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed16 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Send (buf, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed17 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- s.Close();
-
- s.Send (buf, 10, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed18 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.Send (buf, 0, 10, 0);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed19 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.SendTo (buf, 0, ep);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed20 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.SendTo (buf, 10, 0, ep);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed21 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint(IPAddress.Any, 31337);
- s.Close();
-
- s.SendTo(buf, 0, 10, 0, ep);
-
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed22 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.SendTo (buf, ep);
- }
-
- [Test]
- [ExpectedException (typeof (ObjectDisposedException))]
- public void Disposed23 ()
- {
-#if TARGET_JVM
- //UDP sockets are not supported in GH
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-#else
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-#endif
- EndPoint ep = new IPEndPoint (IPAddress.Any, 31337);
- s.Close();
-
- s.Shutdown (0);
- }
-
- static ManualResetEvent SocketError_event = new ManualResetEvent (false);
-
- private static void SocketError_callback (IAsyncResult ar)
- {
- Socket sock = (Socket)ar.AsyncState;
-
- if(sock.Connected) {
- sock.EndConnect (ar);
- }
-
- SocketError_event.Set ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("NMA")]
-#endif
- public void SocketError ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- BogusPort);
-
- SocketError_event.Reset ();
-
- sock.Blocking = false;
- sock.BeginConnect (ep, SocketError_callback,
- sock);
-
- if (SocketError_event.WaitOne (2000, false) == false) {
- Assert.Fail ("SocketError wait timed out");
- }
-
- Assertion.AssertEquals ("SocketError #1", false,
- sock.Connected);
-
- int error;
-
- error = (int)sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
- Assertion.AssertEquals ("SocketError #2", 10061,
- error);
-
- error = (int)sock.GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Error);
- Assertion.AssertEquals ("SocketError #3", 10061,
- error);
-
- sock.Close ();
- }
-
-
-#if NET_2_0
- [Test]
- public void SocketInformationCtor ()
- {
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("Socket.DontFragment property is not supported")]
-#endif
- public void DontFragmentDefaultTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- Assertion.AssertEquals ("DontFragmentDefaultTcp",
- false, sock.DontFragment);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("Socket.DontFragment property is not supported")]
-#endif
- public void DontFragmentChangeTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.DontFragment = true;
-
- Assertion.AssertEquals ("DontFragmentChangeTcp",
- true, sock.DontFragment);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("Socket.DontFragment property is not supported")]
-#endif
- public void DontFragmentDefaultUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- Assertion.AssertEquals ("DontFragmentDefaultUdp",
- false, sock.DontFragment);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("Socket.DontFragment property is not supported")]
-#endif
- public void DontFragmentChangeUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- sock.DontFragment = true;
-
- Assertion.AssertEquals ("DontFragmentChangeUdp",
- true, sock.DontFragment);
-
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("Socket.DontFragment property is not supported")]
-#endif
- public void DontFragmentClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- bool val = sock.DontFragment;
- }
-
- [Test]
- [Category ("NotWorking")] // Need to pick a non-IP AddressFamily that "works" on both mono and ms, this one only works on ms
- public void DontFragment ()
- {
- Socket sock = new Socket (AddressFamily.NetBios,
- SocketType.Seqpacket,
- ProtocolType.Unspecified);
-
- try {
- sock.DontFragment = true;
- Assert.Fail ("DontFragment #1");
- } catch (NotSupportedException) {
- } catch {
- Assert.Fail ("DontFragment #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.EnableBroadcast property is not supported")]
-#endif
- public void EnableBroadcastDefaultTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- try {
- bool value = sock.EnableBroadcast;
- Assert.Fail ("EnableBroadcastDefaultTcp #1");
- } catch (SocketException ex) {
- Assert.AreEqual (10042, ex.ErrorCode, "EnableBroadcastDefaultTcp #2");
- } catch {
- Assert.Fail ("EnableBroadcastDefaultTcp #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.EnableBroadcast property is not supported")]
-#endif
- public void EnableBroadcastDefaultUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- Assertion.AssertEquals ("EnableBroadcastDefaultUdp",
- false, sock.EnableBroadcast);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.EnableBroadcast property is not supported")]
-#endif
- public void EnableBroadcastChangeTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- try {
- sock.EnableBroadcast = true;
- Assert.Fail ("EnableBroadcastChangeTcp #1");
- } catch (SocketException ex) {
- Assert.AreEqual (10042, ex.ErrorCode, "EnableBroadcastChangeTcp #2");
- } catch {
- Assert.Fail ("EnableBroadcastChangeTcp #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.EnableBroadcast property is not supported")]
-#endif
- public void EnableBroadcastChangeUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- sock.EnableBroadcast = true;
-
- Assertion.AssertEquals ("EnableBroadcastChangeUdp",
- true, sock.EnableBroadcast);
-
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.EnableBroadcast property is not supported")]
-#endif
- public void EnableBroadcastClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- sock.Close ();
-
- bool val = sock.EnableBroadcast;
- }
-
- /* Can't test the default for ExclusiveAddressUse as
- * it's different on different versions and service
- * packs of windows
- */
- [Test]
- [Category ("NotWorking")] // Not supported on Linux
- public void ExclusiveAddressUseUnbound ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.ExclusiveAddressUse = true;
-
- Assertion.AssertEquals ("ExclusiveAddressUseUnbound",
- true,
- sock.ExclusiveAddressUse);
-
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(InvalidOperationException))]
- [Category ("NotWorking")] // Not supported on Linux
- public void ExclusiveAddressUseBound ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Bind (new IPEndPoint (IPAddress.Any, 1235));
- sock.ExclusiveAddressUse = true;
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.ExclusiveAddressUse is not supported")]
-#endif
- public void ExclusiveAddressUseClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- bool val = sock.ExclusiveAddressUse;
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.IsBound property isn't supported")]
-#endif
- public void IsBoundTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- BogusPort);
-
- Assertion.AssertEquals ("IsBoundTcp #1", false,
- sock.IsBound);
-
- sock.Bind (ep);
- Assertion.AssertEquals ("IsBoundTcp #2", true,
- sock.IsBound);
-
- sock.Listen (1);
-
- Socket sock2 = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- Assertion.AssertEquals ("IsBoundTcp #3", false,
- sock2.IsBound);
-
- sock2.Connect (ep);
- Assertion.AssertEquals ("IsBoundTcp #4", true,
- sock2.IsBound);
-
- sock2.Close ();
- Assertion.AssertEquals ("IsBoundTcp #5", true,
- sock2.IsBound);
-
- sock.Close ();
- Assertion.AssertEquals ("IsBoundTcp #6", true,
- sock.IsBound);
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.IsBound property isn't supported")]
-#endif
- public void IsBoundUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- BogusPort);
-
- Assertion.AssertEquals ("IsBoundUdp #1", false,
- sock.IsBound);
-
- sock.Bind (ep);
- Assertion.AssertEquals ("IsBoundUdp #2", true,
- sock.IsBound);
-
- sock.Close ();
- Assertion.AssertEquals ("IsBoundUdp #3", true,
- sock.IsBound);
-
-
- sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- Assertion.AssertEquals ("IsBoundUdp #4", false,
- sock.IsBound);
-
- sock.Connect (ep);
- Assertion.AssertEquals ("IsBoundUdp #5", true,
- sock.IsBound);
-
- sock.Close ();
- Assertion.AssertEquals ("IsBoundUdp #6", true,
- sock.IsBound);
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.IsBound property is not supported")]
-#endif
- /* Should not throw an exception */
- public void IsBoundClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- bool val = sock.IsBound;
- }
-
- /* Nothing much to test for LingerState */
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.MulticastLoopback property is not supported")]
-#endif
- public void MulticastLoopbackDefaultTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- try {
- bool value = sock.MulticastLoopback;
- Assert.Fail ("MulticastLoopbackDefaultTcp #1");
- } catch (SocketException ex) {
- Assert.AreEqual (10042, ex.ErrorCode, "MulticastLoopbackDefaultTcp #2");
- } catch {
- Assert.Fail ("MulticastLoopbackDefaultTcp #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.MulticastLoopback property is not supported")]
-#endif
- public void MulticastLoopbackChangeTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- try {
- sock.MulticastLoopback = false;
- Assert.Fail ("MulticastLoopbackChangeTcp #1");
- } catch (SocketException ex) {
- Assert.AreEqual (10042, ex.ErrorCode, "MulticastLoopbackChangeTcp #2");
- } catch {
- Assert.Fail ("MulticastLoopbackChangeTcp #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("Udp sockets are not supported")]
-#endif
- public void MulticastLoopbackDefaultUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- Assertion.AssertEquals ("MulticastLoopbackDefaultUdp",
- true, sock.MulticastLoopback);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("Udp sockets are not supported")]
-#endif
- public void MulticastLoopbackChangeUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- sock.MulticastLoopback = false;
-
- Assertion.AssertEquals ("MulticastLoopbackChangeUdp",
- false, sock.MulticastLoopback);
-
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.MulticastLoopback property is not supported")]
-#endif
- public void MulticastLoopbackClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- bool val = sock.MulticastLoopback;
- }
-
- /* OSSupportsIPv6 depends on the environment */
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.ReseiveBufferSize property is not supported")]
-#endif
- public void ReceiveBufferSizeDefault ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- Assertion.AssertEquals ("ReceiveBufferSizeDefault",
- 8192, sock.ReceiveBufferSize);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.ReseiveBufferSize property is not supported")]
-#endif
- public void ReceiveBufferSizeDefaultUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- Assertion.AssertEquals ("ReceiveBufferSizeDefaultUdp",
- 8192, sock.ReceiveBufferSize);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.ReseiveBufferSize property is not supported")]
-#endif
- public void ReceiveBufferSizeChange ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.ReceiveBufferSize = 16384;
-
- Assertion.AssertEquals ("ReceiveBufferSizeChange",
- 16384, sock.ReceiveBufferSize);
-
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.ReseiveBufferSize property is not supported")]
-#endif
- public void ReceiveBufferSizeClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- int val = sock.ReceiveBufferSize;
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.SendBufferSize property is not supported")]
-#endif
- public void SendBufferSizeDefault ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- Assertion.AssertEquals ("SendBufferSizeDefault",
- 8192, sock.SendBufferSize);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.SendBufferSize property is not supported")]
-#endif
- public void SendBufferSizeDefaultUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- Assertion.AssertEquals ("SendBufferSizeDefaultUdp",
- 8192, sock.SendBufferSize);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.SendBufferSize property is not supported")]
-#endif
- public void SendBufferSizeChange ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.SendBufferSize = 16384;
-
- Assertion.AssertEquals ("SendBufferSizeChange",
- 16384, sock.SendBufferSize);
-
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.SendBufferSize property is not supported")]
-#endif
- public void SendBufferSizeClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- int val = sock.SendBufferSize;
- }
-
- /* No test for TTL default as it's platform dependent */
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Ttl property is not supported")]
-#endif
- public void TtlChange ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Ttl = 255;
-
- Assertion.AssertEquals ("TtlChange", 255, sock.Ttl);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Ttl property is not supported")]
-#endif
- public void TtlChangeOverflow ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- try {
- sock.Ttl = 256;
- Assert.Fail ("TtlChangeOverflow #1");
- } catch (SocketException ex) {
- Assert.AreEqual (10022, ex.ErrorCode,
- "TtlChangeOverflow #2");
- } catch {
- Assert.Fail ("TtlChangeoverflow #3");
- } finally {
- sock.Close ();
- }
- }
-
-/* Apparently you can set TTL=0 on the ms runtime!!
- try {
- sock.Ttl = 0;
- Assert.Fail ("TtlChangeOverflow #4");
- } catch (SocketException ex) {
- Assert.AreEqual (10022, ex.ErrorCode,
- "TtlChangeOverflow #5");
- } catch {
- Assert.Fail ("TtlChangeOverflow #6");
- } finally {
- sock.Close ();
- }
-*/
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Ttl property is not supported")]
-#endif
- public void TtlClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- int val = sock.Ttl;
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.UseOnlyOverlappedIO property is not supported")]
-#endif
- public void UseOnlyOverlappedIODefault ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- Assertion.AssertEquals ("UseOnlyOverlappedIODefault",
- false,
- sock.UseOnlyOverlappedIO);
-
- sock.Close ();
- }
-
- //
- // We need this because the Linux kernel in certain configurations
- // will end up rounding up the values passed on to the kernel
- // for socket send/receive timeouts.
- //
- int Approximate (int target, int value)
- {
- int epsilon = 10;
-
- if (value > target-10 && value < target+10)
- return target;
- return value;
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.UseOnlyOverlappedIO property is not supported")]
-#endif
- public void UseOnlyOverlappedIOChange ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.UseOnlyOverlappedIO = true;
-
- Assertion.AssertEquals ("UseOnlyOverlappedIOChange",
- true,
- sock.UseOnlyOverlappedIO);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.UseOnlyOverlappedIO property is not supported")]
-#endif
- /* Should not throw an exception */
- public void UseOnlyOverlappedIOClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- bool val = sock.UseOnlyOverlappedIO;
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.SendTimeout property is not supported")]
-#endif
- public void SendTimeoutDefault ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- Assertion.AssertEquals ("SendTimeoutDefault",
- 0, sock.SendTimeout);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.SendTimeout property is not supported")]
-#endif
- public void SendTimeoutChange ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- /* Should be rounded up to 500, according to
- * the MSDN docs, but the MS runtime doesn't
- */
- sock.SendTimeout = 50;
- Assertion.AssertEquals ("SendTimeoutChange #1",
- 50, Approximate (50, sock.SendTimeout));
-
- sock.SendTimeout = 2000;
- Assertion.AssertEquals ("SendTimeoutChange #2",
- 2000, Approximate (2000, sock.SendTimeout));
-
- sock.SendTimeout = 0;
- Assertion.AssertEquals ("SendTimeoutChange #3",
- 0, Approximate (0, sock.SendTimeout));
-
- /* Should be the same as setting 0 */
- sock.SendTimeout = -1;
- Assertion.AssertEquals ("SendTimeoutChange #4",
- 0, sock.SendTimeout);
-
- sock.SendTimeout = 65536;
- Assertion.AssertEquals ("SendTimeoutChange #5",
- 65536, Approximate (65536, sock.SendTimeout));
-
- try {
- sock.SendTimeout = -2;
- Assert.Fail ("SendTimeoutChange #8");
- } catch (ArgumentOutOfRangeException) {
- } catch {
- Assert.Fail ("SendTimeoutChange #9");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.SendTimeout property is not supported")]
-#endif
- public void SendTimeoutClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- int val = sock.SendTimeout;
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.ReceiveTimeout property is not supported")]
-#endif
- public void ReceiveTimeoutDefault ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- Assertion.AssertEquals ("ReceiveTimeoutDefault",
- 0, sock.ReceiveTimeout);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.ReceiveTimeout property is not supported")]
-#endif
- public void ReceiveTimeoutChange ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.ReceiveTimeout = 50;
- Assertion.AssertEquals ("ReceiveTimeoutChange #1",
- 50, Approximate (50, sock.ReceiveTimeout));
-
- sock.ReceiveTimeout = 2000;
- Assertion.AssertEquals ("ReceiveTimeoutChange #2",
- 2000, Approximate (2000, sock.ReceiveTimeout));
-
- sock.ReceiveTimeout = 0;
- Assertion.AssertEquals ("ReceiveTimeoutChange #3",
- 0, sock.ReceiveTimeout);
-
- /* Should be the same as setting 0 */
- sock.ReceiveTimeout = -1;
- Assertion.AssertEquals ("ReceiveTimeoutChange #4",
- 0, sock.ReceiveTimeout);
-
- sock.ReceiveTimeout = 65536;
- Assertion.AssertEquals ("ReceiveTimeoutChange #5",
- 65536, Approximate (65536, sock.ReceiveTimeout));
-
- try {
- sock.ReceiveTimeout = -2;
- Assert.Fail ("ReceiveTimeoutChange #8");
- } catch (ArgumentOutOfRangeException) {
- } catch {
- Assert.Fail ("ReceiveTimeoutChange #9");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.ReceiveTimeout property is not supported")]
-#endif
- public void ReceiveTimeoutClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- int val = sock.ReceiveTimeout;
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.NoDelay property is not supported")]
-#endif
- public void NoDelayDefaultTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- Assertion.AssertEquals ("NoDelayDefaultTcp", false,
- sock.NoDelay);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.NoDelay property is not supported")]
-#endif
- public void NoDelayChangeTcp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.NoDelay = true;
-
- Assertion.AssertEquals ("NoDelayChangeTcp", true,
- sock.NoDelay);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.NoDelay property is not supported")]
-#endif
- public void NoDelayDefaultUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- try {
- bool val = sock.NoDelay;
- Assert.Fail ("NoDelayDefaultUdp #1");
- } catch (SocketException ex) {
- Assert.AreEqual (10042, ex.ErrorCode,
- "NoDelayDefaultUdp #2");
- } catch {
- Assert.Fail ("NoDelayDefaultUdp #3");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.NoDelay property is not supported")]
-#endif
- public void NoDelayChangeUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- try {
- sock.NoDelay = true;
- Assert.Fail ("NoDelayChangeUdp #1");
- } catch (SocketException ex) {
- Assert.AreEqual (10042, ex.ErrorCode,
- "NoDelayChangeUdp #2");
- } catch {
- Assert.Fail ("NoDelayChangeUdp #3");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.NoDelay property is not supported")]
-#endif
- public void NoDelayClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- bool val = sock.NoDelay;
- }
-
- static bool BAAccepted = false;
- static Socket BASocket = null;
- static ManualResetEvent BACalledBack = new ManualResetEvent (false);
-
- private static void BACallback (IAsyncResult asyncResult)
- {
- Socket sock = (Socket)asyncResult.AsyncState;
-
- BASocket = sock.EndAccept (asyncResult);
-
- BAAccepted = true;
- BACalledBack.Set ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("NMA")]
-#endif
- [ExpectedException (typeof(InvalidOperationException))]
- public void BeginAcceptNotBound ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.BeginAccept (BACallback, sock);
-
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("NMA")]
-#endif
- [ExpectedException (typeof(InvalidOperationException))]
- public void BeginAcceptNotListening ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Bind (new IPEndPoint (IPAddress.Any, 1236));
-
- sock.BeginAccept (BACallback, sock);
-
- sock.Close ();
- }
-
- [Test]
- public void BeginAccept ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1237);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- BACalledBack.Reset ();
-
- sock.BeginAccept (BACallback, sock);
-
- Socket conn = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- conn.Connect (ep);
-
- if (BACalledBack.WaitOne (2000, false) == false) {
- Assert.Fail ("BeginAccept wait timed out");
- }
-
- Assertion.AssertEquals ("BeginAccept #1", true,
- BAAccepted);
- Assertion.AssertEquals ("BeginAccept #2", true,
- BASocket.Connected);
- Assertion.AssertEquals ("BeginAccept #3", false,
- sock.Connected);
- Assertion.AssertEquals ("BeginAccept #4", true,
- conn.Connected);
-
- BASocket.Close ();
- conn.Close ();
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
- public void BeginAcceptClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- sock.BeginAccept (BACallback, sock);
- }
-
- static bool BADAccepted = false;
- static Socket BADSocket = null;
- static byte[] BADBytes;
- static int BADByteCount;
- static ManualResetEvent BADCalledBack = new ManualResetEvent (false);
-
- private static void BADCallback (IAsyncResult asyncResult)
- {
-#if !TARGET_JVM
- Socket sock = (Socket)asyncResult.AsyncState;
-
- BADSocket = sock.EndAccept (out BADBytes,
- out BADByteCount,
- asyncResult);
-
- BADAccepted = true;
- BADCalledBack.Set ();
-#endif
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.BeginAccept(int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginAcceptData ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1238);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- BADCalledBack.Reset ();
-
- sock.BeginAccept (256, BADCallback, sock);
-
- Socket conn = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- byte[] send_bytes = new byte[] {10, 11, 12, 13};
-
- conn.Connect (ep);
- conn.Send (send_bytes);
-
- if (BADCalledBack.WaitOne (2000, false) == false) {
- Assert.Fail ("BeginAcceptData wait timed out");
- }
-
- Assertion.AssertEquals ("BeginAcceptData #1", true,
- BADAccepted);
- Assertion.AssertEquals ("BeginAcceptData #2", true,
- BADSocket.Connected);
- Assertion.AssertEquals ("BeginAcceptData #3", false,
- sock.Connected);
- Assertion.AssertEquals ("BeginAcceptData #4", true,
- conn.Connected);
- Assertion.AssertEquals ("BeginAcceptData #5",
- send_bytes.Length,
- BADByteCount);
-
- /* The MS runtime gives the returned data in a
- * much bigger array. TODO: investigate
- * whether it the size correlates to the first
- * parameter in BeginAccept()
- */
- Assert.IsFalse (BADBytes.Length == send_bytes.Length,
- "BeginAcceptData #6");
-
- for(int i = 0; i < send_bytes.Length; i++) {
- Assertion.AssertEquals ("BeginAcceptData #" + (i+7).ToString (), send_bytes[i], BADBytes[i]);
- }
-
- BADSocket.Close ();
- conn.Close ();
- sock.Close ();
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginAccept(int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginAcceptDataClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- sock.BeginAccept (256, BADCallback, sock);
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginAccept(Socket,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginAcceptSocketUdp ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket acc = new Socket (AddressFamily.InterNetwork,
- SocketType.Dgram,
- ProtocolType.Udp);
-
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1239);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- try {
- sock.BeginAccept (acc, 256, BADCallback, sock);
- Assert.Fail ("BeginAcceptSocketUdp #1");
- } catch (SocketException ex) {
- Assertion.AssertEquals ("BeginAcceptSocketUdp #2", 10022, ex.ErrorCode);
- } catch {
- Assert.Fail ("BeginAcceptSocketUdp #3");
- } finally {
- acc.Close ();
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginAccept(Socket,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginAcceptSocketBound ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket acc = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- IPEndPoint ep1 = new IPEndPoint (IPAddress.Loopback,
- 1240);
-
- IPEndPoint ep2 = new IPEndPoint (IPAddress.Loopback,
- 1241);
-
- sock.Bind (ep1);
- sock.Listen (1);
-
- acc.Bind (ep2);
-
- try {
- sock.BeginAccept (acc, 256, BADCallback, sock);
- Assert.Fail ("BeginAcceptSocketBound #1");
- } catch (InvalidOperationException) {
- } catch {
- Assert.Fail ("BeginAcceptSocketBound #2");
- } finally {
- acc.Close ();
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginAccept(Socket,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginAcceptSocket ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket acc = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1242);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- BADCalledBack.Reset ();
-
- sock.BeginAccept (acc, 256, BADCallback, sock);
-
- Socket conn = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- byte[] send_bytes = new byte[] {10, 11, 12, 13};
-
- conn.Connect (ep);
- conn.Send (send_bytes);
-
- if (BADCalledBack.WaitOne (2000, false) == false) {
- Assert.Fail ("BeginAcceptSocket wait timed out");
- }
-
- Assertion.AssertEquals ("BeginAcceptSocket #1", true,
- BADAccepted);
- Assertion.AssertEquals ("BeginAcceptSocket #2", true,
- BADSocket.Connected);
- Assertion.AssertEquals ("BeginAcceptSocket #3", false,
- sock.Connected);
- Assertion.AssertEquals ("BeginAcceptSocket #4", true,
- conn.Connected);
- Assertion.AssertEquals ("BeginAcceptSocket #5",
- send_bytes.Length,
- BADByteCount);
- Assertion.AssertEquals ("BeginAcceptSocket #6",
- AddressFamily.InterNetwork,
- acc.AddressFamily);
- Assertion.AssertEquals ("BeginAcceptSocket #7",
- SocketType.Stream,
- acc.SocketType);
- Assertion.AssertEquals ("BeginAcceptSocket #8",
- ProtocolType.Tcp,
- acc.ProtocolType);
- Assertion.AssertEquals ("BeginAcceptSocket #9",
- conn.LocalEndPoint,
- acc.RemoteEndPoint);
-
- /* The MS runtime gives the returned data in a
- * much bigger array. TODO: investigate
- * whether it the size correlates to the first
- * parameter in BeginAccept()
- */
- Assert.IsFalse (BADBytes.Length == send_bytes.Length,
- "BeginAcceptSocket #10");
-
- for(int i = 0; i < send_bytes.Length; i++) {
- Assertion.AssertEquals ("BeginAcceptSocket #" + (i+11).ToString (), send_bytes[i], BADBytes[i]);
- }
-
- BADSocket.Close ();
- conn.Close ();
- acc.Close ();
- sock.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginAccept(Socket,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginAcceptSocketClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket acc = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- try {
- sock.BeginAccept (acc, 256, BADCallback, null);
- Assert.Fail ("BeginAcceptSocketClosed #1");
- } catch (ObjectDisposedException) {
- } catch {
- Assert.Fail ("BeginAcceptSocketClosed #2");
- } finally {
- acc.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginAccept(Socket,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginAcceptSocketAccClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket acc = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1243);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- acc.Close ();
-
- BADCalledBack.Reset ();
-
- try {
- sock.BeginAccept (acc, 256, BADCallback, null);
- Assert.Fail ("BeginAcceptSocketAccClosed #1");
- } catch (ObjectDisposedException) {
- } catch {
- Assert.Fail ("BeginAcceptSocketAccClosed #2");
- } finally {
- sock.Close ();
- }
- }
-
- static bool BCConnected = false;
- static ManualResetEvent BCCalledBack = new ManualResetEvent (false);
-
- private static void BCCallback (IAsyncResult asyncResult)
- {
- Socket sock = (Socket)asyncResult.AsyncState;
-
- sock.EndConnect (asyncResult);
- BCConnected = true;
-
- BCCalledBack.Set ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectAddressPort ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket listen = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
- IPEndPoint ep = new IPEndPoint (ip, 1244);
-
- listen.Bind (ep);
- listen.Listen (1);
-
- BCCalledBack.Reset ();
-
- BCConnected = false;
-
- sock.BeginConnect (ip, 1244, BCCallback, sock);
-
- if (BCCalledBack.WaitOne (2000, false) == false) {
- Assert.Fail ("BeginConnectAddressPort wait timed out");
- }
-
- Assertion.AssertEquals ("BeginConnectAddressPort #1",
- true, BCConnected);
-
- sock.Close ();
- listen.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectAddressPortNull ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = null;
-
- try {
- sock.BeginConnect (ip, 1244, BCCallback,
- sock);
- Assert.Fail ("BeginConnectAddressPortNull #1");
- } catch (ArgumentNullException) {
- } catch {
- Assert.Fail ("BeginConnectAddressPortNull #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectAddressPortListen ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
- IPEndPoint ep = new IPEndPoint (ip, 1245);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- try {
- sock.BeginConnect (ip, 1245, BCCallback, sock);
- Assert.Fail ("BeginConnectAddressPortListen #1");
- } catch (InvalidOperationException) {
- } catch {
- Assert.Fail ("BeginConnectAddressPortListen #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectAddressPortClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
-
- sock.Close ();
-
- sock.BeginConnect (ip, 1244, BCCallback, sock);
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress[],int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectMultiple ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket listen = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1246);
- IPAddress[] ips = new IPAddress[4];
-
- ips[0] = IPAddress.Parse ("127.0.0.4");
- ips[1] = IPAddress.Parse ("127.0.0.3");
- ips[2] = IPAddress.Parse ("127.0.0.2");
- ips[3] = IPAddress.Parse ("127.0.0.1");
-
- listen.Bind (ep);
- listen.Listen (1);
-
- BCCalledBack.Reset ();
-
- BCConnected = false;
-
- sock.BeginConnect (ips, 1246, BCCallback, sock);
-
- /* Longer wait here, because the ms runtime
- * takes a lot longer to not connect
- */
- if (BCCalledBack.WaitOne (10000, false) == false) {
- Assert.Fail ("BeginConnectMultiple wait failed");
- }
-
- Assertion.AssertEquals ("BeginConnectMultiple #1",
- true, BCConnected);
- Assertion.AssertEquals ("BeginConnectMultiple #2",
- AddressFamily.InterNetwork,
- sock.RemoteEndPoint.AddressFamily);
- IPEndPoint remep = (IPEndPoint)sock.RemoteEndPoint;
-
- Assertion.AssertEquals ("BeginConnectMultiple #2",
- IPAddress.Loopback,
- remep.Address);
-
- sock.Close ();
- listen.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress[],int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectMultipleNull ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress[] ips = null;
-
- try {
- sock.BeginConnect (ips, 1246, BCCallback,
- sock);
- Assert.Fail ("BeginConnectMultipleNull #1");
- } catch (ArgumentNullException) {
- } catch {
- Assert.Fail ("BeginConnectMultipleNull #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress[],int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectMultipleListen ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress[] ips = new IPAddress[4];
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1247);
-
- ips[0] = IPAddress.Parse ("127.0.0.4");
- ips[1] = IPAddress.Parse ("127.0.0.3");
- ips[2] = IPAddress.Parse ("127.0.0.2");
- ips[3] = IPAddress.Parse ("127.0.0.1");
-
- sock.Bind (ep);
- sock.Listen (1);
-
- try {
- sock.BeginConnect (ips, 1247, BCCallback,
- sock);
- Assert.Fail ("BeginConnectMultipleListen #1");
- } catch (InvalidOperationException) {
- } catch {
- Assert.Fail ("BeginConnectMultipleListen #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress[],int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectMultipleClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress[] ips = new IPAddress[4];
-
- ips[0] = IPAddress.Parse ("127.0.0.4");
- ips[1] = IPAddress.Parse ("127.0.0.3");
- ips[2] = IPAddress.Parse ("127.0.0.2");
- ips[3] = IPAddress.Parse ("127.0.0.1");
-
- sock.Close ();
-
- sock.BeginConnect (ips, 1247, BCCallback, sock);
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(IPAddress,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectHostPortNull ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- try {
- sock.BeginConnect ((string)null, 0,
- BCCallback, sock);
- Assert.Fail ("BeginConnectHostPort #1");
- } catch (ArgumentNullException) {
- } catch {
- Assert.Fail ("BeginConnectHostPort #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(string,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectHostPortListen ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
- IPEndPoint ep = new IPEndPoint (ip, 1248);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- try {
- sock.BeginConnect ("localhost", 1248,
- BCCallback, sock);
- Assert.Fail ("BeginConnectHostPortListen #1");
- } catch (InvalidOperationException) {
- } catch {
- Assert.Fail ("BeginConnectHostPortListen #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [Category ("NotWorking")] // Need to pick a non-IP AddressFamily that "works" on both mono and ms, this one only works on ms
- public void BeginConnectHostPortNotIP ()
- {
- Socket sock = new Socket (AddressFamily.NetBios,
- SocketType.Seqpacket,
- ProtocolType.Unspecified);
-
- try {
- sock.BeginConnect ("localhost", 0, BCCallback,
- sock);
- Assert.Fail ("BeginConnectHostPortNotIP #1");
- } catch (NotSupportedException) {
- } catch {
- Assert.Fail ("BeginConnectHostPortNotIP #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginConnect(string,int,AsyncCallback,object) is not supported")]
-#endif
- public void BeginConnectHostPortClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- sock.BeginConnect ("localhost", 0, BCCallback, sock);
- }
-
- static bool BDDisconnected = false;
- static ManualResetEvent BDCalledBack = new ManualResetEvent (false);
-
- private static void BDCallback (IAsyncResult asyncResult)
- {
-#if !TARGET_JVM
- Socket sock = (Socket)asyncResult.AsyncState;
-
- sock.EndDisconnect (asyncResult);
- BDDisconnected = true;
-
- BDCalledBack.Set ();
-#endif
- }
-
- [Test]
- [Category ("NotDotNet")] // "Needs XP or later"
- #if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.BeginDisconnect method is not supported")]
-#endif
- public void BeginDisconnect ()
- {
-#if !TARGET_JVM
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket listen = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
- IPEndPoint ep = new IPEndPoint (ip, 1254);
-
- listen.Bind (ep);
- listen.Listen (1);
-
- sock.Connect (ip, 1254);
-
- Assertion.AssertEquals ("BeginDisconnect #1", true,
- sock.Connected);
-
- sock.Shutdown (SocketShutdown.Both);
-
- BDCalledBack.Reset ();
- BDDisconnected = false;
-
- sock.BeginDisconnect (false, BDCallback, sock);
-
- if (BDCalledBack.WaitOne (2000, false) == false) {
- Assert.Fail ("BeginDisconnect wait timed out");
- }
-
- Assertion.AssertEquals ("BeginDisconnect #2", true,
- BDDisconnected);
- Assertion.AssertEquals ("BeginDisconnect #3", false,
- sock.Connected);
-
- sock.Close ();
- listen.Close ();
-#endif
- }
-
- [Test]
- public void BeginReceiveSocketError ()
- {
- }
-
- [Test]
- public void BeginReceiveGeneric ()
- {
- }
-
- [Test]
- public void BeginReceiveGenericSocketError ()
- {
- }
-
- private static void BSCallback (IAsyncResult asyncResult)
- {
- Socket sock = (Socket)asyncResult.AsyncState;
-
- sock.EndSend (asyncResult);
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.BeginSend(byte[] ...) is not supported")]
-#endif
- public void BeginSendNotConnected ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- byte[] send_bytes = new byte[] {10, 11, 12, 13};
-
- try {
- sock.BeginSend (send_bytes, 0,
- send_bytes.Length,
- SocketFlags.None, BSCallback,
- sock);
- Assert.Fail ("BeginSendNotConnected #1");
- } catch (SocketException ex) {
- Assertion.AssertEquals ("BeginSendNotConnected #2", 10057, ex.ErrorCode);
- } catch {
- Assert.Fail ("BeginSendNotConnected #3");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- public void BeginSendSocketError ()
- {
- }
-
- [Test]
- public void BeginSendGeneric ()
- {
- }
-
- [Test]
- public void BeginSendGenericSocketError ()
- {
- }
-
- [Test]
- public void BindTwice ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep1 = new IPEndPoint (IPAddress.Loopback,
- 1256);
- IPEndPoint ep2 = new IPEndPoint (IPAddress.Loopback,
- 1257);
-
- sock.Bind (ep1);
-
- try {
- sock.Bind (ep2);
- Assert.Fail ("BindTwice #1");
- } catch (SocketException ex) {
- Assertion.AssertEquals ("BindTwice #2",
- 10022, ex.ErrorCode);
- } catch {
- Assert.Fail ("BindTwice #3");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.Close(int) method is not supported")]
-#endif
- public void Close ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket listen = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1258);
-
- listen.Bind (ep);
- listen.Listen (1);
-
- sock.Connect (ep);
-
- Assertion.AssertEquals ("Close #1", true,
- sock.Connected);
-
- sock.Close (2);
-
- Thread.Sleep (3000);
-
- Assertion.AssertEquals ("Close #2", false,
- sock.Connected);
-
- listen.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(IPAddress,int) is not supported")]
-#endif
- public void ConnectAddressPort ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket listen = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
- IPEndPoint ep = new IPEndPoint (ip, 1249);
-
- listen.Bind (ep);
- listen.Listen (1);
-
- sock.Connect (ip, 1249);
-
- Assertion.AssertEquals ("ConnectAddressPort #1",
- true, sock.Connected);
-
- sock.Close ();
- listen.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(IPAddress,int) is not supported")]
-#endif
- public void ConnectAddressPortNull ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = null;
-
- try {
- sock.Connect (ip, 1249);
- Assert.Fail ("ConnectAddressPortNull #1");
- } catch (ArgumentNullException) {
- } catch {
- Assert.Fail ("ConnectAddressPortNull #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(IPAddress,int) is not supported")]
-#endif
- public void ConnectAddressPortListen ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
- IPEndPoint ep = new IPEndPoint (ip, 1250);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- try {
- sock.Connect (ip, 1250);
- Assert.Fail ("ConnectAddressPortListen #1");
- } catch (InvalidOperationException) {
- } catch {
- Assert.Fail ("ConnectAddressPortListen #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(IPAddress,int) is not supported")]
-#endif
- public void ConnectAddressPortClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
-
- sock.Close ();
-
- sock.Connect (ip, 1250);
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(IPAddress[],int) is not supported")]
-#endif
- public void ConnectMultiple ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket listen = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1251);
- IPAddress[] ips = new IPAddress[4];
-
- ips[0] = IPAddress.Parse ("127.0.0.4");
- ips[1] = IPAddress.Parse ("127.0.0.3");
- ips[2] = IPAddress.Parse ("127.0.0.2");
- ips[3] = IPAddress.Parse ("127.0.0.1");
-
- listen.Bind (ep);
- listen.Listen (1);
-
- sock.Connect (ips, 1251);
-
- Assertion.AssertEquals ("ConnectMultiple #1",
- true, sock.Connected);
- Assertion.AssertEquals ("ConnectMultiple #2",
- AddressFamily.InterNetwork,
- sock.RemoteEndPoint.AddressFamily);
- IPEndPoint remep = (IPEndPoint)sock.RemoteEndPoint;
-
- Assertion.AssertEquals ("ConnectMultiple #2",
- IPAddress.Loopback,
- remep.Address);
-
- sock.Close ();
- listen.Close ();
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(IPAddress[],int) is not supported")]
-#endif
- public void ConnectMultipleNull ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress[] ips = null;
-
- try {
- sock.Connect (ips, 1251);
- Assert.Fail ("ConnectMultipleNull #1");
- } catch (ArgumentNullException) {
- } catch {
- Assert.Fail ("ConnectMultipleNull #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(IPAddress[],int) is not supported")]
-#endif
- public void ConnectMultipleListen ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress[] ips = new IPAddress[4];
- IPEndPoint ep = new IPEndPoint (IPAddress.Loopback,
- 1252);
-
- ips[0] = IPAddress.Parse ("127.0.0.4");
- ips[1] = IPAddress.Parse ("127.0.0.3");
- ips[2] = IPAddress.Parse ("127.0.0.2");
- ips[3] = IPAddress.Parse ("127.0.0.1");
-
- sock.Bind (ep);
- sock.Listen (1);
-
- try {
- sock.Connect (ips, 1252);
- Assert.Fail ("ConnectMultipleListen #1");
- } catch (InvalidOperationException) {
- } catch {
- Assert.Fail ("ConnectMultipleListen #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(IPAddress[],int) is not supported")]
-#endif
- public void ConnectMultipleClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress[] ips = new IPAddress[4];
-
- ips[0] = IPAddress.Parse ("127.0.0.4");
- ips[1] = IPAddress.Parse ("127.0.0.3");
- ips[2] = IPAddress.Parse ("127.0.0.2");
- ips[3] = IPAddress.Parse ("127.0.0.1");
-
- sock.Close ();
-
- sock.Connect (ips, 1252);
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(string,int) is not supported")]
-#endif
- public void ConnectHostPortNull ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- try {
- sock.Connect ((string)null, 0);
- Assert.Fail ("ConnectHostPort #1");
- } catch (ArgumentNullException) {
- } catch {
- Assert.Fail ("ConnectHostPort #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(string,int) is not supported")]
-#endif
- public void ConnectHostPortListen ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
- IPEndPoint ep = new IPEndPoint (ip, 1253);
-
- sock.Bind (ep);
- sock.Listen (1);
-
- try {
- sock.Connect ("localhost", 1253);
- Assert.Fail ("ConnectHostPortListen #1");
- } catch (InvalidOperationException) {
- } catch {
- Assert.Fail ("ConnectHostPortListen #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [Category ("NotWorking")] // Need to pick a non-IP AddressFamily that "works" on both mono and ms, this one only works on ms
- public void ConnectHostPortNotIP ()
- {
- Socket sock = new Socket (AddressFamily.NetBios,
- SocketType.Seqpacket,
- ProtocolType.Unspecified);
-
- try {
- sock.Connect ("localhost", 0);
- Assert.Fail ("ConnectHostPortNotIP #1");
- } catch (NotSupportedException) {
- } catch {
- Assert.Fail ("ConnectHostPortNotIP #2");
- } finally {
- sock.Close ();
- }
- }
-
- [Test]
- [ExpectedException (typeof(ObjectDisposedException))]
-#if TARGET_JVM
- [Ignore("System.Net.Sockets.Socket.Connect(string,int) is not supported")]
-#endif
- public void ConnectHostPortClosed ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- sock.Close ();
-
- sock.Connect ("localhost", 0);
- }
-
- [Test]
- [Category ("NotDotNet")] // "Needs XP or later"
-#if TARGET_JVM
- [Ignore ("System.Net.Sockets.Socket.Connect(IPAddress,int) is not supported")]
-#endif
- public void Disconnect ()
- {
-#if !TARGET_JVM
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- Socket listen = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
- IPAddress ip = IPAddress.Loopback;
- IPEndPoint ep = new IPEndPoint (ip, 1255);
-
- listen.Bind (ep);
- listen.Listen (1);
-
- sock.Connect (ip, 1255);
-
- Assertion.AssertEquals ("Disconnect #1", true,
- sock.Connected);
-
- sock.Shutdown (SocketShutdown.Both);
-
- sock.Disconnect (false);
-
- Assertion.AssertEquals ("BeginDisconnect #3", false,
- sock.Connected);
-
- sock.Close ();
- listen.Close ();
-#endif
- }
-
- [Test]
- public void DuplicateAndClose ()
- {
- }
-
- [Test]
- public void IOControl ()
- {
- }
-
- [Test]
- public void ReceiveGeneric ()
- {
- }
-
- [Test]
- public void ReceiveGenericSocketFlags ()
- {
- }
-
- [Test]
- public void ReceiveGenericSocketFlagsSocketError ()
- {
- }
-
- [Test]
- public void SendGeneric ()
- {
- }
-
- [Test]
- public void SendGenericSocketFlags ()
- {
- }
-
- [Test]
- public void SendGenericSocketFlagsSocketError ()
- {
- }
-
- [Test]
- public void ListenNotBound ()
- {
- Socket sock = new Socket (AddressFamily.InterNetwork,
- SocketType.Stream,
- ProtocolType.Tcp);
-
- try {
- sock.Listen (1);
- Assert.Fail ("ListenNotBound #1");
- } catch (SocketException ex) {
- Assertion.AssertEquals ("ListenNotBound #2",
- 10022, ex.ErrorCode);
- } catch {
- Assert.Fail ("ListenNotBound #3");
- } finally {
- sock.Close ();
- }
- }
-#endif
- }
-}
-
static ManualResetEvent reset;
private string message;
- private string uri = "http://www.google.com";
[TestFixtureSetUp]
public void FixtureSetUp ()
using NUnit.Framework;
namespace MonoTests.System.Net.Sockets {
-#if TARGET_JVM
- [Ignore("UdpClient is not supported - since UDP sockets are not supported")]
-#endif
[TestFixture]
public class UdpClientTest {
[Test] // .ctor ()
try {
client = new UdpClient (port);
break;
- } catch (Exception ex) {
+ } catch (Exception) {
if (i == 5)
throw;
}
[Test]
public void ServerHandshakeReturnCrapStatusCodeTest ()
{
+ // On purpose,
+ #pragma warning disable 4014
HandleHttpRequestAsync ((req, resp) => resp.StatusCode = 418);
+ #pragma warning restore 4014
try {
Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
} catch (AggregateException e) {
[Test]
public void ServerHandshakeReturnWrongUpgradeHeader ()
{
+ #pragma warning disable 4014
HandleHttpRequestAsync ((req, resp) => {
resp.StatusCode = 101;
resp.Headers["Upgrade"] = "gtfo";
});
+ #pragma warning restore 4014
try {
Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
} catch (AggregateException e) {
[Test]
public void ServerHandshakeReturnWrongConnectionHeader ()
{
+ #pragma warning disable 4014
HandleHttpRequestAsync ((req, resp) => {
resp.StatusCode = 101;
resp.Headers["Upgrade"] = "websocket";
// Mono http request doesn't like the forcing, test still valid since the default connection header value is empty
//ForceSetHeader (resp.Headers, "Connection", "Foo");
});
+ #pragma warning restore 4014
try {
Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
} catch (AggregateException e) {
static ManualResetEvent reset;
private string message;
private string hostname;
- private IPAddress ip;
[TestFixtureSetUp]
public void FixtureSetUp ()
{
reset = new ManualResetEvent (false);
hostname = Dns.GetHostName ();
- ip = Dns.Resolve (site).AddressList[0];
+ var ip = Dns.Resolve (site).AddressList[0];
}
[TestFixtureTearDown]
[TestFixture]\r
public class DnsTest\r
{\r
- private String site1Name = "mono-project.com",\r
- site1Dot = "96.126.105.110",\r
+ private String site1Name = "jenkins.mono-project.com",\r
+ site1Dot = "162.253.133.196",\r
site2Name = "info.diku.dk",\r
site2Dot = "130.225.96.4",\r
noneExistingSite = "unlikely.xamarin.com";\r
IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);\r
IPHostEntry entry = Dns.EndGetHostByName (async);\r
SubTestValidIPHostEntry (entry);\r
- Assert.IsTrue (entry.HostName == "www.mono-project.com" || entry.HostName == "mono-project.com");\r
+ Assert.IsTrue (entry.HostName == "jenkins.mono-project.com");\r
}\r
\r
void GetHostByNameCallback (IAsyncResult ar)\r
[Test]\r
public void GetHostByName ()\r
{\r
- SubTestGetHostByName ("www.mono-project.com", site1Dot);\r
+ SubTestGetHostByName ("jenkins.mono-project.com", site1Dot);\r
SubTestGetHostByName (site2Name, site2Dot);\r
try {\r
var entry = Dns.GetHostByName (noneExistingSite);\r
\r
[Test]\r
[ExpectedException (typeof (SocketException))]\r
-#if TARGET_JVM\r
- [Ignore ("Ignore failures in Sys.Net")]\r
-#endif\r
public void GetHostByAddressString2 ()\r
{\r
Dns.GetHostByAddress ("123.255.23");\r
using NUnit.Framework;
-#if TARGET_JVM
-using System.Globalization;
-using System.Reflection;
-#endif
namespace MonoTests.System.Net
{
#else
Assert.AreEqual ("value", ex.Message, "#4");
#endif
-#if !TARGET_JVM
#if NET_2_0
Assert.IsNotNull (ex.ParamName, "#5");
Assert.AreEqual ("value", ex.ParamName, "#6");
#else
Assert.IsNull (ex.ParamName, "#5");
-#endif
#endif
Assert.IsNull (ex.InnerException, "#7");
}
} catch (WebException ex) {
Assert.AreEqual (typeof (WebException), ex.GetType (), "#1");
Assert.IsNotNull (ex.Message, "#2");
-#if !TARGET_JVM
Assert.IsTrue (ex.Message.IndexOf ("FileWebRequestTest.tmp") != -1, "#3");
Assert.IsNull (ex.Response, "#4");
Assert.IsNotNull (ex.InnerException, "#5");
-#endif
#if ONLY_1_1
FileNotFoundException fnf = ex.InnerException as FileNotFoundException;
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
-#if !TARGET_JVM
#if NET_2_0
Assert.AreEqual ("value", ex.ParamName, "#4");
#else
Assert.IsNull (ex.ParamName, "#4");
-#endif
#endif
Assert.IsNull (ex.InnerException, "#5");
}
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
-#if !TARGET_JVM
#if NET_2_0
Assert.AreEqual ("value", ex.ParamName, "#4");
#else
Assert.IsNull (ex.ParamName, "#4");
-#endif
#endif
Assert.IsNull (ex.InnerException, "#5");
}
} catch (ArgumentOutOfRangeException ex) {
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#3");
Assert.IsNotNull (ex.Message, "#4");
-#if !TARGET_JVM
Assert.IsNotNull (ex.ParamName, "#5");
#if NET_2_0
Assert.IsFalse (ex.ParamName == "value", "#6");
#else
Assert.AreEqual ("value", ex.ParamName, "#6");
-#endif
#endif
Assert.IsNull (ex.InnerException, "#7");
}
}
[Test]
-#if TARGET_JVM
- //FIXME: include Java serialization compliant tests
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void GetObjectData ()
{
FileWebRequest fwr = (FileWebRequest) WebRequest.Create ("file:///test.txt");
}
[Test]
-#if TARGET_JVM
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void Deserialize ()
{
MemoryStream ms = new MemoryStream ();
return new Uri ("file:///" + tempFile);
}
-#if TARGET_JVM
-
- private bool RunningOnUnix {
- get {
- Type t = Type.GetType("java.lang.System");
- MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
- string osName = (string) mi.Invoke(null, new object[] { "os.name" });
-
- if(osName == null) {
- return false;
- }
-
- return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
- }
- }
-
-#else
private bool RunningOnUnix {
get {
// check for Unix platforms - see FAQ for more details
return ((platform == 4) || (platform == 128) || (platform == 6));
}
}
-#endif
private static readonly byte [] _serialized = new byte [] {
#if NET_2_0
using NUnit.Framework;
-#if TARGET_JVM
-using System.Globalization;
-using System.Reflection;
-#endif
namespace MonoTests.System.Net
}
return new Uri ("file:///" + tempFile);
}
-#if TARGET_JVM
-
- private bool RunningOnUnix {
- get {
- Type t = Type.GetType("java.lang.System");
- MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
- string osName = (string) mi.Invoke(null, new object[] { "os.name" });
-
- if(osName == null) {
- return false;
- }
-
- return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
- }
- }
-
-#else
private bool RunningOnUnix {
get {
// check for Unix platforms - see FAQ for more details
return ((platform == 4) || (platform == 128));
}
}
-#endif
}
}
namespace MonoTests.System.Net {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class HttpListener is not supported")]
-#endif
public class HttpListener2Test {
private HttpListener _listener = null;
namespace MonoTests.System.Net {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class HttpListenerBasicIdentity - is not supported")]
-#endif
public class HttpListenerBasicIdentityTest {
[Test]
[ExpectedException (typeof (ArgumentNullException))]
namespace MonoTests.System.Net {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Net.HttpListenerPrefixCollection - is not supported")]
-#endif
public class HttpListenerPrefixCollectionTest {
-#if !TARGET_JVM
// NL -> Not listening -> tests when listener.IsListening == false
[Test]
public void NL_DefaultProperties ()
}
Assert.AreEqual (items, 1);
}
-#endif
}
}
#endif
namespace MonoTests.System.Net
{
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class HttpListener is not supported")]
-#endif
public class HttpListenerRequestTest
{
[Test]
namespace MonoTests.System.Net {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class HttpListener is not implemented")]
-#endif
public class HttpListenerTest {
-#if !TARGET_JVM
[Test]
public void DefaultProperties ()
{
socket.Listen(1);
}
}
- catch(Exception ex) {
+ catch(Exception) {
//Can be AccessDeniedException(ports 80/443 need root access) or
//SocketException because other application is listening
return false;
Event.Close ();
}
}
-#endif
}
}
#endif
}
[Test]
-#if TARGET_JVM
- [Ignore ("Ignore failures in Sys.Net")]
-#endif
public void Proxy_Null ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
[Test]
[Category("InetAccess")]
-#if TARGET_JVM
- [Ignore ("NMA - wrong cookies number returned")]
-#endif
public void Sync ()
{
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
}
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
[Test]
[Ignore ("Fails on MS.NET")]
public void SslClientBlock ()
}
#endif
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void Missing_ContentEncoding ()
{
ServicePointManager.CertificatePolicy = new AcceptAllPolicy ();
}
[Test]
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void BadServer_ChunkedClose ()
{
// The server will send a chunked response without a 'last-chunked' mark
}
[Test]
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
[Ignore ("This does not timeout any more. That's how MS works when reading small responses")]
public void ReadTimeout ()
{
}
[Test] // bug #324300
-#if TARGET_JVM
- [Category("NotWorking")]
-#endif
public void AllowAutoRedirect ()
{
IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8765);
}
}
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
class SslHttpServer : HttpServer {
X509Certificate _certificate;
}
[Test] // bug #324182
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void CanTimeout ()
{
IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9128);
#if NET_2_0
[Test] // bug #324182
-#if TARGET_JVM
- [Category ("NotWorking")]
-#endif
public void CanTimeout ()
{
IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7213")]
-#endif
public void Constructor0_Address_Invalid ()
{
try {
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7213")]
-#endif
public void Constructor1_Address_4Byte ()
{
byte [] bytes = new byte [4] { 192, 202, 112, 37 };
using NUnit.Framework;
-namespace MoonTest.System.Net {
+namespace MonoTests.System.Net {
[TestFixture]
public class NetworkCredentialTest {
\r
[Test, ExpectedException (typeof (InvalidOperationException))]\r
[Category ("InetAccess")]\r
-#if TARGET_JVM\r
- [Ignore ("Unsupported property - ServicePointManager.MaxServicePoints")]\r
-#endif\r
public void MaxServicePointManagers ()\r
{\r
Assert.AreEqual (0, ServicePointManager.MaxServicePoints, "#1");\r
\r
[Test]\r
[Category ("InetAccess")]\r
-#if TARGET_JVM\r
- [Ignore ("Unsupported - ServicePointManager.FindServicePoint")]\r
-#endif\r
public void All ()\r
{\r
ServicePoint p = ServicePointManager.FindServicePoint (new Uri ("mailto:xx@yyy.com"));\r
\r
[Test]\r
[Category ("InetAccess")]\r
-#if TARGET_JVM\r
- [Ignore ("The System.Net.ServicePointManager.FindServicePoint(Uri) is not supported")]\r
-#endif \r
public void ConnectionLimit ()\r
{ \r
// the default is already 2, just in case it isn't..\r
#if NET_2_0\r
[Test]\r
[Category ("InetAccess")]\r
-#if TARGET_JVM\r
- [Ignore ("The System.Net.ServicePointManager.FindServicePoint(Uri) is not supported")]\r
-#endif \r
public void EndPointBind ()\r
{\r
Uri uri = new Uri ("http://www.go-mono.com/");\r
HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);\r
\r
bool called = false;\r
-#if !TARGET_JVM\r
sp.BindIPEndPointDelegate = delegate {\r
Assert.IsTrue (!called);\r
called = true;\r
return null;\r
};\r
-#endif\r
req.GetResponse ().Close ();\r
\r
Assert.IsTrue (called);\r
\r
req = (HttpWebRequest) WebRequest.Create (uri);\r
called = false;\r
-#if !TARGET_JVM\r
sp.BindIPEndPointDelegate = delegate(ServicePoint point, IPEndPoint remote, int times) {\r
Assert.IsTrue (times < 5);\r
called = true;\r
return new IPEndPoint(IPAddress.Parse("0.0.0.0"), 12345 + times);\r
};\r
-#endif\r
req.GetResponse ().Close ();\r
\r
Assert.IsTrue (called);\r
}
[Test]
-#if TARGET_JVM
- //FIXME: include Java serialization compliant tests - the order of object
- // in SerializationInfo should stay same to MS format...
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void GetObjectData ()
{
SerializationInfo si = new SerializationInfo (typeof (WebHeaderCollection),
}
[Test]
-#if TARGET_JVM
- //FIXME: include Java serialization compliant tests
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void Serialize ()
{
WebHeaderCollection headers = new WebHeaderCollection ();
}
[Test]
-#if TARGET_JVM
- //FIXME: include Java serialization compliant tests
- [Ignore ("The MS compliant binary serialization format is not supported")]
-#endif
public void Deserialize ()
{
MemoryStream ms = new MemoryStream ();
}
[Test]
-#if TARGET_JVM
- [Ignore ("TD BUG ID: 7213")]
-#endif
public void IsByPassed_Host_Null ()
{
WebProxy p = new WebProxy ("http://proxy.contoso.com", true);
}
[Test]
-#if TARGET_JVM
- [Ignore ("The MS compliant binary serialization is not supported")]
-#endif
public void GetObjectData ()
{
SerializationInfo si = new SerializationInfo (typeof (WebHeaderCollection),
[Test]
[Category ("NotDotNet")]
-#if TARGET_JVM
- [Ignore ("TD #6954")]
-#endif
public void HtmlEncode_XSS ()
{
string problem = "\xff1cscript\xff1e"; // unicode looks alike <script>
private static byte[] cert_a_issuer_raw = new byte[] { 0x30, 0x5F, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x20, 0x30, 0x1E, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x17, 0x52, 0x53, 0x41, 0x20, 0x44, 0x61, 0x74, 0x61, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2C, 0x20, 0x49, 0x6E, 0x63, 0x2E, 0x31, 0x2E, 0x30, 0x2C, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x13, 0x25, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x43, 0x65,
0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6F, 0x72, 0x69, 0x74, 0x79 };
+#if false
private static byte[] cert_b = { 0x30,0x82,0x03,0x04,0x30,0x82,0x02,0xC4,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x03,0x30,0x09,0x06,0x07,0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,0x30,0x51,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x18,0x30,0x16,0x06,0x03,0x55,0x04,0x0A,0x13,0x0F,0x55,0x2E,0x53,0x2E,0x20,0x47,0x6F,0x76,0x65,0x72,0x6E,0x6D,0x65,0x6E,0x74,0x31,0x0C,0x30,0x0A,0x06,0x03,0x55,0x04,0x0B,0x13,0x03,0x44,0x6F,0x44,0x31,0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x03,0x13,0x11,0x41,0x72,0x6D,0x65,0x64,0x20,0x46,0x6F,
0x72,0x63,0x65,0x73,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x30,0x31,0x30,0x32,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x30,0x33,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x30,0x51,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x18,0x30,0x16,0x06,0x03,0x55,0x04,0x0A,0x13,0x0F,0x55,0x2E,0x53,0x2E,0x20,0x47,0x6F,0x76,0x65,0x72,0x6E,0x6D,0x65,0x6E,0x74,0x31,0x0C,0x30,0x0A,0x06,0x03,0x55,0x04,0x0B,0x13,0x03,0x44,0x6F,0x44,0x31,0x1A,0x30,0x18,
0x06,0x03,0x55,0x04,0x03,0x13,0x11,0x41,0x72,0x6D,0x65,0x64,0x20,0x46,0x6F,0x72,0x63,0x65,0x73,0x20,0x52,0x6F,0x6F,0x74,0x30,0x82,0x01,0xB6,0x30,0x82,0x01,0x2B,0x06,0x07,0x2A,0x86,0x48,0xCE,0x38,0x04,0x01,0x30,0x82,0x01,0x1E,0x02,0x81,0x81,0x00,0x90,0x89,0x3E,0x18,0x1B,0xFE,0xA3,0x1D,0x16,0x89,0x00,0xB4,0xD5,0x40,0x82,0x4C,0x2E,0xEC,0x3D,0x66,0x0D,0x0D,0xB9,0x17,0x40,0x6E,0x3A,0x5C,0x03,0x7B,0x1B,0x93,0x28,0x0C,0xEF,0xB9,0x97,0xE3,0xA1,0xEB,0xE2,0xA3,0x7C,0x61,0xDD,0x6F,0xD5,0xAD,0x15,0x69,0x00,
0x54,0x4B,0xC0,0xA8,0x40,0xEF,0x71,0xE8,0x56,0x6B,0xA2,0x29,0xCB,0x1E,0x09,0x7D,0x27,0x39,0x91,0x3B,0x20,0x4F,0x98,0x39,0xE8,0x39,0xCA,0x98,0xC5,0xAF,0x54,0x03,0x81,0x84,0x00,0x02,0x81,0x80,0x54,0xA8,0x88,0xB5,0x8F,0x01,0x56,0xCE,0x18,0x8F,0xA6,0xD6,0x7C,0x29,0x29,0x75,0x45,0xE8,0x31,0xA4,0x07,0x17,0xED,0x1E,0x5D,0xB2,0x7B,0xBB,0xCE,0x3C,0x97,0x67,0x1E,0x88,0x0A,0xFE,0x7D,0x00,0x22,0x27,0x1D,0x66,0xEE,0xF6,0x1B,0xB6,0x95,0x7F,0x5A,0xFF,0x06,0x34,0x02,0x43,0xC3,0x83,0xC4,0x66,0x2C,0xA1,0x05,0x0E,
0x68,0xB3,0xCA,0xDC,0xD3,0xF9,0x0C,0xC0,0x66,0xDF,0x85,0x84,0x4B,0x20,0x5D,0x41,0xAC,0xC0,0xEC,0x37,0x92,0x0E,0x97,0x19,0xBF,0x53,0x35,0x63,0x27,0x18,0x33,0x35,0x42,0x4D,0xF0,0x2D,0x6D,0xA7,0xA4,0x98,0xAA,0x57,0xF3,0xD2,0xB8,0x6E,0x4E,0x8F,0xFF,0xBE,0x6F,0x4E,0x0F,0x0B,0x44,0x24,0xEE,0xDF,0x4C,0x22,0x5B,0x44,0x98,0x94,0xCB,0xB8,0xA3,0x2F,0x30,0x2D,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x9D,0x2D,0x73,0xC3,0xB8,0xE3,0x4D,0x29,0x28,0xC3,0x65,0xBE,0xA9,0x98,0xCB,0xD6,0x8A,0x06,0x68,
0x9C,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x09,0x06,0x07,0x2A,0x86,0x48,0xCE,0x38,0x04,0x03,0x03,0x2F,0x00,0x30,0x2C,0x02,0x14,0x5A,0x1B,0x2D,0x08,0x0E,0xE6,0x99,0x38,0x8F,0xB5,0x09,0xC9,0x89,0x79,0x7E,0x01,0x30,0xBD,0xCE,0xF0,0x02,0x14,0x71,0x7B,0x08,0x51,0x97,0xCE,0x4D,0x1F,0x6A,0x84,0x47,0x3A,0xC0,0xBD,0x13,0x89,0x81,0xB9,0x01,0x97 };
+#endif
static public byte[] RFC3280MandatoryAttributeTypesCACert_crt = { 0x30, 0x82, 0x02, 0xC1, 0x30, 0x82, 0x02, 0x2A, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x60, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x40, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x1A, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x11, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x0C, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x6E, 0x63, 0x68, 0x6F, 0x72, 0x30, 0x1E, 0x17, 0x0D,
0x30, 0x31, 0x30, 0x34, 0x31, 0x39, 0x31, 0x34, 0x35, 0x37, 0x32, 0x30, 0x5A, 0x17, 0x0D, 0x31, 0x31, 0x30, 0x34, 0x31, 0x39, 0x31, 0x34, 0x35, 0x37, 0x32, 0x30, 0x5A, 0x30, 0x81, 0x8E, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x1A, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x11, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x31, 0x13, 0x30, 0x11, 0x06, 0x0A, 0x09, 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x19, 0x16, 0x03, 0x67, 0x6F, 0x76, 0x31, 0x20, 0x30, 0x1E, 0x06, 0x0A, 0x09,
static public AsnEncodedData emptyData = new AsnEncodedData (new byte[0]);
private X509Certificate2 x509a;
- private X509Certificate2 x509b;
+ //private X509Certificate2 x509b;
[TestFixtureSetUp]
public void FixtureSetUp ()
{
x509a = new X509Certificate2 (cert_a);
- x509b = new X509Certificate2 (cert_b);
+ //x509b = new X509Certificate2 (cert_b);
}
private void Empty (X500DistinguishedName dn)
[TestFixture]
public class X509ChainTest {
- private X509Certificate2Collection empty;
+ //private X509Certificate2Collection empty;
private X509Certificate2Collection collection;
private X509Certificate2 cert_empty;
cert1 = new X509Certificate2 (X509Certificate2Test.farscape_pfx, "farscape", X509KeyStorageFlags.Exportable);
cert2 = new X509Certificate2 (Encoding.ASCII.GetBytes (X509Certificate2Test.base64_cert));
- empty = new X509Certificate2Collection ();
+ //empty = new X509Certificate2Collection ();
collection = new X509Certificate2Collection ();
collection.Add (cert1);
collection.Add (cert2);
namespace MonoTests.System.Security.Cryptography {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Security.Cryptography.AsnEncodedData - is not supported")]
-#endif
public class AsnEncodedDataTest {
-#if !TARGET_JVM
static byte[] asnNullBytes = { 0x05, 0x00 };
static string asnNullString = "05 00";
static byte[] asnLongBytes = { 0x30,0x5C,0x02,0x55,0x2D,0x58,0xE9,0xBF,0xF0,0x31,0xCD,0x79,0x06,0x50,0x5A,0xD5,0x9E,0x0E,0x2C,0xE6,0xC2,0xF7,0xF9,0xD2,0xCE,0x55,0x64,0x85,0xB1,0x90,0x9A,0x92,0xB3,0x36,0xC1,0xBC,0xEA,0xC8,0x23,0xB7,0xAB,0x3A,0xA7,0x64,0x63,0x77,0x5F,0x84,0x22,0x8E,0xE5,0xB6,0x45,0xDD,0x46,0xAE,0x0A,0xDD,0x00,0xC2,0x1F,0xBA,0xD9,0xAD,0xC0,0x75,0x62,0xF8,0x95,0x82,0xA2,0x80,0xB1,0x82,0x69,0xFA,0xE1,0xAF,0x7F,0xBC,0x7D,0xE2,0x7C,0x76,0xD5,0xBC,0x2A,0x80,0xFB,0x02,0x03,0x01,0x00,0x01 };
Assert.AreEqual ("Subject Alternative Name", aed.Oid.FriendlyName, "FriendlyName");
// anyway the answer is most probably CryptoAPI
}
-#endif
}
}
namespace MonoTests.System.Security.Cryptography {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Security.Cryptography.OidCollection - is not supported")]
-#endif
public class OidCollectionTest {
-#if !TARGET_JVM
[Test]
public void Constructor ()
Oid[] array = null;
oc.CopyTo (array, 0);
}
-#endif
}
}
namespace MonoTests.System.Security.Cryptography {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Security.Cryptography.OidEnumerator - is not supported")]
-#endif
public class OidEnumeratorTest {
-#if !TARGET_JVM
private OidEnumerator GetEnumerator ()
{
OidCollection oc = new OidCollection ();
enumerator.Reset ();
Assert.IsNotNull (enumerator.Current, "Current after reset");
}
-#endif
}
}
-#endif
\ No newline at end of file
+#endif
namespace MonoTests.System.Security.Cryptography {
[TestFixture]
-#if TARGET_JVM
- [Ignore ("The class System.Security.Cryptography.Oid - is not supported")]
-#endif
public class OidTest {
-#if !TARGET_JVM
static string invalidOid = "1.0";
static string invalidName = "friendlyName";
// TODO: add other well known oid as we find them
}
-#endif
}
}
try {
result = Regex.Replace (original, pattern, replacement);
}
- catch (Exception e) {
+ catch (Exception) {
result = "Error.";
}
Assert.AreEqual (expected, result, "rr#: {0} ~ s,{1},{2},",
Match match = Regex.Match (original, pattern);
result = match.Result (replacement);
}
- catch (Exception e) {
+ catch (Exception) {
result = "Error.";
}
Assert.AreEqual (expected, result, "rr#: {0} ~ s,{1},{2},",
AddOptions(RegexOptions.RightToLeft)).Matches (null);
}
+ [Test]
+ public void Match_SubstringAnchors ()
+ {
+ Regex r = new Regex ("^ooba$",
+ AddOptions( RegexOptions.None ));
+ Match m = r.Match ("foobar", 1, 4);
+
+ Assert.IsTrue (m.Success);
+ Assert.AreEqual ("ooba", m.Value);
+ }
+
+ [Test]
+ public void Match_SubstringRtl ()
+ {
+ Regex r = new Regex(@".*", RegexOptions.RightToLeft);
+ Match m = r.Match("ABCDEFGHI", 2, 6);
+
+ Assert.IsTrue (m.Success);
+ Assert.AreEqual ("CDEFGH", m.Value);
+ }
+
[Test, ExpectedException (typeof (ArgumentNullException))]
public void Replace_InputNull ()
{
[Test]
public void Constructor1_Interval_Max ()
{
-#if NET_2_0
try {
new Timer (0x80000000);
Assert.Fail ("#A1");
Assert.IsNull (ex.InnerException, "#B3");
Assert.IsNotNull (ex.Message, "#B4");
}
-#else
- timer = new Timer (0x80000000);
- Assert.AreEqual (0x80000000, timer.Interval, "#1");
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void Constructor1_Interval_Max_2 ()
+ {
timer = new Timer (double.MaxValue);
- Assert.AreEqual (double.MaxValue, timer.Interval, "#2");
-#endif
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void Constructor1_Interval_Min_1 ()
+ {
+ timer = new Timer (0);
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void Constructor1_Interval_Min_2 ()
+ {
+ timer = new Timer (-5);
+ }
+
+ [Test]
+ public void Interval_TooHigh_Disabled_NoThrow ()
+ {
+ timer.Interval = double.MaxValue;
+ Assert.AreEqual (double.MaxValue, timer.Interval, "#3");
+ }
+
+ [Test]
+ public void Interval_TooHigh_ThrowOnEnabled ()
+ {
+ timer.Interval = 0x80000000;
+ Assert.AreEqual (0x80000000, timer.Interval, "#1");
+ try {
+ timer.Enabled = true;
+ Assert.Fail ("#2");
+ } catch (Exception ex) {
+ Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#3");
+ Assert.IsFalse (timer.Enabled);
+ }
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void Interval_TooHigh_Enabled_Throw ()
+ {
+ timer.Interval = 100;
+ timer.Enabled = true;
+ timer.Interval = double.MaxValue;
+ }
+
+ [Test]
+ public void DoubleClose_NoThrow ()
+ {
+ timer.Interval = 100;
+ timer.Start ();
+ timer.Close ();
+ timer.Close ();
+ }
+
+ [Test]
+ public void DisposedMeansDisabled_NoThrow ()
+ {
+ timer.Interval = 100;
+ timer.Start ();
+ timer.Close ();
+ Assert.IsFalse (timer.Enabled);
+ }
+
+ [Test]
+ [ExpectedException (typeof (ObjectDisposedException))]
+ public void Disposed_ThrowOnEnabled ()
+ {
+ timer.Interval = 100;
+ timer.Start ();
+ timer.Close ();
+ timer.Enabled = false;
+ }
+
+ [Test]
+ public void Elapsed_DontFireIfDisposed ()
+ {
+ timer.Interval = 500;
+ var countElapsedCalls = 0;
+ timer.Elapsed += (_, __) => { countElapsedCalls++; };
+ timer.Start ();
+ timer.Close ();
+ ST.Thread.Sleep (500);
+ Assert.AreEqual (countElapsedCalls, 0);
}
[Test]
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.IO;
+using System.Reflection;
+using System.Text;
+using System.Text.RegularExpressions;
+using NUnit.Framework;
+
+namespace MonoTests.System {
+ public class StringTester {
+ private const string ext = ".txt";
+ public static string Location = "./StringTests/";
+ public static bool CreateMode = false;
+
+ private static readonly Dictionary<string, Asserts> asserts = new Dictionary<string, Asserts> ();
+
+ public static void Assert (string id, string actual, string message = "")
+ {
+ string testFullName = GetTestMethodName ();
+
+ Asserts testAsserts;
+ if (!asserts.TryGetValue (testFullName, out testAsserts)) {
+ testAsserts = new Asserts ();
+
+ if (!CreateMode) {
+ string filePath = Path.GetFullPath (Path.Combine (Location, testFullName + ext));
+ if (!File.Exists (filePath)) {
+ NUnit.Framework.Assert.Ignore (filePath + " does not exist. \n" +
+ "The file should be generated by running on .NET the same test with StringTester.CreateMode = true.");
+ }
+
+ testAsserts.Load (filePath);
+ }
+
+ asserts.Add (testFullName, testAsserts);
+ }
+
+ if (CreateMode) {
+ testAsserts.AddExpected (id, actual);
+ return;
+ }
+
+ if (string.IsNullOrEmpty(message))
+ message = id;
+
+ string expected = testAsserts.GetExpected (id);
+ NUnit.Framework.Assert.AreEqual (expected, actual, message);
+ }
+
+ public static void Save ()
+ {
+ if (!CreateMode)
+ return;
+
+ foreach (var test in asserts)
+ test.Value.Save (Path.Combine (Location, test.Key + ext));
+ }
+
+ public static string GetTestMethodName ()
+ {
+ var stackTrace = new StackTrace ();
+ foreach (StackFrame stackFrame in stackTrace.GetFrames ()) {
+ MethodBase methodBase = stackFrame.GetMethod ();
+ Object [] attributes = methodBase.GetCustomAttributes (typeof (TestAttribute), false);
+ if (attributes.Length >= 1)
+ return methodBase.DeclaringType.FullName + "." + methodBase.Name;
+ }
+ return "Not called from a test method";
+ }
+
+ public class Asserts {
+ private const string escapes = "\n\t\0\r\\";
+ private const string unescapes = @"\n\t\0\r\\";
+ private static readonly Regex regex = new Regex (@"\\u(?<Value>[a-zA-Z0-9]{4})", RegexOptions.Compiled);
+ private readonly Dictionary<string, string> values = new Dictionary<string, string> ();
+
+ public void AddExpected (string id, string value)
+ {
+ values.Add (id, value);
+ }
+
+ public string GetExpected (string id)
+ {
+ return values [id];
+ }
+
+ public void Save (string filePath)
+ {
+ string dir = Path.GetDirectoryName (filePath);
+ if (!Directory.Exists (dir))
+ Directory.CreateDirectory (dir);
+
+ var sw = new StreamWriter (filePath, false, Encoding.UTF8);
+
+ foreach (var kv in values) {
+ sw.WriteLine (Escape (kv.Key));
+ sw.WriteLine (Escape (kv.Value));
+ }
+
+ sw.Close ();
+ }
+
+ public void Load (string filePath)
+ {
+ if (!File.Exists (filePath))
+ return;
+
+ var sr = new StreamReader (filePath, Encoding.UTF8);
+
+ while (sr.Peek () > 0) {
+ string id = Unescape (sr.ReadLine ());
+
+ if (sr.Peek () == 0)
+ break;
+
+ string value = Unescape (sr.ReadLine ());
+ values.Add (id, value);
+ }
+
+ sr.Close ();
+ }
+
+ private static string Escape (string str)
+ {
+ var sb = new StringBuilder ();
+ foreach (char c in str) {
+ int i = escapes.IndexOf (c);
+ if (i != -1) {
+ sb.Append (unescapes.Substring (i*2, 2));
+ continue;
+ }
+
+ if (c >= 0x7f || c < 0x20) {
+ sb.Append (string.Format (@"\u{0:x4}", (int) c));
+ continue;
+ }
+
+ sb.Append (c);
+ }
+ return sb.ToString ();
+ }
+
+ private static string Unescape (string str)
+ {
+ for (int i = 0; i < escapes.Length; i++)
+ str = str.Replace (unescapes.Substring (i*2, 2), "" + escapes [i]);
+
+ return regex.Replace (str,
+ m => ((char) int.Parse (m.Groups ["Value"].Value, NumberStyles.HexNumber)).ToString ());
+ }
+ }
+ }
+}
\ No newline at end of file
using NUnit.Framework;
using System;
+using System.Reflection;
namespace MonoTests.System
{
public class UriBuilderTest
{
private UriBuilder b, b2, b3;
+ public bool IriParsing;
[SetUp]
public void GetReady()
{
b = new UriBuilder ("http", "www.ximian.com", 80, "foo/bar/index.html");
+
+ //Make sure Uri static constructor is called
+ Uri.EscapeDataString ("");
+
+ FieldInfo iriParsingField = typeof (Uri).GetField ("s_IriParsing",
+ BindingFlags.Static | BindingFlags.GetField | BindingFlags.NonPublic);
+ if (iriParsingField != null)
+ IriParsing = (bool) iriParsingField.GetValue (null);
}
[Test] // ctor ()
{
UriBuilder ub = new UriBuilder ("http", "[1:2:3:4:5:6:7:8]", 8080, "/dir/subdir/file");
Assert.AreEqual ("[1:2:3:4:5:6:7:8]", ub.Host, "Host.1");
- Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", ub.Uri.Host, "Uri.Host");
- // once the Uri is created then some builder properties may change
- Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", ub.Host, "Host.2");
+ if (IriParsing)
+ Assert.AreEqual ("[1:2:3:4:5:6:7:8]", ub.Uri.Host, "Uri.Host");
+ else {
+ Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", ub.Uri.Host, "Uri.Host");
+ // once the Uri is created then some builder properties may change
+ Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", ub.Host, "Host.2");
+ }
}
[Test]
public void GetComponents_Ftp2 ()
{
UnitTestUriParser p = new UnitTestUriParser ();
- Assert.AreEqual ("ftp", p._GetComponents (ftp, UriComponents.Scheme, UriFormat.Unescaped), "ftp.Scheme");
- Assert.AreEqual ("username:password", p._GetComponents (ftp, UriComponents.UserInfo, UriFormat.Unescaped), "ftp.UserInfo");
- Assert.AreEqual ("ftp.go-mono.com", p._GetComponents (ftp, UriComponents.Host, UriFormat.Unescaped), "ftp.Host");
- Assert.AreEqual (String.Empty, p._GetComponents (ftp, UriComponents.Port, UriFormat.Unescaped), "ftp.Port");
- Assert.AreEqual ("with some spaces/mono.tgz", p._GetComponents (ftp, UriComponents.Path, UriFormat.Unescaped), "ftp.Path");
- Assert.AreEqual ("with%20some%20spaces/mono.tgz", p._GetComponents (ftp, UriComponents.Path, UriFormat.UriEscaped), "ftp.Path-UriEscaped");
- Assert.AreEqual ("with some spaces/mono.tgz", p._GetComponents (ftp, UriComponents.Path, UriFormat.SafeUnescaped), "ftp.Path-SafeUnescaped");
- Assert.AreEqual (String.Empty, p._GetComponents (ftp, UriComponents.Query, UriFormat.Unescaped), "ftp.Query");
- Assert.AreEqual (String.Empty, p._GetComponents (ftp, UriComponents.Fragment, UriFormat.Unescaped), "ftp.Fragment");
- Assert.AreEqual ("21", p._GetComponents (ftp, UriComponents.StrongPort, UriFormat.Unescaped), "ftp.StrongPort");
- Assert.AreEqual (String.Empty, p._GetComponents (ftp, UriComponents.KeepDelimiter, UriFormat.Unescaped), "http.KeepDelimiter");
- Assert.AreEqual ("ftp.go-mono.com:21", p._GetComponents (ftp, UriComponents.HostAndPort, UriFormat.Unescaped), "http.HostAndPort");
- Assert.AreEqual ("username:password@ftp.go-mono.com:21", p._GetComponents (ftp, UriComponents.StrongAuthority, UriFormat.Unescaped), "http.StrongAuthority");
- Assert.AreEqual ("ftp://username:password@ftp.go-mono.com/with some spaces/mono.tgz", p._GetComponents (ftp, UriComponents.AbsoluteUri, UriFormat.Unescaped), "http.AbsoluteUri");
- Assert.AreEqual ("/with some spaces/mono.tgz", p._GetComponents (ftp, UriComponents.PathAndQuery, UriFormat.Unescaped), "http.PathAndQuery");
- Assert.AreEqual ("ftp://ftp.go-mono.com/with some spaces/mono.tgz", p._GetComponents (ftp, UriComponents.HttpRequestUrl, UriFormat.Unescaped), "http.HttpRequestUrl");
- Assert.AreEqual ("ftp://ftp.go-mono.com", p._GetComponents (ftp, UriComponents.SchemeAndServer, UriFormat.Unescaped), "http.SchemeAndServer");
- Assert.AreEqual ("ftp://username:password@ftp.go-mono.com/with some spaces/mono.tgz", p._GetComponents (ftp, UriComponents.SerializationInfoString, UriFormat.Unescaped), "http.SerializationInfoString");
+ Assert.AreEqual ("ftp", p._GetComponents (ftp2, UriComponents.Scheme, UriFormat.Unescaped), "ftp.Scheme");
+ Assert.AreEqual ("username:password", p._GetComponents (ftp2, UriComponents.UserInfo, UriFormat.Unescaped), "ftp.UserInfo");
+ Assert.AreEqual ("ftp.go-mono.com", p._GetComponents (ftp2, UriComponents.Host, UriFormat.Unescaped), "ftp.Host");
+ Assert.AreEqual (String.Empty, p._GetComponents (ftp2, UriComponents.Port, UriFormat.Unescaped), "ftp.Port");
+ Assert.AreEqual ("with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.Path, UriFormat.Unescaped), "ftp.Path");
+ Assert.AreEqual ("with%20some%20spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.Path, UriFormat.UriEscaped), "ftp.Path-UriEscaped");
+ Assert.AreEqual ("with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.Path, UriFormat.SafeUnescaped), "ftp.Path-SafeUnescaped");
+ Assert.AreEqual (String.Empty, p._GetComponents (ftp2, UriComponents.Query, UriFormat.Unescaped), "ftp.Query");
+ Assert.AreEqual (String.Empty, p._GetComponents (ftp2, UriComponents.Fragment, UriFormat.Unescaped), "ftp.Fragment");
+ Assert.AreEqual ("21", p._GetComponents (ftp2, UriComponents.StrongPort, UriFormat.Unescaped), "ftp.StrongPort");
+ Assert.AreEqual (String.Empty, p._GetComponents (ftp2, UriComponents.KeepDelimiter, UriFormat.Unescaped), "http.KeepDelimiter");
+ Assert.AreEqual ("ftp.go-mono.com:21", p._GetComponents (ftp2, UriComponents.HostAndPort, UriFormat.Unescaped), "http.HostAndPort");
+ Assert.AreEqual ("username:password@ftp.go-mono.com:21", p._GetComponents (ftp2, UriComponents.StrongAuthority, UriFormat.Unescaped), "http.StrongAuthority");
+ Assert.AreEqual ("ftp://username:password@ftp.go-mono.com/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.AbsoluteUri, UriFormat.Unescaped), "http.AbsoluteUri");
+ Assert.AreEqual ("/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.PathAndQuery, UriFormat.Unescaped), "http.PathAndQuery");
+ Assert.AreEqual ("ftp://ftp.go-mono.com/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.HttpRequestUrl, UriFormat.Unescaped), "http.HttpRequestUrl");
+ Assert.AreEqual ("ftp://ftp.go-mono.com", p._GetComponents (ftp2, UriComponents.SchemeAndServer, UriFormat.Unescaped), "http.SchemeAndServer");
+ Assert.AreEqual ("ftp://username:password@ftp.go-mono.com/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.SerializationInfoString, UriFormat.Unescaped), "http.SerializationInfoString");
Assert.AreSame (p, p._OnNewUri (), "OnNewUri");
// strange mixup
- Assert.AreEqual ("ftp://username:password@", p._GetComponents (ftp, UriComponents.Scheme | UriComponents.UserInfo, UriFormat.Unescaped), "ftp.Scheme+UserInfo");
- Assert.AreEqual (":21/with some spaces/mono.tgz", p._GetComponents (ftp, UriComponents.Path | UriComponents.StrongPort, UriFormat.Unescaped), "ftp.Path+StrongPort");
+ Assert.AreEqual ("ftp://username:password@", p._GetComponents (ftp2, UriComponents.Scheme | UriComponents.UserInfo, UriFormat.Unescaped), "ftp.Scheme+UserInfo");
+ Assert.AreEqual (":21/with some spaces/mono.tgz", p._GetComponents (ftp2, UriComponents.Path | UriComponents.StrongPort, UriFormat.Unescaped), "ftp.Path+StrongPort");
}
// Test case for Xamarin#17665
}
[Test]
- [ExpectedException (typeof (NullReferenceException))]
+ [ExpectedException (typeof (ArgumentNullException))]
public void IsBaseOf_UriNull ()
{
UnitTestUriParser p = new UnitTestUriParser ();
}
[Test]
- [ExpectedException (typeof (NullReferenceException))]
+ [ExpectedException (typeof (ArgumentNullException))]
public void IsBaseOf_NullUri ()
{
UnitTestUriParser p = new UnitTestUriParser ();
--- /dev/null
+using System;
+using System.Text;
+using NUnit.Framework;
+
+namespace MonoTests.System {
+ [TestFixture]
+ public class UriPermutationsTest {
+
+ // Set this to true to generate the expected values
+ // The tests should run first on .NET with CreateMode = true
+ // The generated files should then be used when running the tests in Mono with CreateMode = false
+ private const bool createMode = false;
+
+ // The final location depends on NET_2_0, NET_4_0, NET_4_5.
+ private const string location = "./Test/System/UriPermutationsTest/";
+
+ private const string nonAsciiTestedChars = "☕";
+
+ // Chars that can change the current component.
+ // Those characters are tested alone.
+ private const string specialTestedChars = "@:?#";
+
+ // Scheme news: and custom: are not tested because there is a strange behavior on .NET 4.5
+ // new Uri("news:a/a%30").ToString() == "news:a/a%30a/a0"
+ private static readonly string [] schemes = {
+ "http://", "https://", "file://", "ftp://", "gopher://", "ldap://", "mailto:",
+ "net.pipe://", "net.tcp://", "nntp://", "telnet://", "custom://",
+ //"news:", "custom:"
+ };
+
+ private static readonly string [] componentLocations = {
+ "a/a{0}?", "b/a{0}#", "c/a?", "d/a#",
+ "a/a{0}?%30#", "a/a?{0}#%30", "a/a%30?#", // see why on TestChars comment
+ };
+
+ private static readonly string [] specialCases = {
+ "a/a#%#", "a/a#%25#", // '%' cause '#' to escape in some cases
+ "a/%80%81%B8%B9", // invalid utf8 encoding
+ };
+
+ private static readonly string [] reduceLocations = {
+ "a/b/{0}", "a/b/{0}a", "a/b/c{0}",
+ "a/b/{0}/a", "a/b/{0}a/a", "a/b/c{0}/a",
+ // Test '\\'
+ "a/b\\{0}", "a/b\\{0}a", "a/b\\c{0}",
+ "a/b\\{0}\\a", "a/b\\{0}a\\a", "a/b\\c{0}\\a",
+ // Test '/' %2F
+ "a/b%2F{0}", "a/b%2F{0}a", "a/b%2Fc{0}",
+ "a/b/{0}%2Fa", "a/b/{0}a%2Fa", "a/b/c{0}%2Fa",
+ "a/b%2F{0}/a", "a/b%2F{0}a/a", "a/b%2Fc{0}/a",
+ // Test '\\' %5C
+ "a/b%5C{0}", "a/b%5C{0}a", "a/b%5Cc{0}",
+ "a/b/{0}%5Ca", "a/b/{0}a%5Ca", "a/b/c{0}%5Ca",
+ "a/b%5C{0}/a", "a/b%5C{0}a/a", "a/b%5Cc{0}/a",
+ };
+
+ private static readonly string [] reduceElements = {
+ "", ".", "..", "...", "%2E", "%2E%2E", "%2E%2E%2E"
+ };
+
+ [SetUp]
+ public void Setup()
+ {
+ StringTester.CreateMode = createMode;
+#if NET_4_5
+ StringTester.Location = location + "NET_4_5";
+#elif NET_4_0
+ StringTester.Location = location + "NET_4_0";
+#else
+ StringTester.Location = location + "NET_2_0";
+#endif
+ }
+
+ [TearDown]
+ public void Teardown()
+ {
+ StringTester.Save();
+ }
+
+ // With IriParsing: http://a/a%21 does not unescape to http://a/a!
+ // but http://a/a%21%30 does unescape to http://a/a!0
+ // This happens with alpha numeric characters, non ASCII,'-','.','_' and '~'.
+ // So we tests characters with and without those characters.
+ private void TestChars (Action<string> action)
+ {
+ var sb1 = new StringBuilder ();
+ var sb2 = new StringBuilder ();
+ for (char c = '\0'; c <= 0x7f; c++) {
+ if (specialTestedChars.Contains ("" + c))
+ continue;
+
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ||
+ c == '-' || c == '.' || c == '_' || c == '~') {
+ sb2.Append (c);
+ continue;
+ }
+
+ sb1.Append (c);
+ sb2.Append (c);
+ }
+
+ foreach (char c in nonAsciiTestedChars)
+ sb2.Append (c);
+
+ action (sb1.ToString ());
+ action (sb2.ToString ());
+
+ foreach (char c in specialTestedChars)
+ action ("" + c);
+ }
+
+ internal static string HexEscapeMultiByte (char character, bool upper)
+ {
+ const string hex_upper_chars = "0123456789ABCDEF";
+ const string hex_lower_chars = "0123456789abcdef";
+
+ string hex_chars = (upper)? hex_upper_chars : hex_lower_chars;
+ string ret = "";
+ byte [] bytes = Encoding.UTF8.GetBytes (new [] {character});
+ foreach (byte b in bytes)
+ ret += "%" + hex_chars [((b & 0xf0) >> 4)] + hex_chars [((b & 0x0f))];
+
+ return ret;
+ }
+
+ private void TestScheme(Action<string> action)
+ {
+ foreach (string scheme in schemes)
+ action(scheme);
+ }
+
+ private delegate string UriToStringDelegate (Uri uri);
+
+ private void TestLocation (string id, string str, UriToStringDelegate toString, bool testRelative = true)
+ {
+ TestScheme (scheme => {
+ string uri = scheme + str;
+ string actual = toString (new Uri (scheme + str, UriKind.Absolute));
+ StringTester.Assert (scheme + id, actual);
+ });
+
+ if (!testRelative)
+ return;
+
+ string relActual = toString (new Uri ("./" + str, UriKind.Relative));
+ StringTester.Assert ("./" + id, relActual);
+ }
+
+ private void TestLocations (string [] locations, string id, string str, UriToStringDelegate toString,
+ bool testRelative = true)
+ {
+ foreach (string location in locations) {
+ if (location.Contains ("{0}"))
+ TestLocation (string.Format (location, id), string.Format (location, str), toString, testRelative);
+ else
+ TestLocation (location + id, location + str, toString, testRelative);
+ }
+ }
+
+ private void TestPercentageEncoding (UriToStringDelegate toString, bool testRelative = false, string id = "")
+ {
+ TestChars (unescapedStr => {
+ var sbUpper = new StringBuilder ();
+ var sbLower = new StringBuilder ();
+ foreach (char c in unescapedStr) {
+ sbUpper.Append (HexEscapeMultiByte (c, true));
+ sbLower.Append (HexEscapeMultiByte (c, false));
+ }
+ string escapedUpperStr = sbUpper.ToString ();
+ string escapedLowerStr = sbLower.ToString ();
+
+ TestLocations (componentLocations, unescapedStr+id, unescapedStr, toString, testRelative);
+ TestLocations (componentLocations, escapedUpperStr+id+"[Upper]", escapedUpperStr, toString, testRelative);
+ TestLocations (componentLocations, escapedLowerStr+id+"[Lower]", escapedLowerStr, toString, testRelative);
+ });
+
+ TestLocations (specialCases, id, "", toString, testRelative);
+ }
+
+ private void TestReduce (UriToStringDelegate toString, bool testRelative = true, string id = "")
+ {
+ foreach(var el in reduceElements)
+ TestLocations (reduceLocations, el + id, el, toString, testRelative);
+ }
+
+ private void TestComponent (UriComponents component)
+ {
+ TestPercentageEncoding (uri => uri.GetComponents (component, UriFormat.SafeUnescaped), id: "[SafeUnescaped]");
+ TestPercentageEncoding (uri => uri.GetComponents (component, UriFormat.Unescaped), id: "[Unescaped]");
+ TestPercentageEncoding (uri => uri.GetComponents (component, UriFormat.UriEscaped), id: "[UriEscaped]");
+ }
+
+ private delegate void TestStringDelegate (UriToStringDelegate toString, bool testRelative = true, string id = "");
+
+ [Test]
+ public void PercentageEncoding_AbsoluteUri ()
+ {
+ TestPercentageEncoding (uri => uri.AbsoluteUri);
+ }
+
+ [Test]
+ public void PercentageEncoding_AbsolutePath ()
+ {
+ TestPercentageEncoding (uri => uri.AbsolutePath);
+ }
+
+ [Test]
+ public void PercentageEncoding_Fragment ()
+ {
+ TestPercentageEncoding (uri => uri.Fragment);
+ }
+
+ [Test]
+ public void PercentageEncoding_GetComponents_AbsoluteUri ()
+ {
+ TestComponent (UriComponents.AbsoluteUri);
+ }
+
+ [Test]
+ public void PercentageEncoding_GetComponents_Fragment ()
+ {
+ TestComponent (UriComponents.Fragment);
+ }
+
+ [Test]
+ public void PercentageEncoding_GetComponents_Host ()
+ {
+ TestComponent (UriComponents.Host);
+ }
+
+ [Test]
+ public void PercentageEncoding_GetComponents_Path ()
+ {
+ TestComponent (UriComponents.Path);
+ }
+
+ [Test]
+ public void PercentageEncoding_GetComponents_PathAndQuery ()
+ {
+ TestComponent (UriComponents.PathAndQuery);
+ }
+
+ [Test]
+ public void PercentageEncoding_GetComponents_Query ()
+ {
+ TestComponent (UriComponents.Query);
+ }
+
+ [Test]
+ public void PercentageEncoding_Query ()
+ {
+ TestPercentageEncoding (uri => uri.Query);
+ }
+
+ [Test]
+ public void PercentageEncoding_ToString ()
+ {
+ TestPercentageEncoding (uri => uri.ToString (), true);
+ }
+
+ class UriEx : Uri
+ {
+ public UriEx (string s) : base (s)
+ {
+ }
+
+ public string UnescapeString (string s)
+ {
+ return Unescape (s);
+ }
+
+ public static string UnescapeString (string uri, string target)
+ {
+ return new UriEx (uri).UnescapeString (target);
+ }
+ }
+
+ [Test]
+ public void PercentageEncoding_Unescape ()
+ {
+ TestChars (str => {
+ var sbUpper = new StringBuilder ();
+ var sbLower = new StringBuilder ();
+ foreach (char c in str) {
+ sbUpper.Append (HexEscapeMultiByte (c, true));
+ sbLower.Append (HexEscapeMultiByte (c, false));
+ }
+ string escapedUpperStr = sbUpper.ToString ();
+ string escapedLowerStr = sbLower.ToString ();
+
+ StringTester.Assert (str + "[Unescaped]", UriEx.UnescapeString ("file://a/", str));
+ StringTester.Assert (escapedUpperStr + "[EscapedUpper]", UriEx.UnescapeString ("file://a/", escapedUpperStr));
+ StringTester.Assert (escapedLowerStr + "[EscapedLower]", UriEx.UnescapeString ("file://a/", escapedLowerStr));
+ });
+
+ foreach (var str in specialCases)
+ StringTester.Assert (str, UriEx.UnescapeString("file://a/", str));
+ }
+
+ [Test]
+ public void Reduce_AbsoluteUri ()
+ {
+ TestReduce (uri => uri.AbsoluteUri, false);
+ }
+
+ [Test]
+ public void Reduce_ToString ()
+ {
+ TestReduce (uri => uri.ToString (), true);
+ }
+ }
+}
\ No newline at end of file
// (C) 2003 Ben Maurer
//
+using System.Reflection;
using NUnit.Framework;
using System;
using System.IO;
public class UriTest
{
protected bool isWin32 = false;
+ public bool IriParsing;
[TestFixtureSetUp]
public void GetReady ()
{
isWin32 = (Path.DirectorySeparatorChar == '\\');
+
+ //Make sure Uri static constructor is called
+ Uri.EscapeDataString ("");
+
+ FieldInfo iriParsingField = typeof (Uri).GetField ("s_IriParsing",
+ BindingFlags.Static | BindingFlags.GetField | BindingFlags.NonPublic);
+ if (iriParsingField != null)
+ IriParsing = (bool)iriParsingField.GetValue (null);
}
[Test]
Assert.AreEqual ("/", uri.AbsolutePath, "#7e");
Assert.AreEqual ("/", uri.PathAndQuery, "#7f");
Assert.AreEqual ("file://one_file.txt/", uri.GetLeftPart (UriPartial.Path), "#7g");
-#if !TARGET_JVM
if (isWin32)
Assert.AreEqual ("\\\\one_file.txt\\", uri.LocalPath, "#7b");
else
Assert.AreEqual ("/", uri.LocalPath, "#7b");
-#endif
Assert.AreEqual ("file", uri.Scheme, "#7c");
Assert.AreEqual ("one_file.txt", uri.Host, "#7d");
}
Uri u1 = new Uri("http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx");
Uri u2 = new Uri("http://localhost:8080/test.aspx?ReturnUrl=%252fSearchDoc%252fSearcher.aspx");
- Assert.AreEqual ("http://localhost:8080/test.aspx?ReturnUrl=/SearchDoc/Searcher.aspx", u1.ToString (), "QE1");
+ if (IriParsing)
+ Assert.AreEqual ("http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx", u1.ToString (), "QE1");
+ else
+ Assert.AreEqual ("http://localhost:8080/test.aspx?ReturnUrl=/SearchDoc/Searcher.aspx", u1.ToString (), "QE1");
+
Assert.AreEqual ("http://localhost:8080/test.aspx?ReturnUrl=%252fSearchDoc%252fSearcher.aspx", u2.ToString (), "QE2");
}
{
Assert.AreEqual ("#", UriEx.UnescapeString ("file://localhost/c#", "%23"), "#1");
Assert.AreEqual ("c#", UriEx.UnescapeString ("file://localhost/c#", "c%23"), "#2");
- Assert.AreEqual ("\xA9", UriEx.UnescapeString ("file://localhost/c#", "%A9"), "#3");
Assert.AreEqual ("#", UriEx.UnescapeString ("http://localhost/c#", "%23"), "#1");
Assert.AreEqual ("c#", UriEx.UnescapeString ("http://localhost/c#", "c%23"), "#2");
+#if NET_4_0
+ Assert.AreEqual ("%A9", UriEx.UnescapeString ("file://localhost/c#", "%A9"), "#3");
+ Assert.AreEqual ("%A9", UriEx.UnescapeString ("http://localhost/c#", "%A9"), "#3");
+#else
+ Assert.AreEqual ("\xA9", UriEx.UnescapeString ("file://localhost/c#", "%A9"), "#3");
Assert.AreEqual ("\xA9", UriEx.UnescapeString ("http://localhost/c#", "%A9"), "#3");
+#endif
}
[Test]
// 2-byte escape sequence, 2 individual characters
uri = new Uri ("file:///foo/a%C2%F8b", true);
path = uri.LocalPath;
+#if NET_4_0
+ Assert.AreEqual ("/foo/a%C2%F8b", path, "#7");
+#else
Assert.AreEqual (9, path.Length, "#7");
Assert.AreEqual (0xC2, path [6], "#8");
Assert.AreEqual (0xF8, path [7], "#9");
+#endif
}
[Test]
public void Fragment_Escape ()
{
Uri u = new Uri("http://localhost/index.asp#main#start", false);
- Assert.AreEqual (u.Fragment, "#main%23start", "#1");
+
+#if NET_4_5
+ Assert.AreEqual (u.Fragment, "#main#start", "#1");
+#else
+ Assert.AreEqual (u.Fragment, "#main%23start", "#1");
+#endif
u = new Uri("http://localhost/index.asp#main#start", true);
Assert.AreEqual (u.Fragment, "#main#start", "#2");
Uri b = new Uri ("http://www.gnome.org");
Uri n = new Uri (b, "blah#main#start");
- Assert.AreEqual (n.Fragment, "#main%23start", "#3");
+#if NET_4_5
+ Assert.AreEqual (n.Fragment, "#main#start", "#3");
+#else
+ Assert.AreEqual (n.Fragment, "#main%23start", "#3");
+#endif
n = new Uri (b, "blah#main#start", true);
Assert.AreEqual (n.Fragment, "#main#start", "#4");
// IPv6 Address
Uri ftp = new Uri ("FTP://[::ffFF:169.32.14.5]/");
Assert.AreEqual ("ftp", ftp.Scheme, "#7");
+
+#if NET_4_5
+ Assert.AreEqual ("[::ffff:169.32.14.5]", ftp.Host, "#8");
+ Assert.AreEqual ("ftp://[::ffff:169.32.14.5]/", ftp.ToString (), "#9");
+#else
Assert.AreEqual ("[0000:0000:0000:0000:0000:FFFF:A920:0E05]", ftp.Host, "#8");
Assert.AreEqual ("ftp://[0000:0000:0000:0000:0000:FFFF:A920:0E05]/", ftp.ToString (), "#9");
+#endif
}
[Test]
new Uri ("hey");
}
+ [Test]
+ public void SchemeWithDigits ()
+ {
+ Uri uri = new Uri ("net.p2p://foobar");
+ Assert.AreEqual ("net.p2p", uri.Scheme);
+ }
+
// on .NET 2.0 a port number is limited to UInt16.MaxValue
[ExpectedException (typeof (UriFormatException))]
[Test]
for (int i = 0; i < 128; i++)
sb.Append ((char) i);
+#if NET_4_5
Assert.AreEqual (
-#if NET_4_0
"%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F",
+ Uri.EscapeDataString (sb.ToString ()));
+#elif NET_4_0
+ Assert.AreEqual (
+ "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22%23%24%25%26'()*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F",
+ Uri.EscapeDataString (sb.ToString ()));
#else
+ Assert.AreEqual (
"%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22%23%24%25%26'()*%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F",
+ Uri.EscapeDataString (sb.ToString ()));
#endif
- Uri.EscapeDataString (sb.ToString ()));
Assert.AreEqual ("%C3%A1", Uri.EscapeDataString ("á"));
}
for (int i = 0; i < 128; i++)
sb.Append ((char) i);
+#if NET_4_5
Assert.AreEqual (
-#if NET_4_0
"%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22#$%25&'()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[%5C]%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F",
+ Uri.EscapeUriString (sb.ToString ()));
+#elif NET_4_0
+ Assert.AreEqual (
+ "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22#$%25&'()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F",
+ Uri.EscapeUriString (sb.ToString ()));
#else
+ Assert.AreEqual (
"%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20!%22#$%25&'()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F",
-#endif
Uri.EscapeUriString (sb.ToString ()));
+#endif
Assert.AreEqual ("%C3%A1", Uri.EscapeDataString ("á"));
}
Assert.IsTrue (Uri.TryCreate (mainUri, uriPath, out result), "#1");
Assert.AreEqual ("http://www.imdb.com/title/tt0106521", result.ToString (), "#2");
}
+
+ [Test]
+ public void GetSerializationInfoStringOnRelativeUri ()
+ {
+ var uri = new Uri ("/relative/path", UriKind.Relative);
+ var result = uri.GetComponents (UriComponents.SerializationInfoString, UriFormat.UriEscaped);
+
+ Assert.AreEqual (uri.OriginalString, result);
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentOutOfRangeException))]
+ public void GetSerializationInfoStringException ()
+ {
+ var uri = new Uri ("/relative/path", UriKind.Relative);
+ uri.GetComponents (UriComponents.SerializationInfoString | UriComponents.Host, UriFormat.UriEscaped);
+ }
+
+ [Test]
+ public void UserInfo_EscapedLetter ()
+ {
+ var uri = new Uri ("https://first%61second@host");
+ Assert.AreEqual ("firstasecond", uri.UserInfo);
+ }
+
+ [Test]
+ public void UserInfo_EscapedAt ()
+ {
+ var userinfo = "first%40second";
+ var uri = new Uri ("https://" + userinfo + "@host");
+ Assert.AreEqual (userinfo, uri.UserInfo);
+ }
+ }
+
+ // Tests non default IriParsing
+ [TestFixture]
+ public class UriTestAux : UriTest
+ {
+ private FieldInfo iriParsingField;
+ private bool originalIriParsing;
+
+ [TestFixtureSetUp]
+ public void GetReady2 ()
+ {
+ isWin32 = (Path.DirectorySeparatorChar == '\\');
+
+ //Make sure Uri static constructor is called
+ Uri.EscapeDataString ("");
+
+ iriParsingField = typeof (Uri).GetField ("s_IriParsing",
+ BindingFlags.Static | BindingFlags.GetField | BindingFlags.NonPublic);
+
+ originalIriParsing = (bool) iriParsingField.GetValue (null);
+
+ IriParsing = !originalIriParsing;
+
+ iriParsingField.SetValue (null, IriParsing);
+ }
+
+ [TestFixtureTearDown]
+ public void TearDown ()
+ {
+ iriParsingField.SetValue (null, originalIriParsing);
+ }
}
}
-//\r
-// UriTest2.cs - More NUnit Test Cases for System.Uri\r
-//\r
-\r
-using System;\r
-using System.IO;\r
-using System.Reflection;\r
-using System.Text;\r
-using NUnit.Framework;\r
-\r
-namespace MonoTests.System\r
-{\r
- // help bring Moonlight tests back to mono/mcs nunit\r
-\r
- public delegate void TestCode ();\r
-\r
- static class Assert2 {\r
-\r
- public static void Throws<TException> (TestCode code, string message) where TException : Exception\r
- {\r
- Throws (code, typeof (TException), null, message);\r
- }\r
-\r
- public static void Throws (TestCode code, Type expected_exception, Type expected_inner_exception, string message)\r
- {\r
- bool failed = false;\r
- try {\r
- code ();\r
- failed = true;\r
- }\r
- catch (Exception ex) {\r
- if (!(ex.GetType () == expected_exception))\r
- throw new AssertionException (string.Format ("Expected '{0}', got '{1}'. {2}", expected_exception.FullName, ex.GetType ().FullName, message));\r
- //System.Diagnostics.Debug.WriteLine (ex.ToString ());\r
- if (expected_inner_exception != null) {\r
- // we only check if the inner exception was supplied\r
- if (ex.InnerException.GetType () != expected_inner_exception)\r
- throw new AssertionException (string.Format ("Expected InnerException '{0}', got '{1}'. {2}", expected_inner_exception.FullName, ex.InnerException.GetType ().FullName, message));\r
- }\r
- }\r
- if (failed)\r
- throw new AssertionException (string.Format ("Expected '{0}', but got no exception. {1}", expected_exception.FullName, message));\r
- }\r
- }\r
-
- [TestFixture]\r
- public class UriTest2\r
- {\r
- protected bool isWin32 = false;\r
- \r
- [SetUp]\r
- public void SetUp ()\r
- {\r
- isWin32 = (Path.DirectorySeparatorChar == '\\');\r
- }\r
-\r
- // Segments cannot be validated here...\r
- public void AssertUri (string relsrc, Uri uri,\r
- string toString,\r
- string absoluteUri,\r
- string scheme,\r
- string host,\r
- string localPath,\r
- string query,\r
- int port,\r
- bool isFile,\r
- bool isUnc,\r
- bool isLoopback,\r
- bool userEscaped,\r
- UriHostNameType hostNameType,\r
- string absolutePath,\r
- string pathAndQuery,\r
- string authority,\r
- string fragment,\r
- string userInfo)\r
- {\r
- Assert.AreEqual (absoluteUri, uri.AbsoluteUri, relsrc + " AbsoluteUri");\r
- Assert.AreEqual (scheme, uri.Scheme, relsrc + " Scheme");\r
- Assert.AreEqual (host, uri.Host, relsrc + " Host");\r
- Assert.AreEqual (port, uri.Port, relsrc + " Port");\r
- // Windows UNC path is not automatically testable on *nix environment,\r
- if (relsrc.StartsWith ("\\\\") && Path.DirectorySeparatorChar == '\\')\r
- Assert.AreEqual (localPath, uri.LocalPath, relsrc + " LocalPath");\r
- Assert.AreEqual (query, uri.Query, relsrc + " Query");\r
- Assert.AreEqual (fragment, uri.Fragment, relsrc + " Fragment");\r
- Assert.AreEqual (isFile, uri.IsFile, relsrc + " IsFile");\r
- Assert.AreEqual (isUnc, uri.IsUnc, relsrc + " IsUnc");\r
- Assert.AreEqual (isLoopback, uri.IsLoopback, relsrc + " IsLoopback");\r
- Assert.AreEqual (authority, uri.Authority, relsrc + " Authority");\r
- Assert.AreEqual (userEscaped, uri.UserEscaped, relsrc + " UserEscaped");\r
- Assert.AreEqual (userInfo, uri.UserInfo, relsrc + " UserInfo");\r
- Assert.AreEqual (hostNameType, uri.HostNameType, relsrc + " HostNameType");\r
- Assert.AreEqual (absolutePath, uri.AbsolutePath, relsrc + " AbsolutePath");\r
- Assert.AreEqual (pathAndQuery, uri.PathAndQuery, relsrc + " PathAndQuery");\r
- Assert.AreEqual (toString, uri.ToString (), relsrc + " ToString()");\r
- }\r
-\r
- [Test]\r
- [Ignore ("Tests needs to be updated for 2.0")]\r
- public void AbsoluteUriFromFile ()\r
- {\r
- FromResource ("test-uri-props.txt", null);\r
- }\r
- \r
- [Test]\r
- [Category("NotDotNet")]\r
- [Ignore ("Tests needs to be updated for 2.0")]\r
- public void AbsoluteUriFromFileManual ()\r
- {\r
- if (Path.DirectorySeparatorChar == '\\')\r
- return;\r
- FromResource ("test-uri-props-manual.txt", null);\r
- }\r
- \r
- [Test]\r
- [Ignore ("Tests needs to be updated for 2.0")]\r
- public void RelativeUriFromFile ()\r
- {\r
- FromResource ("test-uri-relative-props.txt", new Uri ("http://www.go-mono.com"));\r
- }\r
- \r
- private void FromResource (string res, Uri baseUri)\r
- {\r
- Assembly a = Assembly.GetExecutingAssembly ();\r
- Stream s = a.GetManifestResourceStream (res);\r
- StreamReader sr = new StreamReader (s, Encoding.UTF8);\r
- while (sr.Peek () > 0) {\r
- sr.ReadLine (); // skip\r
- string uriString = sr.ReadLine ();\r
-/*\r
-TextWriter sw = Console.Out;\r
- sw.WriteLine ("-------------------------");\r
- sw.WriteLine (uriString);\r
-*/\r
- if (uriString == null || uriString.Length == 0)\r
- break;\r
-\r
- try {\r
- Uri uri = baseUri == null ? new Uri (uriString) : new Uri (baseUri, uriString);\r
-/*\r
- sw.WriteLine ("ToString(): " + uri.ToString ());\r
- sw.WriteLine (uri.AbsoluteUri);\r
- sw.WriteLine (uri.Scheme);\r
- sw.WriteLine (uri.Host);\r
- sw.WriteLine (uri.LocalPath);\r
- sw.WriteLine (uri.Query);\r
- sw.WriteLine ("Port: " + uri.Port);\r
- sw.WriteLine (uri.IsFile);\r
- sw.WriteLine (uri.IsUnc);\r
- sw.WriteLine (uri.IsLoopback);\r
- sw.WriteLine (uri.UserEscaped);\r
- sw.WriteLine ("HostNameType: " + uri.HostNameType);\r
- sw.WriteLine (uri.AbsolutePath);\r
- sw.WriteLine ("PathAndQuery: " + uri.PathAndQuery);\r
- sw.WriteLine (uri.Authority);\r
- sw.WriteLine (uri.Fragment);\r
- sw.WriteLine (uri.UserInfo);\r
-*/\r
- AssertUri (uriString, uri,\r
- sr.ReadLine (),\r
- sr.ReadLine (),\r
- sr.ReadLine (),\r
- sr.ReadLine (),\r
- sr.ReadLine (),\r
- sr.ReadLine (),\r
- int.Parse (sr.ReadLine ()),\r
- bool.Parse (sr.ReadLine ()),\r
- bool.Parse (sr.ReadLine ()),\r
- bool.Parse (sr.ReadLine ()),\r
- bool.Parse (sr.ReadLine ()),\r
- (UriHostNameType) Enum.Parse (typeof (UriHostNameType), sr.ReadLine (), false),\r
- sr.ReadLine (),\r
- sr.ReadLine (),\r
- sr.ReadLine (),\r
- sr.ReadLine (),\r
- sr.ReadLine ());\r
-// Console.WriteLine ("Passed: " + uriString);\r
- } catch (UriFormatException ex) {\r
- Assert.Fail (String.Format ("Construction failed: [{0}] {1}", uriString, ex.Message));\r
- }\r
- }\r
- }\r
-\r
- [Test]\r
- public void MoreUnescape () // bug 733316\r
- {\r
- int index = 0;\r
- char unesc = Uri.HexUnescape ("%F6", ref index);\r
- Assert.AreEqual (3, index, "#01");\r
- Assert.AreEqual (0xf6, unesc, "#02");\r
- }\r
-\r
- [Test]\r
- public void UriScheme ()\r
- {\r
- Assert.AreEqual ("://", Uri.SchemeDelimiter, "://");\r
- Assert.AreEqual ("file", Uri.UriSchemeFile, "file");\r
- Assert.AreEqual ("ftp", Uri.UriSchemeFtp, "ftp");\r
- Assert.AreEqual ("gopher", Uri.UriSchemeGopher, "gopher");\r
- Assert.AreEqual ("http", Uri.UriSchemeHttp, "http");\r
- Assert.AreEqual ("https", Uri.UriSchemeHttps, "https");\r
- Assert.AreEqual ("mailto", Uri.UriSchemeMailto, "mailto");\r
- Assert.AreEqual ("news", Uri.UriSchemeNews, "news");\r
- Assert.AreEqual ("nntp", Uri.UriSchemeNntp, "file");\r
- Assert.AreEqual ("net.pipe", Uri.UriSchemeNetPipe, "net.pipe");\r
- Assert.AreEqual ("net.tcp", Uri.UriSchemeNetTcp, "net.tcp");\r
- }\r
-\r
- [Test] // bug #71049\r
- [ExpectedException (typeof (UriFormatException))]\r
- public void StarsInHost ()\r
- {\r
- new Uri ("http://w*w*w.go-mono.com");\r
- }\r
-\r
- [Test]\r
- public void NoHostName1_Bug76146 ()\r
- {\r
- Uri u = new Uri ("foo:///?bar");\r
- Assert.AreEqual ("/", u.AbsolutePath, "AbsolutePath");\r
- Assert.AreEqual ("foo:///?bar", u.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual (String.Empty, u.Authority, "Authority");\r
- Assert.AreEqual (String.Empty, u.Fragment, "Fragment");\r
- Assert.AreEqual (String.Empty, u.Host, "Host");\r
- // FIXME (2.0) - Normally this is never Basic without an Host name :(\r
- // Assert.AreEqual (UriHostNameType.Basic, u.HostNameType, "HostNameType");\r
- Assert.IsTrue (u.IsDefaultPort, "IsDefaultPort");\r
- Assert.IsFalse (u.IsFile, "IsFile");\r
- // FIXME Assert.IsTrue (u.IsLoopback, "IsLoopback");\r
- Assert.IsFalse (u.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/", u.LocalPath, "LocalPath");\r
- Assert.AreEqual ("/?bar", u.PathAndQuery, "PathAndQuery");\r
- Assert.AreEqual ("foo", u.Scheme, "Scheme");\r
- Assert.IsFalse (u.UserEscaped, "UserEscaped");\r
- Assert.AreEqual (String.Empty, u.UserInfo, "UserInfo");\r
- }\r
-\r
- [Test]\r
- public void NoHostName2_Bug76146 ()\r
- {\r
- Uri u = new Uri ("foo:///bar");\r
- Assert.AreEqual ("/bar", u.AbsolutePath, "AbsolutePath");\r
- Assert.AreEqual ("foo:///bar", u.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual (String.Empty, u.Authority, "Authority");\r
- Assert.AreEqual (String.Empty, u.Fragment, "Fragment");\r
- Assert.AreEqual (String.Empty, u.Host, "Host");\r
- // FIXME (2.0) - Normally this is never Basic without an Host name :(\r
- // Assert.AreEqual (UriHostNameType.Basic, u.HostNameType, "HostNameType");\r
- Assert.IsTrue (u.IsDefaultPort, "IsDefaultPort");\r
- Assert.IsFalse (u.IsFile, "IsFile");\r
- // FIXME Assert.IsTrue (u.IsLoopback, "IsLoopback");\r
- Assert.IsFalse (u.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/bar", u.LocalPath, "LocalPath");\r
- Assert.AreEqual ("/bar", u.PathAndQuery, "PathAndQuery");\r
- Assert.AreEqual ("foo", u.Scheme, "Scheme");\r
- Assert.IsFalse (u.UserEscaped, "UserEscaped");\r
- Assert.AreEqual (String.Empty, u.UserInfo, "UserInfo");\r
- }\r
-\r
- [Test]\r
- [ExpectedException (typeof (UriFormatException))]\r
- public void InvalidIPAddress_Bug76659 ()\r
- {\r
- new Uri ("http://127.0.0.1::::/");\r
- }\r
-
- [Test]\r
- public void File ()\r
- {\r
- string s = "file:///dir1%2f..%2fdir%2fapp.xap#header";\r
- Uri uri = new Uri (s);\r
- Assert.AreEqual ("/dir/app.xap", uri.AbsolutePath, "AbsolutePath");\r
- // default port is removed\r
- Assert.AreEqual ("file:///dir/app.xap#header", uri.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual (String.Empty, uri.DnsSafeHost, "DnsSafeHost");\r
- Assert.AreEqual ("#header", uri.Fragment, "Fragment");\r
- Assert.AreEqual (String.Empty, uri.Host, "Host");\r
- Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");\r
- Assert.IsFalse (uri.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/dir/app.xap", uri.LocalPath, "LocalPath");\r
- Assert.AreEqual (s, uri.OriginalString, "OriginalString");\r
- Assert.AreEqual (-1, uri.Port, "Port");\r
- Assert.AreEqual (String.Empty, uri.Query, "Query");\r
- Assert.AreEqual ("file", uri.Scheme, "Scheme");\r
- Assert.IsFalse (uri.UserEscaped, "UserEscaped");\r
- Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");\r
- Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");\r
- }\r
-\r
- [Test]\r
- public void HttpWithDefaultPort ()\r
- {\r
- string s = "HTTP://host.domain.com:80/app.xap";\r
- Uri uri = new Uri (s);\r
- Assert.AreEqual ("/app.xap", uri.AbsolutePath, "AbsolutePath");\r
- // default port is removed\r
- Assert.AreEqual ("http://host.domain.com/app.xap", uri.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");\r
- Assert.AreEqual (String.Empty, uri.Fragment, "Fragment");\r
- Assert.AreEqual ("host.domain.com", uri.Host, "Host");\r
- Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");\r
- Assert.IsFalse (uri.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/app.xap", uri.LocalPath, "LocalPath");\r
- Assert.AreEqual (s, uri.OriginalString, "OriginalString");\r
- Assert.AreEqual (80, uri.Port, "Port");\r
- Assert.AreEqual (String.Empty, uri.Query, "Query");\r
- Assert.AreEqual ("http", uri.Scheme, "Scheme");\r
- Assert.IsFalse (uri.UserEscaped, "UserEscaped");\r
- Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");\r
- Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");\r
- }\r
-\r
- [Test]\r
- public void HttpWithoutPort ()\r
- {\r
- string s = "Http://host.DOMAIN.com/dir/app.xap#options";\r
- Uri uri = new Uri (s);\r
- Assert.AreEqual ("/dir/app.xap", uri.AbsolutePath, "AbsolutePath");\r
- Assert.AreEqual ("http://host.domain.com/dir/app.xap#options", uri.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");\r
- Assert.AreEqual ("#options", uri.Fragment, "Fragment");\r
- Assert.AreEqual ("host.domain.com", uri.Host, "Host");\r
- Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");\r
- Assert.IsFalse (uri.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/dir/app.xap", uri.LocalPath, "LocalPath");\r
- Assert.AreEqual (s, uri.OriginalString, "OriginalString");\r
- Assert.AreEqual (80, uri.Port, "Port");\r
- Assert.AreEqual (String.Empty, uri.Query, "Query");\r
- Assert.AreEqual ("http", uri.Scheme, "Scheme");\r
- Assert.IsFalse (uri.UserEscaped, "UserEscaped");\r
- Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");\r
- Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");\r
- }\r
-\r
- [Test]\r
- public void HttpWithNonStandardPort ()\r
- {\r
- string s = "http://monkey:s3kr3t@HOST.domain.Com:8080/dir/../app.xap?option=1";\r
- Uri uri = new Uri (s);\r
- Assert.AreEqual ("/app.xap", uri.AbsolutePath, "AbsolutePath");\r
- // non-standard port is present\r
- Assert.AreEqual ("http://monkey:s3kr3t@host.domain.com:8080/app.xap?option=1", uri.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");\r
- Assert.AreEqual (String.Empty, uri.Fragment, "Fragment");\r
- Assert.AreEqual ("host.domain.com", uri.Host, "Host");\r
- Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");\r
- Assert.IsFalse (uri.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/app.xap", uri.LocalPath, "LocalPath");\r
- Assert.AreEqual (s, uri.OriginalString, "OriginalString");\r
- Assert.AreEqual (8080, uri.Port, "Port");\r
- Assert.AreEqual ("?option=1", uri.Query, "Query");\r
- Assert.AreEqual ("http", uri.Scheme, "Scheme");\r
- Assert.IsFalse (uri.UserEscaped, "UserEscaped");\r
- Assert.AreEqual ("monkey:s3kr3t", uri.UserInfo, "UserInfo");\r
- Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");\r
- }\r
-\r
- [Test]\r
- public void HttpsWithDefaultPort ()\r
- {\r
- string s = "httpS://host.domain.com:443/";\r
- Uri uri = new Uri (s);\r
- Assert.AreEqual ("/", uri.AbsolutePath, "AbsolutePath");\r
- // default port is removed\r
- Assert.AreEqual ("https://host.domain.com/", uri.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");\r
- Assert.AreEqual (String.Empty, uri.Fragment, "Fragment");\r
- Assert.AreEqual ("host.domain.com", uri.Host, "Host");\r
- Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");\r
- Assert.IsFalse (uri.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/", uri.LocalPath, "LocalPath");\r
- Assert.AreEqual (s, uri.OriginalString, "OriginalString");\r
- Assert.AreEqual (443, uri.Port, "Port");\r
- Assert.AreEqual (String.Empty, uri.Query, "Query");\r
- Assert.AreEqual ("https", uri.Scheme, "Scheme");\r
- Assert.IsFalse (uri.UserEscaped, "UserEscaped");\r
- Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");\r
- Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");\r
- }\r
-\r
- [Test]\r
- public void HttpsWithoutPort ()\r
- {\r
- string s = "Https://host.DOMAIN.com/dir%2fapp.xap#";\r
- Uri uri = new Uri (s);\r
- Assert.AreEqual ("/dir/app.xap", uri.AbsolutePath, "AbsolutePath");\r
- Assert.AreEqual ("https://host.domain.com/dir/app.xap#", uri.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");\r
- Assert.AreEqual ("#", uri.Fragment, "Fragment");\r
- Assert.AreEqual ("host.domain.com", uri.Host, "Host");\r
- Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");\r
- Assert.IsFalse (uri.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/dir/app.xap", uri.LocalPath, "LocalPath");\r
- Assert.AreEqual (s, uri.OriginalString, "OriginalString");\r
- Assert.AreEqual (443, uri.Port, "Port");\r
- Assert.AreEqual (String.Empty, uri.Query, "Query");\r
- Assert.AreEqual ("https", uri.Scheme, "Scheme");\r
- Assert.IsFalse (uri.UserEscaped, "UserEscaped");\r
- Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");\r
- Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");\r
- }\r
-\r
- [Test]\r
- public void HttpsWithNonStandardPort ()\r
- {\r
- string s = "https://monkey:s3kr3t@HOST.domain.Com:4430/dir/..%5Capp.xap?";\r
- Uri uri = new Uri (s);\r
- Assert.AreEqual ("/app.xap", uri.AbsolutePath, "AbsolutePath");\r
- // non-standard port is present\r
- Assert.AreEqual ("https://monkey:s3kr3t@host.domain.com:4430/app.xap?", uri.AbsoluteUri, "AbsoluteUri");\r
- Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");\r
- Assert.AreEqual (String.Empty, uri.Fragment, "Fragment");\r
- Assert.AreEqual ("host.domain.com", uri.Host, "Host");\r
- Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");\r
- Assert.IsFalse (uri.IsUnc, "IsUnc");\r
- Assert.AreEqual ("/app.xap", uri.LocalPath, "LocalPath");\r
- Assert.AreEqual (s, uri.OriginalString, "OriginalString");\r
- Assert.AreEqual (4430, uri.Port, "Port");\r
- Assert.AreEqual ("?", uri.Query, "Query");\r
- Assert.AreEqual ("https", uri.Scheme, "Scheme");\r
- Assert.IsFalse (uri.UserEscaped, "UserEscaped");\r
- Assert.AreEqual ("monkey:s3kr3t", uri.UserInfo, "UserInfo");\r
- Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");\r
- }\r
-\r
- [Test]\r
- public void Relative ()\r
- {\r
- Uri relative = new Uri ("/Moonlight", UriKind.Relative);\r
-\r
- Assert2.Throws<ArgumentNullException> (delegate {\r
- new Uri (null, "/Moonlight");\r
- }, "null,string");\r
- Assert2.Throws<ArgumentNullException> (delegate {\r
- new Uri (null, relative);\r
- }, "null,Uri");\r
-\r
- Assert2.Throws<ArgumentOutOfRangeException> (delegate {\r
- new Uri (relative, "/Moonlight");\r
- }, "Uri,string");\r
- Assert2.Throws<ArgumentOutOfRangeException> (delegate {\r
- new Uri (relative, relative);\r
- }, "Uri,Uri");\r
-\r
- Assert2.Throws<ArgumentOutOfRangeException> (delegate {\r
- new Uri (relative, (string) null);\r
- }, "Uri,string-null");\r
- Assert2.Throws<ArgumentOutOfRangeException> (delegate {\r
- new Uri (relative, (Uri) null);\r
- }, "Uri,Uri-null");\r
- }\r
-\r
- private void CheckRelativeUri (Uri uri)\r
- {\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.AbsolutePath);\r
- }, "AbsolutePath");\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.AbsoluteUri);\r
- }, "AbsoluteUri");\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.DnsSafeHost);\r
- }, "DnsSafeHost");\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.Fragment);\r
- }, "Fragment");\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.Host);\r
- }, "Host");\r
-\r
- Assert.IsFalse (uri.IsAbsoluteUri, "IsAbsoluteUri");\r
-\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.IsUnc);\r
- }, "IsUnc");\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.LocalPath);\r
- }, "LocalPath");\r
-\r
- Assert.AreEqual ("/Moonlight", uri.OriginalString, "OriginalString");\r
-\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.Port);\r
- }, "Port");\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.Query);\r
- }, "Query");\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.Scheme);\r
- }, "Scheme");\r
-\r
- Assert.IsFalse (uri.UserEscaped, "UserEscaped");\r
-\r
- Assert2.Throws<InvalidOperationException> (delegate {\r
- Assert.IsNotNull (uri.UserInfo);\r
- }, "UserInfo");\r
-\r
- Assert.AreEqual ("/Moonlight", uri.ToString (), "ToString");\r
- }\r
-\r
- [Test]\r
- public void Relative_AsRelative ()\r
- {\r
- Uri uri = new Uri ("/Moonlight", UriKind.Relative);\r
- CheckRelativeUri (uri);\r
- }\r
-\r
- [Test]\r
- public void Bug496783 ()\r
- {\r
- string s = "tcp://csve2.csse.unimelb.edu.au:9090/Aneka";\r
- Uri uri = new Uri (s);\r
- // this is not parsed by a known UriParser\r
- Assert.IsFalse (UriParser.IsKnownScheme (uri.Scheme), "UriParser");\r
-\r
- Uri uri2 = new Uri ("tcp://csve2.csse.unimelb.edu.au:9090/");\r
- Assert.IsTrue (uri2.IsBaseOf (uri), "IsBaseOf");\r
-\r
- Assert.AreEqual (uri.AbsoluteUri, uri.GetComponents (UriComponents.AbsoluteUri, UriFormat.Unescaped), "AbsoluteUri");\r
- Assert.AreEqual (uri.Fragment, uri.GetComponents (UriComponents.Fragment, UriFormat.Unescaped), "Fragment");\r
- Assert.AreEqual (uri.Host, uri.GetComponents (UriComponents.Host, UriFormat.Unescaped), "Host");\r
- Assert.AreEqual (uri.Authority, uri.GetComponents (UriComponents.HostAndPort, UriFormat.Unescaped), "HostAndPort");\r
- Assert.AreEqual (uri.AbsoluteUri, uri.GetComponents (UriComponents.HttpRequestUrl, UriFormat.Unescaped), "HttpRequestUrl");\r
- Assert.AreEqual (String.Empty, uri.GetComponents (UriComponents.KeepDelimiter, UriFormat.Unescaped), "KeepDelimiter");\r
- Assert.AreEqual ("Aneka", uri.GetComponents (UriComponents.Path, UriFormat.Unescaped), "Path");\r
- Assert.AreEqual (uri.LocalPath, uri.GetComponents (UriComponents.PathAndQuery, UriFormat.Unescaped), "PathAndQuery");\r
- Assert.AreEqual (uri.Port.ToString (), uri.GetComponents (UriComponents.Port, UriFormat.Unescaped), "Port");\r
- Assert.AreEqual (uri.Query, uri.GetComponents (UriComponents.Query, UriFormat.Unescaped), "Query");\r
- Assert.AreEqual (uri.Scheme, uri.GetComponents (UriComponents.Scheme, UriFormat.Unescaped), "Scheme");\r
- Assert.AreEqual ("tcp://csve2.csse.unimelb.edu.au:9090", uri.GetComponents (UriComponents.SchemeAndServer, UriFormat.Unescaped), "SchemeAndServer");\r
- Assert.AreEqual (uri.OriginalString, uri.GetComponents (UriComponents.SerializationInfoString, UriFormat.Unescaped), "SerializationInfoString");\r
- Assert.AreEqual (uri.Authority, uri.GetComponents (UriComponents.StrongAuthority, UriFormat.Unescaped), "StrongAuthority");\r
- Assert.AreEqual (uri.Port.ToString (), uri.GetComponents (UriComponents.StrongPort, UriFormat.Unescaped), "StrongPort");\r
- Assert.AreEqual (uri.UserInfo, uri.GetComponents (UriComponents.UserInfo, UriFormat.Unescaped), "UserInfo");\r
- }\r
+//
+// UriTest2.cs - More NUnit Test Cases for System.Uri
+//
+
+using System;
+using System.IO;
+using System.Reflection;
+using System.Text;
+using NUnit.Framework;
+
+namespace MonoTests.System
+{
+ // help bring Moonlight tests back to mono/mcs nunit
+
+ public delegate void TestCode ();
+
+ static class Assert2 {
+
+ public static void Throws<TException> (TestCode code, string message) where TException : Exception
+ {
+ Throws (code, typeof (TException), null, message);
+ }
+
+ public static void Throws (TestCode code, Type expected_exception, Type expected_inner_exception, string message)
+ {
+ bool failed = false;
+ try {
+ code ();
+ failed = true;
+ }
+ catch (Exception ex) {
+ if (!(ex.GetType () == expected_exception))
+ throw new AssertionException (string.Format ("Expected '{0}', got '{1}'. {2}", expected_exception.FullName, ex.GetType ().FullName, message));
+ //System.Diagnostics.Debug.WriteLine (ex.ToString ());
+ if (expected_inner_exception != null) {
+ // we only check if the inner exception was supplied
+ if (ex.InnerException.GetType () != expected_inner_exception)
+ throw new AssertionException (string.Format ("Expected InnerException '{0}', got '{1}'. {2}", expected_inner_exception.FullName, ex.InnerException.GetType ().FullName, message));
+ }
+ }
+ if (failed)
+ throw new AssertionException (string.Format ("Expected '{0}', but got no exception. {1}", expected_exception.FullName, message));
+ }
+ }
+
+ [TestFixture]
+ public class UriTest2
+ {
+ protected bool isWin32 = false;
+ public bool IriParsing;
+
+ [SetUp]
+ public void SetUp ()
+ {
+ isWin32 = (Path.DirectorySeparatorChar == '\\');
+
+ //Make sure Uri static constructor is called
+ Uri.EscapeDataString ("");
+
+ FieldInfo iriParsingField = typeof (Uri).GetField ("s_IriParsing",
+ BindingFlags.Static | BindingFlags.GetField | BindingFlags.NonPublic);
+ if (iriParsingField != null)
+ IriParsing = (bool)iriParsingField.GetValue (null);
+ }
+
+ // Segments cannot be validated here...
+ public void AssertUri (string relsrc, Uri uri,
+ string toString,
+ string absoluteUri,
+ string scheme,
+ string host,
+ string localPath,
+ string query,
+ int port,
+ bool isFile,
+ bool isUnc,
+ bool isLoopback,
+ bool userEscaped,
+ UriHostNameType hostNameType,
+ string absolutePath,
+ string pathAndQuery,
+ string authority,
+ string fragment,
+ string userInfo)
+ {
+ Assert.AreEqual (absoluteUri, uri.AbsoluteUri, relsrc + " AbsoluteUri");
+ Assert.AreEqual (scheme, uri.Scheme, relsrc + " Scheme");
+ Assert.AreEqual (host, uri.Host, relsrc + " Host");
+ Assert.AreEqual (port, uri.Port, relsrc + " Port");
+ // Windows UNC path is not automatically testable on *nix environment,
+ if (relsrc.StartsWith ("\\\\") && Path.DirectorySeparatorChar == '\\')
+ Assert.AreEqual (localPath, uri.LocalPath, relsrc + " LocalPath");
+ Assert.AreEqual (query, uri.Query, relsrc + " Query");
+ Assert.AreEqual (fragment, uri.Fragment, relsrc + " Fragment");
+ Assert.AreEqual (isFile, uri.IsFile, relsrc + " IsFile");
+ Assert.AreEqual (isUnc, uri.IsUnc, relsrc + " IsUnc");
+ Assert.AreEqual (isLoopback, uri.IsLoopback, relsrc + " IsLoopback");
+ Assert.AreEqual (authority, uri.Authority, relsrc + " Authority");
+ Assert.AreEqual (userEscaped, uri.UserEscaped, relsrc + " UserEscaped");
+ Assert.AreEqual (userInfo, uri.UserInfo, relsrc + " UserInfo");
+ Assert.AreEqual (hostNameType, uri.HostNameType, relsrc + " HostNameType");
+ Assert.AreEqual (absolutePath, uri.AbsolutePath, relsrc + " AbsolutePath");
+ Assert.AreEqual (pathAndQuery, uri.PathAndQuery, relsrc + " PathAndQuery");
+ Assert.AreEqual (toString, uri.ToString (), relsrc + " ToString()");
+ }
+
+ [Test]
+ [Ignore ("Tests needs to be updated for 2.0")]
+ public void AbsoluteUriFromFile ()
+ {
+ FromResource ("test-uri-props.txt", null);
+ }
+
+ [Test]
+ [Category("NotDotNet")]
+ [Ignore ("Tests needs to be updated for 2.0")]
+ public void AbsoluteUriFromFileManual ()
+ {
+ if (Path.DirectorySeparatorChar == '\\')
+ return;
+ FromResource ("test-uri-props-manual.txt", null);
+ }
+
+ [Test]
+ [Ignore ("Tests needs to be updated for 2.0")]
+ public void RelativeUriFromFile ()
+ {
+ FromResource ("test-uri-relative-props.txt", new Uri ("http://www.go-mono.com"));
+ }
+
+ private void FromResource (string res, Uri baseUri)
+ {
+ Assembly a = Assembly.GetExecutingAssembly ();
+ Stream s = a.GetManifestResourceStream (res);
+ StreamReader sr = new StreamReader (s, Encoding.UTF8);
+ while (sr.Peek () > 0) {
+ sr.ReadLine (); // skip
+ string uriString = sr.ReadLine ();
+/*
+TextWriter sw = Console.Out;
+ sw.WriteLine ("-------------------------");
+ sw.WriteLine (uriString);
+*/
+ if (uriString == null || uriString.Length == 0)
+ break;
+
+ try {
+ Uri uri = baseUri == null ? new Uri (uriString) : new Uri (baseUri, uriString);
+/*
+ sw.WriteLine ("ToString(): " + uri.ToString ());
+ sw.WriteLine (uri.AbsoluteUri);
+ sw.WriteLine (uri.Scheme);
+ sw.WriteLine (uri.Host);
+ sw.WriteLine (uri.LocalPath);
+ sw.WriteLine (uri.Query);
+ sw.WriteLine ("Port: " + uri.Port);
+ sw.WriteLine (uri.IsFile);
+ sw.WriteLine (uri.IsUnc);
+ sw.WriteLine (uri.IsLoopback);
+ sw.WriteLine (uri.UserEscaped);
+ sw.WriteLine ("HostNameType: " + uri.HostNameType);
+ sw.WriteLine (uri.AbsolutePath);
+ sw.WriteLine ("PathAndQuery: " + uri.PathAndQuery);
+ sw.WriteLine (uri.Authority);
+ sw.WriteLine (uri.Fragment);
+ sw.WriteLine (uri.UserInfo);
+*/
+ AssertUri (uriString, uri,
+ sr.ReadLine (),
+ sr.ReadLine (),
+ sr.ReadLine (),
+ sr.ReadLine (),
+ sr.ReadLine (),
+ sr.ReadLine (),
+ int.Parse (sr.ReadLine ()),
+ bool.Parse (sr.ReadLine ()),
+ bool.Parse (sr.ReadLine ()),
+ bool.Parse (sr.ReadLine ()),
+ bool.Parse (sr.ReadLine ()),
+ (UriHostNameType) Enum.Parse (typeof (UriHostNameType), sr.ReadLine (), false),
+ sr.ReadLine (),
+ sr.ReadLine (),
+ sr.ReadLine (),
+ sr.ReadLine (),
+ sr.ReadLine ());
+// Console.WriteLine ("Passed: " + uriString);
+ } catch (UriFormatException ex) {
+ Assert.Fail (String.Format ("Construction failed: [{0}] {1}", uriString, ex.Message));
+ }
+ }
+ }
+
+ [Test]
+ public void MoreUnescape () // bug 733316
+ {
+ int index = 0;
+ char unesc = Uri.HexUnescape ("%F6", ref index);
+ Assert.AreEqual (3, index, "#01");
+ Assert.AreEqual (0xf6, unesc, "#02");
+ }
+
+ [Test]
+ public void UriScheme ()
+ {
+ Assert.AreEqual ("://", Uri.SchemeDelimiter, "://");
+ Assert.AreEqual ("file", Uri.UriSchemeFile, "file");
+ Assert.AreEqual ("ftp", Uri.UriSchemeFtp, "ftp");
+ Assert.AreEqual ("gopher", Uri.UriSchemeGopher, "gopher");
+ Assert.AreEqual ("http", Uri.UriSchemeHttp, "http");
+ Assert.AreEqual ("https", Uri.UriSchemeHttps, "https");
+ Assert.AreEqual ("mailto", Uri.UriSchemeMailto, "mailto");
+ Assert.AreEqual ("news", Uri.UriSchemeNews, "news");
+ Assert.AreEqual ("nntp", Uri.UriSchemeNntp, "file");
+ Assert.AreEqual ("net.pipe", Uri.UriSchemeNetPipe, "net.pipe");
+ Assert.AreEqual ("net.tcp", Uri.UriSchemeNetTcp, "net.tcp");
+ }
+
+ [Test] // bug #71049
+ [ExpectedException (typeof (UriFormatException))]
+ public void StarsInHost ()
+ {
+ new Uri ("http://w*w*w.go-mono.com");
+ }
+
+ [Test]
+ public void NoHostName1_Bug76146 ()
+ {
+ Uri u = new Uri ("foo:///?bar");
+ Assert.AreEqual ("/", u.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("foo:///?bar", u.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual (String.Empty, u.Authority, "Authority");
+ Assert.AreEqual (String.Empty, u.Fragment, "Fragment");
+ Assert.AreEqual (String.Empty, u.Host, "Host");
+ // FIXME (2.0) - Normally this is never Basic without an Host name :(
+ // Assert.AreEqual (UriHostNameType.Basic, u.HostNameType, "HostNameType");
+ Assert.IsTrue (u.IsDefaultPort, "IsDefaultPort");
+ Assert.IsFalse (u.IsFile, "IsFile");
+ // FIXME Assert.IsTrue (u.IsLoopback, "IsLoopback");
+ Assert.IsFalse (u.IsUnc, "IsUnc");
+ Assert.AreEqual ("/", u.LocalPath, "LocalPath");
+ Assert.AreEqual ("/?bar", u.PathAndQuery, "PathAndQuery");
+ Assert.AreEqual ("foo", u.Scheme, "Scheme");
+ Assert.IsFalse (u.UserEscaped, "UserEscaped");
+ Assert.AreEqual (String.Empty, u.UserInfo, "UserInfo");
+ }
+
+ [Test]
+ public void NoHostName2_Bug76146 ()
+ {
+ Uri u = new Uri ("foo:///bar");
+ Assert.AreEqual ("/bar", u.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("foo:///bar", u.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual (String.Empty, u.Authority, "Authority");
+ Assert.AreEqual (String.Empty, u.Fragment, "Fragment");
+ Assert.AreEqual (String.Empty, u.Host, "Host");
+ // FIXME (2.0) - Normally this is never Basic without an Host name :(
+ // Assert.AreEqual (UriHostNameType.Basic, u.HostNameType, "HostNameType");
+ Assert.IsTrue (u.IsDefaultPort, "IsDefaultPort");
+ Assert.IsFalse (u.IsFile, "IsFile");
+ // FIXME Assert.IsTrue (u.IsLoopback, "IsLoopback");
+ Assert.IsFalse (u.IsUnc, "IsUnc");
+ Assert.AreEqual ("/bar", u.LocalPath, "LocalPath");
+ Assert.AreEqual ("/bar", u.PathAndQuery, "PathAndQuery");
+ Assert.AreEqual ("foo", u.Scheme, "Scheme");
+ Assert.IsFalse (u.UserEscaped, "UserEscaped");
+ Assert.AreEqual (String.Empty, u.UserInfo, "UserInfo");
+ }
+
+ [Test]
+ [ExpectedException (typeof (UriFormatException))]
+ public void InvalidIPAddress_Bug76659 ()
+ {
+ new Uri ("http://127.0.0.1::::/");
+ }
+
+ [Test]
+ public void File ()
+ {
+ string s = "file:///dir1%2f..%2fdir%2fapp.xap#header";
+ Uri uri = new Uri (s);
+ Assert.AreEqual ("/dir/app.xap", uri.AbsolutePath, "AbsolutePath");
+ // default port is removed
+ Assert.AreEqual ("file:///dir/app.xap#header", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual (String.Empty, uri.DnsSafeHost, "DnsSafeHost");
+ Assert.AreEqual ("#header", uri.Fragment, "Fragment");
+ Assert.AreEqual (String.Empty, uri.Host, "Host");
+ Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");
+ Assert.IsFalse (uri.IsUnc, "IsUnc");
+ Assert.AreEqual ("/dir/app.xap", uri.LocalPath, "LocalPath");
+ Assert.AreEqual (s, uri.OriginalString, "OriginalString");
+ Assert.AreEqual (-1, uri.Port, "Port");
+ Assert.AreEqual (String.Empty, uri.Query, "Query");
+ Assert.AreEqual ("file", uri.Scheme, "Scheme");
+ Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+ Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");
+ Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");
+ }
+
+ [Test]
+ public void HttpWithDefaultPort ()
+ {
+ string s = "HTTP://host.domain.com:80/app.xap";
+ Uri uri = new Uri (s);
+ Assert.AreEqual ("/app.xap", uri.AbsolutePath, "AbsolutePath");
+ // default port is removed
+ Assert.AreEqual ("http://host.domain.com/app.xap", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");
+ Assert.AreEqual (String.Empty, uri.Fragment, "Fragment");
+ Assert.AreEqual ("host.domain.com", uri.Host, "Host");
+ Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");
+ Assert.IsFalse (uri.IsUnc, "IsUnc");
+ Assert.AreEqual ("/app.xap", uri.LocalPath, "LocalPath");
+ Assert.AreEqual (s, uri.OriginalString, "OriginalString");
+ Assert.AreEqual (80, uri.Port, "Port");
+ Assert.AreEqual (String.Empty, uri.Query, "Query");
+ Assert.AreEqual ("http", uri.Scheme, "Scheme");
+ Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+ Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");
+ Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");
+ }
+
+ [Test]
+ public void HttpWithoutPort ()
+ {
+ string s = "Http://host.DOMAIN.com/dir/app.xap#options";
+ Uri uri = new Uri (s);
+ Assert.AreEqual ("/dir/app.xap", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("http://host.domain.com/dir/app.xap#options", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");
+ Assert.AreEqual ("#options", uri.Fragment, "Fragment");
+ Assert.AreEqual ("host.domain.com", uri.Host, "Host");
+ Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");
+ Assert.IsFalse (uri.IsUnc, "IsUnc");
+ Assert.AreEqual ("/dir/app.xap", uri.LocalPath, "LocalPath");
+ Assert.AreEqual (s, uri.OriginalString, "OriginalString");
+ Assert.AreEqual (80, uri.Port, "Port");
+ Assert.AreEqual (String.Empty, uri.Query, "Query");
+ Assert.AreEqual ("http", uri.Scheme, "Scheme");
+ Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+ Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");
+ Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");
+ }
+
+ [Test]
+ public void HttpWithNonStandardPort ()
+ {
+ string s = "http://monkey:s3kr3t@HOST.domain.Com:8080/dir/../app.xap?option=1";
+ Uri uri = new Uri (s);
+ Assert.AreEqual ("/app.xap", uri.AbsolutePath, "AbsolutePath");
+ // non-standard port is present
+ Assert.AreEqual ("http://monkey:s3kr3t@host.domain.com:8080/app.xap?option=1", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");
+ Assert.AreEqual (String.Empty, uri.Fragment, "Fragment");
+ Assert.AreEqual ("host.domain.com", uri.Host, "Host");
+ Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");
+ Assert.IsFalse (uri.IsUnc, "IsUnc");
+ Assert.AreEqual ("/app.xap", uri.LocalPath, "LocalPath");
+ Assert.AreEqual (s, uri.OriginalString, "OriginalString");
+ Assert.AreEqual (8080, uri.Port, "Port");
+ Assert.AreEqual ("?option=1", uri.Query, "Query");
+ Assert.AreEqual ("http", uri.Scheme, "Scheme");
+ Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+ Assert.AreEqual ("monkey:s3kr3t", uri.UserInfo, "UserInfo");
+ Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");
+ }
+
+ [Test]
+ public void HttpsWithDefaultPort ()
+ {
+ string s = "httpS://host.domain.com:443/";
+ Uri uri = new Uri (s);
+ Assert.AreEqual ("/", uri.AbsolutePath, "AbsolutePath");
+ // default port is removed
+ Assert.AreEqual ("https://host.domain.com/", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");
+ Assert.AreEqual (String.Empty, uri.Fragment, "Fragment");
+ Assert.AreEqual ("host.domain.com", uri.Host, "Host");
+ Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");
+ Assert.IsFalse (uri.IsUnc, "IsUnc");
+ Assert.AreEqual ("/", uri.LocalPath, "LocalPath");
+ Assert.AreEqual (s, uri.OriginalString, "OriginalString");
+ Assert.AreEqual (443, uri.Port, "Port");
+ Assert.AreEqual (String.Empty, uri.Query, "Query");
+ Assert.AreEqual ("https", uri.Scheme, "Scheme");
+ Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+ Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");
+ Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");
+ }
+
+ [Test]
+ public void HttpsWithoutPort ()
+ {
+ string s = "Https://host.DOMAIN.com/dir%2fapp.xap#";
+ Uri uri = new Uri (s);
+
+ if (IriParsing) {
+ Assert.AreEqual ("/dir%2fapp.xap", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("https://host.domain.com/dir%2fapp.xap#", uri.AbsoluteUri, "AbsoluteUri");
+ } else {
+ Assert.AreEqual ("/dir/app.xap", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("https://host.domain.com/dir/app.xap#", uri.AbsoluteUri, "AbsoluteUri");
+ }
+
+ Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");
+ Assert.AreEqual ("#", uri.Fragment, "Fragment");
+ Assert.AreEqual ("host.domain.com", uri.Host, "Host");
+ Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");
+ Assert.IsFalse (uri.IsUnc, "IsUnc");
+ Assert.AreEqual ("/dir/app.xap", uri.LocalPath, "LocalPath");
+ Assert.AreEqual (s, uri.OriginalString, "OriginalString");
+ Assert.AreEqual (443, uri.Port, "Port");
+ Assert.AreEqual (String.Empty, uri.Query, "Query");
+ Assert.AreEqual ("https", uri.Scheme, "Scheme");
+ Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+ Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");
+ Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");
+ }
+
+ [Test]
+ public void HttpsWithNonStandardPort ()
+ {
+ string s = "https://monkey:s3kr3t@HOST.domain.Com:4430/dir/..%5Capp.xap?";
+ Uri uri = new Uri (s);
+
+ if (IriParsing) {
+ Assert.AreEqual ("/dir/..%5Capp.xap", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("https://monkey:s3kr3t@host.domain.com:4430/dir/..%5Capp.xap?", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual ("/dir/..\\app.xap", uri.LocalPath, "LocalPath");
+ } else {
+ Assert.AreEqual ("/app.xap", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("https://monkey:s3kr3t@host.domain.com:4430/app.xap?", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual ("/app.xap", uri.LocalPath, "LocalPath");
+ }
+
+ Assert.AreEqual ("host.domain.com", uri.DnsSafeHost, "DnsSafeHost");
+ Assert.AreEqual (String.Empty, uri.Fragment, "Fragment");
+ Assert.AreEqual ("host.domain.com", uri.Host, "Host");
+ Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");
+ Assert.IsFalse (uri.IsUnc, "IsUnc");
+ Assert.AreEqual (s, uri.OriginalString, "OriginalString");
+ Assert.AreEqual (4430, uri.Port, "Port");
+ Assert.AreEqual ("?", uri.Query, "Query");
+ Assert.AreEqual ("https", uri.Scheme, "Scheme");
+ Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+ Assert.AreEqual ("monkey:s3kr3t", uri.UserInfo, "UserInfo");
+ Assert.AreEqual (uri.AbsoluteUri, uri.ToString (), "ToString");
+ }
+
+ [Test]
+ public void Relative ()
+ {
+ Uri relative = new Uri ("/Moonlight", UriKind.Relative);
+
+ Assert2.Throws<ArgumentNullException> (delegate {
+ new Uri (null, "/Moonlight");
+ }, "null,string");
+ Assert2.Throws<ArgumentNullException> (delegate {
+ new Uri (null, relative);
+ }, "null,Uri");
+
+ Assert2.Throws<ArgumentOutOfRangeException> (delegate {
+ new Uri (relative, "/Moonlight");
+ }, "Uri,string");
+ Assert2.Throws<ArgumentOutOfRangeException> (delegate {
+ new Uri (relative, relative);
+ }, "Uri,Uri");
+
+ Assert2.Throws<ArgumentOutOfRangeException> (delegate {
+ new Uri (relative, (string) null);
+ }, "Uri,string-null");
+ Assert2.Throws<ArgumentOutOfRangeException> (delegate {
+ new Uri (relative, (Uri) null);
+ }, "Uri,Uri-null");
+ }
+
+ private void CheckRelativeUri (Uri uri)
+ {
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.AbsolutePath);
+ }, "AbsolutePath");
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.AbsoluteUri);
+ }, "AbsoluteUri");
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.DnsSafeHost);
+ }, "DnsSafeHost");
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.Fragment);
+ }, "Fragment");
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.Host);
+ }, "Host");
+
+ Assert.IsFalse (uri.IsAbsoluteUri, "IsAbsoluteUri");
+
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.IsUnc);
+ }, "IsUnc");
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.LocalPath);
+ }, "LocalPath");
+
+ Assert.AreEqual ("/Moonlight", uri.OriginalString, "OriginalString");
+
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.Port);
+ }, "Port");
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.Query);
+ }, "Query");
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.Scheme);
+ }, "Scheme");
+
+ Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+
+ Assert2.Throws<InvalidOperationException> (delegate {
+ Assert.IsNotNull (uri.UserInfo);
+ }, "UserInfo");
+
+ Assert.AreEqual ("/Moonlight", uri.ToString (), "ToString");
+ }
+
+ [Test]
+ public void Relative_AsRelative ()
+ {
+ Uri uri = new Uri ("/Moonlight", UriKind.Relative);
+ CheckRelativeUri (uri);
+ }
+
+ [Test]
+ public void Bug496783 ()
+ {
+ string s = "tcp://csve2.csse.unimelb.edu.au:9090/Aneka";
+ Uri uri = new Uri (s);
+ // this is not parsed by a known UriParser
+ Assert.IsFalse (UriParser.IsKnownScheme (uri.Scheme), "UriParser");
+
+ Uri uri2 = new Uri ("tcp://csve2.csse.unimelb.edu.au:9090/");
+ Assert.IsTrue (uri2.IsBaseOf (uri), "IsBaseOf");
+
+ Assert.AreEqual (uri.AbsoluteUri, uri.GetComponents (UriComponents.AbsoluteUri, UriFormat.Unescaped), "AbsoluteUri");
+ Assert.AreEqual (uri.Fragment, uri.GetComponents (UriComponents.Fragment, UriFormat.Unescaped), "Fragment");
+ Assert.AreEqual (uri.Host, uri.GetComponents (UriComponents.Host, UriFormat.Unescaped), "Host");
+ Assert.AreEqual (uri.Authority, uri.GetComponents (UriComponents.HostAndPort, UriFormat.Unescaped), "HostAndPort");
+ Assert.AreEqual (uri.AbsoluteUri, uri.GetComponents (UriComponents.HttpRequestUrl, UriFormat.Unescaped), "HttpRequestUrl");
+ Assert.AreEqual (String.Empty, uri.GetComponents (UriComponents.KeepDelimiter, UriFormat.Unescaped), "KeepDelimiter");
+ Assert.AreEqual ("Aneka", uri.GetComponents (UriComponents.Path, UriFormat.Unescaped), "Path");
+ Assert.AreEqual (uri.LocalPath, uri.GetComponents (UriComponents.PathAndQuery, UriFormat.Unescaped), "PathAndQuery");
+ Assert.AreEqual (uri.Port.ToString (), uri.GetComponents (UriComponents.Port, UriFormat.Unescaped), "Port");
+ Assert.AreEqual (uri.Query, uri.GetComponents (UriComponents.Query, UriFormat.Unescaped), "Query");
+ Assert.AreEqual (uri.Scheme, uri.GetComponents (UriComponents.Scheme, UriFormat.Unescaped), "Scheme");
+ Assert.AreEqual ("tcp://csve2.csse.unimelb.edu.au:9090", uri.GetComponents (UriComponents.SchemeAndServer, UriFormat.Unescaped), "SchemeAndServer");
+ Assert.AreEqual (uri.OriginalString, uri.GetComponents (UriComponents.SerializationInfoString, UriFormat.Unescaped), "SerializationInfoString");
+ Assert.AreEqual (uri.Authority, uri.GetComponents (UriComponents.StrongAuthority, UriFormat.Unescaped), "StrongAuthority");
+ Assert.AreEqual (uri.Port.ToString (), uri.GetComponents (UriComponents.StrongPort, UriFormat.Unescaped), "StrongPort");
+ Assert.AreEqual (uri.UserInfo, uri.GetComponents (UriComponents.UserInfo, UriFormat.Unescaped), "UserInfo");
+ }
[Test]
public void Merge_Query_Fragment ()
// special characters
uri = new Uri ("mono://host/<>%\"{}|\\^`;/:@&=+$,[]#abc");
- Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
+ if (IriParsing)
+ Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/:@&=+$,[]", uri.AbsolutePath, "Special");
+ else
+ Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
}
[Test]
// special escaped characters - they differs a bit from other URI
uri = new Uri ("news:novell.mono.moonlight/<>%\"{}|\\^`;/?:@&=+$,[]#abc");
- Assert.AreEqual ("novell.mono.moonlight/%3C%3E%25%22%7B%7D%7C%5C%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
Assert.AreEqual ("#abc", uri.Fragment, "Special/Fragment");
+ if (IriParsing)
+ Assert.AreEqual ("novell.mono.moonlight/%3C%3E%25%22%7B%7D%7C%5C%5E%60;/%3F:@&=+$,[]", uri.AbsolutePath, "Special");
+ else
+ Assert.AreEqual ("novell.mono.moonlight/%3C%3E%25%22%7B%7D%7C%5C%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
}
[Test]
// special escaped characters - they differs a bit from other URI
uri = new Uri ("nntp://news.mono-project.com/novell.mono.moonlight/<>%\"{}|\\^`;/?:@&=+$,[]#abc");
- Assert.AreEqual ("/novell.mono.moonlight/%3C%3E%25%22%7B%7D%7C%5C%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
Assert.AreEqual ("#abc", uri.Fragment, "Special/Fragment");
+ if (IriParsing)
+ Assert.AreEqual ("/novell.mono.moonlight/%3C%3E%25%22%7B%7D%7C%5C%5E%60;/%3F:@&=+$,[]", uri.AbsolutePath, "Special");
+ else
+ Assert.AreEqual ("/novell.mono.moonlight/%3C%3E%25%22%7B%7D%7C%5C%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
}
[Test]
// special characters and fragment
uri = new Uri ("ftp://ftp.mono-project.com/<>%\"{}|\\^`;/?:@&=+$,[]#abc");
- Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
Assert.AreEqual ("#abc", uri.Fragment, "Special/Fragment");
+ if (IriParsing)
+ Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/%3F:@&=+$,[]", uri.AbsolutePath, "Special");
+ else
+ Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
}
[Test]
public void FileScheme ()
{
Uri uri = new Uri ("file://host/dir/subdir/file?this-is-not-a-query#but-this-is-a-fragment");
- Assert.AreEqual ("/dir/subdir/file%3Fthis-is-not-a-query", uri.AbsolutePath, "AbsolutePath");
- Assert.AreEqual ("file://host/dir/subdir/file%3Fthis-is-not-a-query#but-this-is-a-fragment", uri.AbsoluteUri, "AbsoluteUri");
+
+ if (IriParsing) {
+ Assert.AreEqual ("/dir/subdir/file", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("file://host/dir/subdir/file?this-is-not-a-query#but-this-is-a-fragment", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual (isWin32 ? "\\\\host\\dir\\subdir\\file" : "/dir/subdir/file", uri.LocalPath, "LocalPath");
+ Assert.AreEqual ("/dir/subdir/file?this-is-not-a-query", uri.PathAndQuery, "PathAndQuery");
+ Assert.AreEqual ("?this-is-not-a-query", uri.Query, "Query");
+ Assert.AreEqual ("file", uri.Segments [3], "Segments [3]");
+ } else {
+ Assert.AreEqual ("/dir/subdir/file%3Fthis-is-not-a-query", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("file://host/dir/subdir/file%3Fthis-is-not-a-query#but-this-is-a-fragment", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual (isWin32 ? "\\\\host\\dir\\subdir\\file?this-is-not-a-query" : "/dir/subdir/file?this-is-not-a-query", uri.LocalPath, "LocalPath");
+ Assert.AreEqual ("/dir/subdir/file%3Fthis-is-not-a-query", uri.PathAndQuery, "PathAndQuery");
+ Assert.AreEqual (String.Empty, uri.Query, "Query");
+ Assert.AreEqual ("file%3Fthis-is-not-a-query", uri.Segments [3], "Segments [3]");
+ }
+
Assert.AreEqual ("host", uri.Authority, "Authority");
Assert.AreEqual ("host", uri.DnsSafeHost, "DnsSafeHost");
Assert.AreEqual ("#but-this-is-a-fragment", uri.Fragment, "Fragment");
Assert.IsTrue (uri.IsFile, "IsFile");
Assert.IsFalse (uri.IsLoopback, "IsLoopback");
Assert.AreEqual (isWin32, uri.IsUnc, "IsUnc");
- Assert.AreEqual (isWin32 ? "\\\\host\\dir\\subdir\\file?this-is-not-a-query" : "/dir/subdir/file?this-is-not-a-query", uri.LocalPath, "LocalPath");
Assert.AreEqual ("file://host/dir/subdir/file?this-is-not-a-query#but-this-is-a-fragment", uri.OriginalString, "OriginalString");
- Assert.AreEqual ("/dir/subdir/file%3Fthis-is-not-a-query", uri.PathAndQuery, "PathAndQuery");
Assert.AreEqual (-1, uri.Port, "Port");
- Assert.AreEqual (String.Empty, uri.Query, "Query");
Assert.AreEqual ("file", uri.Scheme, "Scheme");
Assert.AreEqual ("/", uri.Segments [0], "Segments [0]");
Assert.AreEqual ("dir/", uri.Segments [1], "Segments [1]");
Assert.AreEqual ("subdir/", uri.Segments [2], "Segments [2]");
- Assert.AreEqual ("file%3Fthis-is-not-a-query", uri.Segments [3], "Segments [3]");
Assert.IsFalse (uri.UserEscaped, "UserEscaped");
Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");
// special characters
- uri = new Uri ("file://host/<>%\"{}|\\^`;/?:@&=+$,[]#abc");
- Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
+ uri = new Uri ("file://host/<>%\"{}|\\^`;/:@&=+$,[]?#abc");
+ if (IriParsing)
+ Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/:@&=+$,[]", uri.AbsolutePath, "Special");
+ else
+ Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/:@&=+$,%5B%5D%3F", uri.AbsolutePath, "Special");
}
[Test]
{
Uri uri = new Uri ("http://[1:2:3:4:5:6:7:8]");
Assert.AreEqual (UriHostNameType.IPv6, uri.HostNameType, "1.HostNameType");
- Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", uri.Authority, "1.Authority");
- Assert.AreEqual ("0001:0002:0003:0004:0005:0006:0007:0008", uri.DnsSafeHost, "1.DnsSafeHost");
- Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", uri.Host, "1.Host");
+ if (IriParsing) {
+ Assert.AreEqual ("[1:2:3:4:5:6:7:8]", uri.Authority, "1.Authority");
+ Assert.AreEqual ("1:2:3:4:5:6:7:8", uri.DnsSafeHost, "1.DnsSafeHost");
+ Assert.AreEqual ("[1:2:3:4:5:6:7:8]", uri.Host, "1.Host");
+ } else {
+ Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", uri.Authority, "1.Authority");
+ Assert.AreEqual ("0001:0002:0003:0004:0005:0006:0007:0008", uri.DnsSafeHost, "1.DnsSafeHost");
+ Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", uri.Host, "1.Host");
+ }
uri = new Uri ("http://[fe80::200:39ff:fe36:1a2d%4]/temp/example.htm");
Assert.AreEqual (UriHostNameType.IPv6, uri.HostNameType, "1.HostNameType");
- Assert.AreEqual ("[FE80:0000:0000:0000:0200:39FF:FE36:1A2D]", uri.Authority, "2.Authority");
- Assert.AreEqual ("FE80:0000:0000:0000:0200:39FF:FE36:1A2D%4", uri.DnsSafeHost, "2.DnsSafeHost");
- Assert.AreEqual ("[FE80:0000:0000:0000:0200:39FF:FE36:1A2D]", uri.Host, "2.Host");
+ if (IriParsing) {
+ Assert.AreEqual ("[fe80::200:39ff:fe36:1a2d]", uri.Authority, "2.Authority");
+ Assert.AreEqual ("fe80::200:39ff:fe36:1a2d%4", uri.DnsSafeHost, "2.DnsSafeHost");
+ Assert.AreEqual ("[fe80::200:39ff:fe36:1a2d]", uri.Host, "2.Host");
+ } else {
+ Assert.AreEqual ("[FE80:0000:0000:0000:0200:39FF:FE36:1A2D]", uri.Authority, "2.Authority");
+ Assert.AreEqual ("FE80:0000:0000:0000:0200:39FF:FE36:1A2D%4", uri.DnsSafeHost, "2.DnsSafeHost");
+ Assert.AreEqual ("[FE80:0000:0000:0000:0200:39FF:FE36:1A2D]", uri.Host, "2.Host");
+ }
}
[Test]
public void RelativeEscapes ()
{
Uri uri = new Uri ("%2e%2e/dir/%2e%2e/subdir/file?query#fragment", UriKind.Relative);
- Assert.AreEqual ("%2e%2e/dir/%2e%2e/subdir/file?query#fragment", uri.ToString (), "1.ToString");
+ if (IriParsing)
+ Assert.AreEqual ("../dir/../subdir/file?query#fragment", uri.ToString (), "1.ToString");
+ else
+ Assert.AreEqual ("%2e%2e/dir/%2e%2e/subdir/file?query#fragment", uri.ToString (), "1.ToString");
}
[Test]
public void Fragment_SpecialCharacters ()
{
Uri uri = new Uri ("http://host/dir/file#fragment <>%\"{}|\\^`;/?:@&=+$,[]#second");
- Assert.AreEqual ("#fragment%20%3C%3E%25%22%7B%7D%7C%5C%5E%60;/?:@&=+$,%5B%5D%23second", uri.Fragment, "Fragment");
Assert.AreEqual ("http://host/dir/file#fragment <>%25\"{}|\\^`;/?:@&=+$,[]%23second", uri.ToString (), "ToString");
+ if (IriParsing)
+ Assert.AreEqual ("#fragment%20%3C%3E%25%22%7B%7D%7C%5C%5E%60;/?:@&=+$,[]#second", uri.Fragment, "Fragment");
+ else
+ Assert.AreEqual ("#fragment%20%3C%3E%25%22%7B%7D%7C%5C%5E%60;/?:@&=+$,%5B%5D%23second", uri.Fragment, "Fragment");
}
[Test]
public void Query_SpecialCharacters ()
{
Uri uri = new Uri ("http://host/dir/file?query <>%\"{}|\\^`;/?:@&=+$,[]");
- Assert.AreEqual ("?query%20%3C%3E%25%22%7B%7D%7C%5C%5E%60;/?:@&=+$,%5B%5D", uri.Query, "Query");
Assert.AreEqual ("http://host/dir/file?query <>%25\"{}|\\^`;/?:@&=+$,[]", uri.ToString (), "ToString");
+ if (IriParsing)
+ Assert.AreEqual ("?query%20%3C%3E%25%22%7B%7D%7C%5C%5E%60;/?:@&=+$,[]", uri.Query, "Query");
+ else
+ Assert.AreEqual ("?query%20%3C%3E%25%22%7B%7D%7C%5C%5E%60;/?:@&=+$,%5B%5D", uri.Query, "Query");
}
[Test]
public void OriginalPathEscaped ()
{
Uri uri = new Uri ("http://www.mono-project.com/%41/%42/%43", UriKind.Absolute);
- Assert.AreEqual ("http://www.mono-project.com/%41/%42/%43", uri.AbsoluteUri, "AbsoluteUri");
- Assert.AreEqual ("/%41/%42/%43", uri.AbsolutePath, "AbsolutePath");
Assert.AreEqual ("/A/B/C", uri.LocalPath, "LocalPath");
- Assert.AreEqual ("http://www.mono-project.com/%41/%42/%43", uri.GetLeftPart (UriPartial.Path), "GetLeftPart(Path)");
+ if (IriParsing) {
+ Assert.AreEqual ("http://www.mono-project.com/A/B/C", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual ("/A/B/C", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("http://www.mono-project.com/A/B/C", uri.GetLeftPart (UriPartial.Path), "GetLeftPart(Path)");
+ } else {
+ Assert.AreEqual ("http://www.mono-project.com/%41/%42/%43", uri.AbsoluteUri, "AbsoluteUri");
+ Assert.AreEqual ("/%41/%42/%43", uri.AbsolutePath, "AbsolutePath");
+ Assert.AreEqual ("http://www.mono-project.com/%41/%42/%43", uri.GetLeftPart (UriPartial.Path), "GetLeftPart(Path)");
+ }
}
[Test]
Assert.AreEqual ("ftp", uri.Scheme, "Scheme");
Assert.AreEqual ("/", uri.Segments [0], "Segments [0]");
}
- }\r
-}\r
+ }
+}
Uri u2 = null;
Assert.AreEqual (0, Uri.Compare (u1, u2, UriComponents.AbsoluteUri, UriFormat.UriEscaped, StringComparison.CurrentCulture), "null-null");
+ u1 = new Uri ("http://www.go-mono.com");
+ Assert.AreEqual (1, Uri.Compare (u1, u2, UriComponents.AbsoluteUri, UriFormat.UriEscaped, StringComparison.CurrentCulture), "non-null - null");
+
+ u1 = null;
+ u2 = new Uri ("http://www.go-mono.com");
+ Assert.AreEqual (-1, Uri.Compare (u1, u2, UriComponents.AbsoluteUri, UriFormat.UriEscaped, StringComparison.CurrentCulture), "null - non-null");
+
u1 = new Uri ("http://www.go-mono.com/Main Page");
u2 = new Uri ("http://www.go-mono.com/Main%20Page");
Assert.AreEqual (0, Uri.Compare (u1, u2, UriComponents.AbsoluteUri, UriFormat.Unescaped, StringComparison.CurrentCulture), "http/space-http/%20-unescaped");
http.IsBaseOf (null);
Assert.Fail ();
}
-#if NET_4_0
catch (ArgumentNullException) {
}
-#else
- catch (NullReferenceException) {
- }
-#endif
}
[Test]
System.IO.Compression/CompressionMode.cs
System.IO.Compression/DeflateStream.cs
System.IO.Compression/GZipStream.cs
+System.IO/InternalBufferOverflowException.cs
System.IO/InvalidDataException.cs
System.IO/MonoSyncFileStream.cs
System.Net.Cache/HttpCacheAgeControl.cs
System/UriComponents.cs
System/UriFormat.cs
System/UriFormatException.cs
+System/UriHelper.cs
System/UriHostNameType.cs
System/UriIdnScope.cs
System/UriKind.cs
public static void PartUriIsValid (Uri partUri)
{
if (!partUri.OriginalString.StartsWith ("/"))
- throw new UriFormatException ("PartUris must start with '/'");
+ throw new ArgumentException ("PartUris must start with '/'");
if (partUri.IsAbsoluteUri)
- throw new UriFormatException ("PartUris cannot be absolute");
+ throw new ArgumentException ("PartUris cannot be absolute");
}
public static void RelationshipTypeIsValid (string relationshipType)
public static int ComparePackUri (Uri firstPackUri, Uri secondPackUri)
{
- // FIXME: Do i need to do validation that it is a pack:// uri?
if (firstPackUri == null)
return secondPackUri == null ? 0 : -1;
if (secondPackUri == null)
return 1;
+ Check.PackUriIsValid (firstPackUri);
+ Check.PackUriIsValid (secondPackUri);
+
// FIXME: What exactly is compared. Lets assume originalstring
return firstPackUri.OriginalString.CompareTo (secondPackUri.OriginalString);
}
public static int ComparePartUri (Uri firstPartUri, Uri secondPartUri)
{
- // FIXME: Do i need to do validation that it is a part URI?
if (firstPartUri == null)
return secondPartUri == null ? 0 : -1;
if (secondPartUri == null)
return 1;
+ Check.PartUriIsValid (firstPartUri);
+ Check.PartUriIsValid (secondPartUri);
+
return firstPartUri.OriginalString.CompareTo (secondPartUri.OriginalString);
}
\r
\r
using System;\r
+using System.IO;\r
+using System.IO.Packaging;\r
using System.Collections.Generic;\r
\r
-namespace System.IO.Packaging.Tests {\r
+namespace MonoTests.System.IO.Packaging {\r
\r
public class FakePackage : Package {\r
Dictionary<Uri, PackagePart> Parts { get; set; }\r
return p;\r
}\r
}\r
-}
\ No newline at end of file
+}\r
//
using System;
+using System.IO;
+using System.IO.Packaging;
using System.Collections.Generic;
-namespace System.IO.Packaging.Tests {
+namespace MonoTests.System.IO.Packaging {
class FakePackagePart : PackagePart {
using System;\r
using System.Linq;\r
using System.Collections.Generic;\r
+using System.IO;\r
+using System.IO.Packaging;\r
+using System.Xml;\r
using NUnit.Framework;\r
\r
-namespace System.IO.Packaging.Tests {\r
+namespace MonoTests.System.IO.Packaging {\r
\r
[TestFixture]\r
public class FakePackagePartTests : TestBase {\r
}\r
\r
[Test]\r
- [ExpectedException (typeof (Xml.XmlException))]\r
+ [ExpectedException (typeof (XmlException))]\r
public void CreateDupeRelationship ()\r
{\r
part.CreateRelationship (uris [1], TargetMode.External, "blah", "asda");\r
}\r
\r
[Test]\r
- [ExpectedException (typeof (Xml.XmlException))]\r
+ [ExpectedException (typeof (XmlException))]\r
public void CreateDupeRelationshipId ()\r
{\r
part.CreateRelationship (uris [1], TargetMode.External, "blah", "asda");\r
\r
using System;\r
using System.Collections.Generic;\r
+using System.IO;\r
+using System.IO.Packaging;\r
using System.Linq;\r
using System.Text;\r
using NUnit.Framework;\r
\r
-namespace System.IO.Packaging.Tests\r
+namespace MonoTests.System.IO.Packaging\r
{\r
\r
[TestFixture]\r
using System;
+using System.IO;
using System.Collections.Generic;
-namespace System.IO.Packaging.Tests {
+namespace MonoTests.System.IO.Packaging {
public class FakeStream : MemoryStream {
public bool canRead;
using System.IO.Packaging;\r
using NUnit.Framework;\r
\r
-namespace System.IO.Packaging.Tests {\r
+namespace MonoTests.System.IO.Packaging {\r
\r
[TestFixture]\r
public class PackUriHelperTests {\r
Uri main = new Uri ("/main.html", UriKind.Relative);\r
\r
[Test]\r
- [Category("NotWorking")]\r
public void ComparePackUriTest ()\r
{\r
Assert.AreEqual (0, PackUriHelper.ComparePackUri (null, null), "#1");\r
}\r
\r
[Test]\r
- [Category("NotWorking")]\r
[ExpectedException (typeof (ArgumentException))]\r
public void NonPackUriCompareTest ()\r
{\r
}\r
\r
[Test]\r
- [Category("NotWorking")]\r
[ExpectedException (typeof (ArgumentException))]\r
public void NonPackUriCompareRelativeTest ()\r
{\r
}\r
\r
[Test]\r
- [Category("NotWorking")]\r
[ExpectedException (typeof (ArgumentException))]\r
public void InvalidPartUriCompareTest ()\r
{\r
}\r
\r
[Test]\r
- [Category("NotWorking")]\r
public void CreateTest ()\r
{\r
Assert.AreEqual ("pack://http:,,www.test.com,pack.pkg/",\r
}\r
\r
[Test]\r
- [Category("NotWorking")]\r
public void CreateTest2()\r
{\r
Uri uri = PackUriHelper.Create(new Uri("http://www.test.com/pack1.pkg"));\r
}\r
\r
[Test]\r
- [Category("NotWorking")]\r
public void CreateInvalidTest4 ()\r
{\r
PackUriHelper.Create (new Uri ("http://www.test.com/pack.pkg"), new Uri ("/main.html", UriKind.Relative));\r
}\r
\r
[Test]\r
- [Category("NotWorking")]\r
public void GetPackageUriTest ()\r
{\r
Assert.AreEqual (a, PackUriHelper.GetPackageUri (PackUriHelper.Create (a, new Uri ("/test.html", UriKind.Relative))));\r
}\r
\r
[Test]\r
- [Category("NotWorking")]\r
public void GetPartUriTest ()\r
{\r
var pack = PackUriHelper.Create(new Uri("http://www.test.com/pack1.pkg"));\r
using System.IO.Packaging;
using NUnit.Framework;
-namespace System.IO.Packaging.Tests
+namespace MonoTests.System.IO.Packaging
{
[TestFixture]
public class PackagePartFileTests
}
}
}
-}
\ No newline at end of file
+}
\r
using System;\r
using System.Collections.Generic;\r
+using System.IO;\r
+using System.IO.Packaging;\r
using System.Linq;\r
using System.Text;\r
using NUnit.Framework;\r
\r
-namespace System.IO.Packaging.Tests {\r
+namespace MonoTests.System.IO.Packaging {\r
\r
[TestFixture]\r
public class PackagePartStreamTests : TestBase {\r
Assert.IsTrue (stream.Length > buffer.Length * 2, "#4");\r
}\r
}\r
-}
\ No newline at end of file
+}\r
\r
using System;\r
using System.Collections.Generic;\r
+using System.IO;\r
+using System.IO.Packaging;\r
using System.Linq;\r
using System.Text;\r
using NUnit.Framework;\r
using System.Xml;\r
\r
-namespace System.IO.Packaging.Tests {\r
+namespace MonoTests.System.IO.Packaging {\r
\r
[TestFixture]\r
public class PackagePartTest : TestBase {\r
\r
using System;\r
using System.Collections.Generic;\r
+using System.IO;\r
+using System.IO.Packaging;\r
using System.Linq;\r
using System.Text;\r
using System.Xml;\r
using NUnit.Framework;\r
\r
-namespace System.IO.Packaging.Tests {\r
+namespace MonoTests.System.IO.Packaging {\r
\r
[TestFixture]\r
public class PackageRelationshipTests : TestBase {\r
\r
using System;\r
using System.Collections.Generic;\r
+using System.IO;\r
+using System.IO.Packaging;\r
using System.Linq;\r
using System.Text;\r
using NUnit.Framework;\r
\r
-namespace System.IO.Packaging.Tests {\r
+namespace MonoTests.System.IO.Packaging {\r
\r
[TestFixture]\r
public class PackageTest : TestBase {\r
[ExpectedException (typeof (FileFormatException))]\r
public void WriteOnlyAccessExists ()\r
{\r
- System.IO.File.Create (path).Close ();\r
+ File.Create (path).Close ();\r
package = Package.Open (path, FileMode.OpenOrCreate, FileAccess.Write);\r
}\r
}\r
-}
\ No newline at end of file
+}\r
using System;
using System.Collections.Generic;
+using System.IO;
+using System.IO.Packaging;
using System.Linq;
using System.Text;
using NUnit.Framework;
-namespace System.IO.Packaging.Tests {
+namespace MonoTests.System.IO.Packaging {
public abstract class TestBase {
protected string contentType = "mime/type";
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <ProjectGuid>{F6D9C4EA-ABFE-4596-81A0-89E9D5A2D567}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AssemblyName>WindowsBase</AssemblyName>
- <SchemaVersion>2.0</SchemaVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG;NET_3_0</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>none</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Release</OutputPath>
- <DefineConstants>NET_3_0</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Core" />
- <Reference Include="zipsharp, Version=1.0.3223.25758, Culture=neutral" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <ProjectExtensions>
- <MonoDevelop>
- <Properties>
- <MonoDevelop.Autotools.MakefileInfo RelativeMakefileName="Makefile">
- <BuildFilesVar Sync="true" Name="LIBRARY" />
- <DeployFilesVar />
- <ResourcesVar />
- <OthersVar />
- <GacRefVar Name="TEST_MCS_FLAGS" Prefix="-r:" />
- <AsmRefVar Name="TEST_MCS_FLAGS" Prefix="-r:" />
- <ProjectRefVar Name="TEST_MCS_FLAGS" Prefix="-r:" />
- </MonoDevelop.Autotools.MakefileInfo>
- </Properties>
- </MonoDevelop>
- </ProjectExtensions>
- <ItemGroup>
- <Compile Include="Assembly\AssemblyInfo.cs" />
- <Compile Include="System.Windows.Threading\Dispatcher.cs" />
- <Compile Include="System.Windows.Threading\DispatcherEventArgs.cs" />
- <Compile Include="System.Windows.Threading\DispatcherFrame.cs" />
- <Compile Include="System.Windows.Threading\DispatcherHookEventArgs.cs" />
- <Compile Include="System.Windows.Threading\DispatcherHookEventHandler.cs" />
- <Compile Include="System.Windows.Threading\DispatcherHooks.cs" />
- <Compile Include="System.Windows.Threading\DispatcherObject.cs" />
- <Compile Include="System.Windows.Threading\DispatcherOperation.cs" />
- <Compile Include="System.Windows.Threading\DispatcherOperationCallback.cs" />
- <Compile Include="System.Windows.Threading\DispatcherOperationStatus.cs" />
- <Compile Include="System.Windows.Threading\DispatcherPriority.cs" />
- <Compile Include="System.Windows.Threading\DispatcherProcessingDisabled.cs" />
- <Compile Include="System.Windows.Threading\DispatcherSynchronizationContext.cs" />
- <Compile Include="System.Windows.Threading\DispatcherTimer.cs" />
- <Compile Include="System.Windows.Threading\DispatcherUnhandledExceptionEventArgs.cs" />
- <Compile Include="System.Windows.Threading\DispatcherUnhandledExceptionEventHandler.cs" />
- <Compile Include="System.Windows.Threading\DispatcherUnhandledExceptionFilterEventArgs.cs" />
- <Compile Include="System.Windows.Threading\DispatcherUnhandledExceptionFilterEventHandler.cs" />
- <Compile Include="System.Windows.Media.Converters\MatrixValueSerializer.cs" />
- <Compile Include="System.IO.Packaging\CertificateEmbeddingOption.cs" />
- <Compile Include="System.IO.Packaging\CompressionOption.cs" />
- <Compile Include="System.IO.Packaging\EncryptedPackageEnvelope.cs" />
- <Compile Include="System.IO.Packaging\EncryptionOption.cs" />
- <Compile Include="System.IO.Packaging\InvalidSignatureEventHandler.cs" />
- <Compile Include="System.IO.Packaging\Package.cs" />
- <Compile Include="System.IO.Packaging\PackageDigitalSignature.cs" />
- <Compile Include="System.IO.Packaging\PackageDigitalSignatureManager.cs" />
- <Compile Include="System.IO.Packaging\PackagePart.cs" />
- <Compile Include="System.IO.Packaging\PackagePartCollection.cs" />
- <Compile Include="System.IO.Packaging\PackageProperties.cs" />
- <Compile Include="System.IO.Packaging\PackageRelationship.cs" />
- <Compile Include="System.IO.Packaging\PackageRelationshipCollection.cs" />
- <Compile Include="System.IO.Packaging\PackageRelationshipSelector.cs" />
- <Compile Include="System.IO.Packaging\PackageRelationshipSelectorType.cs" />
- <Compile Include="System.IO.Packaging\PackUriHelper.cs" />
- <Compile Include="System.IO.Packaging\RightsManagementInformation.cs" />
- <Compile Include="System.IO.Packaging\SignatureVerificationEventArgs.cs" />
- <Compile Include="System.IO.Packaging\StorageInfo.cs" />
- <Compile Include="System.IO.Packaging\StreamInfo.cs" />
- <Compile Include="System.IO.Packaging\TargetMode.cs" />
- <Compile Include="System.IO.Packaging\VerifyResult.cs" />
- <Compile Include="System.IO.Packaging\ZipPackage.cs" />
- <Compile Include="System.IO.Packaging\ZipPackagePart.cs" />
- <Compile Include="System.IO\FileFormatException.cs" />
- <Compile Include="System.Diagnostics\PresentationTraceLevel.cs" />
- <Compile Include="System.Diagnostics\PresentationTraceSources.cs" />
- <Compile Include="System.Collections.ObjectModel\ObservableCollection.cs" />
- <Compile Include="System.Collections.ObjectModel\ReadOnlyObservableCollection.cs" />
- <Compile Include="System.Collections.Specialized\CollectionChangedEventManager.cs" />
- <Compile Include="System.Collections.Specialized\INotifyCollectionChanged.cs" />
- <Compile Include="System.Collections.Specialized\NotifyCollectionChangedAction.cs" />
- <Compile Include="System.Collections.Specialized\NotifyCollectionChangedEventArgs.cs" />
- <Compile Include="System.Collections.Specialized\NotifyCollectionChangedEventHandler.cs" />
- <Compile Include="System.ComponentModel\CurrentChangedEventManager.cs" />
- <Compile Include="System.ComponentModel\CurrentChangingEventArgs.cs" />
- <Compile Include="System.ComponentModel\CurrentChangingEventHandler.cs" />
- <Compile Include="System.ComponentModel\CurrentChangingEventManager.cs" />
- <Compile Include="System.ComponentModel\DependencyPropertyDescriptor.cs" />
- <Compile Include="System.ComponentModel\GroupDescription.cs" />
- <Compile Include="System.ComponentModel\ICollectionView.cs" />
- <Compile Include="System.ComponentModel\ICollectionViewFactory.cs" />
- <Compile Include="System.ComponentModel\PropertyChangedEventManager.cs" />
- <Compile Include="System.ComponentModel\PropertyFilterAttribute.cs" />
- <Compile Include="System.ComponentModel\PropertyFilterOptions.cs" />
- <Compile Include="System.ComponentModel\SortDescription.cs" />
- <Compile Include="System.ComponentModel\SortDescriptionCollection.cs" />
- <Compile Include="System.Security.Permissions\MediaPermission.cs" />
- <Compile Include="System.Security.Permissions\MediaPermissionAttribute.cs" />
- <Compile Include="System.Security.Permissions\MediaPermissionAudio.cs" />
- <Compile Include="System.Security.Permissions\MediaPermissionImage.cs" />
- <Compile Include="System.Security.Permissions\MediaPermissionVideo.cs" />
- <Compile Include="System.Security.Permissions\WebBrowserPermission.cs" />
- <Compile Include="System.Security.Permissions\WebBrowserPermissionAttribute.cs" />
- <Compile Include="System.Security.Permissions\WebBrowserPermissionLevel.cs" />
- <Compile Include="System.Security.RightsManagement\AuthenticationType.cs" />
- <Compile Include="System.Security.RightsManagement\ContentGrant.cs" />
- <Compile Include="System.Security.RightsManagement\ContentRight.cs" />
- <Compile Include="System.Security.RightsManagement\ContentUser.cs" />
- <Compile Include="System.Security.RightsManagement\CryptoProvider.cs" />
- <Compile Include="System.Security.RightsManagement\LocalizedNameDescriptionPair.cs" />
- <Compile Include="System.Security.RightsManagement\PublishLicense.cs" />
- <Compile Include="System.Security.RightsManagement\RightsManagementException.cs" />
- <Compile Include="System.Security.RightsManagement\RightsManagementFailureCode.cs" />
- <Compile Include="System.Security.RightsManagement\SecureEnvironment.cs" />
- <Compile Include="System.Security.RightsManagement\UnsignedPublishLicense.cs" />
- <Compile Include="System.Security.RightsManagement\UseLicense.cs" />
- <Compile Include="System.Security.RightsManagement\UserActivationMode.cs" />
- <Compile Include="System.Windows\AttachedPropertyBrowsableAttribute.cs" />
- <Compile Include="System.Windows\AttachedPropertyBrowsableForTypeAttribute.cs" />
- <Compile Include="System.Windows\AttachedPropertyBrowsableWhenAttributePresentAttribute.cs" />
- <Compile Include="System.Windows\CoerceValueCallback.cs" />
- <Compile Include="System.Windows\DependencyObject.cs" />
- <Compile Include="System.Windows\DependencyObjectType.cs" />
- <Compile Include="System.Windows\DependencyProperty.cs" />
- <Compile Include="System.Windows\DependencyPropertyChangedEventArgs.cs" />
- <Compile Include="System.Windows\DependencyPropertyChangedEventHandler.cs" />
- <Compile Include="System.Windows\DependencyPropertyKey.cs" />
- <Compile Include="System.Windows\Expression.cs" />
- <Compile Include="System.Windows\ExpressionConverter.cs" />
- <Compile Include="System.Windows\Freezable.cs" />
- <Compile Include="System.Windows\Int32Rect.cs" />
- <Compile Include="System.Windows\Int32RectConverter.cs" />
- <Compile Include="System.Windows\IWeakEventListener.cs" />
- <Compile Include="System.Windows\LocalValueEntry.cs" />
- <Compile Include="System.Windows\LocalValueEnumerator.cs" />
- <Compile Include="System.Windows\Point.cs" />
- <Compile Include="System.Windows\PointConverter.cs" />
- <Compile Include="System.Windows\PropertyChangedCallback.cs" />
- <Compile Include="System.Windows\PropertyMetadata.cs" />
- <Compile Include="System.Windows\Rect.cs" />
- <Compile Include="System.Windows\RectConverter.cs" />
- <Compile Include="System.Windows\Size.cs" />
- <Compile Include="System.Windows\SizeConverter.cs" />
- <Compile Include="System.Windows\ValidateValueCallback.cs" />
- <Compile Include="System.Windows\Vector.cs" />
- <Compile Include="System.Windows\VectorConverter.cs" />
- <Compile Include="System.Windows\WeakEventManager.cs" />
- <Compile Include="System.Windows.Converters\Int32RectValueSerializer.cs" />
- <Compile Include="System.Windows.Converters\PointValueSerializer.cs" />
- <Compile Include="System.Windows.Converters\RectValueSerializer.cs" />
- <Compile Include="System.Windows.Converters\SizeValueSerializer.cs" />
- <Compile Include="System.Windows.Converters\VectorValueSerializer.cs" />
- <Compile Include="System.Windows.Data\DataSourceProvider.cs" />
- <Compile Include="System.Windows.Input\FocusNavigationDirection.cs" />
- <Compile Include="System.Windows.Input\Key.cs" />
- <Compile Include="System.Windows.Input\KeyConverter.cs" />
- <Compile Include="System.Windows.Input\KeyInterop.cs" />
- <Compile Include="System.Windows.Input\KeyValueSerializer.cs" />
- <Compile Include="System.Windows.Input\ModifierKeys.cs" />
- <Compile Include="System.Windows.Input\ModifierKeysConverter.cs" />
- <Compile Include="System.Windows.Input\ModifierKeysValueSerializer.cs" />
- <Compile Include="System.Windows.Input\TraversalRequest.cs" />
- <Compile Include="System.Windows.Interop\ComponentDispatcher.cs" />
- <Compile Include="System.Windows.Interop\IKeyboardInputSink.cs" />
- <Compile Include="System.Windows.Interop\IKeyboardInputSite.cs" />
- <Compile Include="System.Windows.Interop\MSG.cs" />
- <Compile Include="System.Windows.Interop\ThreadMessageEventHandler.cs" />
- <Compile Include="System.Windows.Markup\ConstructorArgumentAttribute.cs" />
- <Compile Include="System.Windows.Markup\ContentPropertyAttribute.cs" />
- <Compile Include="System.Windows.Markup\ContentWrapperAttribute.cs" />
- <Compile Include="System.Windows.Markup\DateTimeValueSerializer.cs" />
- <Compile Include="System.Windows.Markup\DependsOnAttribute.cs" />
- <Compile Include="System.Windows.Markup\DesignerSerializationOptions.cs" />
- <Compile Include="System.Windows.Markup\DesignerSerializationOptionsAttribute.cs" />
- <Compile Include="System.Windows.Markup\IComponentConnector.cs" />
- <Compile Include="System.Windows.Markup\INameScope.cs" />
- <Compile Include="System.Windows.Markup\InternalTypeHelper.cs" />
- <Compile Include="System.Windows.Markup\IValueSerializerContext.cs" />
- <Compile Include="System.Windows.Markup\IXamlTypeResolver.cs" />
- <Compile Include="System.Windows.Markup\MarkupExtension.cs" />
- <Compile Include="System.Windows.Markup\MarkupExtensionReturnTypeAttribute.cs" />
- <Compile Include="System.Windows.Markup\RootNamespaceAttribute.cs" />
- <Compile Include="System.Windows.Markup\RuntimeNamePropertyAttribute.cs" />
- <Compile Include="System.Windows.Markup\ServiceProviders.cs" />
- <Compile Include="System.Windows.Markup\TrimSurroundingWhitespaceAttribute.cs" />
- <Compile Include="System.Windows.Markup\ValueSerializer.cs" />
- <Compile Include="System.Windows.Markup\ValueSerializerAttribute.cs" />
- <Compile Include="System.Windows.Markup\WhitespaceSignificantCollectionAttribute.cs" />
- <Compile Include="System.Windows.Markup\XmlLangPropertyAttribute.cs" />
- <Compile Include="System.Windows.Markup\XmlnsCompatibleWithAttribute.cs" />
- <Compile Include="System.Windows.Markup\XmlnsDefinitionAttribute.cs" />
- <Compile Include="System.Windows.Markup\XmlnsPrefixAttribute.cs" />
- <Compile Include="System.Windows.Markup.Primitives\MarkupObject.cs" />
- <Compile Include="System.Windows.Markup.Primitives\MarkupProperty.cs" />
- <Compile Include="System.Windows.Media\DisableDpiAwarenessAttribute.cs" />
- <Compile Include="System.Windows.Media\Matrix.cs" />
- <Compile Include="System.Windows.Media\MatrixConverter.cs" />
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />
- <Compile Include="..\..\build\common\Consts.cs" />
- <Compile Include="Test\System.IO.Packaging\FakePackage.cs" />
- <Compile Include="Test\System.IO.Packaging\FakeStream.cs" />
- <Compile Include="Test\System.IO.Packaging\PackagePartTest.cs" />
- <Compile Include="Test\System.IO.Packaging\PackageRelationshipTests.cs" />
- <Compile Include="Test\System.IO.Packaging\PackageTest.cs" />
- <Compile Include="Test\System.IO.Packaging\TestBase.cs" />
- <Compile Include="System.IO.Packaging\Check.cs" />
- <Compile Include="Test\System.IO.Packaging\FakePackagePart.cs" />
- <Compile Include="Test\System.IO.Packaging\FakePackagePartTests.cs" />
- <Compile Include="Test\System.IO.Packaging\FakePackageTests.cs" />
- <Compile Include="Test\System.IO.Packaging\PackagePartStreamTests.cs" />
- <Compile Include="System.IO.Packaging\ZipPartStream.cs" />
- <Compile Include="Test\System.Collections.ObjectModel\ObservableCollectionTest.cs" />
- <Compile Include="Test\System.Windows\DependencyObjectTest.cs" />
- <Compile Include="Test\System.Windows\DependencyObjectTypeTest.cs" />
- <Compile Include="Test\System.Windows\DependencyPropertyTest.cs" />
- <Compile Include="Test\System.Windows\FreezableTest.cs" />
- <Compile Include="Test\System.Windows\Int32RectConverterTest.cs" />
- <Compile Include="Test\System.Windows\Int32RectTest.cs" />
- <Compile Include="Test\System.Windows\PointConverterTest.cs" />
- <Compile Include="Test\System.Windows\PointTest.cs" />
- <Compile Include="Test\System.Windows\PropertyMetadataTest.cs" />
- <Compile Include="Test\System.Windows\RectConverterTest.cs" />
- <Compile Include="Test\System.Windows\RectTest.cs" />
- <Compile Include="Test\System.Windows\SizeConverterTest.cs" />
- <Compile Include="Test\System.Windows\SizeTest.cs" />
- <Compile Include="Test\System.Windows\VectorConverterTest.cs" />
- <Compile Include="Test\System.Windows\VectorTest.cs" />
- <Compile Include="ZipSharp\IOFunctions.cs" />
- <Compile Include="ZipSharp\NativeUnzip.cs" />
- <Compile Include="ZipSharp\NativeZip.cs" />
- <Compile Include="ZipSharp\UnzipArchive.cs" />
- <Compile Include="ZipSharp\UnzipFileInfo.cs" />
- <Compile Include="ZipSharp\UnzipHandle.cs" />
- <Compile Include="ZipSharp\UnzipReadStream.cs" />
- <Compile Include="ZipSharp\ZipArchive.cs" />
- <Compile Include="ZipSharp\ZipFileInfo.cs" />
- <Compile Include="ZipSharp\ZipHandle.cs" />
- <Compile Include="ZipSharp\ZipStream.cs" />
- <Compile Include="ZipSharp\ZipTime.cs" />
- <Compile Include="ZipSharp\ZipWriteStream.cs" />
- <Compile Include="System.IO.Packaging\PackagePropertiesPart.cs" />
- <Compile Include="Test\System.Collections.Specialized\CollectionChangedEventValidators.cs" />
- <Compile Include="Test\System.Collections.Specialized\NotifyCollectionChangedEventArgsTest.cs" />
- <Compile Include="Test\System.Collections.ObjectModel\ReadOnlyObservableCollectionTest.cs" />
- <Compile Include="Test\System.Windows.Markup\ConstructorArgumentAttributeTest.cs" />
- <Compile Include="Test\System.Windows.Markup\ContentPropertyAttributeTest.cs" />
- <Compile Include="Test\System.Windows.Markup\ContentWrapperAttributeTest.cs" />
- <Compile Include="Test\System.Windows.Markup\DateTimeValueSerializerTest.cs" />
- <Compile Include="Test\System.Windows.Markup\DependsOnAttributeTest.cs" />
- <Compile Include="Test\System.Windows.Markup\MarkupExtensionReturnTypeAttributeTest.cs" />
- <Compile Include="Test\System.Windows.Markup\ValueSerializerTest.cs" />
- <Compile Include="Test\System.IO.Packaging\PackUriHelperTests.cs" />
- <Compile Include="Test\System.IO.Packaging\PackagePartFileTests.cs" />
- </ItemGroup>
-</Project>
\ No newline at end of file
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsBase", "WindowsBase.csproj", "{F6D9C4EA-ABFE-4596-81A0-89E9D5A2D567}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Release|Any CPU = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {F6D9C4EA-ABFE-4596-81A0-89E9D5A2D567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {F6D9C4EA-ABFE-4596-81A0-89E9D5A2D567}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {F6D9C4EA-ABFE-4596-81A0-89E9D5A2D567}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {F6D9C4EA-ABFE-4596-81A0-89E9D5A2D567}.Release|Any CPU.Build.0 = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(MonoDevelopProperties) = preSolution\r
- name = WindowsBase\r
- StartupItem = WindowsBase.csproj\r
- EndGlobalSection\r
-EndGlobal\r
@echo Running vts tests...
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) -noshadow \
$(vtsdir)/$(PROFILE)_TestLib/BinarySerializationOverVersions.exe
+ifndef NO_TEST
test: test-vts
run-test: run-test-vts
+endif
EXTRA_DISTFILES += \
$(vtsdir)/VersionTolerantSerializationTestLib/1.0/Address.cs \
/// <returns>An integer value representing the fixed day number.
/// </returns>
public static int fixed_from_dmy(int day, int month, int year) {
+ if (month > 12) {
+ year += CCMath.div_mod (out month, month - 1, 12);
+ month++;
+ }
+
int k = epoch - 1;
k += 365 * (year-1);
k += CCMath.div(year-1, 4);
/// </returns>
public static int fixed_from_dmy(int day, int month, int year) {
int y = year < 0 ? year+1 : year;
+
+ if (month > 12) {
+ y += CCMath.div_mod (out month, month - 1, 12);
+ month++;
+ }
+
int k = epoch - 1;
k += 365 * (y-1);
k += CCMath.div(y-1, 4);
/// <returns>An integer value representing the fixed day number.
/// </returns>
public static int fixed_from_dmy(int day, int month, int year) {
+ var lastMonth = last_month_of_year (year);
+ while (month > lastMonth) {
+ year++;
+ month -= lastMonth;
+ lastMonth = last_month_of_year (year);
+ }
+
int m;
int k = epoch-1;
k += elapsed_days(year);
/// <returns>An integer value representing the fixed day number.
/// </returns>
public static int fixed_from_dmy(int day, int month, int year) {
+ if (month > 12) {
+ year += CCMath.div_mod (out month, month - 1, 12);
+ month++;
+ }
+
int k = epoch - 1;
k += 354 * (year-1);
k += CCMath.div(3+11*year, 30);
// Jim Richardson, develop@wtfo-guru.com
// Dan Lewis, dihlewis@yahoo.co.uk
// Sebastien Pouliot <sebastien@ximian.com>
+// Marek Safar <marek.safar@gmail.com>
//
// Copyright (C) 2002 Ximian, Inc.
// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2014 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
throw MonoIO.GetException (Path.GetDirectoryName (path_with_pattern), (MonoIOError) error);
try {
- if (((rattr & FileAttributes.ReparsePoint) == 0)){
- if ((rattr & FileAttributes.Directory) != 0)
- yield return new DirectoryInfo (s);
- else
- yield return new FileInfo (s);
- }
-
- while ((s = MonoIO.FindNext (handle, out rattr, out error)) != null){
- if ((rattr & FileAttributes.ReparsePoint) != 0)
- continue;
- if ((rattr & FileAttributes.Directory) != 0)
- yield return new DirectoryInfo (s);
- else
- yield return new FileInfo (s);
-
+ do {
+ if (((rattr & FileAttributes.ReparsePoint) == 0)){
+ if ((rattr & FileAttributes.Directory) != 0)
+ yield return new DirectoryInfo (s);
+ else
+ yield return new FileInfo (s);
+ }
+
if (((rattr & FileAttributes.Directory) != 0) && subdirs)
foreach (FileSystemInfo child in EnumerateFileSystemInfos (s, searchPattern, searchOption))
yield return child;
- }
+
+ } while ((s = MonoIO.FindNext (handle, out rattr, out error)) != null);
} finally {
MonoIO.FindClose (handle);
}
canonicalize = start > 0;
}
- path = Directory.InsecureGetCurrentDirectory() + DirectorySeparatorStr + path;
+ var cwd = Directory.InsecureGetCurrentDirectory();
+ if (cwd [cwd.Length - 1] == DirectorySeparatorChar)
+ path = cwd + path;
+ else
+ path = cwd + DirectorySeparatorChar + path;
} else if (DirectorySeparatorChar == '\\' &&
path.Length >= 2 &&
IsDsc (path [0]) &&
using System;
using System.IO;
using System.Runtime.InteropServices;
+#if NET_4_5
+using System.Threading;
+using System.Threading.Tasks;
+#endif
namespace System.IO
{
#if NET_4_0
SafeBuffer safebuffer;
#endif
+#if NET_4_5
+ Task<int> read_task;
+#endif
internal event EventHandler Closed;
return progress;
}
+#if NET_4_5
+ public override Task<int> ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ {
+ if (buffer == null)
+ throw new ArgumentNullException("buffer");
+ if (offset < 0)
+ throw new ArgumentOutOfRangeException("offset", "Non-negative number required.");
+ if (count < 0)
+ throw new ArgumentOutOfRangeException("count", "Non-negative number required.");
+ if ((buffer.Length - offset) < count)
+ throw new ArgumentException("The length of the buffer array minus the offset parameter is less than the count parameter");
+
+ if (cancellationToken.IsCancellationRequested)
+ return TaskConstants<int>.Canceled;
+
+ try {
+ count = Read (buffer, offset, count);
+
+ // Try not to allocate a new task for every buffer read
+ if (read_task == null || read_task.Result != count)
+ read_task = Task<int>.FromResult (count);
+
+ return read_task;
+ } catch (Exception ex) {
+ return Task<int>.FromException (ex);
+ }
+ }
+
+#endif
+
public override int ReadByte ()
{
if (closed)
//This method performs no action for this class
//but is included as part of the Stream base class
}
+
+#if NET_4_5
+ public override Task FlushAsync (CancellationToken cancellationToken)
+ {
+ if (cancellationToken.IsCancellationRequested)
+ return TaskConstants.Canceled;
+
+ try {
+ Flush ();
+ return TaskConstants.Finished;
+ } catch (Exception ex) {
+ return Task<object>.FromException (ex);
+ }
+ }
+#endif
protected override void Dispose (bool disposing)
{
if (current_position > length)
length = current_position;
}
+
+#if NET_4_5
+ public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ {
+ if (buffer == null)
+ throw new ArgumentNullException("The buffer parameter is a null reference");
+ if (offset < 0)
+ throw new ArgumentOutOfRangeException("offset", "Non-negative number required.");
+ if (count < 0)
+ throw new ArgumentOutOfRangeException("count", "Non-negative number required.");
+ if ((buffer.Length - offset) < count)
+ throw new ArgumentException("The length of the buffer array minus the offset parameter is less than the count parameter");
+ if (current_position > capacity - count)
+ throw new NotSupportedException ("Unable to expand length of this stream beyond its capacity.");
+
+ if (cancellationToken.IsCancellationRequested)
+ return TaskConstants.Canceled;
+
+ try {
+ Write (buffer, offset, count);
+ return TaskConstants.Finished;
+ } catch (Exception ex) {
+ return Task<object>.FromException (ex);
+ }
+ }
+#endif
public override void WriteByte (byte value)
{
if (parent == pmodule.assemblyb.corlib_enum_type && methods != null)
throw new TypeLoadException ("Could not load type '" + FullName + "' from assembly '" + Assembly + "' because it is an enum with methods.");
+ if (interfaces != null) {
+ foreach (var iface in interfaces) {
+ if (iface.IsNestedPrivate && iface.Assembly != Assembly)
+ throw new TypeLoadException ("Could not load type '" + FullName + "' from assembly '" + Assembly + "' because it is implements the inaccessible interface '" + iface.FullName + "'.");
+ }
+ }
if (methods != null) {
bool is_concrete = !IsAbstract;
}
}
- //
- // The following functions are only for the Mono Debugger.
- //
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- internal static extern int MonoDebugger_GetMethodToken (MethodBase method);
-
[MonoTODO ("Currently it always returns zero")]
[ComVisible (false)]
public
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Text;
+using System.Runtime.Serialization;
namespace System.Reflection
{
[Serializable]
[ClassInterfaceAttribute (ClassInterfaceType.None)]
[StructLayout (LayoutKind.Sequential)]
-#if MOBILE
- public partial class ParameterInfo : ICustomAttributeProvider {
-#else
- public partial class ParameterInfo : ICustomAttributeProvider, _ParameterInfo {
+ public partial class ParameterInfo : ICustomAttributeProvider
+
+#if !MOBILE
+ , _ParameterInfo
#endif
+#if NET_4_0
+ , IObjectReference
+#endif
+ {
protected Type ClassImpl;
protected object DefaultValueImpl;
protected MemberInfo MemberImpl;
return new object [0];
}
+ public object GetRealObject (StreamingContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
public virtual bool IsDefined( Type attributeType, bool inherit) {
return false;
}
-#if NET_4_5
//
// InterfaceImplementedInVersionAttribute.cs
//
// 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;
+
+#if NET_4_5
using System.Runtime.CompilerServices;
namespace System.Runtime.InteropServices.WindowsRuntime
{
- [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
+ [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
public sealed class InterfaceImplementedInVersionAttribute : Attribute
{
public InterfaceImplementedInVersionAttribute (Type interfaceType, byte majorVersion, byte minorVersion,
namespace System.Runtime.Serialization
{
[System.Runtime.InteropServices.ComVisibleAttribute (true)]
- public sealed class FormatterServices
+#if NET_4_5
+ static
+#else
+ sealed
+#endif
+ public class FormatterServices
{
private const BindingFlags fieldFlags = BindingFlags.Public |
BindingFlags.Instance |
BindingFlags.NonPublic |
BindingFlags.DeclaredOnly;
+#if !NET_4_5
private FormatterServices ()
{
}
+#endif
public static object [] GetObjectData (object obj, MemberInfo [] members)
{
--- /dev/null
+//
+// CompatibilitySwitch.cs
+//
+// Authors:
+// Marek Safar (marek.safar@gmail.com)
+//
+// Copyright 2014 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
+
+namespace System.Runtime.Versioning {
+ public static class CompatibilitySwitch
+ {
+ public static bool IsEnabled (string compatibilitySwitchName)
+ {
+ return false;
+ }
+
+ public static string GetValue (string compatibilitySwitchName)
+ {
+ return null;
+ }
+ }
+}
+
+#endif
\ No newline at end of file
get { return false; }
}
- [MonoTODO ("Always returns GCLatencyMode.Interactive and ignores set (.NET 2.0 SP1 member)")]
+ [MonoTODO ("Always returns GCLatencyMode.Interactive and ignores set")]
public static GCLatencyMode LatencyMode {
[ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
get { return GCLatencyMode.Interactive; }
[ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
set { ; }
}
+
+#if NET_4_5
+ public static GCLargeObjectHeapCompactionMode LargeObjectHeapCompactionMode {
+ [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
+ get;
+ [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
+ set;
+ }
+#endif
}
}
+++ /dev/null
-//
-// Claim.cs
-//
-// Authors:
-// Miguel de Icaza (miguel@xamarin.com)
-//
-// Copyright 2014 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;
-
-namespace System.Security.Claims {
-
- public static class AuthenticationTypes {
- public const string Basic = "Basic";
- public const string Federation = "Federation";
- public const string Kerberos = "Kerberos";
- public const string Negotiate = "Negotiate";
- public const string Password = "Password";
- public const string Signature = "Signature";
- public const string Windows = "Windows";
- public const string X509 = "X509";
- }
-}
public const string AuthorizationDecision = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authorizationdecision";
- public const string ClaimsType2005Namespace = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims";
-
- public const string ClaimsType2009Namespace = "http://schemas.xmlsoap.org/ws/2009/09/identity/claims";
-
- public const string ClaimsTypeNamespace = "http://schemas.microsoft.com/ws/2008/06/identity/claims";
-
public const string CookiePath = "http://schemas.microsoft.com/ws/2008/06/identity/claims/cookiepath";
public const string Country = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country";
public const string DateOfBirth = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth";
- public const string DenyOnlyPrimaryGroup = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroup";
+ public const string DenyOnlyPrimaryGroupSid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid";
public const string DenyOnlyPrimarySid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid";
public const string DenyOnlySid = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/denyonlysid";
+ public const string DenyOnlyWindowsDeviceGroup = "http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlywindowsdevicegroup";
+
public const string Dns = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dns";
public const string Dsa = "http://schemas.microsoft.com/ws/2008/06/identity/claims/dsa";
- public const string Email = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/email";
+ public const string Email = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress";
public const string Expiration = "http://schemas.microsoft.com/ws/2008/06/identity/claims/expiration";
public const string PostalCode = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode";
- public const string PPID = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier";
-
public const string PrimaryGroupSid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid";
public const string PrimarySid = "http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid";
public const string WindowsAccountName = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname";
+ public const string WindowsDeviceClaim = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdeviceclaim";
+
+ public const string WindowsDeviceGroup = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdevicegroup";
+
+ public const string WindowsFqbnVersion = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsfqbnversion";
+
+ public const string WindowsSubAuthority = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowssubauthority";
+
+ public const string WindowsUserClaim = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsuserclaim";
+
public const string X500DistinguishedName = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/x500distinguishedname";
}
}
//
// Authors:
// Miguel de Icaza (miguel@xamarin.com)
+// Marek Safar (marek.safar@gmail.com)
//
// Copyright 2014 Xamarin Inc
//
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_5
-using System;
+
using System.Collections.Generic;
using System.Security.Principal;
using System.Runtime.Serialization;
+
namespace System.Security.Claims {
[Serializable]
[NonSerializedAttribute]
public const string DefaultIssuer = "LOCAL AUTHORITY";
- List<Claim> claims;
+ readonly List<Claim> claims;
ClaimsIdentity actor;
- string auth_type;
+ readonly string auth_type;
public ClaimsIdentity ()
: this (claims: null, authenticationType: null, nameType: null, roleType: null)
public ClaimsIdentity(IEnumerable<Claim> claims, string authenticationType, string nameType, string roleType)
: this (identity: null, claims: claims, authenticationType: authenticationType, nameType: nameType, roleType: roleType)
{
- claims = claims == null ? new List<Claim> (): new List<Claim> (claims);
-
- // Special case: if empty, set to null.
- if (authenticationType == "")
- auth_type = null;
- else
- auth_type = authenticationType;
-
- NameClaimType = nameType == null ? DefaultNameClaimType : nameType;
- RoleClaimType = roleType == null ? DefaultRoleClaimType : roleType;
}
public ClaimsIdentity (IIdentity identity, IEnumerable<Claim> claims)
: this (identity, claims, authenticationType: null, nameType: null, roleType: null)
- { }
+ {
+ }
public ClaimsIdentity (IIdentity identity, IEnumerable<Claim> claims, string authenticationType, string nameType, string roleType)
{
- var ci = identity as ClaimsIdentity;
- NameClaimType = nameType == null ? DefaultNameClaimType : nameType;
- RoleClaimType = roleType == null ? DefaultRoleClaimType : roleType;
-
+ NameClaimType = string.IsNullOrEmpty (nameType) ? DefaultNameClaimType : nameType;
+ RoleClaimType = string.IsNullOrEmpty (roleType) ? DefaultRoleClaimType : roleType;
+ auth_type = authenticationType;
+
this.claims = new List<Claim> ();
- if (ci != null){
- actor = ci.Actor;
- BootstrapContext = ci.BootstrapContext;
- foreach (var c in ci.Claims)
- this.claims.Add (c);
+
+ if (identity != null) {
+ if (string.IsNullOrEmpty (authenticationType))
+ auth_type = identity.AuthenticationType;
+
+ var ci = identity as ClaimsIdentity;
+ if (ci != null) {
+ actor = ci.Actor;
+ BootstrapContext = ci.BootstrapContext;
+ foreach (var c in ci.Claims)
+ this.claims.Add (c);
- Label = ci.Label;
- NameClaimType = ci.NameClaimType;
- RoleClaimType = ci.RoleClaimType;
- auth_type = ci.AuthenticationType;
+ Label = ci.Label;
+ NameClaimType = string.IsNullOrEmpty (nameType) ? ci.NameClaimType : nameType;
+ RoleClaimType = string.IsNullOrEmpty (roleType) ? ci.RoleClaimType : roleType;
+ } else if (!string.IsNullOrEmpty (identity.Name)) {
+ AddDefaultClaim (identity.Name);
+ }
}
if (claims != null) {
- foreach (var c in claims)
- this.claims.Add (c);
+ AddClaims (claims);
}
}
return actor;
}
set {
- if (actor == this)
+ if (value == this)
throw new InvalidOperationException ("can not set the Actor property to this instance");
+
actor = value;
}
}
{
if (claim == null)
throw new ArgumentNullException ("claim");
+
+ if (claim.Subject != this)
+ claim = claim.Clone (this);
+
claims.Add (claim);
}
{
if (claims == null)
throw new ArgumentNullException ("claims");
+
foreach (var c in claims)
- this.claims.Add (c);
+ AddClaim (c);
+ }
+
+ internal void AddDefaultClaim (string identityName)
+ {
+ this.claims.Add (new Claim (NameClaimType, identityName, "http://www.w3.org/2001/XMLSchema#string", DefaultIssuer, DefaultIssuer, this));
}
public virtual ClaimsIdentity Clone ()
yield return c;
}
- public virtual IEnumerable<Claim> FindAll(string type)
+ public virtual IEnumerable<Claim> FindAll (string type)
{
if (type == null)
throw new ArgumentNullException ("type");
foreach (var c in claims)
- if (c.Type == type)
+ if (string.Equals (c.Type, type, StringComparison.OrdinalIgnoreCase))
yield return c;
}
if (type == null)
throw new ArgumentNullException ("type");
foreach (var c in claims)
- if (c.Type == type)
+ if (string.Equals (c.Type, type, StringComparison.OrdinalIgnoreCase))
return c;
return null;
}
if (value == null)
throw new ArgumentNullException ("value");
foreach (var c in claims){
- if (c.Type == type && c.Value == value)
+ if (string.Equals (c.Type, type, StringComparison.OrdinalIgnoreCase) && c.Value == value)
return true;
}
return false;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_5
-using System;
+
using System.Collections.Generic;
using System.Security.Principal;
using System.Runtime.Serialization;
throw new ArgumentNullException ("identity");
identities = new List<ClaimsIdentity> ();
- identities.Add (new ClaimsIdentity (identity));
+ identities.Add (identity as ClaimsIdentity ?? new ClaimsIdentity (identity));
}
public ClaimsPrincipal (IPrincipal principal)
}
return false;
}
+
+ public virtual bool HasClaim (string type, string value)
+ {
+ foreach(var claim in Claims){
+ if (claim.Type == type && claim.Value == value)
+ return true;
+ }
+ return false;
+ }
+
+ public virtual Claim FindFirst (string type)
+ {
+ if (type == null)
+ throw new ArgumentNullException ("type");
+ return FindFirst(x => x.Type == type);
+ }
+
+ public virtual IEnumerable<Claim> FindAll (string type)
+ {
+ if (type == null)
+ throw new ArgumentNullException ("type");
+ return FindAll(x => x.Type == type);
+ }
}
}
//
// System.Security.Principal.GenericIdentity.cs
//
-// Author:
+// Authors:
// Miguel de Icaza (miguel@ximian.com)
+// Marek Safar (marek.safar@gmail.com)
//
// (C) Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2006 Novell, Inc (http://www.novell.com)
//
using System.Runtime.InteropServices;
+using System.Collections.Generic;
+#if NET_4_5
+using System.Security.Claims;
+#endif
namespace System.Security.Principal {
[Serializable]
[ComVisible (true)]
- public class GenericIdentity : IIdentity {
+ public class GenericIdentity :
+#if NET_4_5
+ ClaimsIdentity
+#else
+ IIdentity
+#endif
+ {
// field names are serialization compatible with .net
private string m_name;
m_name = name;
m_type = type;
+
+#if NET_4_5
+ AddDefaultClaim (name);
+#endif
}
public GenericIdentity (string name)
{
}
- public virtual string AuthenticationType {
+#if NET_4_5
+ protected GenericIdentity (GenericIdentity identity)
+ : base (identity)
+ {
+ }
+#endif
+
+#if NET_4_5
+ override
+#else
+ virtual
+#endif
+ public string AuthenticationType {
get {
return m_type;
}
}
- public virtual string Name {
+#if NET_4_5
+ override
+#else
+ virtual
+#endif
+ public string Name {
get {
return m_name;
}
}
- public virtual bool IsAuthenticated {
+#if NET_4_5
+ override
+#else
+ virtual
+#endif
+ public bool IsAuthenticated {
get {
return (m_name.Length > 0);
}
}
+
+#if NET_4_5
+ public override IEnumerable<Claim> Claims {
+ get {
+ return base.Claims;
+ }
+ }
+#endif
}
}
//
using System.Runtime.InteropServices;
+#if NET_4_5
+using System.Security.Claims;
+#endif
namespace System.Security.Principal {
[Serializable]
[ComVisible (true)]
- public class GenericPrincipal : IPrincipal {
+ public class GenericPrincipal :
+#if NET_4_5
+ ClaimsPrincipal
+#else
+ IPrincipal
+#endif
+ {
// field names are serialization compatible with .net
private IIdentity m_identity;
get { return m_roles; }
}
- public virtual IIdentity Identity {
+#if NET_4_5
+ override
+#else
+ virtual
+#endif
+ public IIdentity Identity {
get { return m_identity; }
}
- public virtual bool IsInRole (string role)
+#if NET_4_5
+ override
+#else
+ virtual
+#endif
+ public bool IsInRole (string role)
{
if (m_roles == null)
return false;
static private IntPtr invalidWindows = IntPtr.Zero;
+#if NET_4_5
+ [NonSerialized]
+ public new const string DefaultIssuer = "AD AUTHORITY";
+#endif
+
[SecurityPermission (SecurityAction.Demand, ControlPrincipal=true)]
public WindowsIdentity (IntPtr userToken)
: this (userToken, null, WindowsAccountType.Normal, false)
using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
+#if NET_4_5
+using System.Security.Claims;
+#endif
namespace System.Security.Principal {
[Serializable]
[ComVisible (true)]
- public class WindowsPrincipal : IPrincipal {
-
+ public class WindowsPrincipal :
+#if NET_4_5
+ ClaimsPrincipal
+#else
+ IPrincipal
+#endif
+ {
private WindowsIdentity _identity;
// http://groups.google.ca/groups?q=WindowsPrincipal+m_roles&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OghXf4OgCHA.4228%40tkmsftngp08&rnum=4
private string [] m_roles;
}
// properties
-
- public virtual IIdentity Identity {
+#if NET_4_5
+ override
+#else
+ virtual
+#endif
+ public IIdentity Identity {
get { return _identity; }
}
}
}
- public virtual bool IsInRole (string role)
+#if NET_4_5
+ override
+#else
+ virtual
+#endif
+ public bool IsInRole (string role)
{
if (role == null)
return false; // ArgumentNullException
}
// Forwarding decoder implementation.
- private sealed class ForwardingDecoder : Decoder
+ private sealed class ForwardingDecoder : EncodingDecoder
{
- private Encoding encoding;
-
// Constructor.
public ForwardingDecoder (Encoding enc)
+ : base (enc)
{
- encoding = enc;
- DecoderFallback fallback = encoding.DecoderFallback;
- if (fallback != null)
- Fallback = fallback;
}
// Override inherited methods.
} // class ForwardingDecoder
// Forwarding encoder implementation.
- private sealed class ForwardingEncoder : Encoder
+ private sealed class ForwardingEncoder : EncodingEncoder
{
- private Encoding encoding;
-
// Constructor.
public ForwardingEncoder (Encoding enc)
+ : base (enc)
{
- encoding = enc;
- EncoderFallback fallback = encoding.EncoderFallback;
- if (fallback != null)
- Fallback = fallback;
}
// Override inherited methods.
--- /dev/null
+//
+// System.Text.EncodingDecoder.cs
+//
+// Authors:
+// Marcos Henrich (marcos.henrich@xamarin.com)
+//
+// Copyright (C) 2014 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;
+using System.Runtime.InteropServices;
+
+namespace System.Text {
+
+abstract class EncodingDecoder : Decoder {
+ protected readonly Encoding encoding;
+
+ // Constructor.
+ protected EncodingDecoder (Encoding encoding)
+ {
+ this.encoding = encoding;
+ var fallback = encoding.DecoderFallback;
+ if (fallback != null)
+ Fallback = fallback;
+ }
+
+ public unsafe override void Convert (
+ byte* bytes, int byteCount,
+ char* chars, int charCount, bool flush,
+ out int bytesUsed, out int charsUsed, out bool completed)
+ {
+ if (chars == null)
+ throw new ArgumentNullException ("chars");
+ if (bytes == null)
+ throw new ArgumentNullException ("bytes");
+ if (charCount < 0)
+ throw new ArgumentOutOfRangeException ("charCount");
+ if (byteCount < 0)
+ throw new ArgumentOutOfRangeException ("byteCount");
+
+ bytesUsed = encoding.GetByteCount(chars, charCount);
+
+ if (bytesUsed > byteCount) {
+ charsUsed = encoding.GetChars (bytes, byteCount, chars, charCount);
+ bytesUsed = encoding.GetByteCount (chars, charsUsed);
+ } else
+ charsUsed = encoding.GetChars (bytes, bytesUsed, chars, charCount);
+
+
+ completed = bytesUsed == byteCount;
+ }
+
+ public override void Convert (
+ byte [] bytes, int byteIndex, int byteCount,
+ char [] chars, int charIndex, int charCount, bool flush,
+ out int bytesUsed, out int charsUsed, out bool completed)
+ {
+ if (chars == null)
+ throw new ArgumentNullException ("chars");
+ if (bytes == null)
+ throw new ArgumentNullException ("bytes");
+ if (charIndex < 0)
+ throw new ArgumentOutOfRangeException ("charIndex");
+ if (charCount < 0 || chars.Length < charIndex + charCount)
+ throw new ArgumentOutOfRangeException ("charCount");
+ if (byteIndex < 0)
+ throw new ArgumentOutOfRangeException ("byteIndex");
+ if (byteCount < 0 || bytes.Length < byteIndex + byteCount)
+ throw new ArgumentOutOfRangeException ("byteCount");
+
+ bytesUsed = encoding.GetByteCount(chars, charIndex, charCount);
+
+ if (bytesUsed > byteCount) {
+ charsUsed = encoding.GetChars (bytes, byteIndex, byteCount, chars, charIndex);
+ bytesUsed = encoding.GetByteCount (chars, charIndex, charsUsed);
+ } else
+ charsUsed = encoding.GetChars (bytes, byteIndex, bytesUsed, chars, charIndex);
+
+ completed = bytesUsed == byteCount;
+ }
+}; // class EncodingDecoder
+
+}; // namespace System.Text
--- /dev/null
+//
+// System.Text.EncodingEncoder.cs
+//
+// Authors:
+// Marcos Henrich (marcos.henrich@xamarin.com)
+//
+// Copyright (C) 2014 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;
+using System.Runtime.InteropServices;
+
+namespace System.Text {
+
+abstract class EncodingEncoder : Encoder {
+ protected readonly Encoding encoding;
+
+ // Constructor.
+ protected EncodingEncoder (Encoding encoding)
+ {
+ this.encoding = encoding;
+ var fallback = encoding.EncoderFallback;
+ if (fallback != null)
+ Fallback = fallback;
+ }
+
+ public unsafe override void Convert (
+ char* chars, int charCount,
+ byte* bytes, int byteCount, bool flush,
+ out int charsUsed, out int bytesUsed, out bool completed)
+ {
+ if (chars == null)
+ throw new ArgumentNullException ("chars");
+ if (bytes == null)
+ throw new ArgumentNullException ("bytes");
+ if (charCount < 0)
+ throw new ArgumentOutOfRangeException ("charCount");
+ if (byteCount < 0)
+ throw new ArgumentOutOfRangeException ("byteCount");
+
+ charsUsed = encoding.GetCharCount (bytes, byteCount);
+
+ if (charsUsed > charCount)
+ charsUsed = charCount;
+
+ bytesUsed = encoding.GetBytes (chars, charsUsed, bytes, byteCount);
+
+ completed = charsUsed == charCount;
+ }
+
+ public override void Convert (
+ char [] chars, int charIndex, int charCount,
+ byte [] bytes, int byteIndex, int byteCount, bool flush,
+ out int charsUsed, out int bytesUsed, out bool completed)
+ {
+ if (chars == null)
+ throw new ArgumentNullException ("chars");
+ if (bytes == null)
+ throw new ArgumentNullException ("bytes");
+ if (charIndex < 0)
+ throw new ArgumentOutOfRangeException ("charIndex");
+ if (charCount < 0 || chars.Length < charIndex + charCount)
+ throw new ArgumentOutOfRangeException ("charCount");
+ if (byteIndex < 0)
+ throw new ArgumentOutOfRangeException ("byteIndex");
+ if (byteCount < 0 || bytes.Length < byteIndex + byteCount)
+ throw new ArgumentOutOfRangeException ("byteCount");
+
+ charsUsed = encoding.GetCharCount (bytes, byteIndex, byteCount);
+
+ if (charsUsed > charCount)
+ charsUsed = charCount;
+
+ bytesUsed = encoding.GetBytes (chars, charIndex, charsUsed, bytes, byteIndex);
+
+ completed = charsUsed == charCount;
+ }
+}; // class EncodingEncoder
+
+}; // namespace System.Text
// Get a UTF7-specific decoder that is attached to this instance.
public override Decoder GetDecoder ()
{
- return new UTF7Decoder ();
+ return new UTF7Decoder (this);
}
// Get a UTF7-specific encoder that is attached to this instance.
public override Encoder GetEncoder ()
{
- return new UTF7Encoder (allowOptionals);
+ return new UTF7Encoder (allowOptionals, this);
}
// UTF-7 decoder implementation.
- private sealed class UTF7Decoder : Decoder
+ private sealed class UTF7Decoder : EncodingDecoder
{
// Internal state.
private int leftOver;
// Constructor.
- public UTF7Decoder ()
+ public UTF7Decoder (Encoding encoding)
+ : base (encoding)
{
leftOver = 0;
}
} // class UTF7Decoder
// UTF-7 encoder implementation.
- private sealed class UTF7Encoder : Encoder
+ private sealed class UTF7Encoder : EncodingEncoder
{
private bool allowOptionals;
private int leftOver = 0;
private bool isInShifted = false;
// Constructor.
- public UTF7Encoder (bool allowOptionals)
+ public UTF7Encoder (bool allowOptionals, UTF7Encoding encoding)
+ : base (encoding)
{
this.allowOptionals = allowOptionals;
}
private unsafe static int InternalGetCharCount (
byte[] bytes, int index, int count, uint leftOverBits,
uint leftOverCount, object provider,
- ref DecoderFallbackBuffer fallbackBuffer, ref byte [] bufferArg, bool flush)
+ ref DecoderFallbackBuffer fallbackBuffer, bool flush)
{
// Validate the parameters.
if (bytes == null) {
return 0;
fixed (byte *bptr = bytes)
return InternalGetCharCount (bptr + index, count,
- leftOverBits, leftOverCount, provider, ref fallbackBuffer, ref bufferArg, flush);
+ leftOverBits, leftOverCount, provider, ref fallbackBuffer, flush);
}
private unsafe static int InternalGetCharCount (
- byte* bytes, int count, uint leftOverBits,
+ byte* bytes, int byteCount, uint leftOverBits,
uint leftOverCount, object provider,
- ref DecoderFallbackBuffer fallbackBuffer, ref byte [] bufferArg, bool flush)
+ ref DecoderFallbackBuffer fallbackBuffer, bool flush)
{
- int index = 0;
+ int byteIndex = 0;
int length = 0;
if (leftOverCount == 0) {
- int end = index + count;
- for (; index < end; index++, count--) {
- if (bytes [index] < 0x80)
+ int end = byteIndex + byteCount;
+ for (; byteIndex < end; byteIndex++, byteCount--) {
+ if (bytes [byteIndex] < 0x80)
length++;
else
break;
uint leftBits = leftOverBits;
uint leftSoFar = (leftOverCount & (uint)0x0F);
uint leftSize = ((leftOverCount >> 4) & (uint)0x0F);
- while (count > 0) {
- ch = (uint)(bytes[index++]);
- --count;
+
+ int byteEnd = byteIndex + byteCount;
+ for(; byteIndex < byteEnd; byteIndex++) {
+ // Fetch the next character from the byte buffer.
+ ch = (uint)(bytes[byteIndex]);
if (leftSize == 0) {
// Process a UTF-8 start character.
if (ch < (uint)0x0080) {
leftSize = 6;
} else {
// Invalid UTF-8 start character.
- length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - 1, 1);
+ length += Fallback (provider, ref fallbackBuffer, bytes, byteIndex, 1);
}
} else {
// Process an extra byte in a multi-byte sequence.
break;
}
if (overlong) {
- length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - leftSoFar, leftSoFar);
+ length += Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar);
+ --byteIndex; //process byte again
}
else if ((leftBits & 0xF800) == 0xD800) {
// UTF-8 doesn't use surrogate characters
- length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - leftSoFar, leftSoFar);
+ length += Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar);
}
else
++length;
} else if (leftBits < (uint)0x110000) {
length += 2;
} else {
- length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - leftSoFar, leftSoFar);
+ length += Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar);
}
leftSize = 0;
}
} else {
// Invalid UTF-8 sequence: clear and restart.
- length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - leftSoFar, leftSoFar);
+ length += Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar);
leftSize = 0;
- --index;
- ++count;
+ --byteIndex;
}
}
}
if (flush && leftSize != 0) {
// We had left-over bytes that didn't make up
// a complete UTF-8 character sequence.
- length += Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, index - leftSoFar, leftSoFar);
+ length += Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar);
}
// Return the final length to the caller.
}
// for GetCharCount()
- static unsafe int Fallback (object provider, ref DecoderFallbackBuffer buffer, ref byte [] bufferArg, byte* bytes, long index, uint size)
+ static unsafe int Fallback (object provider, ref DecoderFallbackBuffer buffer, byte* bytes, long index, uint size)
{
if (buffer == null) {
DecoderFallback fb = provider as DecoderFallback;
else
buffer = ((Decoder) provider).FallbackBuffer;
}
- if (bufferArg == null)
- bufferArg = new byte [1];
- int ret = 0;
- for (int i = 0; i < size; i++) {
- bufferArg [0] = bytes [(int) index + i];
- buffer.Fallback (bufferArg, 0);
- ret += buffer.Remaining;
- buffer.Reset ();
- }
+
+ var bufferArg = new byte [size];
+
+ for (int i = 0; i < size; i++)
+ bufferArg [i] = bytes [(int) index + i];
+
+ buffer.Fallback (bufferArg, 0);
+ int ret = buffer.Remaining;
+ buffer.Reset ();
+
return ret;
}
// for GetChars()
- static unsafe void Fallback (object provider, ref DecoderFallbackBuffer buffer, ref byte [] bufferArg, byte* bytes, long byteIndex, uint size,
+ static unsafe void Fallback (object provider, ref DecoderFallbackBuffer buffer, byte* bytes, long byteIndex, uint size,
char* chars, ref int charIndex)
{
if (buffer == null) {
else
buffer = ((Decoder) provider).FallbackBuffer;
}
- if (bufferArg == null)
- bufferArg = new byte [1];
- for (int i = 0; i < size; i++) {
- bufferArg [0] = bytes [byteIndex + i];
- buffer.Fallback (bufferArg, 0);
- while (buffer.Remaining > 0)
- chars [charIndex++] = buffer.GetNextChar ();
- buffer.Reset ();
- }
+
+ var bufferArg = new byte [size];
+
+ for (int i = 0; i < size; i++)
+ bufferArg [i] = bytes [byteIndex + i];
+
+ buffer.Fallback (bufferArg, 0);
+ while (buffer.Remaining > 0)
+ chars [charIndex++] = buffer.GetNextChar ();
+ buffer.Reset ();
}
// Get the number of characters needed to decode a byte buffer.
public override int GetCharCount (byte[] bytes, int index, int count)
{
DecoderFallbackBuffer buf = null;
- byte [] bufferArg = null;
- return InternalGetCharCount (bytes, index, count, 0, 0, DecoderFallback, ref buf, ref bufferArg, true);
+ return InternalGetCharCount (bytes, index, count, 0, 0, DecoderFallback, ref buf, true);
}
[CLSCompliant (false)]
public unsafe override int GetCharCount (byte* bytes, int count)
{
DecoderFallbackBuffer buf = null;
- byte [] bufferArg = null;
- return InternalGetCharCount (bytes, count, 0, 0, DecoderFallback, ref buf, ref bufferArg, true);
+ return InternalGetCharCount (bytes, count, 0, 0, DecoderFallback, ref buf, true);
}
// Get the characters that result from decoding a byte buffer.
byte[] bytes, int byteIndex, int byteCount, char[] chars,
int charIndex, ref uint leftOverBits, ref uint leftOverCount,
object provider,
- ref DecoderFallbackBuffer fallbackBuffer, ref byte [] bufferArg, bool flush)
+ ref DecoderFallbackBuffer fallbackBuffer, bool flush)
{
// Validate the parameters.
if (bytes == null) {
fixed (char* cptr = chars) {
if (byteCount == 0 || byteIndex == bytes.Length)
- return InternalGetChars (null, 0, cptr + charIndex, chars.Length - charIndex, ref leftOverBits, ref leftOverCount, provider, ref fallbackBuffer, ref bufferArg, flush);
+ return InternalGetChars (null, 0, cptr + charIndex, chars.Length - charIndex, ref leftOverBits, ref leftOverCount, provider, ref fallbackBuffer, flush);
// otherwise...
fixed (byte* bptr = bytes)
- return InternalGetChars (bptr + byteIndex, byteCount, cptr + charIndex, chars.Length - charIndex, ref leftOverBits, ref leftOverCount, provider, ref fallbackBuffer, ref bufferArg, flush);
+ return InternalGetChars (bptr + byteIndex, byteCount, cptr + charIndex, chars.Length - charIndex, ref leftOverBits, ref leftOverCount, provider, ref fallbackBuffer, flush);
}
}
byte* bytes, int byteCount, char* chars, int charCount,
ref uint leftOverBits, ref uint leftOverCount,
object provider,
- ref DecoderFallbackBuffer fallbackBuffer, ref byte [] bufferArg, bool flush)
+ ref DecoderFallbackBuffer fallbackBuffer, bool flush)
{
int charIndex = 0, byteIndex = 0;
int length = charCount;
leftSize = 6;
} else {
// Invalid UTF-8 start character.
- Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex, 1, chars, ref posn);
+ Fallback (provider, ref fallbackBuffer, bytes, byteIndex, 1, chars, ref posn);
}
} else {
// Process an extra byte in a multi-byte sequence.
break;
}
if (overlong) {
- Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
+ Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
+ --byteIndex; //process byte again
}
else if ((leftBits & 0xF800) == 0xD800) {
// UTF-8 doesn't use surrogate characters
- Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
+ Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
}
else {
if (posn >= length) {
chars[posn++] =
(char)((leftBits & (uint)0x3FF) + (uint)0xDC00);
} else {
- Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
+ Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
}
leftSize = 0;
}
} else {
// Invalid UTF-8 sequence: clear and restart.
- Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
+ Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
leftSize = 0;
--byteIndex;
}
if (flush && leftSize != 0) {
// We had left-over bytes that didn't make up
// a complete UTF-8 character sequence.
- Fallback (provider, ref fallbackBuffer, ref bufferArg, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
+ Fallback (provider, ref fallbackBuffer, bytes, byteIndex - leftSoFar, leftSoFar, chars, ref posn);
}
leftOverBits = leftBits;
leftOverCount = (leftSoFar | (leftSize << 4));
DecoderFallbackBuffer buf = null;
byte [] bufferArg = null;
return InternalGetChars (bytes, byteIndex, byteCount, chars,
- charIndex, ref leftOverBits, ref leftOverCount, DecoderFallback, ref buf, ref bufferArg, true);
+ charIndex, ref leftOverBits, ref leftOverCount, DecoderFallback, ref buf, true);
}
[CLSCompliant (false)]
public unsafe override int GetChars (byte* bytes, int byteCount, char* chars, int charCount)
{
DecoderFallbackBuffer buf = null;
- byte [] bufferArg = null;
uint leftOverBits = 0;
uint leftOverCount = 0;
return InternalGetChars (bytes, byteCount, chars,
- charCount, ref leftOverBits, ref leftOverCount, DecoderFallback, ref buf, ref bufferArg, true);
+ charCount, ref leftOverBits, ref leftOverCount, DecoderFallback, ref buf, true);
}
// Get the maximum number of bytes needed to encode a
// Get a UTF8-specific decoder that is attached to this instance.
public override Decoder GetDecoder ()
{
- return new UTF8Decoder (DecoderFallback);
+ return new UTF8Decoder (this);
}
// Get a UTF8-specific encoder that is attached to this instance.
public override Encoder GetEncoder ()
{
- return new UTF8Encoder (EncoderFallback, emitIdentifier);
+ return new UTF8Encoder (this);
}
// Get the UTF8 preamble.
// UTF-8 decoder implementation.
[Serializable]
- private class UTF8Decoder : Decoder
+ private class UTF8Decoder : EncodingDecoder
{
private uint leftOverBits;
private uint leftOverCount;
// Constructor.
- public UTF8Decoder (DecoderFallback fallback)
+ public UTF8Decoder (Encoding encoding)
+ : base (encoding)
{
- Fallback = fallback;
leftOverBits = 0;
leftOverCount = 0;
}
public override int GetCharCount (byte[] bytes, int index, int count)
{
DecoderFallbackBuffer buf = null;
- byte [] bufferArg = null;
return InternalGetCharCount (bytes, index, count,
- leftOverBits, leftOverCount, this, ref buf, ref bufferArg, false);
+ leftOverBits, leftOverCount, this, ref buf, false);
}
public override int GetChars (byte[] bytes, int byteIndex,
int byteCount, char[] chars, int charIndex)
{
DecoderFallbackBuffer buf = null;
- byte [] bufferArg = null;
return InternalGetChars (bytes, byteIndex, byteCount,
- chars, charIndex, ref leftOverBits, ref leftOverCount, this, ref buf, ref bufferArg, false);
+ chars, charIndex, ref leftOverBits, ref leftOverCount, this, ref buf, false);
}
} // class UTF8Decoder
// UTF-8 encoder implementation.
[Serializable]
- private class UTF8Encoder : Encoder
+ private class UTF8Encoder : EncodingEncoder
{
// private bool emitIdentifier;
private char leftOverForCount;
private char leftOverForConv;
// Constructor.
- public UTF8Encoder (EncoderFallback fallback, bool emitIdentifier)
+ public UTF8Encoder (UTF8Encoding encoding)
+ : base (encoding)
{
- Fallback = fallback;
-// this.emitIdentifier = emitIdentifier;
leftOverForCount = '\0';
leftOverForConv = '\0';
}
// Get a Unicode-specific decoder that is attached to this instance.
public override Decoder GetDecoder ()
{
- return new UnicodeDecoder (bigEndian);
+ return new UnicodeDecoder (bigEndian, this);
}
// Get the Unicode preamble.
}
// Unicode decoder implementation.
- private sealed class UnicodeDecoder : Decoder
+ private sealed class UnicodeDecoder : EncodingDecoder
{
private bool bigEndian;
private int leftOverByte;
// Constructor.
- public UnicodeDecoder (bool bigEndian)
+ public UnicodeDecoder (bool bigEndian, UnicodeEncoding encoding)
+ : base (encoding)
{
this.bigEndian = bigEndian;
leftOverByte = -1;
bool IAsyncResult.CompletedSynchronously {
get {
- return true;
+ return false;
}
}
public extern static float Read (ref float location);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
+ [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
public extern static T Read<T> (ref T location) where T : class;
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public extern static void Write (ref float location, float value);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
+ [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
public extern static void Write<T>(ref T location, T value) where T : class;
}
}
//
#if MONODROID
+using System.Reflection;
using System.Threading;
namespace System {
static AndroidPlatform ()
{
+ Type androidRuntime = Type.GetType ("Android.Runtime.AndroidEnvironment, Mono.Android", true);
+
getDefaultSyncContext = (Func<SynchronizationContext>)
Delegate.CreateDelegate (typeof(Func<SynchronizationContext>),
- Type.GetType ("Android.Runtime.AndroidEnvironment, Mono.Android", true)
- .GetMethod ("GetDefaultSyncContext",
+ androidRuntime.GetMethod ("GetDefaultSyncContext",
System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic));
getDefaultTimeZone = (Func<string>)
Delegate.CreateDelegate (typeof(Func<string>),
- Type.GetType ("Android.Runtime.AndroidEnvironment, Mono.Android", true)
- .GetMethod ("GetDefaultTimeZone",
+ androidRuntime.GetMethod ("GetDefaultTimeZone",
System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic));
- getCurrentSystemTimeZone = (Func<TimeZone>)
- Delegate.CreateDelegate (typeof(Func<TimeZone>),
- Type.GetType ("Android.Runtime.AndroidEnvironment, Mono.Android", true)
- .GetMethod ("GetCurrentSystemTimeZone",
- System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic));
+ MethodInfo mi = androidRuntime.GetMethod ("GetCurrentSystemTimeZone",
+ System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
+ if (mi != null)
+ getCurrentSystemTimeZone = (Func<TimeZone>) Delegate.CreateDelegate (typeof(Func<TimeZone>), mi);
}
internal static SynchronizationContext GetDefaultSyncContext ()
"H:mzzz",
"H:m",
"H tt", // Specifies AM to disallow '8'.
- "H'\u6642'm'\u5206's'\u79D2'",
+ "H'\u6642'm'\u5206's'\u79D2'"
};
// DateTime.Parse date patterns extend ParseExact patterns as follows:
if (_DoParse (s, firstPart, ParseTimeFormats [j], false, out result, out dto, dfi, styles, true, ref incompleteFormat, ref longYear))
return true;
}
+
+ if (_DoParse (s, firstPart, "zzz", false, out result, out dto, dfi, styles, true, ref incompleteFormat, ref longYear))
+ return true;
}
//
}
// Try as a last resort all the patterns
- if (ParseExact (s, dfi.GetAllDateTimePatternsInternal (), dfi, styles, out result, false, ref longYear, setExceptionOnError, ref exception))
+ if (CoreParseExact (s, dfi.GetAllDateTimePatternsInternal (), dfi, styles, out result, out dto, false, ref longYear, setExceptionOnError, ref exception))
return true;
- if (ParseExact (s, ExoticAndNonStandardFormats, dfi, styles, out result, false, ref longYear, setExceptionOnError, ref exception))
+ if (CoreParseExact (s, ExoticAndNonStandardFormats, dfi, styles, out result, out dto, false, ref longYear, setExceptionOnError, ref exception))
return true;
if (!setExceptionOnError)
DateTimeStyles style,
bool firstPartIsDate,
ref bool incompleteFormat,
- ref bool longYear)
+ ref bool longYear,
+ bool dateTimeOffset = false)
{
bool useutc = false;
bool use_invariant = false;
bool afterTFormat = false;
DateTimeFormatInfo invInfo = DateTimeFormatInfo.InvariantInfo;
if (format.Length == 1)
- format = DateTimeUtils.GetStandardPattern (format [0], dfi, out useutc, out use_invariant);
+ format = DateTimeUtils.GetStandardPattern (format [0], dfi, out useutc, out use_invariant, dateTimeOffset);
result = new DateTime (0);
if (format == null)
} else if (num < 3) {
year = _ParseNumber (s, valuePos, 1, 2, true, sloppy_parsing, out num_parsed);
} else {
- year = _ParseNumber (s, valuePos, exact ? 4 : 3, 4, false, sloppy_parsing, out num_parsed);
- if ((year >= 1000) && (num_parsed == 4) && (!longYear) && (s.Length > 4 + valuePos)) {
- int np = 0;
- int ly = _ParseNumber (s, valuePos, 5, 5, false, sloppy_parsing, out np);
- longYear = (ly > 9999);
- }
- num = 3;
+ year = _ParseNumber (s, valuePos, exact ? num + 1 : 3, num + 1, false, sloppy_parsing, out num_parsed);
+ longYear = (year > 9999);
}
//FIXME: We should do use dfi.Calendat.TwoDigitYearMax
if (num_parsed == -1)
return false;
fractionalSeconds = decimalNumber / Math.Pow(10.0, num_parsed);
+
+ //Parse ISO8601 with an unlimited number of fractional digits.
+ if (!exact && num == 6 && hour != -1 && minute != -1 && second != -1) {
+ var total_num_parsed = num_parsed;
+ while (true) {
+ valuePos += num_parsed;
+ decimalNumber = (double) _ParseNumber (s, valuePos, 0, 1, leading_zeros, sloppy_parsing, out num_parsed);
+ if (num_parsed < 1) {
+ num_parsed = 0;
+ break;
+ }
+
+ total_num_parsed += num_parsed;
+ if (total_num_parsed > 15)
+ continue; //not enough precision, ignore additional digits.
+
+ fractionalSeconds += decimalNumber / Math.Pow (10.0, total_num_parsed);
+ }
+ }
break;
case 't':
if (!_ParseAmPm (s, valuePos, num > 0 ? 0 : 1, dfi, exact, out num_parsed, ref ampm))
valuePos += num_parsed;
tzoffmin = _ParseNumber (s, valuePos, 0, 2, true, sloppy_parsing, out num_parsed);
- num = 2;
if (num_parsed < 0)
return false;
}
if (tzsign == -1) {
if (result != DateTime.MinValue) {
try {
- dto = new DateTimeOffset (result);
+ if (((style & DateTimeStyles.AssumeUniversal) != 0) || useutc) {
+ dto = new DateTimeOffset (result, TimeSpan.Zero);
+ } else if ((style & DateTimeStyles.AssumeLocal) != 0) {
+ var offset = use_invariant ?
+ TimeSpan.Zero :
+ TimeZone.CurrentTimeZone.GetUtcOffset (DateTime.Now);
+ dto = new DateTimeOffset (result, offset);
+ } else {
+ dto = new DateTimeOffset (result);
+ }
} catch { } // We handle this error in DateTimeOffset.Parse
}
} else {
throw new FormatException ("Format specifier was invalid.");
DateTime result;
+ DateTimeOffset dto;
bool longYear = false;
Exception e = null;
- if (!ParseExact (s, formats, dfi, style, out result, true, ref longYear, true, ref e))
+ if (!CoreParseExact (s, formats, dfi, style, out result, out dto, true, ref longYear, true, ref e))
throw e;
return result;
}
{
try {
DateTimeFormatInfo dfi = DateTimeFormatInfo.GetInstance (provider);
+ DateTimeOffset dto;
bool longYear = false;
Exception e = null;
- return ParseExact (s, formats, dfi, style, out result, true, ref longYear, false, ref e);
+ return CoreParseExact (s, formats, dfi, style, out result, out dto, true, ref longYear, false, ref e);
} catch {
result = MinValue;
return false;
}
}
- private static bool ParseExact (string s, string [] formats,
- DateTimeFormatInfo dfi, DateTimeStyles style, out DateTime ret,
+ internal static bool CoreParseExact (string s, string [] formats,
+ DateTimeFormatInfo dfi, DateTimeStyles style,
+ out DateTime ret, out DateTimeOffset dto,
bool exact, ref bool longYear,
- bool setExceptionOnError, ref Exception exception)
+ bool setExceptionOnError, ref Exception exception,
+ bool dateTimeOffset = false)
{
+ dto = new DateTimeOffset (0, TimeSpan.Zero);
int i;
bool incompleteFormat = false;
for (i = 0; i < formats.Length; i++)
if (format == null || format == String.Empty)
break;
- DateTimeOffset dto;
- if (_DoParse (s, formats[i], null, exact, out result, out dto, dfi, style, false, ref incompleteFormat, ref longYear)) {
+ if (_DoParse (s, formats[i], null, exact, out result, out dto, dfi, style, false, ref incompleteFormat, ref longYear, dateTimeOffset)) {
ret = result;
return true;
}
if ((styles & DateTimeStyles.AssumeLocal) != 0 && (styles & DateTimeStyles.AssumeUniversal) != 0)
throw new ArgumentException ("styles parameter contains incompatible flags");
+ DateTimeFormatInfo dfi = DateTimeFormatInfo.GetInstance (formatProvider);
+ DateTime d;
DateTimeOffset result;
- if (!ParseExact (input, formats, DateTimeFormatInfo.GetInstance (formatProvider), styles, out result))
- throw new FormatException ("Invalid format string");
-
- return result;
- }
-
- private static bool ParseExact (string input, string [] formats,
- DateTimeFormatInfo dfi, DateTimeStyles styles, out DateTimeOffset ret)
- {
- foreach (string format in formats)
- {
- if (format == null || format == String.Empty)
- throw new FormatException ("Invalid format string");
-
- DateTimeOffset result;
- if (DoParse (input, format, false, out result, dfi, styles)) {
- ret = result;
- return true;
- }
- }
- ret = DateTimeOffset.MinValue;
- return false;
- }
-
- private static bool DoParse (string input,
- string format,
- bool exact,
- out DateTimeOffset result,
- DateTimeFormatInfo dfi,
- DateTimeStyles styles)
- {
- if ((styles & DateTimeStyles.AllowLeadingWhite) != 0) {
- format = format.TrimStart (null);
- input = input.TrimStart (null);
- }
-
- if ((styles & DateTimeStyles.AllowTrailingWhite) != 0) {
- format = format.TrimEnd (null);
- input = input.TrimEnd (null);
- }
-
- bool allow_white_spaces = false;
- if ((styles & DateTimeStyles.AllowInnerWhite) != 0)
- allow_white_spaces = true;
-
- result = DateTimeOffset.MinValue;
-
- bool useutc = false, use_invariants = false;
- if (format.Length == 1) {
- format = DateTimeUtils.GetStandardPattern (format[0], dfi, out useutc, out use_invariants, true);
- if (format == null)
- return false;
- }
-
- int year = -1;
- int month = -1;
- int day = -1;
- int partial_hour = -1; // for 'hh tt' formats
- int hour = -1;
- int minute = -1;
- int second = -1;
- double fraction = -1;
- int temp_int = -1;
- TimeSpan offset = TimeSpan.MinValue;
-
- int fi = 0; //format iterator
- int ii = 0; //input iterator
- while (fi < format.Length) {
- int tokLen;
- char ch = format [fi];
-
- switch (ch) {
- case 'd':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (day != -1 || tokLen > 4)
- return false;
-
- if (tokLen <= 2)
- ii += ParseNumber (input, ii, 2, tokLen == 2, allow_white_spaces, out day);
- else
- ii += ParseEnum (input, ii, tokLen == 3 ? dfi.AbbreviatedDayNames : dfi.DayNames, allow_white_spaces, out temp_int);
- break;
- case 'f':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- ii += ParseNumber (input, ii, tokLen, true, allow_white_spaces, out temp_int);
- if (fraction >= 0 || tokLen > 7 || temp_int == -1)
- return false;
- fraction = (double)temp_int / Math.Pow (10, tokLen);
- break;
- case 'F':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- int digits;
- int read = ParseNumber (input, ii, tokLen, true, allow_white_spaces, out temp_int, out digits);
- if (temp_int == -1)
- ii += ParseNumber (input, ii, digits, true, allow_white_spaces, out temp_int);
- else
- ii += read;
- if (fraction >= 0 || tokLen > 7 || temp_int == -1)
- return false;
- fraction = (double)temp_int / Math.Pow (10, digits);
- break;
- case 'h':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (hour != -1 || tokLen > 2)
- return false;
-
- ii += ParseNumber (input, ii, 2, tokLen == 2, allow_white_spaces, out temp_int);
- if (temp_int == -1)
- return false;
-
- if (partial_hour == -1)
- partial_hour = temp_int;
- else
- hour = partial_hour + temp_int;
- break;
- case 'H':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (hour != -1 || tokLen > 2)
- return false;
-
- ii += ParseNumber (input, ii, 2, tokLen == 2, allow_white_spaces, out hour);
- break;
- case 'm':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (minute != -1 || tokLen > 2)
- return false;
-
- ii += ParseNumber (input, ii, 2, tokLen == 2, allow_white_spaces, out minute);
- break;
- case 'M':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (month != -1 || tokLen > 4)
- return false;
-
- if (tokLen <= 2)
- ii += ParseNumber (input, ii, 2, tokLen == 2, allow_white_spaces, out month);
- else {
- ii += ParseEnum (input, ii, tokLen == 3 ? dfi.AbbreviatedMonthNames : dfi.MonthNames, allow_white_spaces, out month);
- month += 1;
- }
-
- break;
- case 's':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (second != -1 || tokLen > 2)
- return false;
- ii += ParseNumber (input, ii, 2, tokLen == 2, allow_white_spaces, out second);
- break;
- case 't':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (hour != -1 || tokLen > 2)
- return false;
-
- ii += ParseEnum (input, ii,
- tokLen == 1 ? new string[] {new string (dfi.AMDesignator[0], 1), new string (dfi.PMDesignator[0], 0)}
- : new string[] {dfi.AMDesignator, dfi.PMDesignator},
- allow_white_spaces, out temp_int);
- if (temp_int == -1)
- return false;
-
- if (partial_hour == -1)
- partial_hour = temp_int * 12;
- else
- hour = partial_hour + temp_int * 12;
- break;
- case 'y':
- if (year != -1)
- return false;
-
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (tokLen <= 2) {
- ii += ParseNumber (input, ii, 2, tokLen == 2, allow_white_spaces, out year);
- if (year != -1)
- year = dfi.Calendar.ToFourDigitYear (year);
- } else if (tokLen <= 4) { // yyy and yyyy accept up to 5 digits with leading 0
- int digit_parsed;
- ii += ParseNumber (input, ii, 5, false, allow_white_spaces, out year, out digit_parsed);
- if (digit_parsed < tokLen || (digit_parsed > tokLen && (year / Math.Pow (10, digit_parsed - 1) < 1)))
- return false;
- } else
- ii += ParseNumber (input, ii, tokLen, true, allow_white_spaces, out year);
- break;
-
- // The documentation is incorrect, they claim that K is the same as 'zz', but
- // it actually allows the format to contain 4 digits for the offset
- case 'K':
- tokLen = 1;
- int off_h, off_m = 0, sign;
- temp_int = 0;
- ii += ParseEnum (input, ii, new string [] {"-", "+"}, allow_white_spaces, out sign);
- ii += ParseNumber (input, ii, 4, false, false, out off_h);
- if (off_h == -1 || off_m == -1 || sign == -1)
- return false;
-
- if (sign == 0)
- sign = -1;
- offset = new TimeSpan (sign * off_h, sign * off_m, 0);
- break;
-
- case 'z':
- tokLen = DateTimeUtils.CountRepeat (format, fi, ch);
- if (offset != TimeSpan.MinValue || tokLen > 3)
- return false;
-
- off_m = 0;
- temp_int = 0;
- ii += ParseEnum (input, ii, new string [] {"-", "+"}, allow_white_spaces, out sign);
- ii += ParseNumber (input, ii, 2, tokLen != 1, false, out off_h);
- if (tokLen == 3) {
- ii += ParseEnum (input, ii, new string [] {dfi.TimeSeparator}, false, out temp_int);
- ii += ParseNumber (input, ii, 2, true, false, out off_m);
- }
- if (off_h == -1 || off_m == -1 || sign == -1)
- return false;
-
- if (sign == 0)
- sign = -1;
- offset = new TimeSpan (sign * off_h, sign * off_m, 0);
- break;
- case ':':
- tokLen = 1;
- ii += ParseEnum (input, ii, new string [] {dfi.TimeSeparator}, false, out temp_int);
- if (temp_int == -1)
- return false;
- break;
- case '/':
- tokLen = 1;
- ii += ParseEnum (input, ii, new string [] {dfi.DateSeparator}, false, out temp_int);
- if (temp_int == -1)
- return false;
- break;
- case '%':
- tokLen = 1;
- if (fi != 0)
- return false;
- break;
- case ' ':
- tokLen = 1;
- ii += ParseChar (input, ii, ' ', false, out temp_int);
- if (temp_int == -1)
- return false;
- break;
- case '\\':
- tokLen = 2;
- ii += ParseChar (input, ii, format [fi + 1], allow_white_spaces, out temp_int);
- if (temp_int == -1)
- return false;
- break;
- case '\'':
- case '"':
- tokLen = 1;
- while (ii < input.Length) {
- var ftoken = format [fi + tokLen];
- ++tokLen;
- if (ftoken == format [fi]) {
- if (useutc && tokLen == 5 && input [ii - 3] == 'G' && input [ii - 2] == 'M' && input [ii - 1] == 'T') {
- offset = TimeSpan.Zero;
- }
-
- break;
- }
-
- if (ftoken != input [ii++])
- return false;
- }
-
- break;
- default:
- //Console.WriteLine ("un-parsed character: {0}", ch);
- tokLen = 1;
- ii += ParseChar (input, ii, format [fi], allow_white_spaces, out temp_int);
- if (temp_int == -1)
- return false;
- break;
- }
- fi += tokLen;
- }
-
- //Console.WriteLine ("{0}-{1}-{2} {3}:{4} {5}", year, month, day, hour, minute, offset);
- if (offset == TimeSpan.MinValue) {
- if ((styles & DateTimeStyles.AssumeUniversal) != 0) {
- offset = TimeSpan.Zero;
- } else if ((styles & DateTimeStyles.AssumeLocal) != 0) {
- offset = use_invariants ?
- TimeSpan.Zero :
- TimeZone.CurrentTimeZone.GetUtcOffset (DateTime.Now);
- }
- }
-
-
- if (hour < 0) hour = 0;
- if (minute < 0) minute = 0;
- if (second < 0) second = 0;
- if (fraction < 0) fraction = 0;
- if (year > 0 && month > 0 && day > 0) {
- result = new DateTimeOffset (year, month, day, hour, minute, second, 0, offset);
- result = result.AddSeconds (fraction);
- if ((styles & DateTimeStyles.AdjustToUniversal) != 0)
- result = result.ToUniversalTime ();
- return true;
- }
-
- return false;
- }
-
- private static int ParseNumber (string input, int pos, int digits, bool leading_zero, bool allow_leading_white, out int result)
- {
- int digit_parsed;
- return ParseNumber (input, pos, digits, leading_zero, allow_leading_white, out result, out digit_parsed);
- }
-
- private static int ParseNumber (string input, int pos, int digits, bool leading_zero, bool allow_leading_white, out int result, out int digit_parsed)
- {
- int char_parsed = 0;
- digit_parsed = 0;
- result = 0;
- for (; allow_leading_white && pos < input.Length && input[pos] == ' '; pos++)
- char_parsed++;
-
- for (; pos < input.Length && Char.IsDigit (input[pos]) && digits > 0; pos ++, char_parsed++, digit_parsed++, digits --)
- result = 10 * result + (byte) (input[pos] - '0');
-
- if (leading_zero && digits > 0)
- result = -1;
-
- if (digit_parsed == 0)
- result = -1;
-
- return char_parsed;
- }
-
- private static int ParseEnum (string input, int pos, string [] enums, bool allow_leading_white, out int result)
- {
- int char_parsed = 0;
- result = -1;
- for (; allow_leading_white && pos < input.Length && input[pos] == ' '; pos++)
- char_parsed ++;
-
- for (int i = 0; i < enums.Length; i++)
- if (input.Substring(pos).StartsWith (enums [i])) {
- result = i;
- break;
- }
-
- if (result >= 0)
- char_parsed += enums[result].Length;
-
- return char_parsed;
- }
-
- private static int ParseChar (string input, int pos, char c, bool allow_leading_white, out int result)
- {
- int char_parsed = 0;
- result = -1;
- for (; allow_leading_white && pos < input.Length && input[pos] == ' '; pos++, char_parsed++)
- ;
-
- if (pos < input.Length && input[pos] == c){
- result = (int) c;
- char_parsed ++;
+ Exception exception = null;
+ bool longYear = false;
+ try {
+ if (!DateTime.CoreParseExact (input, formats, dfi, styles, out d, out result, true, ref longYear, true, ref exception, true))
+ throw exception;
+ } catch (ArgumentOutOfRangeException ex) {
+ throw new FormatException ("The UTC representation falls outside the 1-9999 year range", ex);
}
- return char_parsed;
+ return result;
}
public TimeSpan Subtract (DateTimeOffset value)
dec_part = Decimal.Floor(dec_part);
dec_part /= (10000000000000000000000000000M / p);
dec_part = Math.Round (dec_part, mode);
+
+ // ignore trailing zeros
+ while (decimals > 0 && (dec_part % 10) == 0) {
+ decimals--;
+ dec_part /= 10;
+ p /= 10;
+ }
+
dec_part /= p;
decimal result = int_part + dec_part;
}
// private methods
-#if MOBILE
+#if (MONOTOUCH || MONODROID || XAMMAC)
internal const bool IsRunningOnWindows = false;
#else
internal static bool IsRunningOnWindows {
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-// NumberFormatter is shared with Grasshopper and hence the #if TARGET_JVM for
-// marking the use of unsafe code that is not supported in Grasshopper.
-#if !TARGET_JVM
-#define UNSAFE_TABLES
-#endif
-
using System.Globalization;
using System.Text;
using System.Threading;
const double MinRoundtripVal = -1.79769313486231E+308;
const double MaxRoundtripVal = 1.79769313486231E+308;
-#if UNSAFE_TABLES
// The below arrays are taken from mono/metatdata/number-formatter.h
private static readonly unsafe ulong* MantissaBitsTable;
out DigitLowerTable, out DigitUpperTable, out TenPowersList, out DecHexDigits);
}
- unsafe
-#endif
- static long GetTenPowerOf(int i)
+ unsafe static long GetTenPowerOf(int i)
{
return TenPowersList [i];
}
// Helper to translate an int in the range 0 .. 9999 to its
// Hexadecimal digits representation.
-#if UNSAFE_TABLES
- unsafe
-#endif
- private static uint FastToDecHex (int val)
+ unsafe private static uint FastToDecHex (int val)
{
if (val < 100)
return (uint)DecHexDigits [val];
_decPointPos = _digitsLen = DecHexLen ();
}
-#if UNSAFE_TABLES // No unsafe code under TARGET_JVM
- unsafe
-#endif
- private void Init (string format, double value, int defPrecision)
+ unsafe private void Init (string format, double value, int defPrecision)
{
Init (format);
return new string (_cbuf, 0, _ind);
}
-#if UNSAFE_TABLES // No unsafe code under TARGET_JVM
- unsafe
-#endif
- private string FormatHexadecimal (int precision)
+ unsafe private string FormatHexadecimal (int precision)
{
int size = Math.Max (precision, _decPointPos);
-#if UNSAFE_TABLES
char* digits = _specifierIsUpper ? DigitUpperTable : DigitLowerTable;
-#else
- char[] digits = _specifierIsUpper ? DigitUpperTable : DigitLowerTable;
-#endif
+
ResetCharBuf (size);
_ind = size;
ulong val = _val1 | ((ulong)_val2 << 32);
_cbuf [_ind++] = (char)('0' | v & 0xf);
}
-#if UNSAFE_TABLES // No unsafe code under TARGET_JVM
- unsafe
-#endif
- private void FastAppendDigits (int val, bool force)
+ unsafe private void FastAppendDigits (int val, bool force)
{
int i = _ind;
int digits;
+++ /dev/null
-//
-// System.NumberFormatter.cs
-//
-// Author:
-// Eyal Alaluf (eyala@mainsoft.com)
-//
-// Copyright (C) 2008 Mainsoft Co. (http://www.mainsoft.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 !TARGET_JVM
-#define UNSAFE_TABLES
-#endif
-
-namespace System
-{
-#if !UNSAFE_TABLES
- partial class NumberFormatter
- {
- static internal readonly char[] DigitLowerTable = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
- static internal readonly char[] DigitUpperTable = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
- private static readonly long[] TenPowersList = new long[] {
- 1,
- 10,
- 100,
- 1000,
- 10000,
- 100000,
- 1000000,
- 10000000,
- 100000000,
- 1000000000,
- 10000000000,
- 100000000000,
- 1000000000000,
- 10000000000000,
- 100000000000000,
- 1000000000000000,
- 10000000000000000,
- 100000000000000000,
- 1000000000000000000
- };
-
- // DecHexDigits s a translation table from a decimal number to its
- // digits hexadecimal representation (e.g. DecHexDigits [34] = 0x34).
- static readonly int[] DecHexDigits = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99};
-
- static readonly ulong[] MantissaBitsTable = {
- 4556951262222748432, 9113902524445496865, 1822780504889099373,
- 3645561009778198746, 7291122019556397492, 14582244039112794984,
- 2916448807822558996, 5832897615645117993, 11665795231290235987,
- 2333159046258047197, 4666318092516094394, 9332636185032188789,
- 1866527237006437757, 3733054474012875515, 7466108948025751031,
- 14932217896051502063, 2986443579210300412, 5972887158420600825,
- 11945774316841201651, 2389154863368240330, 4778309726736480660,
- 9556619453472961320, 1911323890694592264, 3822647781389184528,
- 7645295562778369056, 15290591125556738113, 3058118225111347622,
- 6116236450222695245, 12232472900445390490, 2446494580089078098,
- 4892989160178156196, 9785978320356312392, 1957195664071262478,
- 3914391328142524957, 7828782656285049914, 15657565312570099828,
- 3131513062514019965, 6263026125028039931, 12526052250056079862,
- 2505210450011215972, 5010420900022431944, 10020841800044863889,
- 2004168360008972777, 4008336720017945555, 8016673440035891111,
- 16033346880071782223, 3206669376014356444, 6413338752028712889,
- 12826677504057425779, 2565335500811485155, 5130671001622970311,
- 10261342003245940623, 2052268400649188124, 4104536801298376249,
- 8209073602596752498, 16418147205193504997, 3283629441038700999,
- 6567258882077401998, 13134517764154803997, 2626903552830960799,
- 5253807105661921599, 10507614211323843198, 2101522842264768639,
- 4203045684529537279, 8406091369059074558, 16812182738118149117,
- 3362436547623629823, 6724873095247259646, 13449746190494519293,
- 2689949238098903858, 5379898476197807717, 10759796952395615435,
- 2151959390479123087, 4303918780958246174, 8607837561916492348,
- 17215675123832984696, 3443135024766596939, 6886270049533193878,
- 13772540099066387756, 2754508019813277551, 5509016039626555102,
- 11018032079253110205, 2203606415850622041, 4407212831701244082,
- 8814425663402488164, 17628851326804976328, 3525770265360995265,
- 7051540530721990531, 14103081061443981063, 2820616212288796212,
- 5641232424577592425, 11282464849155184850, 2256492969831036970,
- 4512985939662073940, 9025971879324147880, 18051943758648295760,
- 3610388751729659152, 7220777503459318304, 14441555006918636608,
- 2888311001383727321, 5776622002767454643, 11553244005534909286,
- 2310648801106981857, 4621297602213963714, 9242595204427927429,
- 1848519040885585485, 3697038081771170971, 7394076163542341943,
- 14788152327084683887, 2957630465416936777, 5915260930833873554,
- 11830521861667747109, 2366104372333549421, 4732208744667098843,
- 9464417489334197687, 1892883497866839537, 3785766995733679075,
- 7571533991467358150, 15143067982934716300, 3028613596586943260,
- 6057227193173886520, 12114454386347773040, 2422890877269554608,
- 4845781754539109216, 9691563509078218432, 1938312701815643686,
- 3876625403631287372, 7753250807262574745, 15506501614525149491,
- 3101300322905029898, 6202600645810059796, 12405201291620119593,
- 2481040258324023918, 4962080516648047837, 9924161033296095674,
- 1984832206659219134, 3969664413318438269, 7939328826636876539,
- 15878657653273753079, 3175731530654750615, 6351463061309501231,
- 12702926122619002463, 2540585224523800492, 5081170449047600985,
- 10162340898095201970, 2032468179619040394, 4064936359238080788,
- 8129872718476161576, 16259745436952323153, 3251949087390464630,
- 6503898174780929261, 13007796349561858522, 2601559269912371704,
- 5203118539824743409, 10406237079649486818, 2081247415929897363,
- 4162494831859794727, 8324989663719589454, 16649979327439178909,
- 3329995865487835781, 6659991730975671563, 13319983461951343127,
- 2663996692390268625, 5327993384780537250, 10655986769561074501,
- 2131197353912214900, 4262394707824429800, 8524789415648859601,
- 17049578831297719202, 3409915766259543840, 6819831532519087681,
- 13639663065038175362, 2727932613007635072, 5455865226015270144,
- 10911730452030540289, 2182346090406108057, 4364692180812216115,
- 8729384361624432231, 17458768723248864463, 3491753744649772892,
- 6983507489299545785, 13967014978599091570, 2793402995719818314,
- 5586805991439636628, 11173611982879273256, 2234722396575854651,
- 4469444793151709302, 8938889586303418605, 17877779172606837210,
- 3575555834521367442, 7151111669042734884, 14302223338085469768,
- 2860444667617093953, 5720889335234187907, 11441778670468375814,
- 2288355734093675162, 4576711468187350325, 9153422936374700651,
- 1830684587274940130, 3661369174549880260, 7322738349099760521,
- 14645476698199521043, 2929095339639904208, 5858190679279808417,
- 11716381358559616834, 2343276271711923366, 4686552543423846733,
- 9373105086847693467, 1874621017369538693, 3749242034739077387,
- 7498484069478154774, 14996968138956309548, 2999393627791261909,
- 5998787255582523819, 11997574511165047638, 2399514902233009527,
- 4799029804466019055, 9598059608932038110, 1919611921786407622,
- 3839223843572815244, 7678447687145630488, 15356895374291260977,
- 3071379074858252195, 6142758149716504390, 12285516299433008781,
- 2457103259886601756, 4914206519773203512, 9828413039546407025,
- 1965682607909281405, 3931365215818562810, 7862730431637125620,
- 15725460863274251240, 3145092172654850248, 6290184345309700496,
- 12580368690619400992, 2516073738123880198, 5032147476247760397,
- 10064294952495520794, 2012858990499104158, 4025717980998208317,
- 8051435961996416635, 16102871923992833270, 3220574384798566654,
- 6441148769597133308, 12882297539194266616, 2576459507838853323,
- 5152919015677706646, 10305838031355413293, 2061167606271082658,
- 4122335212542165317, 8244670425084330634, 16489340850168661269,
- 3297868170033732253, 6595736340067464507, 13191472680134929015,
- 2638294536026985803, 5276589072053971606, 10553178144107943212,
- 2110635628821588642, 4221271257643177284, 8442542515286354569,
- 16885085030572709139, 3377017006114541827, 6754034012229083655,
- 13508068024458167311, 2701613604891633462, 5403227209783266924,
- 10806454419566533849, 2161290883913306769, 4322581767826613539,
- 8645163535653227079, 17290327071306454158, 3458065414261290831,
- 6916130828522581663, 13832261657045163327, 2766452331409032665,
- 5532904662818065330, 11065809325636130661, 2213161865127226132,
- 4426323730254452264, 8852647460508904529, 17705294921017809058,
- 3541058984203561811, 7082117968407123623, 14164235936814247246,
- 2832847187362849449, 5665694374725698898, 11331388749451397797,
- 2266277749890279559, 4532555499780559119, 9065110999561118238,
- 1813022199912223647, 3626044399824447295, 7252088799648894590,
- 14504177599297789180, 2900835519859557836, 5801671039719115672,
- 11603342079438231344, 2320668415887646268, 4641336831775292537,
- 9282673663550585075, 1856534732710117015, 3713069465420234030,
- 7426138930840468060, 14852277861680936121, 2970455572336187224,
- 5940911144672374448, 11881822289344748896, 2376364457868949779,
- 4752728915737899558, 9505457831475799117, 1901091566295159823,
- 3802183132590319647, 7604366265180639294, 15208732530361278588,
- 3041746506072255717, 6083493012144511435, 12166986024289022870,
- 2433397204857804574, 4866794409715609148, 9733588819431218296,
- 1946717763886243659, 3893435527772487318, 7786871055544974637,
- 15573742111089949274, 3114748422217989854, 6229496844435979709,
- 12458993688871959419, 2491798737774391883, 4983597475548783767,
- 9967194951097567535, 1993438990219513507, 3986877980439027014,
- 7973755960878054028, 15947511921756108056, 3189502384351221611,
- 6379004768702443222, 12758009537404886445, 2551601907480977289,
- 5103203814961954578, 10206407629923909156, 2041281525984781831,
- 4082563051969563662, 8165126103939127325, 16330252207878254650,
- 3266050441575650930, 6532100883151301860, 13064201766302603720,
- 2612840353260520744, 5225680706521041488, 10451361413042082976,
- 2090272282608416595, 4180544565216833190, 8361089130433666380,
- 16722178260867332761, 3344435652173466552, 6688871304346933104,
- 13377742608693866209, 2675548521738773241, 5351097043477546483,
- 10702194086955092967, 2140438817391018593, 4280877634782037187,
- 8561755269564074374, 17123510539128148748, 3424702107825629749,
- 6849404215651259499, 13698808431302518998, 2739761686260503799,
- 5479523372521007599, 10959046745042015198, 2191809349008403039,
- 4383618698016806079, 8767237396033612159, 17534474792067224318,
- 3506894958413444863, 7013789916826889727, 14027579833653779454,
- 2805515966730755890, 5611031933461511781, 11222063866923023563,
- 2244412773384604712, 4488825546769209425, 8977651093538418850,
- 17955302187076837701, 3591060437415367540, 7182120874830735080,
- 14364241749661470161, 2872848349932294032, 5745696699864588064,
- 11491393399729176129, 2298278679945835225, 4596557359891670451,
- 9193114719783340903, 1838622943956668180, 3677245887913336361,
- 7354491775826672722, 14708983551653345445, 2941796710330669089,
- 5883593420661338178, 11767186841322676356, 2353437368264535271,
- 4706874736529070542, 9413749473058141084, 1882749894611628216,
- 3765499789223256433, 7530999578446512867, 15061999156893025735,
- 3012399831378605147, 6024799662757210294, 12049599325514420588,
- 2409919865102884117, 4819839730205768235, 9639679460411536470,
- 1927935892082307294, 3855871784164614588, 7711743568329229176,
- 15423487136658458353, 3084697427331691670, 6169394854663383341,
- 12338789709326766682, 2467757941865353336, 4935515883730706673,
- 9871031767461413346, 1974206353492282669, 3948412706984565338,
- 7896825413969130677, 15793650827938261354, 3158730165587652270,
- 6317460331175304541, 12634920662350609083, 2526984132470121816,
- 5053968264940243633, 10107936529880487266, 2021587305976097453,
- 4043174611952194906, 8086349223904389813, 16172698447808779626,
- 3234539689561755925, 6469079379123511850, 12938158758247023701,
- 2587631751649404740, 5175263503298809480, 10350527006597618960,
- 2070105401319523792, 4140210802639047584, 8280421605278095168,
- 16560843210556190337, 3312168642111238067, 6624337284222476135,
- 13248674568444952270, 2649734913688990454, 5299469827377980908,
- 10598939654755961816, 2119787930951192363, 4239575861902384726,
- 8479151723804769452, 16958303447609538905, 3391660689521907781,
- 6783321379043815562, 13566642758087631124, 2713328551617526224,
- 5426657103235052449, 10853314206470104899, 2170662841294020979,
- 4341325682588041959, 8682651365176083919, 17365302730352167839,
- 3473060546070433567, 6946121092140867135, 13892242184281734271,
- 2778448436856346854, 5556896873712693708, 11113793747425387417,
- 2222758749485077483, 4445517498970154966, 8891034997940309933,
- 17782069995880619867, 3556413999176123973, 7112827998352247947,
- 14225655996704495894, 2845131199340899178, 5690262398681798357,
- 11380524797363596715, 2276104959472719343, 4552209918945438686,
- 9104419837890877372, 1820883967578175474, 3641767935156350948,
- 7283535870312701897, 14567071740625403795, 2913414348125080759,
- 5826828696250161518, 11653657392500323036, 2330731478500064607,
- 4661462957000129214, 9322925914000258429, 1864585182800051685,
- 3729170365600103371, 7458340731200206743, 14916681462400413486,
- 2983336292480082697, 5966672584960165394, 11933345169920330789,
- 2386669033984066157, 4773338067968132315, 9546676135936264631,
- 1909335227187252926, 3818670454374505852, 7637340908749011705,
- 15274681817498023410, 3054936363499604682, 6109872726999209364,
- 12219745453998418728, 2443949090799683745, 4887898181599367491,
- 9775796363198734982, 1955159272639746996, 3910318545279493993,
- 7820637090558987986, 15641274181117975972, 3128254836223595194,
- 6256509672447190388, 12513019344894380777, 2502603868978876155,
- 5005207737957752311, 10010415475915504622, 2002083095183100924,
- 4004166190366201848, 8008332380732403697, 16016664761464807395,
- 3203332952292961479, 6406665904585922958, 12813331809171845916,
- 2562666361834369183, 5125332723668738366, 10250665447337476733,
- 2050133089467495346, 4100266178934990693, 8200532357869981386,
- 16401064715739962772, 3280212943147992554, 6560425886295985109,
- 13120851772591970218, 2624170354518394043, 5248340709036788087,
- 10496681418073576174, 2099336283614715234, 4198672567229430469,
- 8397345134458860939, 16794690268917721879, 3358938053783544375,
- 6717876107567088751, 13435752215134177503, 2687150443026835500,
- 5374300886053671001, 10748601772107342002, 2149720354421468400,
- 4299440708842936801, 8598881417685873602, 17197762835371747204,
- 3439552567074349440, 6879105134148698881, 13758210268297397763,
- 2751642053659479552, 5503284107318959105, 11006568214637918210,
- 2201313642927583642, 4402627285855167284, 8805254571710334568,
- 17610509143420669137, 3522101828684133827, 7044203657368267654,
- 14088407314736535309, 2817681462947307061, 5635362925894614123,
- 11270725851789228247, 2254145170357845649, 4508290340715691299,
- 9016580681431382598, 18033161362862765196, 3606632272572553039,
- 7213264545145106078, 14426529090290212157, 2885305818058042431,
- 5770611636116084862, 11541223272232169725, 2308244654446433945,
- 4616489308892867890, 9232978617785735780, 1846595723557147156,
- 3693191447114294312, 7386382894228588624, 14772765788457177249,
- 2954553157691435449, 5909106315382870899, 11818212630765741799,
- 2363642526153148359, 4727285052306296719, 9454570104612593439,
- 1890914020922518687, 3781828041845037375, 7563656083690074751,
- 15127312167380149503, 3025462433476029900, 6050924866952059801,
- 12101849733904119602, 2420369946780823920, 4840739893561647841,
- 9681479787123295682, 1936295957424659136, 3872591914849318272,
- 7745183829698636545, 15490367659397273091, 3098073531879454618,
- 6196147063758909236, 12392294127517818473, 2478458825503563694,
- 4956917651007127389, 9913835302014254778, 1982767060402850955,
- 3965534120805701911, 7931068241611403822, 15862136483222807645,
- 3172427296644561529, 6344854593289123058, 12689709186578246116,
- 2537941837315649223, 5075883674631298446, 10151767349262596893,
- 2030353469852519378, 4060706939705038757, 8121413879410077514,
- 16242827758820155028, 3248565551764031005, 6497131103528062011,
- 12994262207056124023, 2598852441411224804, 5197704882822449609,
- 10395409765644899218, 2079081953128979843, 4158163906257959687,
- 8316327812515919374, 16632655625031838749, 3326531125006367749,
- 6653062250012735499, 13306124500025470999, 2661224900005094199,
- 5322449800010188399, 10644899600020376799, 2128979920004075359,
- 4257959840008150719, 8515919680016301439, 17031839360032602879,
- 3406367872006520575, 6812735744013041151, 13625471488026082303,
- 2725094297605216460, 5450188595210432921, 10900377190420865842,
- 2180075438084173168, 4360150876168346337, 8720301752336692674,
- 17440603504673385348, 3488120700934677069, 6976241401869354139,
- 13952482803738708279, 2790496560747741655, 5580993121495483311,
- 11161986242990966623, 2232397248598193324, 4464794497196386649,
- 8929588994392773298, 17859177988785546597, 3571835597757109319,
- 7143671195514218638, 14287342391028437277, 2857468478205687455,
- 5714936956411374911, 11429873912822749822, 2285974782564549964,
- 4571949565129099928, 9143899130258199857, 1828779826051639971,
- 3657559652103279943, 7315119304206559886, 14630238608413119772,
- 2926047721682623954, 5852095443365247908, 11704190886730495817,
- 2340838177346099163, 4681676354692198327, 9363352709384396654,
- 1872670541876879330, 3745341083753758661, 7490682167507517323,
- 14981364335015034646, 2996272867003006929, 5992545734006013858,
- 11985091468012027717, 2397018293602405543, 4794036587204811087,
- 9588073174409622174, 1917614634881924434, 3835229269763848869,
- 7670458539527697739, 15340917079055395478, 3068183415811079095,
- 6136366831622158191, 12272733663244316382, 2454546732648863276,
- 4909093465297726553, 9818186930595453106, 1963637386119090621,
- 3927274772238181242, 7854549544476362484, 15709099088952724969,
- 3141819817790544993, 6283639635581089987, 12567279271162179975,
- 2513455854232435995, 5026911708464871990, 10053823416929743980,
- 2010764683385948796, 4021529366771897592, 8043058733543795184,
- 16086117467087590369, 3217223493417518073, 6434446986835036147,
- 12868893973670072295, 2573778794734014459, 5147557589468028918,
- 10295115178936057836, 2059023035787211567, 4118046071574423134,
- 8236092143148846269, 16472184286297692538, 3294436857259538507,
- 6588873714519077015, 13177747429038154030, 2635549485807630806,
- 5271098971615261612, 10542197943230523224, 2108439588646104644,
- 4216879177292209289, 8433758354584418579, 16867516709168837158,
- 3373503341833767431, 6747006683667534863, 13494013367335069727,
- 2698802673467013945, 5397605346934027890, 10795210693868055781,
- 2159042138773611156, 4318084277547222312, 8636168555094444625,
- 17272337110188889250, 3454467422037777850, 6908934844075555700,
- 13817869688151111400, 2763573937630222280, 5527147875260444560,
- 11054295750520889120, 2210859150104177824, 4421718300208355648,
- 8843436600416711296, 17686873200833422592, 3537374640166684518,
- 7074749280333369037, 14149498560666738074, 2829899712133347614,
- 5659799424266695229, 11319598848533390459, 2263919769706678091,
- 4527839539413356183, 9055679078826712367, 1811135815765342473,
- 3622271631530684947, 7244543263061369894, 14489086526122739788,
- 2897817305224547957, 5795634610449095915, 11591269220898191830,
- 2318253844179638366, 4636507688359276732, 9273015376718553464,
- 1854603075343710692, 3709206150687421385, 7418412301374842771,
- 14836824602749685542, 2967364920549937108, 5934729841099874217,
- 11869459682199748434, 2373891936439949686, 4747783872879899373,
- 9495567745759798747, 1899113549151959749, 3798227098303919498,
- 7596454196607838997, 15192908393215677995, 3038581678643135599,
- 6077163357286271198, 12154326714572542396, 2430865342914508479,
- 4861730685829016958, 9723461371658033917, 1944692274331606783,
- 3889384548663213566, 7778769097326427133, 15557538194652854267,
- 3111507638930570853, 6223015277861141707, 12446030555722283414,
- 2489206111144456682, 4978412222288913365, 9956824444577826731,
- 1991364888915565346, 3982729777831130692, 7965459555662261385,
- 15930919111324522770, 3186183822264904554, 6372367644529809108,
- 12744735289059618216, 2548947057811923643, 5097894115623847286,
- 10195788231247694572, 2039157646249538914, 4078315292499077829,
- 8156630584998155658, 16313261169996311316, 3262652233999262263,
- 6525304467998524526, 13050608935997049053, 2610121787199409810,
- 5220243574398819621, 10440487148797639242, 2088097429759527848,
- 4176194859519055697, 8352389719038111394, 16704779438076222788,
- 3340955887615244557, 6681911775230489115, 13363823550460978230,
- 2672764710092195646, 5345529420184391292, 10691058840368782584,
- 2138211768073756516, 4276423536147513033, 8552847072295026067,
- 17105694144590052135, 3421138828918010427, 6842277657836020854,
- 13684555315672041708, 2736911063134408341, 5473822126268816683,
- 10947644252537633366, 2189528850507526673, 4379057701015053346,
- 8758115402030106693, 17516230804060213386, 3503246160812042677,
- 7006492321624085354, 14012984643248170709, 2802596928649634141,
- 5605193857299268283, 11210387714598536567, 2242077542919707313,
- 4484155085839414626, 8968310171678829253, 17936620343357658507,
- 3587324068671531701, 7174648137343063403, 14349296274686126806,
- 2869859254937225361, 5739718509874450722, 11479437019748901445,
- 2295887403949780289, 4591774807899560578, 9183549615799121156,
- 1836709923159824231, 3673419846319648462, 7346839692639296924,
- 14693679385278593849, 2938735877055718769, 5877471754111437539,
- 11754943508222875079, 2350988701644575015, 4701977403289150031,
- 9403954806578300063, 1880790961315660012, 3761581922631320025,
- 7523163845262640050, 15046327690525280101, 3009265538105056020,
- 6018531076210112040, 12037062152420224081, 2407412430484044816,
- 4814824860968089632, 9629649721936179265, 1925929944387235853,
- 3851859888774471706, 7703719777548943412, 15407439555097886824,
- 3081487911019577364, 6162975822039154729, 12325951644078309459,
- 2465190328815661891, 4930380657631323783, 9860761315262647567,
- 1972152263052529513, 3944304526105059027, 7888609052210118054,
- 15777218104420236108, 3155443620884047221, 6310887241768094443,
- 12621774483536188886, 2524354896707237777, 5048709793414475554,
- 10097419586828951109, 2019483917365790221, 4038967834731580443,
- 8077935669463160887, 16155871338926321774, 3231174267785264354,
- 6462348535570528709, 12924697071141057419, 2584939414228211483,
- 5169878828456422967, 10339757656912845935, 2067951531382569187,
- 4135903062765138374, 8271806125530276748, 16543612251060553497,
- 3308722450212110699, 6617444900424221398, 13234889800848442797,
- 2646977960169688559, 5293955920339377119, 10587911840678754238,
- 2117582368135750847, 4235164736271501695, 8470329472543003390,
- 16940658945086006781, 3388131789017201356, 6776263578034402712,
- 13552527156068805425, 2710505431213761085, 5421010862427522170,
- 10842021724855044340, 2168404344971008868, 4336808689942017736,
- 8673617379884035472, 17347234759768070944, 3469446951953614188,
- 6938893903907228377, 13877787807814456755, 2775557561562891351,
- 5551115123125782702, 11102230246251565404, 2220446049250313080,
- 4440892098500626161, 8881784197001252323, 17763568394002504646,
- 3552713678800500929, 7105427357601001858, 14210854715202003717,
- 2842170943040400743, 5684341886080801486, 11368683772161602973,
- 2273736754432320594, 4547473508864641189, 9094947017729282379,
- 1818989403545856475, 3637978807091712951, 7275957614183425903,
- 14551915228366851806, 2910383045673370361, 5820766091346740722,
- 11641532182693481445, 2328306436538696289, 4656612873077392578,
- 9313225746154785156, 1862645149230957031, 3725290298461914062,
- 7450580596923828125, 14901161193847656250, 2980232238769531250,
- 5960464477539062500, 11920928955078125000, 2384185791015625000,
- 4768371582031250000, 9536743164062500000, 1907348632812500000,
- 3814697265625000000, 7629394531250000000, 15258789062500000000,
- 3051757812500000000, 6103515625000000000, 12207031250000000000,
- 2441406250000000000, 4882812500000000000, 9765625000000000000,
- 1953125000000000000, 3906250000000000000, 7812500000000000000,
- 15625000000000000000, 3125000000000000000, 6250000000000000000,
- 12500000000000000000, 2500000000000000000, 5000000000000000000,
- 10000000000000000000, 2000000000000000000, 4000000000000000000,
- 8000000000000000000, 16000000000000000000, 3200000000000000000,
- 6400000000000000000, 12800000000000000000, 2560000000000000000,
- 5120000000000000000, 10240000000000000000, 2048000000000000000,
- 4096000000000000000, 8192000000000000000, 16384000000000000000,
- 3276800000000000000, 6553600000000000000, 13107200000000000000,
- 2621440000000000000, 5242880000000000000, 10485760000000000000,
- 2097152000000000000, 4194304000000000000, 8388608000000000000,
- 16777216000000000000, 3355443200000000000, 6710886400000000000,
- 13421772800000000000, 2684354560000000000, 5368709120000000000,
- 10737418240000000000, 2147483648000000000, 4294967296000000000,
- 8589934592000000000, 17179869184000000000, 3435973836800000000,
- 6871947673600000000, 13743895347200000000, 2748779069440000000,
- 5497558138880000000, 10995116277760000000, 2199023255552000000,
- 4398046511104000000, 8796093022208000000, 17592186044416000000,
- 3518437208883200000, 7036874417766400000, 14073748835532800000,
- 2814749767106560000, 5629499534213120000, 11258999068426240000,
- 2251799813685248000, 4503599627370496000, 9007199254740992000,
- 18014398509481984000, 3602879701896396800, 7205759403792793600,
- 14411518807585587200, 2882303761517117440, 5764607523034234880,
- 11529215046068469760, 2305843009213693952, 4611686018427387904,
- 9223372036854775808, 1844674407370955161, 3689348814741910323,
- 7378697629483820646, 14757395258967641292, 2951479051793528258,
- 5902958103587056517, 11805916207174113034, 2361183241434822606,
- 4722366482869645213, 9444732965739290427, 1888946593147858085,
- 3777893186295716170, 7555786372591432341, 15111572745182864683,
- 3022314549036572936, 6044629098073145873, 12089258196146291747,
- 2417851639229258349, 4835703278458516698, 9671406556917033397,
- 1934281311383406679, 3868562622766813359, 7737125245533626718,
- 15474250491067253436, 3094850098213450687, 6189700196426901374,
- 12379400392853802748, 2475880078570760549, 4951760157141521099,
- 9903520314283042199, 1980704062856608439, 3961408125713216879,
- 7922816251426433759, 15845632502852867518, 3169126500570573503,
- 6338253001141147007, 12676506002282294014, 2535301200456458802,
- 5070602400912917605, 10141204801825835211, 2028240960365167042,
- 4056481920730334084, 8112963841460668169, 16225927682921336339,
- 3245185536584267267, 6490371073168534535, 12980742146337069071,
- 2596148429267413814, 5192296858534827628, 10384593717069655257,
- 2076918743413931051, 4153837486827862102, 8307674973655724205,
- 16615349947311448411, 3323069989462289682, 6646139978924579364,
- 13292279957849158729, 2658455991569831745, 5316911983139663491,
- 10633823966279326983, 2126764793255865396, 4253529586511730793,
- 8507059173023461586, 17014118346046923173, 3402823669209384634,
- 6805647338418769269, 13611294676837538538, 2722258935367507707,
- 5444517870735015415, 10889035741470030830, 2177807148294006166,
- 4355614296588012332, 8711228593176024664, 17422457186352049329,
- 3484491437270409865, 6968982874540819731, 13937965749081639463,
- 2787593149816327892, 5575186299632655785, 11150372599265311570,
- 2230074519853062314, 4460149039706124628, 8920298079412249256,
- 17840596158824498513, 3568119231764899702, 7136238463529799405,
- 14272476927059598810, 2854495385411919762, 5708990770823839524,
- 11417981541647679048, 2283596308329535809, 4567192616659071619,
- 9134385233318143238, 1826877046663628647, 3653754093327257295,
- 7307508186654514591, 14615016373309029182, 2923003274661805836,
- 5846006549323611672, 11692013098647223345, 2338402619729444669,
- 4676805239458889338, 9353610478917778676, 1870722095783555735,
- 3741444191567111470, 7482888383134222941, 14965776766268445882,
- 2993155353253689176, 5986310706507378352, 11972621413014756705,
- 2394524282602951341, 4789048565205902682, 9578097130411805364,
- 1915619426082361072, 3831238852164722145, 7662477704329444291,
- 15324955408658888583, 3064991081731777716, 6129982163463555433,
- 12259964326927110866, 2451992865385422173, 4903985730770844346,
- 9807971461541688693, 1961594292308337738, 3923188584616675477,
- 7846377169233350954, 15692754338466701909, 3138550867693340381,
- 6277101735386680763, 12554203470773361527, 2510840694154672305,
- 5021681388309344611, 10043362776618689222, 2008672555323737844,
- 4017345110647475688, 8034690221294951377, 16069380442589902755,
- 3213876088517980551, 6427752177035961102, 12855504354071922204,
- 2571100870814384440, 5142201741628768881, 10284403483257537763,
- 2056880696651507552, 4113761393303015105, 8227522786606030210,
- 16455045573212060421, 3291009114642412084, 6582018229284824168,
- 13164036458569648337, 2632807291713929667, 5265614583427859334,
- 10531229166855718669, 2106245833371143733, 4212491666742287467,
- 8424983333484574935, 16849966666969149871, 3369993333393829974,
- 6739986666787659948, 13479973333575319897, 2695994666715063979,
- 5391989333430127958, 10783978666860255917, 2156795733372051183,
- 4313591466744102367, 8627182933488204734, 17254365866976409468,
- 3450873173395281893, 6901746346790563787, 13803492693581127574,
- 2760698538716225514, 5521397077432451029, 11042794154864902059,
- 2208558830972980411, 4417117661945960823, 8834235323891921647,
- 17668470647783843295, 3533694129556768659, 7067388259113537318,
- 14134776518227074636, 2826955303645414927, 5653910607290829854,
- 11307821214581659709, 2261564242916331941, 4523128485832663883,
- 9046256971665327767, 18092513943330655534, 3618502788666131106,
- 7237005577332262213, 14474011154664524427, 2894802230932904885,
- 5789604461865809771, 11579208923731619542, 2315841784746323908,
- 4631683569492647816, 9263367138985295633, 1852673427797059126,
- 3705346855594118253, 7410693711188236507, 14821387422376473014,
- 2964277484475294602, 5928554968950589205, 11857109937901178411,
- 2371421987580235682, 4742843975160471364, 9485687950320942729,
- 1897137590064188545, 3794275180128377091, 7588550360256754183,
- 15177100720513508366, 3035420144102701673, 6070840288205403346,
- 12141680576410806693, 2428336115282161338, 4856672230564322677,
- 9713344461128645354, 1942668892225729070, 3885337784451458141,
- 7770675568902916283, 15541351137805832567, 3108270227561166513,
- 6216540455122333026, 12433080910244666053, 2486616182048933210,
- 4973232364097866421, 9946464728195732843, 1989292945639146568,
- 3978585891278293137, 7957171782556586274, 15914343565113172548,
- 3182868713022634509, 6365737426045269019, 12731474852090538039,
- 2546294970418107607, 5092589940836215215, 10185179881672430431,
- 2037035976334486086, 4074071952668972172, 8148143905337944345,
- 16296287810675888690, 3259257562135177738, 6518515124270355476,
- 13037030248540710952, 2607406049708142190, 5214812099416284380,
- 10429624198832568761, 2085924839766513752, 4171849679533027504,
- 8343699359066055009, 16687398718132110018, 3337479743626422003,
- 6674959487252844007, 13349918974505688014, 2669983794901137602,
- 5339967589802275205, 10679935179604550411, 2135987035920910082,
- 4271974071841820164, 8543948143683640329, 17087896287367280659,
- 3417579257473456131, 6835158514946912263, 13670317029893824527,
- 2734063405978764905, 5468126811957529810, 10936253623915059621,
- 2187250724783011924, 4374501449566023848, 8749002899132047697,
- 17498005798264095394, 3499601159652819078, 6999202319305638157,
- 13998404638611276315, 2799680927722255263, 5599361855444510526,
- 11198723710889021052, 2239744742177804210, 4479489484355608421,
- 8958978968711216842, 17917957937422433684, 3583591587484486736,
- 7167183174968973473, 14334366349937946947, 2866873269987589389,
- 5733746539975178779, 11467493079950357558, 2293498615990071511,
- 4586997231980143023, 9173994463960286046, 1834798892792057209,
- 3669597785584114418, 7339195571168228837, 14678391142336457674,
- 2935678228467291534, 5871356456934583069, 11742712913869166139,
- 2348542582773833227, 4697085165547666455, 9394170331095332911,
- 1878834066219066582, 3757668132438133164, 7515336264876266329,
- 15030672529752532658, 3006134505950506531, 6012269011901013063,
- 12024538023802026126, 2404907604760405225, 4809815209520810450,
- 9619630419041620901, 1923926083808324180, 3847852167616648360,
- 7695704335233296721, 15391408670466593442, 3078281734093318688,
- 6156563468186637376, 12313126936373274753, 2462625387274654950,
- 4925250774549309901, 9850501549098619803, 1970100309819723960,
- 3940200619639447921, 7880401239278895842, 15760802478557791684,
- 3152160495711558336, 6304320991423116673, 12608641982846233347,
- 2521728396569246669, 5043456793138493339, 10086913586276986678,
- 2017382717255397335, 4034765434510794671, 8069530869021589342,
- 16139061738043178685, 3227812347608635737, 6455624695217271474,
- 12911249390434542948, 2582249878086908589, 5164499756173817179,
- 10328999512347634358, 2065799902469526871, 4131599804939053743,
- 8263199609878107486, 16526399219756214973, 3305279843951242994,
- 6610559687902485989, 13221119375804971979, 2644223875160994395,
- 5288447750321988791, 10576895500643977583, 2115379100128795516,
- 4230758200257591033, 8461516400515182066, 16923032801030364133,
- 3384606560206072826, 6769213120412145653, 13538426240824291306,
- 2707685248164858261, 5415370496329716522, 10830740992659433045,
- 2166148198531886609, 4332296397063773218, 8664592794127546436,
- 17329185588255092872, 3465837117651018574, 6931674235302037148,
- 13863348470604074297, 2772669694120814859, 5545339388241629719,
- 11090678776483259438, 2218135755296651887, 4436271510593303775,
- 8872543021186607550, 17745086042373215101, 3549017208474643020,
- 7098034416949286040, 14196068833898572081, 2839213766779714416,
- 5678427533559428832, 11356855067118857664, 2271371013423771532,
- 4542742026847543065, 9085484053695086131, 1817096810739017226,
- 3634193621478034452, 7268387242956068905, 14536774485912137810,
- 2907354897182427562, 5814709794364855124, 11629419588729710248,
- 2325883917745942049, 4651767835491884099, 9303535670983768199,
- 1860707134196753639, 3721414268393507279, 7442828536787014559,
- 14885657073574029118, 2977131414714805823, 5954262829429611647,
- 11908525658859223294, 2381705131771844658, 4763410263543689317,
- 9526820527087378635, 1905364105417475727, 3810728210834951454,
- 7621456421669902908, 15242912843339805817, 3048582568667961163,
- 6097165137335922326, 12194330274671844653, 2438866054934368930,
- 4877732109868737861, 9755464219737475723, 1951092843947495144,
- 3902185687894990289, 7804371375789980578, 15608742751579961156,
- 3121748550315992231, 6243497100631984462, 12486994201263968925,
- 2497398840252793785, 4994797680505587570, 9989595361011175140,
- 1997919072202235028, 3995838144404470056, 7991676288808940112,
- 15983352577617880224, 3196670515523576044, 6393341031047152089,
- 12786682062094304179, 2557336412418860835, 5114672824837721671,
- 10229345649675443343, 2045869129935088668, 4091738259870177337,
- 8183476519740354675, 16366953039480709350, 3273390607896141870,
- 6546781215792283740, 13093562431584567480, 2618712486316913496,
- 5237424972633826992, 10474849945267653984, 2094969989053530796,
- 4189939978107061593, 8379879956214123187, 16759759912428246374,
- 3351951982485649274, 6703903964971298549, 13407807929942597099,
- 2681561585988519419, 5363123171977038839, 10726246343954077679,
- 2145249268790815535, 4290498537581631071, 8580997075163262143,
- 17161994150326524287, 3432398830065304857, 6864797660130609714,
- 13729595320261219429, 2745919064052243885, 5491838128104487771,
- 10983676256208975543, 2196735251241795108, 4393470502483590217,
- 8786941004967180435, 17573882009934360870, 3514776401986872174,
- 7029552803973744348, 14059105607947488696, 2811821121589497739,
- 5623642243178995478, 11247284486357990957, 2249456897271598191,
- 4498913794543196382, 8997827589086392765, 17995655178172785531,
- 3599131035634557106, 7198262071269114212, 14396524142538228424,
- 2879304828507645684, 5758609657015291369, 11517219314030582739,
- 2303443862806116547, 4606887725612233095, 9213775451224466191,
- 1842755090244893238, 3685510180489786476, 7371020360979572953,
- 14742040721959145907, 2948408144391829181, 5896816288783658362,
- 11793632577567316725, 2358726515513463345, 4717453031026926690,
- 9434906062053853380, 1886981212410770676, 3773962424821541352,
- 7547924849643082704, 15095849699286165408, 3019169939857233081,
- 6038339879714466163, 12076679759428932327, 2415335951885786465,
- 4830671903771572930, 9661343807543145861, 1932268761508629172,
- 3864537523017258344, 7729075046034516689, 15458150092069033378,
- 3091630018413806675, 6183260036827613351, 12366520073655226703,
- 2473304014731045340, 4946608029462090681, 9893216058924181362,
- 1978643211784836272, 3957286423569672544, 7914572847139345089,
- 15829145694278690179, 3165829138855738035, 6331658277711476071,
- 12663316555422952143, 2532663311084590428, 5065326622169180857,
- 10130653244338361715, 2026130648867672343, 4052261297735344686,
- 8104522595470689372, 16209045190941378744, 3241809038188275748,
- 6483618076376551497, 12967236152753102995, 2593447230550620599,
- 5186894461101241198, 10373788922202482396, 2074757784440496479,
- 4149515568880992958, 8299031137761985917, 16598062275523971834,
- 3319612455104794366, 6639224910209588733, 13278449820419177467,
- 2655689964083835493, 5311379928167670986, 10622759856335341973,
- 2124551971267068394, 4249103942534136789, 8498207885068273579,
- 16996415770136547158, 3399283154027309431, 6798566308054618863,
- 13597132616109237726, 2719426523221847545, 5438853046443695090,
- 10877706092887390181, 2175541218577478036, 4351082437154956072,
- 8702164874309912144, 17404329748619824289, 3480865949723964857,
- 6961731899447929715, 13923463798895859431, 2784692759779171886,
- 5569385519558343772, 11138771039116687545, 2227754207823337509,
- 4455508415646675018, 8911016831293350036, 17822033662586700072,
- 3564406732517340014, 7128813465034680029, 14257626930069360058,
- 2851525386013872011, 5703050772027744023, 11406101544055488046,
- 2281220308811097609, 4562440617622195218, 9124881235244390437,
- 1824976247048878087, 3649952494097756174, 7299904988195512349,
- 14599809976391024699, 2919961995278204939, 5839923990556409879,
- 11679847981112819759, 2335969596222563951, 4671939192445127903,
- 9343878384890255807, 1868775676978051161, 3737551353956102323,
- 7475102707912204646, 14950205415824409292, 2990041083164881858,
- 5980082166329763716, 11960164332659527433, 2392032866531905486,
- 4784065733063810973, 9568131466127621947, 1913626293225524389,
- 3827252586451048778, 7654505172902097557, 15309010345804195115,
- 3061802069160839023, 6123604138321678046, 12247208276643356092,
- 2449441655328671218, 4898883310657342436, 9797766621314684873,
- 1959553324262936974, 3919106648525873949, 7838213297051747899,
- 15676426594103495798, 3135285318820699159, 6270570637641398319,
- 12541141275282796638, 2508228255056559327, 5016456510113118655,
- 10032913020226237310, 2006582604045247462, 4013165208090494924,
- 8026330416180989848, 16052660832361979697, 3210532166472395939,
- 6421064332944791878, 12842128665889583757, 2568425733177916751,
- 5136851466355833503, 10273702932711667006, 2054740586542333401,
- 4109481173084666802, 8218962346169333605, 16437924692338667210,
- 3287584938467733442, 6575169876935466884, 13150339753870933768,
- 2630067950774186753, 5260135901548373507, 10520271803096747014,
- 2104054360619349402, 4208108721238698805, 8416217442477397611,
- 16832434884954795223, 3366486976990959044, 6732973953981918089,
- 13465947907963836178, 2693189581592767235, 5386379163185534471,
- 10772758326371068942, 2154551665274213788, 4309103330548427577,
- 8618206661096855154, 17236413322193710308, 3447282664438742061,
- 6894565328877484123, 13789130657754968246, 2757826131550993649,
- 5515652263101987298, 11031304526203974597, 2206260905240794919,
- 4412521810481589838, 8825043620963179677, 17650087241926359355,
- 3530017448385271871, 7060034896770543742, 14120069793541087484,
- 2824013958708217496, 5648027917416434993, 11296055834832869987,
- 2259211166966573997, 4518422333933147995, 9036844667866295990,
- 18073689335732591980, 3614737867146518396, 7229475734293036792,
- 14458951468586073584, 2891790293717214716, 5783580587434429433,
- 11567161174868858867, 2313432234973771773, 4626864469947543547,
- 9253728939895087094, 1850745787979017418, 3701491575958034837,
- 7402983151916069675, 14805966303832139350, 2961193260766427870,
- 5922386521532855740, 11844773043065711480, 2368954608613142296,
- 4737909217226284592, 9475818434452569184, 1895163686890513836,
- 3790327373781027673, 7580654747562055347, 15161309495124110694,
- 3032261899024822138, 6064523798049644277, 12129047596099288555,
- 2425809519219857711, 4851619038439715422, 9703238076879430844,
- 1940647615375886168, 3881295230751772337, 7762590461503544675,
- 15525180923007089351, 3105036184601417870, 6210072369202835740,
- 12420144738405671481, 2484028947681134296, 4968057895362268592,
- 9936115790724537184, 1987223158144907436, 3974446316289814873,
- 7948892632579629747, 15897785265159259495, 3179557053031851899,
- 6359114106063703798, 12718228212127407596, 2543645642425481519,
- 5087291284850963038, 10174582569701926077, 2034916513940385215,
- 4069833027880770430, 8139666055761540861, 16279332111523081723,
- 3255866422304616344, 6511732844609232689, 13023465689218465379,
- 2604693137843693075, 5209386275687386151, 10418772551374772303,
- 2083754510274954460, 4167509020549908921, 8335018041099817842,
- 16670036082199635685, 3334007216439927137, 6668014432879854274,
- 13336028865759708548, 2667205773151941709, 5334411546303883419,
- 10668823092607766838, 2133764618521553367, 4267529237043106735,
- 8535058474086213470, 17070116948172426941, 3414023389634485388,
- 6828046779268970776, 13656093558537941553, 2731218711707588310,
- 5462437423415176621, 10924874846830353242, 2184974969366070648,
- 4369949938732141297, 8739899877464282594, 17479799754928565188,
- 3495959950985713037, 6991919901971426075, 13983839803942852150,
- 2796767960788570430, 5593535921577140860, 11187071843154281720,
- 2237414368630856344, 4474828737261712688, 8949657474523425376,
- 17899314949046850752, 3579862989809370150, 7159725979618740301,
- 14319451959237480602, 2863890391847496120, 5727780783694992240,
- 11455561567389984481, 2291112313477996896, 4582224626955993792,
- 9164449253911987585, 1832889850782397517, 3665779701564795034,
- 7331559403129590068, 14663118806259180136, 2932623761251836027,
- 5865247522503672054, 11730495045007344109, 2346099009001468821,
- 4692198018002937643, 9384396036005875287, 1876879207201175057,
- 3753758414402350114, 7507516828804700229, 15015033657609400459,
- 3003006731521880091, 6006013463043760183, 12012026926087520367,
- 2402405385217504073, 4804810770435008147, 9609621540870016294,
- 1921924308174003258, 3843848616348006517, 7687697232696013035,
- 15375394465392026070, 3075078893078405214, 6150157786156810428,
- 12300315572313620856, 2460063114462724171, 4920126228925448342,
- 9840252457850896685, 1968050491570179337, 3936100983140358674,
- 7872201966280717348, 15744403932561434696, 3148880786512286939,
- 6297761573024573878, 12595523146049147757, 2519104629209829551,
- 5038209258419659102, 10076418516839318205, 2015283703367863641,
- 4030567406735727282, 8061134813471454564, 16122269626942909129,
- 3224453925388581825, 6448907850777163651, 12897815701554327303,
- 2579563140310865460, 5159126280621730921, 10318252561243461842,
- 2063650512248692368, 4127301024497384737, 8254602048994769474,
- 16509204097989538948, 3301840819597907789, 6603681639195815579,
- 13207363278391631158, 2641472655678326231, 5282945311356652463,
- 10565890622713304927, 2113178124542660985, 4226356249085321970,
- 8452712498170643941, 16905424996341287883, 3381084999268257576,
- 6762169998536515153, 13524339997073030306, 2704867999414606061,
- 5409735998829212122, 10819471997658424245, 2163894399531684849,
- 4327788799063369698, 8655577598126739396, 17311155196253478792,
- 3462231039250695758, 6924462078501391516, 13848924157002783033,
- 2769784831400556606, 5539569662801113213, 11079139325602226427,
- 2215827865120445285, 4431655730240890570, 8863311460481781141,
- 17726622920963562283, 3545324584192712456, 7090649168385424913,
- 14181298336770849826, 2836259667354169965, 5672519334708339930,
- 11345038669416679861, 2269007733883335972, 4538015467766671944,
- 9076030935533343889, 18152061871066687778, 3630412374213337555,
- 7260824748426675111, 14521649496853350222, 2904329899370670044,
- 5808659798741340089, 11617319597482680178, 2323463919496536035,
- 4646927838993072071, 9293855677986144142, 1858771135597228828,
- 3717542271194457656, 7435084542388915313, 14870169084777830627,
- 2974033816955566125, 5948067633911132251, 11896135267822264502,
- 2379227053564452900, 4758454107128905800, 9516908214257811601,
- 1903381642851562320, 3806763285703124640, 7613526571406249281,
- 15227053142812498563, 3045410628562499712, 6090821257124999425,
- 12181642514249998850, 2436328502849999770, 4872657005699999540,
- 9745314011399999080, 1949062802279999816, 3898125604559999632,
- 7796251209119999264, 15592502418239998528, 3118500483647999705,
- 6237000967295999411, 12474001934591998822, 2494800386918399764,
- 4989600773836799529, 9979201547673599058, 1995840309534719811,
- 3991680619069439623, 7983361238138879246, 15966722476277758493,
- 3193344495255551698, 6386688990511103397, 12773377981022206794,
- 2554675596204441358, 5109351192408882717, 10218702384817765435,
- 2043740476963553087, 4087480953927106174, 8174961907854212348,
- 16349923815708424697, 3269984763141684939, 6539969526283369878,
- 13079939052566739757, 2615987810513347951, 5231975621026695903,
- 10463951242053391806, 2092790248410678361, 4185580496821356722,
- 8371160993642713444, 16742321987285426889, 3348464397457085377,
- 6696928794914170755, 13393857589828341511, 2678771517965668302,
- 5357543035931336604, 10715086071862673209, 2143017214372534641,
- 4286034428745069283, 8572068857490138567, 17144137714980277135,
- 3428827542996055427, 6857655085992110854, 13715310171984221708,
- 2743062034396844341, 5486124068793688683, 10972248137587377366,
- 2194449627517475473, 4388899255034950946, 8777798510069901893,
- 17555597020139803786, 3511119404027960757, 7022238808055921514,
- 14044477616111843029, 2808895523222368605, 5617791046444737211,
- 11235582092889474423, 2247116418577894884, 4494232837155789769,
- 8988465674311579538, 17976931348623159077, 3595386269724631815,
- 7190772539449263630, 14381545078898527261, 2876309015779705452,
- 5752618031559410904, 11505236063118821809, 2301047212623764361,
- 4602094425247528723, 9204188850495057447, 1840837770099011489,
- 3681675540198022979, 7363351080396045958,
- };
-
- static readonly int[] TensExponentTable = {
- -323, -323, -322, -322, -322, -322, -321, -321, -321, -320, -320, -320,
- -319, -319, -319, -319, -318, -318, -318, -317, -317, -317, -316, -316,
- -316, -316, -315, -315, -315, -314, -314, -314, -313, -313, -313, -313,
- -312, -312, -312, -311, -311, -311, -310, -310, -310, -310, -309, -309,
- -309, -308, -308, -308, -307, -307, -307, -307, -306, -306, -306, -305,
- -305, -305, -304, -304, -304, -304, -303, -303, -303, -302, -302, -302,
- -301, -301, -301, -301, -300, -300, -300, -299, -299, -299, -298, -298,
- -298, -298, -297, -297, -297, -296, -296, -296, -295, -295, -295, -295,
- -294, -294, -294, -293, -293, -293, -292, -292, -292, -291, -291, -291,
- -291, -290, -290, -290, -289, -289, -289, -288, -288, -288, -288, -287,
- -287, -287, -286, -286, -286, -285, -285, -285, -285, -284, -284, -284,
- -283, -283, -283, -282, -282, -282, -282, -281, -281, -281, -280, -280,
- -280, -279, -279, -279, -279, -278, -278, -278, -277, -277, -277, -276,
- -276, -276, -276, -275, -275, -275, -274, -274, -274, -273, -273, -273,
- -273, -272, -272, -272, -271, -271, -271, -270, -270, -270, -270, -269,
- -269, -269, -268, -268, -268, -267, -267, -267, -267, -266, -266, -266,
- -265, -265, -265, -264, -264, -264, -263, -263, -263, -263, -262, -262,
- -262, -261, -261, -261, -260, -260, -260, -260, -259, -259, -259, -258,
- -258, -258, -257, -257, -257, -257, -256, -256, -256, -255, -255, -255,
- -254, -254, -254, -254, -253, -253, -253, -252, -252, -252, -251, -251,
- -251, -251, -250, -250, -250, -249, -249, -249, -248, -248, -248, -248,
- -247, -247, -247, -246, -246, -246, -245, -245, -245, -245, -244, -244,
- -244, -243, -243, -243, -242, -242, -242, -242, -241, -241, -241, -240,
- -240, -240, -239, -239, -239, -239, -238, -238, -238, -237, -237, -237,
- -236, -236, -236, -235, -235, -235, -235, -234, -234, -234, -233, -233,
- -233, -232, -232, -232, -232, -231, -231, -231, -230, -230, -230, -229,
- -229, -229, -229, -228, -228, -228, -227, -227, -227, -226, -226, -226,
- -226, -225, -225, -225, -224, -224, -224, -223, -223, -223, -223, -222,
- -222, -222, -221, -221, -221, -220, -220, -220, -220, -219, -219, -219,
- -218, -218, -218, -217, -217, -217, -217, -216, -216, -216, -215, -215,
- -215, -214, -214, -214, -214, -213, -213, -213, -212, -212, -212, -211,
- -211, -211, -211, -210, -210, -210, -209, -209, -209, -208, -208, -208,
- -208, -207, -207, -207, -206, -206, -206, -205, -205, -205, -204, -204,
- -204, -204, -203, -203, -203, -202, -202, -202, -201, -201, -201, -201,
- -200, -200, -200, -199, -199, -199, -198, -198, -198, -198, -197, -197,
- -197, -196, -196, -196, -195, -195, -195, -195, -194, -194, -194, -193,
- -193, -193, -192, -192, -192, -192, -191, -191, -191, -190, -190, -190,
- -189, -189, -189, -189, -188, -188, -188, -187, -187, -187, -186, -186,
- -186, -186, -185, -185, -185, -184, -184, -184, -183, -183, -183, -183,
- -182, -182, -182, -181, -181, -181, -180, -180, -180, -180, -179, -179,
- -179, -178, -178, -178, -177, -177, -177, -176, -176, -176, -176, -175,
- -175, -175, -174, -174, -174, -173, -173, -173, -173, -172, -172, -172,
- -171, -171, -171, -170, -170, -170, -170, -169, -169, -169, -168, -168,
- -168, -167, -167, -167, -167, -166, -166, -166, -165, -165, -165, -164,
- -164, -164, -164, -163, -163, -163, -162, -162, -162, -161, -161, -161,
- -161, -160, -160, -160, -159, -159, -159, -158, -158, -158, -158, -157,
- -157, -157, -156, -156, -156, -155, -155, -155, -155, -154, -154, -154,
- -153, -153, -153, -152, -152, -152, -152, -151, -151, -151, -150, -150,
- -150, -149, -149, -149, -149, -148, -148, -148, -147, -147, -147, -146,
- -146, -146, -145, -145, -145, -145, -144, -144, -144, -143, -143, -143,
- -142, -142, -142, -142, -141, -141, -141, -140, -140, -140, -139, -139,
- -139, -139, -138, -138, -138, -137, -137, -137, -136, -136, -136, -136,
- -135, -135, -135, -134, -134, -134, -133, -133, -133, -133, -132, -132,
- -132, -131, -131, -131, -130, -130, -130, -130, -129, -129, -129, -128,
- -128, -128, -127, -127, -127, -127, -126, -126, -126, -125, -125, -125,
- -124, -124, -124, -124, -123, -123, -123, -122, -122, -122, -121, -121,
- -121, -121, -120, -120, -120, -119, -119, -119, -118, -118, -118, -117,
- -117, -117, -117, -116, -116, -116, -115, -115, -115, -114, -114, -114,
- -114, -113, -113, -113, -112, -112, -112, -111, -111, -111, -111, -110,
- -110, -110, -109, -109, -109, -108, -108, -108, -108, -107, -107, -107,
- -106, -106, -106, -105, -105, -105, -105, -104, -104, -104, -103, -103,
- -103, -102, -102, -102, -102, -101, -101, -101, -100, -100, -100, -99,
- -99, -99, -99, -98, -98, -98, -97, -97, -97, -96, -96, -96,
- -96, -95, -95, -95, -94, -94, -94, -93, -93, -93, -93, -92,
- -92, -92, -91, -91, -91, -90, -90, -90, -89, -89, -89, -89,
- -88, -88, -88, -87, -87, -87, -86, -86, -86, -86, -85, -85,
- -85, -84, -84, -84, -83, -83, -83, -83, -82, -82, -82, -81,
- -81, -81, -80, -80, -80, -80, -79, -79, -79, -78, -78, -78,
- -77, -77, -77, -77, -76, -76, -76, -75, -75, -75, -74, -74,
- -74, -74, -73, -73, -73, -72, -72, -72, -71, -71, -71, -71,
- -70, -70, -70, -69, -69, -69, -68, -68, -68, -68, -67, -67,
- -67, -66, -66, -66, -65, -65, -65, -65, -64, -64, -64, -63,
- -63, -63, -62, -62, -62, -62, -61, -61, -61, -60, -60, -60,
- -59, -59, -59, -58, -58, -58, -58, -57, -57, -57, -56, -56,
- -56, -55, -55, -55, -55, -54, -54, -54, -53, -53, -53, -52,
- -52, -52, -52, -51, -51, -51, -50, -50, -50, -49, -49, -49,
- -49, -48, -48, -48, -47, -47, -47, -46, -46, -46, -46, -45,
- -45, -45, -44, -44, -44, -43, -43, -43, -43, -42, -42, -42,
- -41, -41, -41, -40, -40, -40, -40, -39, -39, -39, -38, -38,
- -38, -37, -37, -37, -37, -36, -36, -36, -35, -35, -35, -34,
- -34, -34, -34, -33, -33, -33, -32, -32, -32, -31, -31, -31,
- -30, -30, -30, -30, -29, -29, -29, -28, -28, -28, -27, -27,
- -27, -27, -26, -26, -26, -25, -25, -25, -24, -24, -24, -24,
- -23, -23, -23, -22, -22, -22, -21, -21, -21, -21, -20, -20,
- -20, -19, -19, -19, -18, -18, -18, -18, -17, -17, -17, -16,
- -16, -16, -15, -15, -15, -15, -14, -14, -14, -13, -13, -13,
- -12, -12, -12, -12, -11, -11, -11, -10, -10, -10, -9, -9,
- -9, -9, -8, -8, -8, -7, -7, -7, -6, -6, -6, -6,
- -5, -5, -5, -4, -4, -4, -3, -3, -3, -3, -2, -2,
- -2, -1, -1, -1, 0, 0, 0, 1, 1, 1, 1, 2,
- 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5,
- 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9,
- 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13,
- 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16,
- 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20,
- 20, 20, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23,
- 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27,
- 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 31,
- 31, 31, 32, 32, 32, 32, 33, 33, 33, 34, 34, 34,
- 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38,
- 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 41,
- 42, 42, 42, 43, 43, 43, 44, 44, 44, 44, 45, 45,
- 45, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 49,
- 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52,
- 53, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56,
- 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60,
- 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63,
- 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 67,
- 67, 67, 68, 68, 68, 69, 69, 69, 69, 70, 70, 70,
- 71, 71, 71, 72, 72, 72, 72, 73, 73, 73, 74, 74,
- 74, 75, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78,
- 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81,
- 81, 82, 82, 82, 83, 83, 83, 84, 84, 84, 84, 85,
- 85, 85, 86, 86, 86, 87, 87, 87, 88, 88, 88, 88,
- 89, 89, 89, 90, 90, 90, 91, 91, 91, 91, 92, 92,
- 92, 93, 93, 93, 94, 94, 94, 94, 95, 95, 95, 96,
- 96, 96, 97, 97, 97, 97, 98, 98, 98, 99, 99, 99,
- 100, 100, 100, 100, 101, 101, 101, 102, 102, 102, 103, 103,
- 103, 103, 104, 104, 104, 105, 105, 105, 106, 106, 106, 106,
- 107, 107, 107, 108, 108, 108, 109, 109, 109, 109, 110, 110,
- 110, 111, 111, 111, 112, 112, 112, 112, 113, 113, 113, 114,
- 114, 114, 115, 115, 115, 116, 116, 116, 116, 117, 117, 117,
- 118, 118, 118, 119, 119, 119, 119, 120, 120, 120, 121, 121,
- 121, 122, 122, 122, 122, 123, 123, 123, 124, 124, 124, 125,
- 125, 125, 125, 126, 126, 126, 127, 127, 127, 128, 128, 128,
- 128, 129, 129, 129, 130, 130, 130, 131, 131, 131, 131, 132,
- 132, 132, 133, 133, 133, 134, 134, 134, 134, 135, 135, 135,
- 136, 136, 136, 137, 137, 137, 137, 138, 138, 138, 139, 139,
- 139, 140, 140, 140, 140, 141, 141, 141, 142, 142, 142, 143,
- 143, 143, 143, 144, 144, 144, 145, 145, 145, 146, 146, 146,
- 147, 147, 147, 147, 148, 148, 148, 149, 149, 149, 150, 150,
- 150, 150, 151, 151, 151, 152, 152, 152, 153, 153, 153, 153,
- 154, 154, 154, 155, 155, 155, 156, 156, 156, 156, 157, 157,
- 157, 158, 158, 158, 159, 159, 159, 159, 160, 160, 160, 161,
- 161, 161, 162, 162, 162, 162, 163, 163, 163, 164, 164, 164,
- 165, 165, 165, 165, 166, 166, 166, 167, 167, 167, 168, 168,
- 168, 168, 169, 169, 169, 170, 170, 170, 171, 171, 171, 171,
- 172, 172, 172, 173, 173, 173, 174, 174, 174, 175, 175, 175,
- 175, 176, 176, 176, 177, 177, 177, 178, 178, 178, 178, 179,
- 179, 179, 180, 180, 180, 181, 181, 181, 181, 182, 182, 182,
- 183, 183, 183, 184, 184, 184, 184, 185, 185, 185, 186, 186,
- 186, 187, 187, 187, 187, 188, 188, 188, 189, 189, 189, 190,
- 190, 190, 190, 191, 191, 191, 192, 192, 192, 193, 193, 193,
- 193, 194, 194, 194, 195, 195, 195, 196, 196, 196, 196, 197,
- 197, 197, 198, 198, 198, 199, 199, 199, 199, 200, 200, 200,
- 201, 201, 201, 202, 202, 202, 202, 203, 203, 203, 204, 204,
- 204, 205, 205, 205, 206, 206, 206, 206, 207, 207, 207, 208,
- 208, 208, 209, 209, 209, 209, 210, 210, 210, 211, 211, 211,
- 212, 212, 212, 212, 213, 213, 213, 214, 214, 214, 215, 215,
- 215, 215, 216, 216, 216, 217, 217, 217, 218, 218, 218, 218,
- 219, 219, 219, 220, 220, 220, 221, 221, 221, 221, 222, 222,
- 222, 223, 223, 223, 224, 224, 224, 224, 225, 225, 225, 226,
- 226, 226, 227, 227, 227, 227, 228, 228, 228, 229, 229, 229,
- 230, 230, 230, 230, 231, 231, 231, 232, 232, 232, 233, 233,
- 233, 234, 234, 234, 234, 235, 235, 235, 236, 236, 236, 237,
- 237, 237, 237, 238, 238, 238, 239, 239, 239, 240, 240, 240,
- 240, 241, 241, 241, 242, 242, 242, 243, 243, 243, 243, 244,
- 244, 244, 245, 245, 245, 246, 246, 246, 246, 247, 247, 247,
- 248, 248, 248, 249, 249, 249, 249, 250, 250, 250, 251, 251,
- 251, 252, 252, 252, 252, 253, 253, 253, 254, 254, 254, 255,
- 255, 255, 255, 256, 256, 256, 257, 257, 257, 258, 258, 258,
- 258, 259, 259, 259, 260, 260, 260, 261, 261, 261, 261, 262,
- 262, 262, 263, 263, 263, 264, 264, 264, 265, 265, 265, 265,
- 266, 266, 266, 267, 267, 267, 268, 268, 268, 268, 269, 269,
- 269, 270, 270, 270, 271, 271, 271, 271, 272, 272, 272, 273,
- 273, 273, 274, 274, 274, 274, 275, 275, 275, 276, 276, 276,
- 277, 277, 277, 277, 278, 278, 278, 279, 279, 279, 280, 280,
- 280, 280, 281, 281, 281, 282, 282, 282, 283, 283, 283, 283,
- 284, 284, 284, 285, 285, 285, 286, 286, 286, 286, 287, 287,
- 287, 288, 288, 288, 289, 289, 289, 289, 290, 290, 290, 291,
- 291, 291, 292, 292, 292, 293, 293, 293,
- };
-
-#if false
- #region Double exponent table construction
-
- // This code computes the above valus of TensExponentTable &
- // MantissaBitsTable. This code is helpful when you try to optimize
- // further the double ToString performance.
- private const int ExponentMid = 1043;
- private const int ExponentMax = 2047;
-
- // Ensure that values won't cause overflow when multiplied with the double Mantissa.
- private const ulong UpperMapMark = UInt64.MaxValue / 2 - (1 << 57);
- private const ulong LowerMapMark = UInt64.MaxValue / 5 - (1 << 56);
-
- // The results of 2 ^ 64 / 5 * i for i in {0 .. 4}
- private static ulong[] Div5 = new ulong[] {
- 0,
- 0x3333333333333333,
- 0x6666666666666666,
- 0x9999999999999999,
- 0xCCCCCCCCCCCCCCCC };
-
- static NumberFormatter ()
- {
- InitUpperMap ();
- InitLowerMap ();
- }
-
- private static void InitUpperMap ()
- {
- ulong val = 1000000000UL << 32;
- int expVal = -9;
- ulong loVal = 0;
- for (int i = ExponentMid; i <= ExponentMax; i++) {
- MantissaBitsTable [i] = val;
- TensExponentTable [i] = expVal;
- if (val < UpperMapMark) {
- val = (val << 1) + (uint)(loVal >> 63);
- loVal = (loVal << 1);
- }
- else {
- ulong rem = val % 5;
- val /= 5;
- ulong rem2 = rem + (loVal % 5);
- loVal = loVal / 5 + Div5 [rem];
- if (rem2 >= 5) {
- loVal++;
- rem2 -= 5;
- }
- expVal++;
- }
- }
- }
-
- private static void InitLowerMap ()
- {
- ulong val = 1000000000UL << 32;
- int expVal = -9;
- ulong loVal = 0;
- for (int i = ExponentMid; i >= 0; i--) {
- MantissaBitsTable [i] = val;
- TensExponentTable [i] = expVal;
- if (val < LowerMapMark) {
- val *= 5;
- for (uint j = 4; j > 0; j--) {
- if (loVal > Div5 [j]) {
- val += j;
- break;
- }
- }
- loVal *= 5;
- expVal--;
- }
- else {
- loVal = (((ulong)val & 1) << 63) | (loVal >> 1);
- val = val >> 1;
- }
- }
- }
-
- #endregion Double exponent table construction
-#endif
- }
-}
-#endif // !UNSAFE_TABLES
if (ptr < max && str[ptr] == ':') {
int start = ++ ptr;
- while (ptr < max && str[ptr] != '}')
- ++ ptr;
-
+ while (ptr < max) {
+ if (str [ptr] == '}') {
+ if (ptr + 1 < max && str [ptr + 1] == '}') {
+ ++ptr;
+ format += str.Substring (start, ptr - start);
+ ++ptr;
+ start = ptr;
+ continue;
+ }
+
+ break;
+ }
+
+ ++ptr;
+ }
+
format += str.Substring (start, ptr - start);
}
else
using NUnit.Framework.SyntaxHelpers;
#endif
-namespace MonoTests {
+namespace MonoTests.Mono {
[TestFixture]
public class DataConverterTest
[Test]
public void StringAlignment ()
{
- byte[] packed = Mono.DataConverter.Pack ("bz8", 1, TEST_STRING);
+ byte[] packed = global::Mono.DataConverter.Pack ("bz8", 1, TEST_STRING);
- IList unpacked = Mono.DataConverter.Unpack ("bz8", packed, 0);
+ IList unpacked = global::Mono.DataConverter.Unpack ("bz8", packed, 0);
Assert.AreEqual(1, (byte) unpacked[0]);
Assert.AreEqual(TEST_STRING, new string((char[]) unpacked[1]));
Assert.That ((f - 3.14f), Is.LessThanOrEqualTo (Single.Epsilon));
}
}
-}
\ No newline at end of file
+}
}
[Test]
- [Category ("TargetJvmNotWorking")] // BUGBUG Very very slow on TARGET_JVM.
public void SerializationTest()
{
for (int i = 0; i < 50; i++)
#if !NET_4_0 // FIXME: the blob contains the 2.0 mscorlib version
[Test]
- [Category ("TargetJvmNotWorking")]
public void SerializeTest ()
{
List <int> list = new List <int> ();
list.Add (0);
list.Add (7);
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, list);
#endif
[Test]
- [Category ("TargetJvmNotWorking")]
public void DeserializeTest ()
{
MemoryStream ms = new MemoryStream ();
ms.Write (_serializedList, 0, _serializedList.Length);
ms.Position = 0;
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
List<int> list = (List<int>) bf.Deserialize (ms);
Assert.AreEqual (3, list.Count, "#1");
Assert.AreEqual (5, list [0], "#2");
[Test]
public void Deserialize ()
{
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
MemoryStream ms = new MemoryStream (serialized_en_us);
CaseInsensitiveHashCodeProvider enus = (CaseInsensitiveHashCodeProvider) bf.Deserialize (ms);
h['b'] = 2;\r
DictionaryEntry[] o = new DictionaryEntry[2];\r
h.CopyTo(o,0);\r
-#if TARGET_JVM // Hashtable is not an ordered collection!\r
- if (o[0].Key.Equals('b')) {\r
- DictionaryEntry v = o[0];\r
- o[0] = o[1];\r
- o[1] = v;\r
- }\r
-#endif // TARGET_JVM\r
Assert.AreEqual ('a', o[0].Key, "first copy fine.");\r
Assert.AreEqual (1, o[0].Value, "first copy fine.");\r
Assert.AreEqual ('b', o[1].Key, "second copy fine.");\r
}\r
\r
[Test]\r
- [Category ("TargetJvmNotWorking")]\r
public void TestSerialization2 () {\r
// Test from bug #70570\r
MemoryStream stream = new MemoryStream();\r
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void SerializeTest ()
{
SortedList sl1 = new SortedList ();
sl1.Add (0, "B");
sl1.Add (7, "C");
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
bf.AssemblyFormat = FormatterAssemblyStyle.Full;
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, sl1);
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void Keys_Serialize ()
{
SortedList sl = new SortedList ();
sl.Add (7, "C");
IList keys1 = (IList) sl.Keys;
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
bf.AssemblyFormat = FormatterAssemblyStyle.Full;
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, keys1);
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void Values_Serialize ()
{
SortedList sl = new SortedList ();
sl.Add (7, "C");
IList values1 = (IList) sl.Values;
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
bf.AssemblyFormat = FormatterAssemblyStyle.Full;
MemoryStream ms = new MemoryStream ();
bf.Serialize (ms, values1);
[Category ("NotWorking")]
public void Values_Deserialize ()
{
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
MemoryStream ms = new MemoryStream ();
ms.Write (_serializedValues, 0, _serializedValues.Length);
// (C) 2002 Ulrich Kunitz
//
+using System.Collections.Generic;
using NUnit.Framework;
using System;
using System.Globalization;
Assert.AreEqual (4363, kc.ToFourDigitYear (4363), "#4-4");
}
+ public void TestDaysInYear (Calendar calendar, int year)
+ {
+ var daysInYear = calendar.GetDaysInYear (year);
+ var daysInMonths = 0;
+ var monthInYear = calendar.GetMonthsInYear (year);
+ for (var m = 1; m <= monthInYear; m++)
+ daysInMonths += calendar.GetDaysInMonth (year, m);
+
+ Assert.AreEqual (daysInYear, daysInMonths, string.Format("Calendar:{0} Year:{1}",calendar.GetType(), year));
+ }
+
+ [Test]
+ public void DaysInYear ()
+ {
+ var calendars = new List<Calendar> (acal) {
+ new UmAlQuraCalendar ()
+ };
+
+ foreach (var calendar in calendars) {
+ var minYear = calendar.GetYear (calendar.MinSupportedDateTime);
+ var maxYear = calendar.GetYear (calendar.MaxSupportedDateTime) - 1 ;
+ var midYear = calendar.GetYear (DateTime.Now);
+ var yearsTested = Math.Min (1000, (maxYear - minYear) / 2);
+
+ midYear -= yearsTested / 2;
+
+ int y1 = minYear, y2 = maxYear, y3 = midYear;
+ for (var i = 0; i < yearsTested; i++) {
+ TestDaysInYear (calendar, y1);
+ TestDaysInYear (calendar, y2);
+ if (y3 > minYear && y3 < maxYear)
+ TestDaysInYear (calendar, y3);
+
+ y1++; y2--; y3++;
+ }
+ }
+ }
+
// TODO: more tests :-)
} // class CalendarTest
+++ /dev/null
-// CompareInfoTest.cs - NUnit Test Cases for the
-// System.Globalization.CompareInfo class
-//
-// Dick Porter <dick@ximian.com>
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-// (C) 2003-2005 Novell, Inc. http://www.novell.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System.Globalization
-{
-
-[TestFixture]
-public class CompareInfoTest
-{
- static bool doTest = Environment.GetEnvironmentVariable ("MONO_DISABLE_MANAGED_COLLATION") != "yes";
-
- public CompareInfoTest() {}
-
- [Test]
- public void Compare()
- {
- string s1 = "foo";
-
- Assert.AreEqual (0, CultureInfo.InvariantCulture.CompareInfo.Compare ("", ""), "Compare two empty strings");
- Assert.AreEqual (1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, ""), "Compare string with empty string");
- Assert.AreEqual (-1, CultureInfo.InvariantCulture.CompareInfo.Compare ("", s1), "Compare empty string with string");
-
- Assert.AreEqual (0, CultureInfo.InvariantCulture.CompareInfo.Compare ("", 0, "", 0), "Compare two empty strings, with 0 offsets");
- Assert.AreEqual (1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, "", 0), "Compare string with empty string, with 0 offsets");
- Assert.AreEqual (-1, CultureInfo.InvariantCulture.CompareInfo.Compare ("", 0, s1, 0), "Compare empty string with string, with 0 offsets");
-
- Assert.AreEqual (0, CultureInfo.InvariantCulture.CompareInfo.Compare ("", 0, "".Length, "", 0, "".Length), "Compare two empty strings, with 0 offsets and specified lengths");
- Assert.AreEqual (1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, s1.Length, "", 0, "".Length), "Compare string with empty string, with 0 offsets and specified lengths");
- Assert.AreEqual (-1, CultureInfo.InvariantCulture.CompareInfo.Compare ("", 0, "".Length, s1, 0, s1.Length), "Compare empty string with string, with 0 offsets and specified lengths");
-
- Assert.AreEqual (0, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, s1.Length, s1, s1.Length), "Compare two strings, with offsets == string lengths");
- Assert.AreEqual (-1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, s1.Length, s1, 0), "Compare two strings, with first offset == string length");
- Assert.AreEqual (1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, s1, s1.Length), "Compare two strings, with second offset == string length");
-
- Assert.AreEqual (0, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, 0, s1, 0, 0), "Compare two strings, with zero lengths");
- Assert.AreEqual (-1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, 0, s1, 0, s1.Length), "Compare two strings, with first length zero");
- Assert.AreEqual (1, CultureInfo.InvariantCulture.CompareInfo.Compare (s1, 0, s1.Length, s1, 0, 0), "Compare strings, with second length zero");
-
- }
-
- // Culture-sensitive collation tests
-
- CompareInfo invariant = CultureInfo.InvariantCulture.CompareInfo;
- CompareInfo french = new CultureInfo ("fr").CompareInfo;
- CompareInfo japanese = new CultureInfo ("ja").CompareInfo;
- CompareInfo czech = new CultureInfo ("cs").CompareInfo;
- CompareInfo hungarian = new CultureInfo ("hu").CompareInfo;
-
- CompareOptions ignoreCN =
- CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase;
-
- void AssertCompare (string message, int result, string s1, string s2)
- {
- AssertCompare (message, result, s1, s2, CompareOptions.None);
- }
-
- void AssertCompare (string message, int result, string s1, string s2,
- CompareOptions opt)
- {
- AssertCompare (message, result, s1, s2, opt, invariant);
- }
-
- void AssertCompare (string message, int result, string s1, string s2,
- CompareOptions opt, CompareInfo ci)
- {
- int ret = ci.Compare (s1, s2, opt);
- if (result == 0)
- AssertEquals (message, 0, ret);
- else if (result < 0)
- Assert.IsTrue (message + String.Format ("(neg: {0})", ret), ret < 0);
- else
- Assert.IsTrue (message + String.Format ("(pos: {0})", ret), ret > 0);
- }
-
- void AssertCompare (string message, int result,
- string s1, int idx1, int len1, string s2, int idx2, int len2)
- {
- int ret = invariant.Compare (s1, idx1, len1, s2, idx2, len2);
- if (result == 0)
- AssertEquals (message, 0, ret);
- else if (result < 0)
- Assert.IsTrue (message, ret < 0);
- else
- Assert.IsTrue (message, ret > 0);
- }
-
- void AssertCompare (string message, int result,
- string s1, int idx1, int len1, string s2, int idx2, int len2,
- CompareOptions opt, CompareInfo ci)
- {
- int ret = ci.Compare (s1, idx1, len1, s2, idx2, len2, opt);
- if (result == 0)
- AssertEquals (message, 0, ret);
- else if (result < 0)
- Assert.IsTrue (message, ret < 0);
- else
- Assert.IsTrue (message, ret > 0);
- }
-
- void AssertIndexOf (string message, int expected,
- string source, char target)
- {
- AssertEquals (message, expected,
- invariant.IndexOf (source, target));
- }
-
- void AssertIndexOf (string message, int expected, string source,
- char target, CompareOptions opt)
- {
- AssertEquals (message, expected,
- invariant.IndexOf (source, target, opt));
- }
-
- void AssertIndexOf (string message, int expected, string source,
- char target, int idx, int len, CompareOptions opt, CompareInfo ci)
- {
- AssertEquals (message, expected,
- ci.IndexOf (source, target, idx, len, opt));
- }
-
- void AssertIndexOf (string message, int expected,
- string source, string target)
- {
- AssertEquals (message, expected,
- invariant.IndexOf (source, target));
- }
-
- void AssertIndexOf (string message, int expected, string source,
- string target, CompareOptions opt)
- {
- AssertEquals (message, expected,
- invariant.IndexOf (source, target, opt));
- }
-
- void AssertIndexOf (string message, int expected, string source,
- string target, int idx, int len, CompareOptions opt, CompareInfo ci)
- {
- AssertEquals (message, expected,
- ci.IndexOf (source, target, idx, len, opt));
- }
-
- void AssertLastIndexOf (string message, int expected,
- string source, char target)
- {
- AssertEquals (message, expected,
- invariant.LastIndexOf (source, target));
- }
-
- void AssertLastIndexOf (string message, int expected, string source,
- char target, CompareOptions opt)
- {
- AssertEquals (message, expected,
- invariant.LastIndexOf (source, target, opt));
- }
-
- void AssertLastIndexOf (string message, int expected, string source,
- char target, int idx, int len)
- {
- AssertEquals (message, expected,
- invariant.LastIndexOf (source, target, idx, len));
- }
-
- void AssertLastIndexOf (string message, int expected, string source,
- char target, int idx, int len, CompareOptions opt, CompareInfo ci)
- {
- AssertEquals (message, expected,
- ci.LastIndexOf (source, target, idx, len, opt));
- }
-
- void AssertLastIndexOf (string message, int expected,
- string source, string target)
- {
- AssertEquals (message, expected,
- invariant.LastIndexOf (source, target));
- }
-
- void AssertLastIndexOf (string message, int expected, string source,
- string target, CompareOptions opt)
- {
- AssertEquals (message, expected,
- invariant.LastIndexOf (source, target, opt));
- }
-
- void AssertLastIndexOf (string message, int expected, string source,
- string target, int idx, int len)
- {
- AssertEquals (message, expected,
- invariant.LastIndexOf (source, target, idx, len));
- }
-
- void AssertLastIndexOf (string message, int expected, string source,
- string target, int idx, int len, CompareOptions opt, CompareInfo ci)
- {
- AssertEquals (message, expected,
- ci.LastIndexOf (source, target, idx, len, opt));
- }
-
- void AssertIsPrefix (string message, bool expected, string source,
- string target)
- {
- Assert.IsTrue (message, expected == invariant.IsPrefix (
- source, target));
- }
-
- void AssertIsPrefix (string message, bool expected, string source,
- string target, CompareOptions opt)
- {
- Assert.IsTrue (message, expected == invariant.IsPrefix (
- source, target, opt));
- }
-
- void AssertIsSuffix (string message, bool expected, string source,
- string target)
- {
- Assert.IsTrue (message, expected == invariant.IsSuffix (
- source, target));
- }
-
- void AssertIsSuffix (string message, bool expected, string source,
- string target, CompareOptions opt)
- {
- Assert.IsTrue (message, expected == invariant.IsSuffix (
- source, target, opt));
- }
-
- [Test]
-#if NET_2_0
- [Category ("NotDotNet")]
-#endif
- public void CultureSensitiveCompare ()
- {
- if (!doTest)
- return;
-
- AssertCompare ("#1", -1, "1", "2");
- AssertCompare ("#2", 1, "A", "a");
- AssertCompare ("#3", 0, "A", "a", CompareOptions.IgnoreCase);
- AssertCompare ("#6", 1, "12", "1");
-// BUG in .NET 2.0: See GetSortKey() test that assures sortkeys for "AE" and
-// "\u00C6" are equivalent.
- AssertCompare ("#7", 0, "AE", "\u00C6");
- AssertCompare ("#8", 0, "AB\u01c0C", "A\u01c0B\u01c0C", CompareOptions.IgnoreSymbols);
-// BUG in .NET 2.0: ditto.
- AssertCompare ("#9", 0, "A\u0304", "\u0100");
- AssertCompare ("#10", 1, "ABCABC", 5, 1, "1", 0, 1, CompareOptions.IgnoreCase, invariant);
- AssertCompare ("#11", 0, "-d:NET_2_0", 0, 1, "-", 0, 1);
-
-// BUG in .NET 2.0: ditto.
- AssertCompare ("#12", 0, "ae", "\u00E6");
- AssertCompare ("#13", 0, "\u00E6", "ae");
- AssertCompare ("#14", 0, "\u00E6s", 0, 1, "ae", 0, 2);
-
- // target is "empty" (in culture-sensitive context).
-// BUG in .NET 2.0: \u3007 is totally-ignored character as a GetSortKey()
-// result, while it is not in Compare().
- AssertCompare ("#17", 0, String.Empty, "\u3007");
- AssertCompare ("#18", 1, "A", "\u3007");
- AssertCompare ("#19", 1, "ABC", "\u3007");
-
- // shift weight comparison
- AssertCompare ("#20", 1, "--start", "--");
- // expansion
-// BUG in .NET 2.0: the same 00C6/00E6 issue.
- AssertCompare ("#21", -1, "\u00E6", "aes");
-
-// bug #78748
- AssertCompare ("#22", -1, "++)", "+-+)");
- AssertCompare ("#23", -1, "+-+)", "+-+-)");
- AssertCompare ("#24", 1, "+-+-)", "++)");
- // BUG in .NET: it returns 1
- AssertCompare ("#25", -1, "+-+-)", "-+-+)");
- AssertCompare ("#26", -1, "+-+)", "-+-+)");
- AssertCompare ("#27", -1, "++)", "-+-+)");
- }
-
- [Test]
-#if NET_2_0
- [Category ("NotDotNet")]
-#endif
- public void CompareSpecialWeight ()
- {
- if (!doTest)
- return;
-
- // Japanese (in invariant)
-// BUG in .NET 2.0 : half-width kana should be bigger.
- AssertCompare ("#1", 1, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D");
- AssertCompare ("#4", 1, "\u3042\u309D", "\u3042\u3042");
- AssertCompare ("#5", 0, "\u3042\u309D", "\u3042\u3042", CompareOptions.IgnoreNonSpace);
-
- // extender in target
-// BUG in .NET 2.0 : an extender should result in bigger sortkey
- AssertCompare ("#7", -1, "\u30D1\u30A2", "\u30D1\u30FC");
- AssertCompare ("#8", 0, "\u30D1\u30A2", "\u30D1\u30FC", CompareOptions.IgnoreNonSpace);
- // extender in source
-// BUG in .NET 2.0 : vice versa
- AssertCompare ("#9", 1, "\u30D1\u30FC", "\u30D1\u30A2");
- AssertCompare ("#10", 0, "\u30D1\u30FC", "\u30D1\u30A2", CompareOptions.IgnoreNonSpace);
- }
-
- [Test]
- public void IndexOfChar ()
- {
- if (!doTest)
- return;
-
- AssertIndexOf ("#1", -1, "ABC", '1');
- AssertIndexOf ("#2", 2, "ABCABC", 'c', CompareOptions.IgnoreCase);
- AssertIndexOf ("#4", 4, "ABCDE", '\u0117', ignoreCN);
- AssertIndexOf ("#5", 1, "ABCABC", 'B', 1, 5, CompareOptions.IgnoreCase, invariant);
- AssertIndexOf ("#6", 4, "ABCABC", 'B', 2, 4, CompareOptions.IgnoreCase, invariant);
- }
-
- [Test]
- [Category ("NotDotNet")]
- public void IndexOfCharMSBug ()
- {
- if (!doTest)
- return;
-
- AssertIndexOf ("#1", 0, "\u00E6", 'a');
- }
-
- [Test]
- public void LastIndexOfChar ()
- {
- if (!doTest)
- return;
-
- AssertLastIndexOf ("#1", -1, "ABC", '1');
- AssertLastIndexOf ("#2", 5, "ABCABC", 'c', CompareOptions.IgnoreCase);
- AssertLastIndexOf ("#4", 4, "ABCDE", '\u0117', ignoreCN);
- AssertLastIndexOf ("#5", 1, "ABCABC", 'B', 3, 3);
- AssertLastIndexOf ("#6", 4, "ABCABC", 'B', 4, 4);
- AssertLastIndexOf ("#7", -1, "ABCABC", 'B', 5, 1);
- AssertLastIndexOf ("#11", 0, "\\", '\\');
- Assert.AreEqual (0, new CultureInfo ("en").CompareInfo.LastIndexOf ("\\", '\\'), "#11en");
- Assert.AreEqual (0, new CultureInfo ("ja").CompareInfo.LastIndexOf ("\\", '\\'), "#11ja");
- AssertLastIndexOf ("#12", 8, "/system/web", 'w');
- Assert.AreEqual (8, new CultureInfo ("sv").CompareInfo.LastIndexOf ("/system/web", 'w'), "#12sv");
- }
-
- [Test]
- [Category ("NotDotNet")]
- public void LastIndexOfCharMSBug ()
- {
- if (!doTest)
- return;
-
- AssertIndexOf ("#1", 0, "\u00E6", 'a');
- }
-
- [Test]
-#if NET_2_0
- [Category ("NotDotNet")]
-#endif
- public void IsPrefix ()
- {
- if (!doTest)
- return;
-
- AssertIsPrefix ("#1", false, "ABC", "c", CompareOptions.IgnoreCase);
- AssertIsPrefix ("#2", false, "BC", "c", CompareOptions.IgnoreCase);
- AssertIsPrefix ("#3", true, "C", "c", CompareOptions.IgnoreCase);
- AssertIsPrefix ("#4", true, "EDCBA", "\u0117", ignoreCN);
- AssertIsPrefix ("#5", true, "ABC", "AB", CompareOptions.IgnoreCase);
-// BUG in .NET 2.0 : see GetSortKey() test (mentioned above).
- AssertIsPrefix ("#6", true, "ae", "\u00E6", CompareOptions.None);
- AssertIsPrefix ("#7", true, "\u00E6", "ae", CompareOptions.None);
-
-// BUG in .NET 2.0 : see GetSortKey() test (mentioned above).
- AssertIsPrefix ("#8", true, "\u00E6", "a", CompareOptions.None);
- AssertIsPrefix ("#9", true, "\u00E6s", "ae", CompareOptions.None);
- AssertIsPrefix ("#10", false, "\u00E6", "aes", CompareOptions.None);
- AssertIsPrefix ("#11", true, "--start", "--", CompareOptions.None);
- AssertIsPrefix ("#12", true, "-d:NET_1_1", "-", CompareOptions.None);
- AssertIsPrefix ("#13", false, "-d:NET_1_1", "@", CompareOptions.None);
- // U+3007 is completely ignored character.
- AssertIsPrefix ("#14", true, "\uff21\uff21", "\uff21", CompareOptions.None);
-// BUG in .NET 2.0 : see \u3007 issue (mentioned above).
- AssertIsPrefix ("#15", true, "\uff21\uff21", "\u3007\uff21", CompareOptions.None);
- AssertIsPrefix ("#16", true, "\uff21\uff21", "\uff21\u3007", CompareOptions.None);
- AssertIsPrefix ("#17", true, "\\b\\a a", "\\b\\a a");
- Assert.IsTrue (new CultureInfo ("en").CompareInfo.IsPrefix ("\\b\\a a", "\\b\\a a"), "#17en");
- Assert.IsTrue (new CultureInfo ("ja").CompareInfo.IsPrefix ("\\b\\a a", "\\b\\a a"), "#17ja");
- }
-
- [Test]
- public void IsPrefixSpecialWeight ()
- {
- if (!doTest)
- return;
-
- // Japanese (in invariant)
- AssertIsPrefix ("#1", false, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D");
- AssertIsPrefix ("#2-2", false, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D");
- AssertIsPrefix ("#3-2", false, "\uFF80\uFF9E\uFF72\uFF8C\uFF9E",
- "\u30C0\u30A4\u30D6");
- AssertIsPrefix ("#4", false, "\u3042\u309D", "\u3042\u3042");
-
- // extender in target
- AssertIsPrefix ("#7", false, "\u30D1\u30A2", "\u30D1\u30FC");
- // extender in source
- AssertIsPrefix ("#9", false, "\u30D1\u30FC", "\u30D1\u30A2");
-
- // empty suffix always matches the source.
- AssertIsPrefix ("#11", true, "", "");
- AssertIsPrefix ("#12", true, "/test.css", "");
-
- // bug #76243
- AssertIsPrefix ("#13", false, "\u00e4_", "a");
- }
-
- [Test]
-#if NET_2_0
- [Category ("NotDotNet")]
-#endif
- public void IsSuffix ()
- {
- if (!doTest)
- return;
-
- AssertIsSuffix ("#1", true, "ABC", "c", CompareOptions.IgnoreCase);
- AssertIsSuffix ("#2", true, "BC", "c", CompareOptions.IgnoreCase);
- AssertIsSuffix ("#3", false, "CBA", "c", CompareOptions.IgnoreCase);
- AssertIsSuffix ("#4", true, "ABCDE", "\u0117", CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase);
- AssertIsSuffix ("#5", false, "\u00E6", "a", CompareOptions.None);
-// BUG in .NET 2.0 : see GetSortKey() test (mentioned above).
- AssertIsSuffix ("#6", true, "\u00E6", "ae", CompareOptions.None);
- AssertIsSuffix ("#7", true, "ae", "\u00E6", CompareOptions.None);
- AssertIsSuffix ("#8", false, "e", "\u00E6", CompareOptions.None);
- // U+3007 is completely ignored character.
- AssertIsSuffix ("#9", true, "\uff21\uff21", "\uff21", CompareOptions.None);
-// BUG in .NET 2.0 : see \u3007 issue (mentioned above).
- AssertIsSuffix ("#10", true, "\uff21\uff21", "\u3007\uff21", CompareOptions.None);
- AssertIsSuffix ("#11", true, "\uff21\uff21", "\uff21\u3007", CompareOptions.None);
- // extender in target
- AssertIsSuffix ("#12", false, "\u30D1\u30A2", "\u30D1\u30FC");
- AssertIsSuffix ("#13", true, "\u30D1\u30A2", "\u30D1\u30FC", CompareOptions.IgnoreNonSpace);
- // extender in source
- AssertIsSuffix ("#14", false, "\u30D1\u30FC", "\u30D1\u30A2");
- AssertIsSuffix ("#15", true, "\u30D1\u30FC", "\u30D1\u30A2", CompareOptions.IgnoreNonSpace);
- // optimization sanity check
- AssertIsSuffix ("#16", true,
- "/configuration/system.runtime.remoting",
- "system.runtime.remoting");
-
- // empty suffix always matches the source.
- AssertIsSuffix ("#17", true, "", "");
- AssertIsSuffix ("#18", true, "/test.css", "");
- AssertIsSuffix ("#19", true, "/test.css", "/test.css");
- AssertIsSuffix ("#20", true, "\\b\\a a", "\\b\\a a");
- Assert.IsTrue (new CultureInfo ("en").CompareInfo.IsSuffix ("\\b\\a a", "\\b\\a a"), "#20en");
- Assert.IsTrue (new CultureInfo ("ja").CompareInfo.IsSuffix ("\\b\\a a", "\\b\\a a"), "#20ja");
- }
-
- [Test]
- [Category ("NotDotNet")]
- [Category ("NotWorking")]
- public void IsSuffixMSBug ()
- {
- if (!doTest)
- return;
-
- AssertIsSuffix ("#1", true, "\u00E6", "e", CompareOptions.None);
- }
-
- [Test]
-#if NET_2_0
- [Category ("NotDotNet")]
-#endif
- public void IndexOfString ()
- {
- if (!doTest)
- return;
-
- AssertIndexOf ("#1", -1, "ABC", "1", CompareOptions.None);
- AssertIndexOf ("#2", 2, "ABCABC", "c", CompareOptions.IgnoreCase);
- AssertIndexOf ("#4", 4, "ABCDE", "\u0117", CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase);
- AssertIndexOf ("#5", 1, "ABCABC", "BC", CompareOptions.IgnoreCase);
- AssertIndexOf ("#6", 1, "BBCBBC", "BC", CompareOptions.IgnoreCase);
- AssertIndexOf ("#7", -1, "ABCDEF", "BCD", 0, 3, CompareOptions.IgnoreCase, invariant);
- AssertIndexOf ("#8", 0, "-ABC", "-", CompareOptions.None);
- AssertIndexOf ("#9", 0, "--ABC", "--", CompareOptions.None);
- AssertIndexOf ("#10", -1, "--ABC", "--", 1, 2, CompareOptions.None, invariant);
-// BUG in .NET 2.0 : see GetSortKey() test (mentioned above).
- AssertIndexOf ("#11", 0, "AE", "\u00C6", CompareOptions.None);
- // U+3007 is completely ignored character.
- AssertIndexOf ("#12", 0, "\uff21\uff21", "\uff21", CompareOptions.None);
-// BUG in .NET 2.0 : see \u3007 issue (mentioned above).
- AssertIndexOf ("#13", 0, "\uff21\uff21", "\u3007\uff21", CompareOptions.None);
- AssertIndexOf ("#14", 0, "\uff21\uff21", "\uff21\u3007", CompareOptions.None);
- AssertIndexOf ("#15", 0, "\uff21\uff21", "\u3007", CompareOptions.None);
- AssertIndexOf ("#15-2", 1, "\u3007\uff21", "\uff21", CompareOptions.None);
- // target is "empty" (in culture-sensitive context).
- AssertIndexOf ("#16", -1, String.Empty, "\u3007");
-// BUG in .NET 2.0 : see \u3007 issue (mentioned above).
- AssertIndexOf ("#17", 0, "A", "\u3007");
- AssertIndexOf ("#18", 0, "ABC", "\u3007");
-
- AssertIndexOf ("#19", 0, "\\b\\a a", "\\b\\a a");
- Assert.AreEqual (0, new CultureInfo ("en").CompareInfo.IndexOf ("\\b\\a a", "\\b\\a a"), "#19en");
- Assert.AreEqual (0, new CultureInfo ("ja").CompareInfo.IndexOf ("\\b\\a a", "\\b\\a a"), "#19ja");
- }
-
- [Test]
- public void IndexOfSpecialWeight ()
- {
- if (!doTest)
- return;
-
- // Japanese (in invariant)
- AssertIndexOf ("#1", -1, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D");
- // extender in target
- AssertIndexOf ("#1-2", -1, "\u30D1\u30A2", "\u30D1\u30FC");
- // extender in source
- AssertIndexOf ("#2-2", -1, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D");
- AssertIndexOf ("#4", -1, "\u3042\u309D", "\u3042\u3042");
- }
-
- [Test]
-#if NET_2_0
- [Category ("NotDotNet")]
-#endif
- public void LastIndexOfString ()
- {
- if (!doTest)
- return;
-
- AssertLastIndexOf ("#1", -1, "ABC", "1", CompareOptions.None);
- AssertLastIndexOf ("#2", 5, "ABCABC", "c", CompareOptions.IgnoreCase);
- AssertLastIndexOf ("#4", 4, "ABCDE", "\u0117", CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase);
- AssertLastIndexOf ("#5", 4, "ABCABC", "BC", CompareOptions.IgnoreCase);
- AssertLastIndexOf ("#6", 4, "BBCBBC", "BC", CompareOptions.IgnoreCase);
- AssertLastIndexOf ("#7", 1, "original", "rig", CompareOptions.None);
-// BUG in .NET 2.0 : see GetSortKey() test (mentioned above).
- AssertLastIndexOf ("#8", 0, "\u00E6", "ae", CompareOptions.None);
- AssertLastIndexOf ("#9", 0, "-ABC", "-", CompareOptions.None);
- AssertLastIndexOf ("#10", 0, "--ABC", "--", CompareOptions.None);
- AssertLastIndexOf ("#11", -1, "--ABC", "--", 2, 2, CompareOptions.None, invariant);
- AssertLastIndexOf ("#12", -1, "--ABC", "--", 4, 2, CompareOptions.None, invariant);
-// BUG in .NET 2.0 : see GetSortKey() test (mentioned above).
- AssertLastIndexOf ("#13", 0, "AE", "\u00C6", CompareOptions.None);
- // U+3007 is completely ignored character.
- AssertLastIndexOf ("#14", 1, "\uff21\uff21", "\uff21", CompareOptions.None);
-// BUG in .NET 2.0 : see \u3007 issue (mentioned above).
- AssertLastIndexOf ("#15", 1, "\uff21\uff21", "\u3007\uff21", CompareOptions.None);
- AssertLastIndexOf ("#16", 1, "\uff21\uff21", "\uff21\u3007", CompareOptions.None);
- AssertLastIndexOf ("#17", 1, "\uff21\uff21", "\u3007", CompareOptions.None);
- AssertLastIndexOf ("#18", 1, "\u3007\uff21", "\uff21", CompareOptions.None);
- AssertLastIndexOf ("#19", 0, "\\b\\a a", "\\b\\a a");
- Assert.AreEqual (0, new CultureInfo ("en").CompareInfo.LastIndexOf ("\\b\\a a", "\\b\\a a"), "#19en");
- Assert.AreEqual (0, new CultureInfo ("ja").CompareInfo.LastIndexOf ("\\b\\a a", "\\b\\a a"), "#19ja");
- // bug #80612
- AssertLastIndexOf ("#20", 8, "/system/web", "w");
- Assert.AreEqual (8, new CultureInfo ("sv").CompareInfo.LastIndexOf ("/system/web", "w"), "#20sv");
- }
-
- [Test]
- public void LastIndexOfSpecialWeight ()
- {
- if (!doTest)
- return;
-
- // Japanese (in invariant)
- AssertLastIndexOf ("#1", -1, "\u30D1\u30FC\u30B9", "\uFF8A\uFF9F\uFF70\uFF7D");
- // extender in target
- AssertLastIndexOf ("#1-2", -1, "\u30D1\u30A2", "\u30D1\u30FC");
- // extender in source
- AssertLastIndexOf ("#4", -1, "\u3042\u309D", "\u3042\u3042");
- }
-
- [Test]
- public void LastIndexOfOrdinalString ()
- {
- if (!doTest)
- return;
-
- AssertLastIndexOf ("#1", -1, "ABC", "1", CompareOptions.Ordinal);
- AssertLastIndexOf ("#2", 5, "ABCABC", "C", CompareOptions.Ordinal);
- AssertLastIndexOf ("#3", -1, "ABCABC", "\uFF22", CompareOptions.Ordinal);
- AssertLastIndexOf ("#4", 4, "ABCABC", "BC", CompareOptions.Ordinal);
- AssertLastIndexOf ("#5", 4, "BBCBBC", "BC", CompareOptions.Ordinal);
- AssertLastIndexOf ("#6", 1, "original", "rig", CompareOptions.Ordinal);
- AssertLastIndexOf ("#7", 0, "\\b\\a a", "\\b\\a a", CompareOptions.Ordinal);
- }
-
- [Test]
- [Category ("TargetJvmNotWorking")]
- // for bug #76702
- public void NullCharacter ()
- {
- Assert.AreEqual (-1, "MONO".IndexOf ("\0\0\0"), "#1");
- Assert.AreEqual (-1, "MONO".LastIndexOf ("\0\0\0"), "#2");
- Assert.AreEqual (1, "MONO".CompareTo ("\0\0\0"), "#3");
- }
-
- [Test]
- [Category ("NotDotNet")]
- // MS.NET treats it as equivalent, while in IndexOf() it does not match.
- public void NullCharacterWeird ()
- {
- Assert.AreEqual (-1, "MONO".CompareTo ("MONO\0\0\0"), "#4");
- }
-
-#if NET_2_0
- [Test]
- [Category ("NotDotNet")]
- public void OrdinalIgnoreCaseCompare ()
- {
- if (!doTest)
- return;
-
- // matches
-// BUG in .NET 2.0 : see GetSortKey() test (mentioned above).
- AssertCompare ("#1", 0, "AE", "\u00C6", CompareOptions.None);
-// BUG in .NET 2.0 : It raises inappropriate ArgumentException.
- // should not match since it is Ordinal
- AssertCompare ("#2", -133, "AE", "\u00C6", CompareOptions.OrdinalIgnoreCase);
-
- AssertCompare ("#3", 1, "AE", "\u00E6", CompareOptions.None);
- // matches
- AssertCompare ("#4", 0, "AE", "\u00E6", CompareOptions.IgnoreCase);
- // should not match since it is Ordinal
- AssertCompare ("#5", -133, "AE", "\u00E6", CompareOptions.OrdinalIgnoreCase);
-
- AssertCompare ("#6", 0, "AE", "ae", CompareOptions.OrdinalIgnoreCase);
- AssertCompare ("#7", 0, "aE", "ae", CompareOptions.OrdinalIgnoreCase);
- AssertCompare ("#8", 0, "aE", "ae", CompareOptions.OrdinalIgnoreCase);
- AssertCompare ("#9", 0, "ae", "ae", CompareOptions.OrdinalIgnoreCase);
- AssertCompare ("#10", 0, "AE", "AE", CompareOptions.OrdinalIgnoreCase);
- AssertCompare ("#11", 0, "aE", "AE", CompareOptions.OrdinalIgnoreCase);
- AssertCompare ("#12", 0, "aE", "AE", CompareOptions.OrdinalIgnoreCase);
- AssertCompare ("#13", 0, "ae", "AE", CompareOptions.OrdinalIgnoreCase);
- AssertCompare ("#14", 0, "ola", "OLA", CompareOptions.OrdinalIgnoreCase);
- }
-
- [Test]
- public void OrdinalIgnoreCaseIndexOf ()
- {
- AssertIndexOf ("#1-1", 0, "ABC", "abc", CompareOptions.OrdinalIgnoreCase);
- AssertIndexOf ("#1-2", -1, "AEBECE", "\u00E6", CompareOptions.OrdinalIgnoreCase);
- AssertIndexOf ("#1-3", -1, "@_@", "`_`", CompareOptions.OrdinalIgnoreCase);
- }
-
- [Test]
- public void OrdinalIgnoreCaseIndexOfChar ()
- {
- AssertIndexOf ("#2-1", 0, "ABC", 'a', CompareOptions.OrdinalIgnoreCase);
- AssertIndexOf ("#2-2", -1, "AEBECE", '\u00C0', CompareOptions.OrdinalIgnoreCase);
- AssertIndexOf ("#2-3", -1, "@_@", '`', CompareOptions.OrdinalIgnoreCase);
- }
-
- [Test]
- public void OrdinalIgnoreCaseLastIndexOf ()
- {
- AssertLastIndexOf ("#1-1", 0, "ABC", "abc", CompareOptions.OrdinalIgnoreCase);
- AssertLastIndexOf ("#1-2", -1, "AEBECE", "\u00E6", CompareOptions.OrdinalIgnoreCase);
- AssertLastIndexOf ("#1-3", -1, "@_@", "`_`", CompareOptions.OrdinalIgnoreCase);
- AssertLastIndexOf ("#1-4", 1, "ABCDE", "bc", CompareOptions.OrdinalIgnoreCase);
- AssertLastIndexOf ("#1-5", -1, "BBBBB", "ab", CompareOptions.OrdinalIgnoreCase);
- }
-
- [Test]
- public void OrdinalIgnoreCaseLastIndexOfChar ()
- {
- AssertLastIndexOf ("#2-1", 0, "ABC", 'a', CompareOptions.OrdinalIgnoreCase);
- AssertLastIndexOf ("#2-2", -1, "AEBECE", '\u00C0', CompareOptions.OrdinalIgnoreCase);
- AssertLastIndexOf ("#2-3", -1, "@_@", '`', CompareOptions.OrdinalIgnoreCase);
- }
-
- [Test] // bug #80865
- public void IsPrefixOrdinalIgnoreCase ()
- {
- Assert ("aaaa".StartsWith ("A", StringComparison.OrdinalIgnoreCase));
- }
-#endif
-}
-
-}
}
[Test]
- [Category ("TargetJvmNotWorking")] //OptionalCalendars not yet supported for TARGET_JVM.
// make sure that all CultureInfo holds non-null calendars.
public void OptionalCalendars ()
{
Assert.AreEqual ("dddd, d' ta\\' 'MMMM yyyy", culture.DateTimeFormat.LongDatePattern);
}
-#if !TARGET_JVM
[Test]
public void Bug78569 ()
{
DateTime dt2 = DateTime.Parse (s, ci);
Assert.AreEqual (dt.Month, dt2.Month);
}
-#endif
}
}
public void DeserializeKnownValue ()
{
MemoryStream ms = new MemoryStream (serialized_daylighttime);
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
DaylightTime dt = (DaylightTime) bf.Deserialize (ms);
Assert.AreEqual (DateTime.MinValue, dt.Start, "Start");
Assert.AreEqual (DateTime.MaxValue, dt.End, "End");
using System;
using System.Collections;
+using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void LastAccessTime ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void LastAccessTimeUtc ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTime ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeUtc ()
{
DirectoryInfo info = new DirectoryInfo (TempFolder);
Assert.AreEqual (TempFolder + DSC + "ToString.Test", info.ToString ());
}
+#if NET_4_0
+ [Test]
+ public void EnumerateFileSystemInfosTest ()
+ {
+ var dirInfo = new DirectoryInfo (TempFolder);
+ dirInfo.CreateSubdirectory ("1").CreateSubdirectory ("a");
+ dirInfo.CreateSubdirectory ("2").CreateSubdirectory ("b");
+
+ var l = new List<string> ();
+ foreach (var info in dirInfo.EnumerateFileSystemInfos ("*", SearchOption.AllDirectories))
+ l.Add (info.Name);
+
+ l.Sort ();
+ Assert.AreEqual ("1,2,a,b", string.Join (",", l), "#1");
+ }
+#endif
+
#if !MOBILE
[Test]
public void Serialization ()
try {
Directory.CreateDirectory (path);
Directory.CreateDirectory (dir);
- Mono.Unix.UnixSymbolicLinkInfo li = new Mono.Unix.UnixSymbolicLinkInfo (link);
+ global::Mono.Unix.UnixSymbolicLinkInfo li = new global::Mono.Unix.UnixSymbolicLinkInfo (link);
li.CreateSymbolicLinkTo (dir);
DirectoryInfo info = new DirectoryInfo (path);
Assert.IsFalse (Directory.Exists (null as string));\r
}\r
\r
-#if !TARGET_JVM && !MOBILE // We don't support yet the Process class.\r
+#if !MOBILE // We don't support yet the Process class.\r
[Test] // bug #78239\r
public void ExistsAccessDenied ()\r
{\r
string path = TempFolder + DSC + "ExistsAccessDenied";\r
\r
Directory.CreateDirectory (path);\r
- Mono.Posix.Syscall.chmod (path, 0);\r
+ global::Mono.Posix.Syscall.chmod (path, 0);\r
try {\r
Assert.IsFalse (Directory.Exists(path + DSC + "b"));\r
} finally {\r
- Mono.Posix.Syscall.chmod (path, (Mono.Posix.FileMode) 755);\r
+ global::Mono.Posix.Syscall.chmod (path, (global::Mono.Posix.FileMode) 755);\r
Directory.Delete (path);\r
}\r
}\r
#endif\r
\r
[Test]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
[ExpectedException(typeof(ArgumentNullException))]\r
public void GetCreationTimeException1 ()\r
{\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException2 ()\r
{\r
Directory.GetCreationTime (string.Empty);\r
#if !NET_2_0\r
[ExpectedException(typeof(IOException))]\r
#endif\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetCreationTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException4 ()\r
{\r
Directory.GetCreationTime (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeException5 ()\r
{\r
Directory.GetCreationTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException1 ()\r
{\r
Directory.GetCreationTimeUtc (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException2 ()\r
{\r
Directory.GetCreationTimeUtc (string.Empty);\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtc_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetCreationTimeUtc.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException4 ()\r
{\r
Directory.GetCreationTimeUtc (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM\r
public void GetCreationTimeUtcException5 ()\r
{\r
Directory.GetCreationTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTime_Null ()\r
{\r
Directory.GetLastAccessTime (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException2 ()\r
{\r
Directory.GetLastAccessTime (string.Empty);\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTime_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetLastAccessTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException4 ()\r
{\r
Directory.GetLastAccessTime (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeException5 ()\r
{\r
Directory.GetLastAccessTime (Path.InvalidPathChars [0].ToString ());\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtc_Null ()\r
{\r
Directory.GetLastAccessTimeUtc (null as string);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException2 ()\r
{\r
Directory.GetLastAccessTimeUtc (string.Empty);\r
#if !NET_2_0\r
[ExpectedException (typeof (IOException))]\r
#endif\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtc_NonExistingPath ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.GetLastAccessTimeUtc.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException4 ()\r
{\r
Directory.GetLastAccessTimeUtc (" ");\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM\r
public void GetLastAccessTimeUtcException5 ()\r
{\r
Directory.GetLastAccessTimeUtc (Path.InvalidPathChars [0].ToString ());\r
}\r
\r
[Test]\r
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM\r
public void CreationTime ()\r
{\r
if (RunningOnUnix)\r
}\r
\r
[Test]\r
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM\r
public void LastAccessTime ()\r
{\r
string path = TempFolder + DSC + "DirectoryTest.AccessTime.1";\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM\r
public void SetLastAccessTimeUtcException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentNullException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException1 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException2 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(FileNotFoundException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException3 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException4 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
\r
[Test]\r
[ExpectedException(typeof(ArgumentException))]\r
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM\r
public void SetCreationTimeUtcException5 ()\r
{\r
DateTime time = new DateTime (2003, 4, 6, 6, 4, 2);\r
}
[Test]
- [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM
public void OpenRead_FileLock ()
{
string path = TempFolder + DSC + "FIT.OpenReadIOException.Test";
Assert.IsNotNull (fnf.Message, "#4");
Assert.AreEqual ("message", fnf.Message, "#5");
Assert.IsNull (fnf.FusionLog, "#6");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message"),"#7");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": message",
fnf.ToString (), "#7");
-#endif
}
[Test]
Assert.IsNotNull (fnf.Message, "#4");
Assert.AreEqual (string.Empty, fnf.Message, "#5");
Assert.IsNull (fnf.FusionLog, "#6");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": "), "#7");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": ",
fnf.ToString (), "#7");
-#endif
}
[Test]
Assert.IsNotNull (fnf.Message, "#4"); // File or assembly name (null), or ...
#endif
Assert.IsNull (fnf.FusionLog, "#5");
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
Assert.AreEqual (fnf.GetType ().FullName + ": ",
fnf.ToString (), "#6");
#else
Assert.IsNotNull (fnf.Message, "#5");
Assert.AreEqual ("message", fnf.Message, "#6");
Assert.IsNull (fnf.FusionLog, "#7");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message ---> "
- + ame.GetType().FullName + ": something"), "#8");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": message ---> "
+ ame.GetType ().FullName + ": something", fnf.ToString (), "#8");
-#endif
}
[Test]
Assert.IsNotNull (fnf.Message, "#5");
Assert.AreEqual (string.Empty, fnf.Message, "#6");
Assert.IsNull (fnf.FusionLog, "#7");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": ---> "
- + ame.GetType().FullName + ": something"), "#8");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": ---> "
+ ame.GetType ().FullName + ": something", fnf.ToString (), "#8");
-#endif
}
[Test]
#endif
Assert.IsNull (fnf.FusionLog, "#6");
#if NET_2_0
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": ---> "
- + ame.GetType().FullName + ": something"), "#7");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": ---> "
+ ame.GetType ().FullName + ": something", fnf.ToString (), "#7");
-#endif
#else
Assert.IsTrue (fnf.ToString ().StartsWith (fnf.GetType ().FullName), "#7");
Assert.IsFalse (fnf.ToString ().IndexOf (Environment.NewLine) != -1, "#9");
Assert.IsNotNull (fnf.Message, "#4");
Assert.AreEqual ("message", fnf.Message, "#5");
Assert.IsNull (fnf.FusionLog, "#6");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message"), "#7");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": message",
fnf.ToString (), "#7");
-#endif
}
[Test]
Assert.IsNotNull (fnf.Message, "#5");
Assert.AreEqual ("message", fnf.Message, "#6");
Assert.IsNull (fnf.FusionLog, "#7");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message"), "#8");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": message",
fnf.ToString (), "#8");
-#endif
}
[Test]
Assert.IsNotNull (fnf.Message, "#A4");
Assert.AreEqual ("message", fnf.Message, "#A5");
Assert.IsNull (fnf.FusionLog, "#A6");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": message"), "#A7");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": message",
fnf.ToString (), "#A7");
-#endif
fnf = new FileNotFoundException (string.Empty, (string) null);
Assert.IsNotNull (fnf.Message, "#B4");
Assert.AreEqual (string.Empty, fnf.Message, "#B5");
Assert.IsNull (fnf.FusionLog, "#B6");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": "), "#B7");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": ",
fnf.ToString (), "#B7");
-#endif
}
[Test]
Assert.IsNotNull (fnf.Message, "#5");
Assert.AreEqual (string.Empty, fnf.Message, "#6");
Assert.IsNull (fnf.FusionLog, "#7");
-#if TARGET_JVM
- Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": "), "#8");
-#else
Assert.AreEqual (fnf.GetType ().FullName + ": ", fnf.ToString (), "#8");
-#endif
}
[Test]
Assert.IsNull (fnf.FusionLog, "#5");
Assert.IsTrue (fnf.ToString ().StartsWith (fnf.GetType ().FullName
+ ": "), "#6");
-#if !TARGET_JVM
Assert.IsFalse (fnf.ToString ().IndexOf (Environment.NewLine) != -1, "#7");
-#endif
Assert.IsFalse (fnf.ToString ().IndexOf ("''") != -1, "#8");
}
Assert.IsNull (fnf.FusionLog, "#B6");
Assert.IsTrue (fnf.ToString ().StartsWith (fnf.GetType ().FullName
+ ": "), "#B7");
-#if !TARGET_JVM
Assert.IsFalse (fnf.ToString ().IndexOf (Environment.NewLine) != -1, "#B8");
-#endif
#if NET_2_0
Assert.IsTrue (fnf.ToString ().IndexOf ("''") != -1, "#B9");
#else
}
}
-#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
[Test, ExpectedException (typeof (IOException))]
public void CtorIOException2 ()
{
stream.Close ();
}
}
-#endif // TARGET_JVM
- [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM
[Test, ExpectedException (typeof (IOException))]
public void CtorIOException ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM
[ExpectedException (typeof (IOException))]
public void CtorAccess1Read2Write ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // File sharing not supported for TARGET_JVM
[ExpectedException (typeof (IOException))]
public void CtorAccess1Write2Write ()
{
DeleteFile (path);
}
- [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM
public void TestLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "TestLock";
}
}
-#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
// Check that the stream is flushed even when it doesn't own the
// handle
[Test]
Assert.AreEqual ((int) '1', s.ReadByte ());
s.Close ();
}
-#endif // TARGET_JVM
private void DeleteFile (string path)
{
}
}
-#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Constructor_InvalidFileHandle ()
{
new FileStream ((IntPtr) (-1L), FileAccess.Read);
}
-#endif // TARGET_JVM
[Test]
public void PositionAfterSetLength ()
}
[Test]
- [Category("TargetJvmNotSupported")] // Async IO not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
public void BeginRead_Disposed ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // Async IO not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
public void BeginWrite_Disposed ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
public void Lock_Disposed ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
public void Unlock_Disposed ()
{
}
}
- [Category("TargetJvmNotSupported")] // FileOptions.DeleteOnClose not supported for TARGET_JVM
[Test]
public void DeleteOnClose ()
{
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeFile ()
{
if (Unix)
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeDirectory ()
{
if (Unix)
}
[Test]
- [Category("TargetJvmNotSupported")] // CreationTime not supported for TARGET_JVM
public void CreationTimeNoFileOrDirectory ()
{
string path = TempFolder + DSC + "FSIT.CreationTimeNoFile.Test";
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void DefaultLastAccessTime ()
{
string path = TempFolder + DSC + "FSIT.DefaultLastAccessTime.Test";
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void LastAccessTime ()
{
string path = TempFolder + DSC + "FSIT.LastAccessTime.Test";
}
[Test]
- [Category("TargetJvmNotSupported")] // LastAccessTime not supported for TARGET_JVM
public void DefaultLastWriteTime ()
{
string path = TempFolder + DSC + "FSIT.DefaultLastWriteTime.Test";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void TestGetCreationTime ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "baz";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void CreationTime ()
{
if (RunningOnUnix)
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void LastAccessTime ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "lastAccessTime";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_Empty ()
{
try {
}
[Test]
- //[Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "GetCreationTimeException3";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTime_Path_InvalidPathChars ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "GetCreationTimeUtcException3";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetCreationTime not supported for TARGET_JVM
public void GetCreationTimeUtc_Path_InvalidPathChars ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "GetLastAccessTimeException3";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTime_Path_InvalidPathChars ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "GetLastAccessTimeUtcException3";
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // GetLastAccessTime not supported for TARGET_JVM
public void GetLastAccessTimeUtc_Path_InvalidPathChars ()
{
try {
// SetCreationTime and SetCreationTimeUtc exceptions
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_InvalidPathChars ()
{
// On Unix there are no invalid path chars.
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeFileNotFoundException1";
// }
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTime_FileLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "CreationTimeIOException1";
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_InvalidPathChars ()
{
// On Unix there are no invalid path chars.
}
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeUtcFileNotFoundException1";
// }
[Test]
- [Category("TargetJvmNotSupported")] // SetCreationTime not supported for TARGET_JVM
public void SetCreationTimeUtc_FileLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetCreationTimeUtcIOException1";
// SetLastAccessTime and SetLastAccessTimeUtc exceptions
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_InvalidPathChars ()
{
// On Unix there are no invalid path chars.
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeFileNotFoundException1";
// }
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTime_FileLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "LastAccessIOException1";
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_Path_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetCLastAccessTimeUtc_Path_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_Path_Whitespace ()
{
try {
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_Path_InvalidPathChars ()
{
// On Unix there are no invalid path chars.
}
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_Path_DoesNotExist ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeUtcFileNotFoundException1";
// }
[Test]
- [Category("TargetJvmNotSupported")] // SetLastAccessTime not supported for TARGET_JVM
public void SetLastAccessTimeUtc_FileLock ()
{
string path = TempFolder + Path.DirectorySeparatorChar + "SetLastAccessTimeUtcIOException1";
Assert.AreEqual (Environment.CurrentDirectory, Path.GetFullPath ("."), "#03");
Assert.AreEqual (Path.Combine (Environment.CurrentDirectory, "hey"),
Path.GetFullPath ("hey"), "#04");
+ Assert.AreEqual ("/", Path.GetFullPath ("/"), "#01");
+
+ string curdir = Directory.GetCurrentDirectory ();
+ try {
+ Directory.SetCurrentDirectory ("/");
+ Assert.AreEqual ("/test.txt", Path.GetFullPath ("test.txt"), "xambug #833");
+ }
+ finally {
+ Directory.SetCurrentDirectory (curdir);
+ }
}
[Test]
{
if (Windows) {
Assert.AreEqual (@"Z:\", Path.GetFullPath ("Z:"), "GetFullPath w#01");
-#if !TARGET_JVM // Java full (canonical) path always starts with caps drive letter
Assert.AreEqual (@"c:\abc\def", Path.GetFullPath (@"c:\abc\def"), "GetFullPath w#02");
-#endif
Assert.IsTrue (Path.GetFullPath (@"\").EndsWith (@"\"), "GetFullPath w#03");
// "\\\\" is not allowed
Assert.IsTrue (Path.GetFullPath ("/").EndsWith (@"\"), "GetFullPath w#05");
string curdir = Directory.GetCurrentDirectory ();
try {
-#if TARGET_JVM
- string system = "C:\\WINDOWS\\system32\\";
-#else
string system = Environment.SystemDirectory;
-#endif
Directory.SetCurrentDirectory (system);
string drive = system.Substring (0, 2);
Assert.AreEqual (system, Path.GetFullPath (drive), "current dir");
string curdir = Directory.GetCurrentDirectory ();
try {
-#if TARGET_JVM
- string system = "C:\\WINDOWS\\system32\\";
-#else
string system = Environment.SystemDirectory;
-#endif
Directory.SetCurrentDirectory (system);
// e.g. C:dir (no backslash) will return CurrentDirectory + dir
string dir = system.Substring (0, 2) + "dir";
}
#endif
[Test]
-#if TARGET_JVM
- [Ignore("Java full (canonical) path always returns windows dir in caps")]
-#endif
public void WindowsDriveC14N_77058 ()
{
// check for Unix platforms - see FAQ for more details
// Copyright (C) 2004, 2009 Novell (http://www.novell.com)
//
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using System;
using System.Collections;
using System.IO;
m1.Invoke(null, new object[] { 5 });
}
+ // Disabl known warning, the Field is never used directly from C#
+ #pragma warning disable 414
class Host {
static string Field = "foo";
}
-
+ #pragma warning restore 414
[Test]
[Category ("NotDotNet")] // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=297416
public void TestOwnerMemberAccess ()
{
AssemblyBuilder assembly;
ModuleBuilder module;
- int typeCount;
static string ASSEMBLY_NAME = "MonoTests.System.Reflection.Emit.TypeBuilderTest";
[SetUp]
assemblyName, mode, Path.GetTempPath ());
module = assembly.DefineDynamicModule ("module1");
- typeCount = 0;
}
[Test]
[TestFixture]
public class TypeBuilderTest
{
- private interface AnInterface
+ public interface AnInterface
{
}
}
public class Tuple <A,B> {
- A a;
- B b;
+ public A a;
+ public B b;
}
private AssemblyBuilder assembly;
var ins4 = ins3.Bar ();
Assert.IsNotNull (ins4);
}
+
+ // #22059
+ [Test]
+ [ExpectedException (typeof (TypeLoadException))]
+ public void PrivateIface ()
+ {
+ TypeBuilder tb = module.DefineType ("Sample", TypeAttributes.Public, typeof (object), new[] { typeof (IFoo) });
+ tb.CreateType();
+ }
+
+ interface IFoo {
+ }
}
}
public class AssemblyNameCas {
private MonoTests.System.Reflection.AssemblyNameTest ant;
- private AssemblyName main;
[TestFixtureSetUp]
public void FixtureSetUp ()
using System.Configuration.Assemblies;
using System.IO;
using System.Reflection;
-#if !TARGET_JVM && !MOBILE
+#if !MOBILE
using System.Reflection.Emit;
#endif
using System.Runtime.Serialization;
private string tempDir = Path.Combine (Path.GetTempPath (), "MonoTests.System.Reflection.AssemblyNameTest");
-#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM.
private AppDomain domain;
-#endif // TARGET_JVM
// created with "sn -o test.snk test.txt"
static byte[] keyPair = {
Directory.CreateDirectory (tempDir);
-#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM.
domain = Thread.GetDomain ();
-#endif // TARGET_JVM
}
[TearDown]
return assemblyName;
}
-#if !TARGET_JVM && !MOBILE // Reflection.Emit is not supported for TARGET_JVM.
+#if !MOBILE
private Assembly GenerateAssembly (AssemblyName name)
{
AssemblyBuilder ab = domain.DefineDynamicAssembly (
ab = GenerateDynamicAssembly (name);
Assert.AreEqual ("1.2.0.0", ab.GetName ().Version.ToString (), "1.2.0.0 dynamic");
}
-#endif // TARGET_JVM
+#endif
[Test]
public void HashAlgorithm ()
Assert.AreEqual (an.GetPublicKeyToken (), dsAssemblyName.GetPublicKeyToken (), "PublicToken");
}
-#if !TARGET_JVM // Assemblyname.GetObjectData not implemented yet for TARGET_JVM
[Test]
public void GetObjectData_Info_Null ()
{
Assert.AreEqual ("info", ex.ParamName, "#6");
}
}
-#endif // TARGET_JVM
[Test]
public void Clone_Corlib ()
}
[Test] // ctor (String)
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM.
public void Constructor1_Full ()
{
const string assemblyName = "TestAssembly";
}
[Test] // ctor (String)
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM.
public void Constructor1_Version ()
{
const string assemblyName = "TestAssembly";
using System.Globalization;
using System.IO;
using System.Reflection;
-#if !TARGET_JVM && !MONOTOUCH
+#if !MONOTOUCH
using System.Reflection.Emit;
#endif
using System.Threading;
string fname = AppDomain.CurrentDomain.FriendlyName;
if (fname.EndsWith (".dll")) { // nunit-console
Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
-#if NET_2_0 && !TARGET_JVM // IsDefaultAppDomain not supported for TARGET_JVM
+#if NET_2_0
Assert.IsFalse (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
#endif
} else { // gnunit
Assert.IsNotNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
-#if NET_2_0 && !TARGET_JVM // IsDefaultAppDomain not supported for TARGET_JVM
+#if NET_2_0
Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
#endif
}
}
-#if !TARGET_JVM && !MONOTOUCH // Reflection.Emit is not supported.
+#if !MONOTOUCH // Reflection.Emit is not supported.
[Test]
public void GetModules_MissingFile ()
{
}
#endif
-#if !TARGET_JVM // ManifestModule not supported under TARGET_JVM.
[Category ("NotWorking")]
[Test]
public void Corlib ()
Assert.IsNotNull (corlib_test.ManifestModule, "ManifestModule");
Assert.IsFalse (corlib_test.ReflectionOnly, "ReflectionOnly");
}
-#endif
[Test]
public void GetAssembly ()
}
[Test]
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFile_Null ()
{
try {
}
[Test]
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFile_Empty ()
{
try {
}
[Test]
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFiles_False ()
{
Assembly corlib = typeof (int).Assembly;
}
[Test]
- [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM
public void GetFiles_True ()
{
Assembly corlib = typeof (int).Assembly;
Assert.Fail ("Was not able to load any corlib test");
}
-#if !TARGET_JVM // GetObjectData currently not implemented for Assembly.
[Test]
public void GetObjectData_Info_Null ()
{
Assert.AreEqual ("info", ex.ParamName, "#6");
}
}
-#endif // TARGET_JVM
[Test]
public void GetReferencedAssemblies ()
}
}
-#if !TARGET_JVM && !MONOTOUCH // Reflection.Emit is not supported.
+#if !MONOTOUCH // Reflection.Emit is not supported.
[Test]
public void Location_Empty() {
string assemblyFileName = Path.Combine (
Directory.Delete (outdir, true);
}
-#endif // TARGET_JVM
+#endif
[Test]
public void ManifestModule ()
using System;
using System.Threading;
using System.Reflection;
-#if !TARGET_JVM && !MONOTOUCH
+#if !MONOTOUCH
using System.Reflection.Emit;
-#endif // TARGET_JVM
+#endif
using System.Runtime.InteropServices;
using NUnit.Framework;
{
}
+ // Disable this warning, as the purpose of this struct is to poke at the internal via reflection
+ #pragma warning disable 649
class FieldInvokeMatrix
{
public Byte field_Byte;
public Int64Enum field_Int64Enum;
public UInt64Enum field_UInt64Enum;
}
+ #pragma warning restore 649
public enum ByteEnum : byte
{
Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#I4");
}
+ // Disable "field not used warning", this is intended.
+#pragma warning disable 649
class Foo {
public static int static_field;
public int field;
}
+#pragma warning restore 649
[ExpectedException (typeof (ArgumentException))]
public void GetValueWrongObject ()
typeof (Foo).GetField ("static_field").GetValue (typeof (int));
}
-#if !TARGET_JVM // ReflectionOnlyLoad not supported for TARGET_JVM
[Test]
[ExpectedException (typeof (InvalidOperationException))]
public void GetValueOnRefOnlyAssembly ()
FieldInfo f = t.GetField ("RefOnlyField", BindingFlags.Static | BindingFlags.NonPublic);
f.SetValue (null, 8);
}
-#endif // TARGET_JVM
const int literal = 42;
Assert.AreEqual (null, fi2.GetValue (t));
}
-#if !TARGET_JVM // TypeBuilder not supported for TARGET_JVM
[Test]
public void NonPublicTests ()
{
fi = t.GetField ("protectedField", BindingFlags.NonPublic | BindingFlags.Instance);
Assert.IsNotNull (fi);
}
-#endif // TARGET_JVM
[Test]
public void GetRawDefaultValue ()
}
+ // We do not refernece the field, that is expected
+#pragma warning disable 169
// Helper classes
class RefOnlyFieldClass
{
// Helper property
static int RefOnlyField;
}
-
+#pragma warning restore 169
+
class NonPublicFieldClass
{
protected int protectedField;
+
+ public void Dummy ()
+ {
+ protectedField = 1;
+ }
}
public class FieldInfoTest<T>
#endif
namespace A.B.C {
+ // Disable expected warning
+#pragma warning disable 169
public struct MethodInfoTestStruct {
int p;
}
+#pragma warning restore 169
}
namespace MonoTests.System.Reflection
{
[TestFixture]
public class MethodInfoTest
{
-#if !TARGET_JVM
[DllImport ("libfoo", EntryPoint="foo", CharSet=CharSet.Unicode, ExactSpelling=false, PreserveSig=true, SetLastError=true, BestFitMapping=true, ThrowOnUnmappableChar=true)]
public static extern void dllImportMethod ();
-#endif
[MethodImplAttribute(MethodImplOptions.PreserveSig)]
public void preserveSigMethod ()
{
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ReturnTypePseudoCustomAttributes ()
{
MethodInfo mi = typeof (MethodInfoTest).GetMethod ("ReturnTypeMarshalAs");
public struct SimpleStruct
{
- int a;
+ public int a;
}
public static unsafe SimpleStruct* PtrFunc2 (SimpleStruct* a, A.B.C.MethodInfoTestStruct *b)
}
#if NET_2_0
-#if !TARGET_JVM // MethodBody is not supported for TARGET_JVM
[Test]
public void GetMethodBody_Abstract ()
{
else
Assert.AreEqual (false, locals [1].IsPinned, "#6");
}
-#endif // TARGET_JVM
public int return_parameter_test ()
{
//Assert.IsTrue (pi.IsRetval, "#3");
}
-#if !TARGET_JVM // ReflectionOnly is not supported yet on TARGET_JVM
[Test]
public void InvokeOnRefOnlyAssembly ()
{
Assert.IsNotNull (ex.Message, "#4");
}
}
-#endif // TARGET_JVM
[Test]
[ExpectedException (typeof (TargetInvocationException))]
Assert.AreEqual ("System.Nullable`1[System.Int32] Bug12856()", m.ToString (), "#1");
}
+#if !MONOTOUCH
class GenericClass<T>
{
public void Method ()
Assert.AreEqual (typeofK, type);
Assert.AreEqual (typeof (GenericClass<>), type.DeclaringType);
}
+#endif
}
#if NET_2_0
}
public class Bar<T> {
- public class Foo<T> {}
+ public class Foo<U> {}
}
[Test]
{
}
-#if !TARGET_JVM // No support for extern methods in TARGET_JVM
[DllImport ("foo")]
public extern static void marshalAsMethod (
[MarshalAs(UnmanagedType.Bool)]int p0,
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)] string [] p1,
[MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Marshal1), MarshalCookie = "5")] object p2);
-#endif
[Test]
public void DefaultValueEnum () {
ParameterInfo[] info = typeof (ParameterInfoTest).GetMethod ("paramMethod").GetParameters ();
Assert.AreEqual (1, info[3].GetCustomAttributes (typeof (OptionalAttribute), true).Length, "#A4");
Assert.AreEqual (2, info[4].GetCustomAttributes (true).Length, "#A5");
-#if !TARGET_JVM // No support for extern methods in TARGET_JVM
ParameterInfo[] pi = typeof (ParameterInfoTest).GetMethod ("marshalAsMethod").GetParameters ();
MarshalAsAttribute attr;
Assert.AreEqual (UnmanagedType.CustomMarshaler, attr.Value, "#D1");
Assert.AreEqual ("5", attr.MarshalCookie, "#D2");
Assert.AreEqual (typeof (Marshal1), Type.GetType (attr.MarshalType), "#D3");
-#endif
}
[Test] // bug #342536
using System.Reflection;
using NUnit.Framework;
+// Various fields in this class are not used directly by the C# code, they are only here to be reflected upon
+#pragma warning disable 649
namespace MonoTests.System.Reflection
{
[TestFixture]
using System;
using System.Threading;
using System.Reflection;
-#if !TARGET_JVM && !MONOTOUCH
+#if !MONOTOUCH
using System.Reflection.Emit;
-#endif // TARGET_JVM
+#endif
using NUnit.Framework;
static int reachable = 0;
public class FinalizableLink {
+ // The sole purpose of this object is to keep a reference to another object, so it is fine to not use it.
+ #pragma warning disable 414
object obj;
- ConditionalWeakTable <object,object> cwt;
int id;
+ #pragma warning restore 414
+ ConditionalWeakTable <object,object> cwt;
public FinalizableLink (int id, object obj, ConditionalWeakTable <object,object> cwt) {
this.id = id;
RuntimeHelpers.RunClassConstructor (rth);
}
+ // Expected the handle here is that way, because we are going to test for an ArgumentException being thrown
+#pragma warning disable 649
static RuntimeTypeHandle handle;
-
+#pragma warning restore 649
[Test]
[ExpectedException (typeof (ArgumentException))]
public void RunClassConstructor_Uninitialized ()
}
static RuntimeFieldHandle rfh = typeof (Fielder).GetField ("array").FieldHandle;
+
+ // Disable expected warning: the point of the test is to validate that an exception is thrown for something with a null (the default value in this case)
+ #pragma warning disable 649
static RuntimeFieldHandle static_rfh;
+ #pragma warning restore 649
[Test]
[ExpectedException (typeof (ArgumentNullException))]
Interlocked.Increment (ref ic);
return false;
}
+
+ public override string ToString ()
+ {
+ return "Scheduler-" + name;
+ }
}
class SingleThreadSynchronizationContext : SynchronizationContext
[TestFixture]
public class GCHandleTest
{
+ // Expected warning, the tests that reference this handle are testing for the default values of the object
+ #pragma warning disable 649
static GCHandle handle;
-
+ #pragma warning restore 649
+
[Test]
public void DefaultZeroValue_Allocated ()
{
//
// Copyright (C) 2004-2007 Novell, Inc (http://www.novell.com)
//
-#if !TARGET_JVM
using NUnit.Framework;
using System;
using System.IO;
public int field;
}
- class ClsNoLayout {
+ public class ClsNoLayout {
public int field;
}
Marshal.FreeHGlobal (ptr);
}
- struct Foo {
- int a;
- static int b;
- long c;
- static char d;
- int e;
+ public struct Foo {
+ public int a;
+ public static int b;
+ public long c;
+ public static char d;
+ public int e;
}
[Test]
}
#endif
}
-#endif
public void DeserializeKnownValue ()
{
MemoryStream ms = new MemoryStream (serialized_sync_attr);
-#if TARGET_JVM
- BinaryFormatter bf = (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
-#else
BinaryFormatter bf = new BinaryFormatter ();
-#endif // TARGET_JVM
SynchronizationAttribute sa = (SynchronizationAttribute) bf.Deserialize (ms);
Assert.IsTrue (sa.IsReEntrant, "IsReEntrant");
Assert.IsFalse (sa.Locked, "Locked");
RemotingServices.Disconnect (mt);
}
+#if !MONOTOUCH
[Test]
public void DelegateSerializationTest ()
{
a2.Test ();
}
}
+#endif
static int HandleE1 (StringBuilder arg)
{
Assert.AreEqual (_char, obj._char, context + "._char");
Assert.AreEqual (_dateTime, obj._dateTime, context + "._dateTime");
Assert.AreEqual (_decimal, obj._decimal, context + "._decimal");
+ Assert.AreEqual (_double, obj._double, context + "._double");
+ Assert.AreEqual (_short, obj._short, context = "._short");
Assert.AreEqual (_int, obj._int, context + "._int");
Assert.AreEqual (_long, obj._long, context + "._long");
Assert.AreEqual (_sbyte, obj._sbyte, context + "._sbyte");
//
-// WindowsIdentityTest.cs - NUnit Test Cases for WindowsIdentity
-//
-// Author:
-// Sebastien Pouliot (sebastien@ximian.com)
-//
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// ClaimsIdentityTest.cs - NUnit Test Cases for System.Security.Claims.ClaimsIdentity
//
+
#if NET_4_5
+
using NUnit.Framework;
using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Security.Claims;
+using System.Security.Principal;
-namespace MonoTests.System.Security.Claims {
-
+namespace MonoTests.System.Security.Claims
+{
[TestFixture]
- public class ClaimsIdentityTest {
+ public class ClaimsIdentityTest
+ {
+ #region Ctor Empty
[Test]
- public void EmptyCtorWorks () {
+ public void EmptyCtorWorks ()
+ {
var id = new ClaimsIdentity ();
Assert.IsNull (id.AuthenticationType, "#1");
-
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ #endregion
+
+ #region Ctor AuthTypeOnly
+
+ [Test]
+ public void AuthTypeOnlyCtorEmptyWorks ()
+ {
+ var id = new ClaimsIdentity ("");
+ //NOTE: According to MSDN the id.AuthenticationType should be null, but it isn't on .Net 4.5
+ //Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.AreEqual ("", id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void AuthTypeOnlyCtorNullWorks ()
+ {
+ var id = new ClaimsIdentity ((string)null);
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void AuthTypeOnlyCtorNotEmptyWorks ()
+ {
+ var id = new ClaimsIdentity ("auth_type");
+ Assert.AreEqual ("auth_type", id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsTrue (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ #endregion
+
+ #region Ctor IEnumerable<Claim>
+
+ [Test]
+ public void EnumClaimsCtorNullWorks ()
+ {
+ var id = new ClaimsIdentity ((IEnumerable<Claim>)null);
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void EnumClaimsCtorEmptyWorks ()
+ {
+ var id = new ClaimsIdentity ((IEnumerable<Claim>)null);
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void EnumClaimsCtorWithClaimsWithNameWorks ()
+ {
+ var id = new ClaimsIdentity (
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ });
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (2, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.AreEqual ("claim_name_value", id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void EnumClaimsCtorWithClaimsWithoutNameWorks ()
+ {
+ var id = new ClaimsIdentity (
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType + "_x", "claim_name_value"),
+ });
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (2, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ #endregion
+
+ #region Ctor IEnumerable<Claim>, authType, nameType, roleType
+
+ [Test]
+ public void EnumClaimsAuthNameRoleTypeCtorWorks ()
+ {
+ var id = new ClaimsIdentity (new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ new Claim ("claim_role_type", "claim_role_value"),
+ },
+ "test_auth_type", "test_name_type", "claim_role_type");
+ Assert.AreEqual ("test_auth_type", id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (3, id.Claims.Count (), "#5");
+ Assert.IsTrue (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual ("test_name_type", id.NameClaimType, "#9");
+ Assert.AreEqual ("claim_role_type", id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void EnumClaimsAuthNameRoleTypeCtorAllArgsNullWorks ()
+ {
+ var id = new ClaimsIdentity ((IEnumerable<Claim>)null, (string)null, (string)null, (string)null);
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void EnumClaimsAuthNameRoleTypeCtorAllArgsEmptyWorks ()
+ {
+ var id = new ClaimsIdentity (new Claim [0], "", "", "");
+ //NOTE: According to MSDN the id.AuthenticationType should be null, but it isn't on .Net 4.5
+ //Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.AreEqual ("", id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void EnumClaimsAuthNameRoleTypeCtorWithTwoClaimsAndTypesEmptyWorks ()
+ {
+ var id = new ClaimsIdentity (
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ },
+ "", "", "");
+ //NOTE: According to MSDN the id.AuthenticationType should be null, but it isn't on .Net 4.5
+ //Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.AreEqual ("", id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (2, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.AreEqual ("claim_name_value", id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void EnumClaimsAuthNameRoleTypeCtorWithTwoClaimsAndTypesNullWorks ()
+ {
+ var id = new ClaimsIdentity (
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ },
+ (string)null, (string)null, (string)null);
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (2, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.AreEqual ("claim_name_value", id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ #endregion
+
+ #region Ctor IIdentity, IEnumerable<Claim>, authType, nameType, roleType
+
+ [Test]
+ public void IdentityEnumClaimsAuthNameRoleTypeCtorNullsWorks ()
+ {
+ var id = new ClaimsIdentity ((IIdentity)null, (IEnumerable<Claim>)null, (string)null, (string)null, (string)null);
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void IdentityEnumClaimsAuthNameRoleTypeCtorIdentityNullRestEmptyWorks ()
+ {
+ var id = new ClaimsIdentity (null, new Claim [0], "", "", "");
+ //NOTE: According to MSDN the id.AuthenticationType should be null, but it isn't on .Net 4.5
+ //Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.AreEqual ("", id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (0, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void IdentityEnumClaimsAuthNameRoleTypeCtorNullClaimsArrayEmptyTypesWorks ()
+ {
+ var id = new ClaimsIdentity (
+ null,
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ },
+ "", "", "");
+ //NOTE: According to MSDN the id.AuthenticationType should be null, but it isn't on .Net 4.5
+ //Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.AreEqual ("", id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (2, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.AreEqual ("claim_name_value", id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void IdentityEnumClaimsAuthNameRoleTypeCtorNullClaimsArrayNullsWorks ()
+ {
+ var id = new ClaimsIdentity (
+ null,
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ },
+ (string)null, (string)null, (string)null);
+ Assert.IsNull (id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (2, id.Claims.Count (), "#5");
+ Assert.IsFalse (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.AreEqual ("claim_name_value", id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void IdentityEnumClaimsAuthNameRoleTypeCtorNullIdentityRestFilledWorks ()
+ {
+ var id = new ClaimsIdentity (
+ null,
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ new Claim ("claim_role_type", "claim_role_value"),
+ },
+ "test_auth_type", "test_name_type", "claim_role_type");
+ Assert.AreEqual ("test_auth_type", id.AuthenticationType, "#1");
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (3, id.Claims.Count (), "#5");
+ Assert.IsTrue (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual ("test_name_type", id.NameClaimType, "#9");
+ Assert.AreEqual ("claim_role_type", id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void IdentityEnumClaimsAuthNameRoleTypeCtorClaimsIdentityRestFilledWorks ()
+ {
+ var baseId = new ClaimsIdentity (
+ new[] { new Claim ("base_claim_type", "base_claim_value") },
+ "base_auth_type");
+
+ baseId.Actor = new ClaimsIdentity ("base_actor");
+ baseId.BootstrapContext = "bootstrap_context";
+ baseId.Label = "base_label";
+
+ Assert.IsTrue (baseId.IsAuthenticated, "#0");
+
+ var id = new ClaimsIdentity (
+ baseId,
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ new Claim ("claim_role_type", "claim_role_value"),
+ },
+ "test_auth_type", "test_name_type", "claim_role_type");
+
+ Assert.AreEqual ("test_auth_type", id.AuthenticationType, "#1");
+
+ Assert.IsNotNull (id.Actor, "#2");
+ Assert.AreEqual ("base_actor", id.Actor.AuthenticationType, "#2b");
+ Assert.AreEqual ("bootstrap_context", id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (4, id.Claims.Count (), "#5");
+ Assert.AreEqual ("base_claim_type", id.Claims.First ().Type);
+ Assert.IsTrue (id.IsAuthenticated, "#6");
+ Assert.AreEqual ("base_label", id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual ("test_name_type", id.NameClaimType, "#9");
+ Assert.AreEqual ("claim_role_type", id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void IdentityEnumClaimsAuthNameRoleTypeCtorNonClaimsIdentityRestEmptyWorks ()
+ {
+ var baseId = new TestIdentity { Name = "base_name", AuthenticationType = "TestId_AuthType" };
+
+ var id = new ClaimsIdentity (
+ baseId,
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ new Claim ("claim_role_type", "claim_role_value"),
+ },
+ "", "", "");
+
+ Assert.AreEqual ("TestId_AuthType", id.AuthenticationType, "#1");
+
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (4, id.Claims.Count (), "#5");
+ Assert.AreEqual (2, id.Claims.Count (_ => _.Type == ClaimsIdentity.DefaultNameClaimType), "#5b");
+ Assert.IsTrue (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.AreEqual ("base_name", id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ #endregion
+
+ #region Ctor IIdentity, IEnumerable<Claim>
+
+ [Test]
+ public void IdentityEnumClaimsCtorClaimsIdentityClaimsWorks ()
+ {
+ var baseId = new ClaimsIdentity (
+ new [] { new Claim ("base_claim_type", "base_claim_value") },
+ "base_auth_type", "base_name_claim_type", null);
+
+ baseId.Actor = new ClaimsIdentity ("base_actor");
+ baseId.BootstrapContext = "bootstrap_context";
+ baseId.Label = "base_label";
+
+ Assert.IsTrue (baseId.IsAuthenticated, "#0");
+
+ var id = new ClaimsIdentity (
+ baseId,
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ new Claim ("claim_role_type", "claim_role_value"),
+ });
+
+ Assert.AreEqual ("base_auth_type", id.AuthenticationType, "#1");
+
+ Assert.IsNotNull (id.Actor, "#2");
+ Assert.AreEqual ("base_actor", id.Actor.AuthenticationType, "#2b");
+ Assert.AreEqual ("bootstrap_context", id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (4, id.Claims.Count (), "#5");
+ Assert.AreEqual ("base_claim_type", id.Claims.First ().Type, "#5b");
+ Assert.IsTrue (id.IsAuthenticated, "#6");
+ Assert.AreEqual ("base_label", id.Label, "#7");
+ Assert.IsNull (id.Name, "#8");
+ Assert.AreEqual ("base_name_claim_type", id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ [Test]
+ public void IdentityEnumClaimsCtorNonClaimsIdentityClaimsWorks ()
+ {
+ var baseId = new TestIdentity {
+ Name = "base_name", AuthenticationType = "TestId_AuthType"
+ };
+
+ var id = new ClaimsIdentity (
+ baseId,
+ new [] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ new Claim ("claim_role_type", "claim_role_value"),
+ });
+
+ Assert.AreEqual ("TestId_AuthType", id.AuthenticationType, "#1");
+
+ Assert.IsNull (id.Actor, "#2");
+ Assert.IsNull (id.BootstrapContext, "#3");
+ Assert.IsNotNull (id.Claims, "#4");
+ Assert.AreEqual (4, id.Claims.Count (), "#5");
+ Assert.AreEqual (2, id.Claims.Count (_ => _.Type == ClaimsIdentity.DefaultNameClaimType), "#5b");
+ Assert.IsTrue (id.IsAuthenticated, "#6");
+ Assert.IsNull (id.Label, "#7");
+ Assert.AreEqual ("base_name", id.Name, "#8");
+ Assert.AreEqual (ClaimsIdentity.DefaultNameClaimType, id.NameClaimType, "#9");
+ Assert.AreEqual (ClaimsIdentity.DefaultRoleClaimType, id.RoleClaimType, "#10");
+ }
+
+ #endregion
+
+ [Test]
+ public void FindCaseInsensivity ()
+ {
+ var claim_type = new Claim("TYpe", "value");
+ var id = new ClaimsIdentity (
+ new[] { claim_type },
+ "base_auth_type", "base_name_claim_type", null);
+
+ var f1 = id.FindFirst ("tyPe");
+ Assert.AreEqual ("value", f1.Value, "#1");
+
+ var f2 = id.FindAll ("tyPE").First ();
+ Assert.AreEqual ("value", f2.Value, "#2");
+ }
+
+ [Test]
+ public void HasClaim_typeValue_Works()
+ {
+ var id = new ClaimsIdentity(
+ new[] {
+ new Claim ("claim_type", "claim_value"),
+ new Claim (ClaimsIdentity.DefaultNameClaimType, "claim_name_value"),
+ new Claim ("claim_role_type", "claim_role_value"),
+ }, "test_authority");
+
+ Assert.IsTrue (id.HasClaim("claim_type", "claim_value"), "#1");
+ Assert.IsTrue (id.HasClaim("cLaIm_TyPe", "claim_value"), "#2");
+ Assert.IsFalse (id.HasClaim("claim_type", "cLaIm_VaLuE"), "#3");
+ Assert.IsFalse (id.HasClaim("Xclaim_type", "claim_value"), "#4");
+ Assert.IsFalse (id.HasClaim("claim_type", "Xclaim_value"), "#5");
+ }
+ }
+
+ class TestIdentity : IIdentity
+ {
+ public string Name {
+ get;
+ set;
+ }
+
+ public string AuthenticationType {
+ get;
+ set;
+ }
+
+ public bool IsAuthenticated {
+ get { throw new NotImplementedException (); }
}
}
}
+
#endif
--- /dev/null
+//
+//
+// ClaimsPrincipalTest.cs - NUnit Test Cases for System.Security.Claims.ClaimsPrincipal
+//
+
+#if NET_4_5
+
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Claims;
+using System.Security.Principal;
+
+namespace MonoTests.System.Security.Claims
+{
+ [TestFixture]
+ public class ClaimsPrincipalTest
+ {
+ #region Ctor Empty
+
+ [Test]
+ public void EmptyCtorWorks ()
+ {
+ var p = new ClaimsPrincipal ();
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (p.Identities.ToArray ().Length, 0, "#2");
+
+ Assert.IsNotNull (p.Claims, "#3");
+ Assert.AreEqual (p.Claims.ToArray ().Length, 0, "#4");
+
+ Assert.IsNull (p.Identity, "#5");
+ }
+
+ #endregion
+
+ #region Ctor IIdentity
+
+ [Test]
+ [ExpectedException (typeof (ArgumentNullException))]
+ public void IIdentityCtorNullThrows ()
+ {
+ var p = new ClaimsPrincipal ((IIdentity)null);
+ }
+
+ [Test]
+ public void IIdentityCtorClaimsIdentityWorks ()
+ {
+ var id = new ClaimsIdentity (
+ new List<Claim> { new Claim ("claim_type", "claim_value") },
+ "");
+ var p = new ClaimsPrincipal (id);
+
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (1, p.Identities.Count (), "#2");
+
+ Assert.AreEqual (id, p.Identities.First (), "#3");
+
+ Assert.AreEqual (id, p.Identity, "#4");
+
+ Assert.IsNotNull (p.Claims, "#5");
+ Assert.AreEqual (1, p.Claims.Count (), "#6");
+ Assert.IsTrue (p.Claims.Any (claim => claim.Type == "claim_type" && claim.Value == "claim_value"), "#7");
+ }
+
+ [Test]
+ public void IIdentityCtorNonClaimsIdentityWorks ()
+ {
+ var id = new TestIdentity {
+ Name = "test_name",
+ AuthenticationType = "test_auth"
+ };
+ var p = new ClaimsPrincipal (id);
+
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (1, p.Identities.Count (), "#2");
+
+ Assert.AreNotEqual (id, p.Identities.First (), "#3");
+ Assert.AreNotEqual (id, p.Identity, "#4");
+ Assert.AreEqual (id.Name, p.Identity.Name, "#5");
+
+ Assert.IsNotNull (p.Claims, "#6");
+ Assert.AreEqual (1, p.Claims.Count (), "#7");
+ Assert.IsTrue (p.Claims.Any (claim => claim.Type == ClaimsIdentity.DefaultNameClaimType && claim.Value == "test_name"), "#8");
+ }
+
+ #endregion
+
+ #region Ctor IPrincipal
+
+ [Test]
+ [ExpectedException (typeof (ArgumentNullException))]
+ public void IPrincipalCtorNullThrows ()
+ {
+ var p = new ClaimsPrincipal ((IPrincipal)null);
+ }
+
+ [Test]
+ public void IPrincipalCtorClaimsPrincipalWorks ()
+ {
+ var baseId = new ClaimsIdentity (
+ new List<Claim> { new Claim ("claim_type", "claim_value") },
+ "");
+ var basePrincipal = new ClaimsPrincipal ();
+ basePrincipal.AddIdentity (baseId);
+
+ var p = new ClaimsPrincipal (basePrincipal);
+
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (1, p.Identities.Count (), "#2");
+
+ Assert.AreEqual (baseId, p.Identities.First (), "#3");
+
+ Assert.AreEqual (baseId, p.Identity, "#4");
+
+ Assert.IsNotNull (p.Claims, "$5");
+ Assert.AreEqual (1, p.Claims.Count (), "#6");
+ Assert.IsTrue (p.Claims.Any (claim => claim.Type == "claim_type" && claim.Value == "claim_value"), "#7");
+ }
+
+ [Test]
+ public void IPrincipalCtorNonClaimsPrincipalWithNonClaimsIdentityWorks ()
+ {
+ var id = new TestIdentity {
+ Name = "test_name",
+ AuthenticationType = "test_auth"
+ };
+ var basePrincipal = new TestPrincipal { Identity = id };
+ var p = new ClaimsPrincipal (basePrincipal);
+
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (1, p.Identities.Count (), "#2");
+
+ Assert.AreNotEqual (id, p.Identities.First (), "#3");
+ Assert.AreNotEqual (id, p.Identity, "#4");
+ Assert.AreEqual (id.Name, p.Identity.Name, "#5");
+
+ Assert.IsNotNull (p.Claims, "#6");
+ Assert.AreEqual (1, p.Claims.Count (), "#7");
+ Assert.IsTrue (p.Claims.Any (claim => claim.Type == ClaimsIdentity.DefaultNameClaimType && claim.Value == "test_name"), "#8");
+ }
+
+ [Test]
+ public void IPrincipalCtorNonClaimsPrincipalWithoutIdentityWorks ()
+ {
+ var p = new ClaimsPrincipal (new TestPrincipal ());
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (p.Identities.ToArray ().Length, 1, "#2");
+
+ Assert.IsNotNull (p.Claims, "#3");
+ Assert.AreEqual (p.Claims.ToArray ().Length, 0, "#4");
+
+ Assert.IsNotNull (p.Identity, "#5");
+ Assert.IsFalse (p.Identity.IsAuthenticated, "#6");
+ }
+
+ [Test]
+ [Category ("Ctor_IPrincipal")]
+ public void IPrincipalCtorClaimsPrincipalWithoutIdentityWorks ()
+ {
+ var p = new ClaimsPrincipal (new ClaimsPrincipal ());
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (p.Identities.ToArray ().Length, 0, "#2");
+
+ Assert.IsNotNull (p.Claims, "#3");
+ Assert.AreEqual (p.Claims.ToArray ().Length, 0, "#4");
+
+ Assert.IsNull (p.Identity, "#5");
+ }
+
+ [Test]
+ public void IPrincipalCtorClaimsPrincipalWithMultipleIdentitiesWorks ()
+ {
+ var baseId1 = new ClaimsIdentity ("baseId1");
+ var baseId2 = new GenericIdentity ("generic_name", "baseId2");
+ var baseId3 = WindowsIdentity.GetAnonymous ();
+
+ var basePrincipal = new ClaimsPrincipal (baseId1);
+ basePrincipal.AddIdentity (baseId2);
+ basePrincipal.AddIdentity (baseId3);
+
+ var p = new ClaimsPrincipal (basePrincipal);
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (3, p.Identities.Count (), "#2");
+
+ Assert.IsNotNull (p.Claims, "#3");
+ Assert.AreEqual (1, p.Claims.Count (), "#4");
+
+ // The Identity property favours WindowsIdentity
+ Assert.AreEqual (baseId3, p.Identity, "#5");
+
+ Assert.IsTrue (p.Claims.Any (claim => claim.Type == ClaimsIdentity.DefaultNameClaimType && claim.Value == "generic_name"), "#6");
+
+ Assert.AreEqual (baseId2.Claims.First (), p.Claims.First (), "#7");
+ }
+
+ #endregion
+
+ #region Ctor IEnumerable<ClaimsIdentity>
+
+ [Test]
+ [ExpectedException (typeof (ArgumentNullException))]
+ public void IEnumClaimsIdCtorNullThrows ()
+ {
+ var p = new ClaimsPrincipal ((IEnumerable<ClaimsIdentity>)null);
+ }
+
+ [Test]
+ public void IEnumClaimsIdCtorEmptyWorks ()
+ {
+ var p = new ClaimsPrincipal (new ClaimsIdentity [0]);
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (p.Identities.ToArray ().Length, 0, "#2");
+ Assert.IsNotNull (p.Claims, "#3");
+ Assert.AreEqual (p.Claims.ToArray ().Length, 0, "#4");
+ Assert.IsNull (p.Identity, "#5");
+ }
+
+ [Test]
+ public void IEnumClaimsIdCtorMultipleIdentitiesWorks ()
+ {
+ var baseId1 = new ClaimsIdentity ("baseId1");
+ var baseId2 = new GenericIdentity ("generic_name2", "baseId2");
+ var baseId3 = new GenericIdentity ("generic_name3", "baseId3");
+
+ var p = new ClaimsPrincipal (new List<ClaimsIdentity> { baseId1, baseId2, baseId3 });
+ Assert.IsNotNull (p.Identities, "#1");
+ Assert.AreEqual (3, p.Identities.Count (), "#2");
+
+ Assert.IsNotNull (p.Claims, "#3");
+ Assert.AreEqual (2, p.Claims.Count (), "#4");
+
+ Assert.AreEqual (baseId1, p.Identity, "#5");
+
+ Assert.IsTrue (p.Claims.Any (claim => claim.Type == ClaimsIdentity.DefaultNameClaimType && claim.Value == "generic_name2"), "#6");
+ Assert.IsTrue (p.Claims.Any (claim => claim.Type == ClaimsIdentity.DefaultNameClaimType && claim.Value == "generic_name3"), "#7");
+
+ Assert.AreEqual (baseId2.Claims.First (), p.Claims.First (), "#7");
+ Assert.AreEqual (baseId3.Claims.Last (), p.Claims.Last (), "#8");
+ }
+
+ #endregion
+
+ internal class TestPrincipal : IPrincipal
+ {
+ public IIdentity Identity { get; set; }
+
+ public bool IsInRole (string role)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
+
+#endif
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
// Copyright 2011 Xamarin Inc (http://www.xamarin.com).
//
-#if !TARGET_JVM
using NUnit.Framework;
using System;
}
}
}
-#endif
CreateFromName ("http://www.w3.org/2000/09/xmldsig#hmac-sha1", null);
// URL used in DigestMethod element
CreateFromName ("http://www.w3.org/2000/09/xmldsig#sha1", "System.Security.Cryptography.SHA1CryptoServiceProvider");
-#if !TARGET_JVM //TargetJvmNotWorking - algorithms from System.Security assembly
// URL used in Canonicalization or Transform elements
CreateFromName ("http://www.w3.org/TR/2001/REC-xml-c14n-20010315", "System.Security.Cryptography.Xml.XmlDsigC14NTransform");
CreateFromName ("http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments", "System.Security.Cryptography.Xml.XmlDsigC14NWithCommentsTransform");
CreateFromName ("http://www.w3.org/2001/04/xmldsig-more#hmac-sha384", "System.Security.Cryptography.HMACSHA384");
CreateFromName ("http://www.w3.org/2001/04/xmldsig-more#hmac-sha512", "System.Security.Cryptography.HMACSHA512");
CreateFromName ("http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160", "System.Security.Cryptography.HMACRIPEMD160");
-#endif
#endif
}
Stream readStream;
Stream writeStream;
ICryptoTransform encryptor;
- ICryptoTransform decryptor;
CryptoStream cs;
SymmetricAlgorithm aes;
writeStream = new MemoryStream (new byte [0], true);
aes = SymmetricAlgorithm.Create ();
encryptor = aes.CreateEncryptor ();
- decryptor = aes.CreateEncryptor ();
}
}
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void ConstructorCspParameters ()
{
CspParameters csp = new CspParameters (13, null, "Mono1024");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void ConstructorKeySizeCspParameters ()
{
CspParameters csp = new CspParameters (13, null, "Mono512");
// http://msdn.microsoft.com/library/en-us/cpguide/html/cpcongeneratingkeysforencryptiondecryption.asp
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_PersistKeyInCsp_False ()
{
CspParameters csp = new CspParameters (3, null, "Persistence_PersistKeyInCsp_False");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_PersistKeyInCsp_True ()
{
CspParameters csp = new CspParameters (3, null, "Persistence_PersistKeyInCsp_True");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_Delete ()
{
CspParameters csp = new CspParameters (3, null, "Persistence_Delete");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void UseMachineKeyStore ()
{
// note only applicable when CspParameters isn't used - which don't
public class SelectableHmacSha384: HMAC {
+ // legacy parameter:
+ // http://blogs.msdn.com/shawnfa/archive/2007/01/31/please-do-not-use-the-net-2-0-hmacsha512-and-hmacsha384-classes.aspx
+
public SelectableHmacSha384 (byte[] key, bool legacy)
{
HashName = "SHA384";
public class HMACSHA384Test : KeyedHashAlgorithmTest {
protected HMACSHA384 algo;
- private bool legacy;
[SetUp]
public override void SetUp ()
algo = new HMACSHA384 ();
algo.Key = new byte [8];
hash = algo;
- // http://blogs.msdn.com/shawnfa/archive/2007/01/31/please-do-not-use-the-net-2-0-hmacsha512-and-hmacsha384-classes.aspx
- legacy = (new HS384 ().BlockSize == 64);
}
// the hash algorithm only exists as a managed implementation
public class SelectableHmacSha512: HMAC {
+ // Legacy parameter explanation:
+ // http://blogs.msdn.com/shawnfa/archive/2007/01/31/please-do-not-use-the-net-2-0-hmacsha512-and-hmacsha384-classes.aspx
+
public SelectableHmacSha512 (byte[] key, bool legacy)
{
HashName = "SHA512";
public class HMACSHA512Test : KeyedHashAlgorithmTest {
protected HMACSHA512 algo;
- private bool legacy;
[SetUp]
public override void SetUp ()
algo = new HMACSHA512 ();
algo.Key = new byte [8];
hash = algo;
- // http://blogs.msdn.com/shawnfa/archive/2007/01/31/please-do-not-use-the-net-2-0-hmacsha512-and-hmacsha384-classes.aspx
- legacy = (new HS512 ().BlockSize == 64);
}
// the hash algorithm only exists as a managed implementation
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void ConstructorCspParameters ()
{
CspParameters csp = new CspParameters (1, null, "Mono1024");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void ConstructorKeySizeCspParameters ()
{
int keySize = 512;
// http://msdn.microsoft.com/library/en-us/cpguide/html/cpcongeneratingkeysforencryptiondecryption.asp
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_PersistKeyInCsp_False ()
{
CspParameters csp = new CspParameters (1, null, "Persistence_PersistKeyInCsp_False");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_PersistKeyInCsp_True ()
{
CspParameters csp = new CspParameters (1, null, "Persistence_PersistKeyInCsp_True");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void Persistence_Delete ()
{
CspParameters csp = new CspParameters (1, null, "Persistence_Delete");
}
[Test]
- [Category ("TargetJvmNotSupported")]
public void UseMachineKeyStore ()
{
// note only applicable when CspParameters isn't used - which don't
using NUnit.Framework;
namespace MonoTests.System.Security.Permissions {
-#if !TARGET_JVM
public class FilePathUtil {
[DllImport("kernel32.dll")]
private static extern uint GetLongPathName (string shortPath,
return null;
}
}
-#endif
[TestFixture]
public class FileIOPermissionTest {
pathsInPermission = read.Split(';');
Assert.IsTrue(pathsInPermission.Length == 2, "Path list should have 2 for Read");
}
-#if !TARGET_JVM
[Test]
[Ignore("should compatibility go that far ?")]
public void ShortToLong ()
// note: this will fail on Linux as kernel32.dll isn't available
Assert.AreEqual (FilePathUtil.GetLongPathName (filename), files [0], "GetLongPathName(GetTempFileName)==GetPathList[0]");
}
-#endif
[Test]
[ExpectedException (typeof (ArgumentException))]
public void FileUrl ()
private static string className = "System.Security.Permissions.RegistryPermission, ";
private static string keyCurrentUser = @"HKEY_CURRENT_USER\Software\Novell iFolder\spouliot\Home";
- private static string keyCurrentUserSubset = @"HKEY_CURRENT_USER\Software\Novell iFolder\";
private static string keyLocalMachine = @"HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Novell iFolder\1.00.000";
private static string keyLocalMachineSubset = @"HKEY_LOCAL_MACHINE\SOFTWARE\Novell\";
"*",
};
- // accepted as Url but fails to work (as expected) in some methods
- static string[] SemiBadUrls = {
- "www.mono-project.com:80",
- String.Empty,
- };
-
[Test]
public void PermissionState_None ()
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using NUnit.Framework;
using System;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using NUnit.Framework;
using System;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0 && !TARGET_JVM
+#if NET_2_0
using NUnit.Framework;
using System;
try {
SecureStringTest unit = new SecureStringTest ();
unit.DefaultConstructor ();
-#if !TARGET_JVM
unit.UnsafeConstructor ();
-#endif
unit.ReadOnly ();
unit.Disposed ();
}
Assert.Ignore (NotSupported);
}
}
-#if !TARGET_JVM
[Test]
public unsafe void UnsafeConstructor ()
{
SecureString ss = GetMaxLength ();
ss.AppendChar ('a');
}
-#endif
[Test]
public void Copy_Empty ()
{
SecureString ss = new SecureString ();
ss.RemoveAt (1);
}
-#if !TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void InsertAt_BiggerThanMax ()
SecureString ss = GetMaxLength ();
ss.InsertAt (ss.Length, 'a');
}
-#endif
private SecureString GetReadOnly ()
{
SecureString ss = new SecureString ();
char [] chars = new char [10000];
byte [] bytes = new byte [10000];
- Decoder conv = Encoding.UTF8.GetDecoder ();
+ Decoder conv = new ExposedDecoder ();
int charsUsed, bytesUsed;
bool done;
Assert.AreEqual (625, bytesUsed, "#3");
}
+ [Test]
+ public void ConvertLimitedDestinationUTF8 ()
+ {
+ char [] chars = new char [10000];
+ byte [] bytes = new byte [10000];
+
+ Decoder conv = Encoding.UTF8.GetDecoder ();
+ int charsUsed, bytesUsed;
+ bool done;
+
+ conv.Convert (bytes, 0, 10000, chars, 0, 1000, true,
+ out charsUsed, out bytesUsed, out done);
+
+ Assert.IsFalse (done, "#1");
+ Assert.AreEqual (1000, charsUsed, "#2");
+ Assert.AreEqual (1000, bytesUsed, "#3");
+ }
+
[Test]
public void CustomEncodingGetDecoder ()
Assert.IsNotNull (decoder);
}
+ class ExposedDecoder : Decoder {
+ public override int GetCharCount (byte [] bytes, int index, int count)
+ {
+ return Encoding.UTF8.GetDecoder ().GetCharCount (bytes, index, count);
+ }
+
+ public override int GetChars (byte [] bytes, int byteIndex, int byteCount, char [] chars, int charIndex)
+ {
+ return Encoding.UTF8.GetDecoder ().GetChars (bytes, byteIndex, byteCount, chars, charIndex);
+ }
+ }
+
class CustomEncoding : Encoding {
public override int GetByteCount (char [] chars, int index, int count)
byte [] bytes = new byte [10000];
char [] chars = new char [10000];
- Encoder conv = Encoding.UTF8.GetEncoder ();
+ Encoder conv = new ExposedEncoder ();
int bytesUsed, charsUsed;
bool done;
Assert.AreEqual (625, charsUsed, "#3");
}
+ [Test]
+ public void ConvertLimitedDestinationUTF8 ()
+ {
+ byte [] bytes = new byte [10000];
+ char [] chars = new char [10000];
+
+ Encoder conv = Encoding.UTF8.GetEncoder ();
+ var type = conv.GetType ();
+ int bytesUsed, charsUsed;
+ bool done;
+
+ conv.Convert (chars, 0, 10000, bytes, 0, 1000, true,
+ out bytesUsed, out charsUsed, out done);
+
+ Assert.IsFalse (done, "#1");
+ Assert.AreEqual (1000, bytesUsed, "#2");
+ Assert.AreEqual (1000, charsUsed, "#3");
+ }
+
[Test]
public void CustomEncodingGetEncoder ()
{
Assert.AreEqual (0, bytesUsed, "#3");
}
+ class ExposedEncoder : Encoder {
+ public override int GetByteCount (char [] chars, int index, int count, bool flush)
+ {
+ return Encoding.UTF8.GetEncoder ().GetByteCount (chars, index, count, flush);
+ }
+
+ public override int GetBytes (char [] chars, int charIndex, int charCount, byte [] bytes, int byteIndex, bool flush)
+ {
+ return Encoding.UTF8.GetEncoder ().GetBytes (chars, charIndex, charCount, bytes, byteIndex, flush);
+ }
+ }
+
class CustomEncoding : Encoding {
public override int GetByteCount (char [] chars, int index, int count)
--- /dev/null
+//
+// EncodingTester.cs
+//
+// Author:
+// Marcos Henrich <marcos.henrich@xamarin.com>
+//
+// (C) 2014 Xamarin, Inc.
+//
+
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MonoTests.System.Text
+{
+ class EncodingTester
+ {
+ class DecoderTestFallbackBuffer : DecoderFallbackBuffer
+ {
+ DecoderFallbackBuffer buffer;
+ private FallbackDelegate fallbackAction;
+
+ public DecoderTestFallbackBuffer (DecoderReplacementFallback fallback, FallbackDelegate fallbackAction)
+ {
+ this.fallbackAction = fallbackAction;
+ buffer = new DecoderReplacementFallbackBuffer (fallback);
+ }
+
+ public override bool Fallback (byte [] bytesUnknown, int index)
+ {
+ fallbackAction (bytesUnknown, index);
+ return buffer.Fallback (bytesUnknown, index);
+ }
+
+ public override char GetNextChar ()
+ {
+ return buffer.GetNextChar ();
+ }
+
+ public override bool MovePrevious ()
+ {
+ return buffer.MovePrevious ();
+ }
+
+ public override int Remaining
+ {
+ get { return buffer.Remaining; }
+ }
+
+ public override void Reset ()
+ {
+ buffer.Reset ();
+ }
+ }
+
+ class DecoderTestFallback : DecoderFallback
+ {
+ private DecoderReplacementFallback fallback;
+ private FallbackDelegate fallbackAction;
+
+ public DecoderTestFallback (FallbackDelegate fallbackAction)
+ {
+ this.fallbackAction = fallbackAction;
+ }
+
+ public override DecoderFallbackBuffer CreateFallbackBuffer ()
+ {
+ fallback = new DecoderReplacementFallback ();
+ return new DecoderTestFallbackBuffer (fallback, fallbackAction);
+ }
+
+ public override int MaxCharCount
+ {
+ get { return fallback.MaxCharCount; }
+ }
+ }
+
+ public delegate void FallbackDelegate (byte [] bytesUnknown, int index);
+
+ Encoding encoding;
+
+ byte [][] expectedUnknownBytes;
+ int expectedUnknownBytesIndex;
+
+ public EncodingTester (string encodingName)
+ {
+ var decoderFallback = new DecoderTestFallback (this.DecoderFallback);
+ encoding = Encoding.GetEncoding (encodingName, new EncoderReplacementFallback(), decoderFallback);
+ }
+
+ private void DecoderFallback (byte [] bytesUnknown, int index)
+ {
+ if (expectedUnknownBytesIndex == expectedUnknownBytes.Length)
+ expectedUnknownBytesIndex = 0;
+
+ var expectedBytes = expectedUnknownBytes [expectedUnknownBytesIndex++];
+ Assert.AreEqual (expectedBytes, bytesUnknown);
+ }
+
+ public void TestDecoderFallback (byte [] data, string expectedString, params byte [][] expectedUnknownBytes)
+ {
+ lock (this)
+ {
+ this.expectedUnknownBytes = expectedUnknownBytes;
+ this.expectedUnknownBytesIndex = 0;
+
+ Assert.AreEqual (expectedString.Length, encoding.GetCharCount (data));
+ Assert.AreEqual (expectedUnknownBytesIndex, expectedUnknownBytes.Length);
+
+ Assert.AreEqual (expectedString, encoding.GetString (data));
+ Assert.AreEqual (expectedUnknownBytesIndex, expectedUnknownBytes.Length);
+ }
+ }
+ }
+}
\ No newline at end of file
int charactersWritten = Encoding.UTF8.GetDecoder ().GetChars (bytes, 0, 0, chars, 10, false);
Assert.AreEqual (0, charactersWritten, "#3");
}
+
+ [Test]
+ public void EncodingFallback ()
+ {
+ /* Legal UTF-8 Byte Sequences
+ * 1st 2nd 3rd 4th
+ * 00..7F
+ * C2..DF 80..BF
+ * E0 A0..BF 80..BF
+ * E1..EF 80..BF 80..BF
+ * F0 90..BF 80..BF 80..BF
+ * F1..F3 80..BF 80..BF 80..BF
+ * F4 80..8F 80..BF 80..BF
+ */
+
+ var t = new EncodingTester ("utf-8");
+ byte [] data;
+
+ // Invalid 1st byte
+ for (byte b = 0x80; b <= 0xC1; b++) {
+ data = new byte [] { b };
+ t.TestDecoderFallback (data, "?", new byte [] { b });
+ }
+
+ ///Invalid 2nd byte
+ // C2..DF 80..BF
+ for (byte b = 0xC2; b <= 0xDF; b++) {
+ data = new byte [] { b, 0x61 };
+ t.TestDecoderFallback (data, "?a", new byte [] { b });
+ }
+
+ // E0 A0..BF
+ data = new byte [] { 0xE0, 0x99};
+ t.TestDecoderFallback (data, "?", new byte [] { 0xE0, 0x99});
+
+ // E1..EF 80..BF
+ for (byte b = 0xE1; b <= 0xEF; b++) {
+ data = new byte [] { b, 0x61 };
+ t.TestDecoderFallback (data, "?a", new byte [] { b });
+ }
+
+ // F0 90..BF
+ data = new byte [] { 0xF0, 0x8F};
+ t.TestDecoderFallback (data, "?", new byte [] { 0xF0, 0x8F });
+
+ // F1..F4 80..XX
+ for (byte b = 0xF1; b <= 0xF4; b++) {
+ data = new byte [] { b, 0x61 };
+ t.TestDecoderFallback (data, "?a", new byte [] { b });
+ }
+
+ // C2..F3 XX..BF
+ for (byte b = 0xC2; b <= 0xF3; b++) {
+ data = new byte [] { b, 0xC0 };
+ t.TestDecoderFallback (data, "??", new byte [] { b }, new byte [] { 0xC0 });
+ }
+
+ // Invalid 3rd byte
+ // E0..F3 90..BF 80..BF
+ for (byte b = 0xE0; b <= 0xF3; b++) {
+ data = new byte [] { b, 0xB0, 0x61 };
+ t.TestDecoderFallback (data, "?a", new byte [] { b, 0xB0 });
+ data = new byte [] { b, 0xB0, 0xC0 };
+ t.TestDecoderFallback (data, "??", new byte [] { b, 0xB0 }, new byte [] { 0xC0 });
+ }
+
+ // F4 80..8F 80..BF
+ data = new byte [] { 0xF4, 0x8F, 0xC0 };
+ t.TestDecoderFallback (data, "??", new byte [] { 0xF4, 0x8F }, new byte [] { 0xC0 });
+
+ // Invalid 4th byte
+ // F0..F3 90..BF 80..BF 80..BF
+ for (byte b = 0xF0; b <= 0xF3; b++) {
+ data = new byte [] { b, 0xB0, 0xB0, 0x61 };
+ t.TestDecoderFallback (data, "?a", new byte [] { b, 0xB0, 0xB0 });
+ data = new byte [] { b, 0xB0, 0xB0, 0xC0 };
+ t.TestDecoderFallback (data, "??", new byte [] { b, 0xB0, 0xB0 }, new byte [] { 0xC0 });
+ }
+
+ // F4 80..8F 80..BF 80..BF
+ data = new byte [] { 0xF4, 0x8F, 0xB0, 0xC0 };
+ t.TestDecoderFallback (data, "??", new byte [] { 0xF4, 0x8F, 0xB0 }, new byte [] { 0xC0 });
+ }
}
}
{
var task = new TaskFactory ().StartNew (() => { });
var ar = (IAsyncResult)task;
- ar.AsyncWaitHandle.WaitOne ();
+ Assert.IsFalse (ar.CompletedSynchronously, "#1");
+ Assert.IsTrue (ar.AsyncWaitHandle.WaitOne (5000), "#2");
}
[Test]
readonly object obj_1 = "obj_1";
readonly object obj_2 = "obj_2";
readonly object obj_3 = "obj_3";
-#if !TARGET_JVM // No support for exchanging two IntPtrs
readonly IntPtr iptr_1 = (IntPtr)int32_1;
readonly IntPtr iptr_2 = (IntPtr)int32_2;
readonly IntPtr iptr_3 = (IntPtr)int32_3;
-#endif // TARGET_JVM
[Test]
public void TestExchange_Int32 ()
Assert.AreEqual(dbl_2, dbl);
}
-#if !TARGET_JVM // No support for exchanging two IntPtrs
[Test]
public void TestExchange_Iptr ()
{
Assert.AreEqual(iptr_1, Interlocked.Exchange(ref iptr, iptr_2));
Assert.AreEqual(iptr_2, iptr);
}
-#endif // TARGET_JVM
#endif
[Test]
Assert.AreEqual(dbl_2, dbl);
}
-#if !TARGET_JVM // No support for compare exchanging two IntPtrs
[Test]
public void TestCompareExchange_Iptr ()
{
Assert.AreEqual(iptr_1, Interlocked.CompareExchange(ref iptr, iptr_2, iptr_1));
Assert.AreEqual(iptr_2, iptr);
}
-#endif // TARGET_JVM
#endif
[Test]
Assert.AreEqual(dbl_1, dbl);
}
-#if !TARGET_JVM // No support for compare exchanging two IntPtrs
[Test]
public void TestCompareExchange_Failed_Iptr ()
{
Assert.AreEqual(iptr_1, Interlocked.CompareExchange(ref iptr, iptr_2, iptr_3));
Assert.AreEqual(iptr_1, iptr);
}
-#endif // TARGET_JVM
#endif
[Test]
}\r
\r
[Test]\r
- [Category("TargetJvmNotSupported")] // IntPtr native handles are not supported for TARGET_JVM.\r
public void TestHandle()\r
{\r
Mutex Sem = new Mutex();\r
{
public static void NoPrincipal ()
{
-#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
AppDomain.CurrentDomain.SetPrincipalPolicy (PrincipalPolicy.NoPrincipal);
-#endif
IPrincipal p = Thread.CurrentPrincipal;
Assert.IsNull (p, "#1");
// in this case we can return to null
}
-#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
public static void UnauthenticatedPrincipal ()
{
AppDomain.CurrentDomain.SetPrincipalPolicy (PrincipalPolicy.UnauthenticatedPrincipal);
Assert.IsNotNull (Thread.CurrentPrincipal, "#7");
// in this case we can't return to null
}
-#endif // TARGET_JVM
public static void CopyOnNewThread ()
{
[Category("MobileNotWorking")] // Abort #10240
public class ThreadTest
{
- TimeSpan Infinite = new TimeSpan (-10000); // -10000 ticks == -1 ms
+ //TimeSpan Infinite = new TimeSpan (-10000); // -10000 ticks == -1 ms
TimeSpan SmallNegative = new TimeSpan (-2); // between 0 and -1.0 (infinite) ms
TimeSpan Negative = new TimeSpan (-20000); // really negative
- TimeSpan MaxValue = TimeSpan.FromMilliseconds ((long) Int32.MaxValue);
+ //TimeSpan MaxValue = TimeSpan.FromMilliseconds ((long) Int32.MaxValue);
TimeSpan TooLarge = TimeSpan.FromMilliseconds ((long) Int32.MaxValue + 1);
static bool is_win32;
[Test]
[ExpectedException (typeof (InvalidOperationException))]
- public void ReName ()
+ public void Rename ()
{
- Thread t = new Thread (new ThreadStart (ReName));
+ Thread t = new Thread (new ThreadStart (Rename));
t.Name = "a";
t.Name = "b";
}
+ bool rename_finished;
+ bool rename_failed;
+
+ [Test]
+ public void RenameTpThread ()
+ {
+ object monitor = new object ();
+ ThreadPool.QueueUserWorkItem (new WaitCallback (Rename_callback), monitor);
+ lock (monitor) {
+ if (!rename_finished)
+ Monitor.Wait (monitor);
+ }
+ Assert.IsTrue (!rename_failed);
+ }
+
+ void Rename_callback (object o) {
+ Thread.CurrentThread.Name = "a";
+ try {
+ Thread.CurrentThread.Name = "b";
+ //Console.WriteLine ("Thread name is: {0}", Thread.CurrentThread.Name);
+ } catch (Exception e) {
+ //Console.Error.WriteLine (e);
+ rename_failed = true;
+ }
+ object monitor = o;
+ lock (monitor) {
+ rename_finished = true;
+ Monitor.Pulse (monitor);
+ }
+ }
+
[Test]
public void TestNestedThreads1()
{
}
}
-#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
[Test]
[Ignore ("see comment below.")]
public void CurrentPrincipal_PrincipalPolicy_UnauthenticatedPrincipal ()
t.Abort ();
}
}
-#endif // TARGET_JVM
[Test]
public void IPrincipal_CopyOnNewThread ()
using System.Globalization;
using System.IO;
using System.Reflection;
-#if !TARGET_JVM && !MONOTOUCH // Reflection.Emit not supported for TARGET_JVM
+#if !MONOTOUCH
using System.Reflection.Emit;
#endif
using System.Runtime.InteropServices;
Assert.AreEqual (7, objCOMTest.Id, "#A05");
}
-#if !TARGET_JVM && !MONOTOUCH // Reflection.Emit not supported for TARGET_JVM
+#if !MONOTOUCH
[Test]
[ExpectedException (typeof (MissingMethodException))]
public void CreateInstance_TypeBuilder ()
{
Activator.CreateInstance (typeof (ArgIterator), null);
}
-#endif // TARGET_JVM
+#endif
[Test]
[ExpectedException (typeof (NotSupportedException))]
Activator.CreateInstance (typeof (void), null);
}
-#if !TARGET_JVM // RuntimeArgumentHandle not supported for TARGET_JVM
[Test]
[ExpectedException (typeof (NotSupportedException))]
public void CreateInstance_RuntimeArgumentHandle ()
{
Activator.CreateInstance (typeof (RuntimeArgumentHandle), null);
}
-#endif // TARGET_JVM
[Test]
[ExpectedException (typeof (NotSupportedException))]
[Test]
[ExpectedException(typeof(MissingMethodException))]
- [Category ("TargetJvmNotWorking")]
public void CreateInstanceAbstract2 ()
{
Activator.CreateInstance (typeof (Type), true);
[Test]
[ExpectedException (typeof (MissingMethodException))]
- [Category ("TargetJvmNotWorking")]
public void CreateInstanceAbstract5 ()
{
Activator.CreateInstance (typeof (Type), BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, null, CultureInfo.InvariantCulture, null);
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void CreateInstance_Nullable ()
{
Assert.AreEqual (5, Activator.CreateInstance (typeof (Nullable<int>), new object [] { 5 }));
#if !MOBILE
[Test]
[ExpectedException (typeof (ArgumentNullException))]
- [Category ("TargetJvmNotWorking")]
public void GetObject_UrlNull ()
{
Activator.GetObject (typeof (COMTest), null);
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx10 ()
{
Unification (String.Format (CorlibPermissionPattern, fx10version));
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx11 ()
{
Unification (String.Format (CorlibPermissionPattern, fx11version));
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx20 ()
{
Unification (String.Format (CorlibPermissionPattern, fx20version));
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
public void Unification_FromFx99_Corlib ()
{
Unification (String.Format (CorlibPermissionPattern, "9.99.999.9999"));
}
[Test]
- [Category ("TargetJvmNotSupported")] // No support under TARGET_JVM for assemlies versioning
[Category ("NotWorking")]
public void Unification_FromFx99_System ()
{
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ConfigurationFile_Relative_ApplicationBase ()
{
string fileName = "blar.config";
[Test]
[ExpectedException (typeof (MemberAccessException))] // The ApplicationBase must be set before retrieving this property
- [Category ("TargetJvmNotWorking")]
public void ConfigurationFile_Relative_NoApplicationBase ()
{
AppDomainSetup setup = new AppDomainSetup();
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase1 ()
{
string expected_path = tmpPath.Replace(@"\", @"/");
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase2 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase3 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase4 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase5 ()
{
// This is failing because of (probably) a windows-ism, so don't worry
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void ApplicationBase6 ()
{
AppDomainSetup setup = new AppDomainSetup ();
}
#endif
+
public class StuffToPick
{
public StuffToPick () {}
public event Action Event;
public int Field;
public void GenericMethod<T> () {}
+
+ public void Dummy ()
+ {
+ Event += delegate {};
+ }
}
public class StuffToPick<T>
public int Property { get; set; }
public event Action Event;
public int Field;
- public void GenericMethod<T> () {}
+ public void GenericMethod<U> () {}
+
+ public void Dummy ()
+ {
+ Event += delegate {};
+ }
}
static void TestSerialization (CrossDomainTester tester, object o)
} catch (ArgumentException) {
errorThrown = true;
}
-#if TARGET_JVM // This is really implementation dependent behaviour.
- catch (RankException) {
- errorThrown = true;
- }
-#endif // TARGET_JVM
Assert.IsTrue (errorThrown, "#E62");
}
{
}
Assert.IsTrue (errorThrown, "#F03b");
}
-#if !TARGET_JVM // Arrays lower bounds are not supported for TARGET_JVM
{
bool errorThrown = false;
try {
}
Assert.IsTrue (errorThrown, "#F04");
}
-#endif // TARGET_JVM
{
bool errorThrown = false;
try {
}
Assert.IsTrue (errorThrown, "#F05");
}
-#if !TARGET_JVM // CreateInstance with lower bounds not supported for TARGET_JVM
{
bool errorThrown = false;
try {
Type szarrayType = new int [10].GetType ();
Assert.IsTrue (szarrayType == (Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0})).GetType ());
Assert.IsTrue (szarrayType != (Array.CreateInstance (typeof (int), new int[] {1}, new int[] {1})).GetType ());
-#endif // TARGET_JVM
}
[Test]
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestGetEnumeratorNonZeroLowerBounds() {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_Add () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_Insert () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_Remove () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_RemoveAt () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_Contains () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
}
[Test]
- [Category ("TargetJvmNotSupported")] // Arrays lower bounds are not supported for TARGET_JVM
public void TestIList_IndexOf () {
int[] myLengthsArray = new int[2] { 3, 5 };
int[] myBoundsArray = new int[2] { 2, 3 };
public int i, j;
}
-#if !TARGET_JVM // BugBUG: T[] is not yet ICollection<T> under TARGET_JVM
[Test]
// From bug #80563
public void ICollectionNull ()
Assert.AreEqual (-1, test.IndexOf (null), "array with test");
}
-#endif // TARGET_JVM
#region Bug 80299
Assert.IsNotNull (bif.Message, "#4");
Assert.AreEqual ("message", bif.Message, "#5");
Assert.IsNull (bif.FusionLog, "#6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName + ": message"), "#7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message",
bif.ToString (), "#7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#4");
Assert.AreEqual (string.Empty, bif.Message, "#5");
Assert.IsNull (bif.FusionLog, "#6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": ",
bif.ToString (), "#7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#5");
Assert.AreEqual ("message", bif.Message, "#6");
Assert.IsNull (bif.FusionLog, "#7");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().IndexOf (ame.GetType ().FullName + ": something") != -1, "#8");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message ---> "
+ ame.GetType ().FullName + ": something", bif.ToString (), "#8");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#5");
Assert.AreEqual (string.Empty, bif.Message, "#6");
Assert.IsNull (bif.FusionLog, "#7");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().IndexOf (ame.GetType ().FullName + ": something") != -1, "#8");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": ---> "
+ ame.GetType ().FullName + ": something", bif.ToString (), "#8");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNull (bif.FusionLog, "#7");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName), "#8");
Assert.IsTrue (bif.ToString ().IndexOf ("---> " + ame.GetType ().FullName) != -1, "#9");
-#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM
Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#10");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#4");
Assert.AreEqual ("message", bif.Message, "#5");
Assert.IsNull (bif.FusionLog, "#6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message",
bif.ToString (), "#7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#5");
Assert.AreEqual ("message", bif.Message, "#6");
Assert.IsNull (bif.FusionLog, "#7");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#8");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message",
bif.ToString (), "#8");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#A4");
Assert.AreEqual ("message", bif.Message, "#A5");
Assert.IsNull (bif.FusionLog, "#A6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": message"), "#A7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": message",
bif.ToString (), "#A7");
-#endif // TARGET_JVM
bif = new BadImageFormatException (string.Empty, (string) null);
Assert.IsNotNull (bif.Message, "#B4");
Assert.AreEqual (string.Empty, bif.Message, "#B5");
Assert.IsNull (bif.FusionLog, "#B6");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#B7");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": ",
bif.ToString (), "#B7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNotNull (bif.Message, "#5");
Assert.AreEqual (string.Empty, bif.Message, "#6");
Assert.IsNull (bif.FusionLog, "#7");
-#if TARGET_JVM // ToString always has a stack trace under TARGET_JVM
- Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType().FullName + ": "), "#8");
-#else
Assert.AreEqual (bif.GetType ().FullName + ": ", bif.ToString (), "#8");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNull (bif.FusionLog, "#5");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName
+ ": "), "#6");
-#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM
Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#7");
-#endif // TARGET_JVM
}
[Test]
Assert.IsNull (bif.FusionLog, "#B6");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName
+ ": "), "#B7");
-#if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM
Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#B8");
-#endif // TARGET_JVM
Assert.IsTrue (bif.ToString ().IndexOf ("''") != -1, "#B9");
}
}
[Test]
[ExpectedException (typeof (FormatException))]
- [Category ("TargetJvmNotWorking")]
public void FromBase64CharArray_Empty ()
{
Convert.FromBase64CharArray (new char[0], 0, 0);
[Test]
[ExpectedException (typeof (FormatException))]
- [Category ("TargetJvmNotWorking")]
public void FormatBase64CharArray_OnlyWhitespace ()
{
Convert.FromBase64CharArray (new char[3] {' ',
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void FromBase64_Empty ()
{
Assert.AreEqual (new byte[0], Convert.FromBase64String (string.Empty));
Assert.AreEqual (dto.Offset, dto2.Offset);
Assert.AreEqual (dt.AddDays (-60), dto2.DateTime);
}
+
+ [Test]
+ public void TestPartialDateTimeParsing ()
+ {
+ var now = DateTime.Now;
+ const DateTimeStyles style = DateTimeStyles.AssumeUniversal;
+
+ //year
+ var date = DateTimeOffset.ParseExact ("2003", "yyyy", CultureInfo.InvariantCulture, style);
+ var expected = "01/01/2003 00:00:00 +00:00";
+ Assert.AreEqual (expected, date.ToString (CultureInfo.InvariantCulture));
+
+ //month
+ date = DateTimeOffset.ParseExact ("12", "MM", CultureInfo.InvariantCulture, style);
+ expected = string.Format ("12/01/{0} 00:00:00 +00:00", now.Year);
+ Assert.AreEqual (expected, date.ToString (CultureInfo.InvariantCulture));
+
+ //day
+ date = DateTimeOffset.ParseExact ("29", "dd", CultureInfo.InvariantCulture, style);
+ expected = string.Format ("01/29/{0} 00:00:00 +00:00", now.Year);
+ Assert.AreEqual (expected, date.ToString (CultureInfo.InvariantCulture));
+
+ //hours
+ date = DateTimeOffset.ParseExact ("06", "HH", CultureInfo.InvariantCulture, style);
+ expected = string.Format ("{0:D2}/{1:D2}/{2} 06:00:00 +00:00", now.Month, now.Day, now.Year);
+ Assert.AreEqual (expected, date.ToString (CultureInfo.InvariantCulture));
+
+ //minutes
+ date = DateTimeOffset.ParseExact ("45", "mm", CultureInfo.InvariantCulture, style);
+ expected = string.Format ("{0:D2}/{1:D2}/{2} 00:45:00 +00:00", now.Month, now.Day, now.Year);
+ Assert.AreEqual (expected, date.ToString (CultureInfo.InvariantCulture));
+
+ //seconds
+ date = DateTimeOffset.ParseExact ("45", "ss", CultureInfo.InvariantCulture, style);
+ expected = string.Format ("{0:D2}/{1:D2}/{2} 00:00:45 +00:00", now.Month, now.Day, now.Year);
+ Assert.AreEqual (expected, date.ToString (CultureInfo.InvariantCulture));
+ }
+
+ [Test]
+ public void TestDateOnlyWithTimeOffset ()
+ {
+ var fp = CultureInfo.InvariantCulture;
+ var date = DateTimeOffset.Parse("2013-11-07+11:00", fp, DateTimeStyles.AssumeUniversal);
+ var expected = string.Format ("{0:D2}/{1:D2}/{2} 00:00:00 +11:00", 11, 7, 2013);
+ Assert.AreEqual (expected, date.ToString (CultureInfo.InvariantCulture));
+ }
+
+ [Test]
+ public void GMTDateTime ()
+ {
+ var date = DateTimeOffset.Parse ("Wed, 10 Sep 2014 22:01:40 GMT", CultureInfo.InvariantCulture);
+ var expected = "09/10/2014 22:01:40 +00:00";
+ Assert.AreEqual (expected, date.ToString (CultureInfo.InvariantCulture));
+ }
}
}
Assert.AreEqual (dt, parsed, "#1");
}
+
+ [Test]
+ public void ISO8601FractionalDigits ()
+ {
+ string date = "2014-08-25T01:20:23.601911612343423423465789789365674575676746756747467Z";
+ long expectedTicks = 635445264236019116;
+
+ var dt = DateTime.Parse (date, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind);
+
+ Assert.AreEqual (expectedTicks, dt.Ticks);
+ }
+
+ [Test]
+ [ExpectedException (typeof (FormatException))]
+ public void ISO8601FractionalDigitsException1 ()
+ {
+ string date = "2014-08-25T01:20:23.60191161234342342346578978936567457567:6746756747467Z";
+ DateTime.Parse (date, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind);
+ }
+
+ [Test]
+ [ExpectedException (typeof (FormatException))]
+ public void ISO8601FractionalDigitsException2 ()
+ {
+ string date = "2014-08-25T01:20:23.6019116-12343423423465789789365674575676746756747467Z";
+ DateTime.Parse (date, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind);
+ }
+
+ [Test]
+ [ExpectedException (typeof (FormatException))]
+ public void ISO8601FractionalDigitsException3 ()
+ {
+ string date = "2014-08-25T01:20:23.601911612343423423465789789365674575676746756747467%Z";
+ DateTime.Parse (date, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind);
+ }
}
}
new ToStringTest ("E", Decimal.MinValue, "-7.922816E+028"),
new ToStringTest ("E3", Decimal.MinValue, "-7.923E+028"),
new ToStringTest ("E28", Decimal.MinValue, "-7.9228162514264337593543950335E+028"),
-#if !TARGET_JVM // TargetJvmNotWorking
new ToStringTest ("E30", Decimal.MinValue, "-7.922816251426433759354395033500E+028"),
-#endif
new ToStringTest ("E0", Decimal.MinValue, "-8E+028"),
new ToStringTest ("N3", Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.000"),
new ToStringTest ("N0", Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335"),
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void TestPercentPattern ()
{
NumberFormatInfo nfi2 = (NumberFormatInfo) NfiUser.Clone ();
};
[Test]
- [Category ("TargetJvmNotWorking")]
public void TestParse ()
{
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void TryParse ()
{
Decimal r;
d = Decimal.Parse ("0.");
Assert.AreEqual ("0", d.ToString (), "#11");
}
+
+ [Test] // bug #21764
+ public void RoundToString ()
+ {
+ Assert.AreEqual ("3", Math.Round (3M, 5).ToString (CultureInfo.InvariantCulture), "#1");
+ Assert.AreEqual ("3.01", Math.Round (3.01M, 5).ToString (CultureInfo.InvariantCulture), "#2");
+ Assert.AreEqual ("-3.01", Math.Round (-3.01M, 5).ToString (CultureInfo.InvariantCulture), "#3");
+ }
}
}
}\r
}\r
\r
-#if TARGET_JVM\r
- // Under TARGET_JVm we have a slightly better precision (becuase of\r
- // using Java BigDecimal).\r
- private bool AreNotEqual(Decimal v1, Decimal v2)\r
- {\r
- Decimal delta = v1 - v2;\r
- if (delta < 0m)\r
- delta = -delta;\r
- Decimal absV1 = v1 < 0m ? -v1 : v1;\r
- if (absV1 < 1m)\r
- return delta > 1E-27m;\r
- return delta / absV1 > 1E-27m;\r
- }\r
-#else\r
private bool AreNotEqual(Decimal v1, Decimal v2)\r
{\r
return v1 != v2;\r
}\r
-#endif\r
\r
[Test]\r
\r
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void CoContraVariance ()
{
CoContraVariantDelegate d = (CoContraVariantDelegate)
Assert.AreEqual ("00", TestingEnum4.This.ToString ("x"), "#B1");
Assert.AreEqual ("00", TestingEnum4.This.ToString ("X"), "#B2");
-#if !TARGET_JVM // This appears not to work under .Net
Assert.AreEqual ("ff", TestingEnum4.Test.ToString ("x"), "#B3");
-#endif // TARGET_JVM
Assert.AreEqual ("FF", TestingEnum4.Test.ToString ("X"), "#B4");
Assert.AreEqual ("0000", TestingEnum5.This.ToString ("x"), "#C1");
Assert.AreEqual ("0000", TestingEnum5.This.ToString ("X"), "#C2");
-#if !TARGET_JVM // This appears not to work under .Net
Assert.AreEqual ("7fff", TestingEnum5.Test.ToString ("x"), "#C3");
-#endif // TARGET_JVM
Assert.AreEqual ("7FFF", TestingEnum5.Test.ToString ("X"), "#C4");
Assert.AreEqual ("00000000", TestingEnum6.This.ToString ("x"), "#D1");
Assert.AreEqual ("00000000", TestingEnum6.This.ToString ("X"), "#D2");
-#if !TARGET_JVM // This appears not to work under .Net
Assert.AreEqual ("7fffffff", TestingEnum6.Test.ToString ("x"), "#D3");
-#endif // TARGET_JVM
Assert.AreEqual ("7FFFFFFF", TestingEnum6.Test.ToString ("X"), "#D4");
Assert.AreEqual ("0000000000000000", TestingEnum3.This.ToString ("x"), "#E1");
Assert.AreEqual ("0000000000000000", TestingEnum3.This.ToString ("X"), "#E2");
-#if !TARGET_JVM // This appears not to work under .Net
Assert.AreEqual ("ffffffffffffffff", TestingEnum3.Test.ToString ("x"), "#E3");
-#endif // TARGET_JVM
Assert.AreEqual ("FFFFFFFFFFFFFFFF", TestingEnum3.Test.ToString ("X"), "#E4");
}
Assert.IsFalse (d.IsSynchronized, "IsSynchronized");
}
-#if NET_2_0 && !TARGET_JVM && !NET_2_1
+#if NET_2_0 && !NET_2_1
[Test] // bug #333740
public void GetEnvironmentVariables_NewlySet ()
{
Environment.GetEnvironmentVariables ((EnvironmentVariableTarget)Int32.MinValue);
}
-#if !TARGET_JVM // Environment.SetEnvironmentVariable not supported under TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentException))]
public void SetEnvironmentVariable_Target_Invalid ()
Environment.SetEnvironmentVariable ("A3", "\0");
Assert.IsNull (Environment.GetEnvironmentVariables ()["A3"]);
}
-#endif // TARGET_JVM
#endif
}
}
public class MathTest
{
private static double double_epsilon =
-#if TARGET_JVM
- 1E-15;
-#else
double.Epsilon;
-#endif
static double x = 0.1234;
static double y = 12.345;
iTest++;
Assert.IsTrue (Double.IsNaN (Math.Pow (1, Double.NaN)),
"Math.Pow(1, NaN) should be NaN");
-#if !TARGET_JVM
iTest++;
Assert.IsTrue (Double.IsNaN (Math.Pow (Double.NaN, 0)),
"Math.Pow(NaN, 0) should be NaN");
-#endif
iTest++;
Assert.IsTrue (1.0 == Math.Pow (-1, Double.MaxValue),
"Math.Pow(-1, MaxValue) should be 1.0");
private const string MyString3 = "127";
private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
+#if false
+ // These are not currently being tested against, due to the locale-specific nature of the test, we need a different way of doing this
private string[] Results1 = {"("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"128.00)",
"-128", "-1.280000e+002", "-128.00",
"-128", "-128.00", "-12,800.00 %", "80"};
private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"127.00000",
"00127", "1.27000e+002", "127.00000",
"127", "127.00000", "12,700.00000 %", "0007f"};
+#endif
private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"128.00)",
"-128", "-1.280000e+002", "-128.00",
"-128", "-128.00", "-12,800.00 %", "80"};
Assert.IsTrue(String.Compare(MyString2, MySByte2.ToString()) == 0, "MyString2, MySByte2.ToString()");
Assert.IsTrue(String.Compare(MyString3, MySByte3.ToString()) == 0, "MyString3, MySByte3.ToString()");
//test ToString(string format)
+
+#if false
/*
- TODO: These tests depend on the culture of the system running the test.
- So, this needs to be tested in a different way.
+ * TODO: These tests depend on the culture of the system running the test.
+ * So, this needs to be tested in a different way.
+ /
for (int i=0; i < Formats1.Length; i++) {
Assert.IsTrue("i="+i+", Results1[i]="+Results1[i]+", MySByte2.ToString(Formats1[i])="+MySByte2.ToString(Formats1[i]), String.Compare(Results1[i], MySByte2.ToString(Formats1[i])) == 0);
Assert.IsTrue(String.Compare(Results2[i], MySByte3.ToString(Formats2[i])) == 0, "Results2[i], MySByte3.ToString(Formats2[i])");
}
- */
+#endif
//test ToString(string format, IFormatProvider provider);
for (int i=0; i < Formats1.Length; i++) {
Assert.IsTrue(String.Compare(ResultsNfi1[i], MySByte2.ToString(Formats1[i], Nfi)) == 0, "i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MySByte2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MySByte2.ToString(Formats1[i], Nfi));
{
private CultureInfo old_culture;
-#if TARGET_JVM // BinaryFormatter is Java based under TARGET_JVM.
- private BinaryFormatter CreateBinaryFormatter()
- {
- return (BinaryFormatter)vmw.@internal.remoting.BinaryFormatterUtils.CreateBinaryFormatter (false);
- }
-#else
private BinaryFormatter CreateBinaryFormatter()
{
return new BinaryFormatter();
}
-#endif // TARGET_JVM
[SetUp]
public void SetUp ()
}
-#if !TARGET_JVM
[Test] // ctor (Char [])
public unsafe void Constructor2 ()
{
Assert.AreEqual (String.Empty, new String (new Char [0]), "#2");
Assert.AreEqual ("A", new String (new Char [1] {'A'}), "#3");
}
-#endif
[Test] // ctor (Char, Int32)
public void Constructor4 ()
}
}
-#if !TARGET_JVM
[Test]
public unsafe void CharPtrConstructor ()
{
Assert.AreEqual (String.Empty, new String ((sbyte*) null, 1, 0, Encoding.Default), "#F");
}
-#endif
[Test]
public void Length ()
{
Assert.AreEqual ("typedef struct _MonoObject { ... } MonoObject;", String.Format ("typedef struct _{0} {{ ... }} MonoObject;", "MonoObject"), "Escaped bracket");
Assert.AreEqual ("Could not find file \"a/b\"", String.Format ("Could not find file \"{0}\"", "a/b"), "With Slash");
Assert.AreEqual ("Could not find file \"a\\b\"", String.Format ("Could not find file \"{0}\"", "a\\b"), "With BackSlash");
+ Assert.AreEqual ("{d} ", string.Format ("{{{0:d}} }", 100));
}
[Test] // Format (String, Object)
Assert.AreEqual (-1, s1.LastIndexOf("original", s1.Length-11), "stepped string index #3");
Assert.AreEqual (-1, s1.LastIndexOf("translator", 2), "stepped string index #4");
Assert.AreEqual (0, string.Empty.LastIndexOf(string.Empty, 0), "stepped string index #5");
-#if !TARGET_JVM
Assert.AreEqual (-1, string.Empty.LastIndexOf("A", -1), "stepped string index #6");
-#endif
Assert.AreEqual (10, s1.LastIndexOf("rig", s1.Length-1, 10), "stepped limited string index #1");
Assert.AreEqual (-1, s1.LastIndexOf("rig", s1.Length, 3), "stepped limited string index #2");
Assert.AreEqual (10, s1.LastIndexOf("rig", s1.Length-2, 15), "stepped limited string index #3");
Assert.AreEqual (s2.Replace("..", "."), "..aaaaaaa.bbbbbbbbb,......ccccccc.u..");
// Test replacing null characters (bug #67395)
-#if !TARGET_JVM //bug #7276
Assert.AreEqual ("is this ok ?", "is \0 ok ?".Replace ("\0", "this"), "should not strip content after nullchar");
-#endif
}
[Test]
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void CurrentTimeZone_SerializationRoundtrip ()
{
TimeZone tz = TimeZone.CurrentTimeZone;
TimeZone tz = TimeZone.CurrentTimeZone;
- DaylightTime daylightChanges = tz.GetDaylightChanges(2007);
+ int year = DateTime.Now.Year;
+ DaylightTime daylightChanges = tz.GetDaylightChanges(year);
DateTime dst_end = daylightChanges.End;
if (dst_end == DateTime.MinValue)
- Assert.Ignore (tz.StandardName + " did not observe daylight saving time during 2007.");
+ Assert.Ignore (tz.StandardName + " did not observe daylight saving time during " + year + ".");
var standardOffset = tz.GetUtcOffset(daylightChanges.Start.AddMinutes(-1));
}
public event EventHandler E;
+ public void Dummy ()
+ {
+ E += delegate {};
+ }
}
class Derived1 : Base1
set { }
}
- public event Action E;
+ public new event Action E;
+ public new void Dummy ()
+ {
+ E += delegate {};
+ }
}
public class Foo<T>
Assert.AreEqual (typeof (ICloneable[][]).IsAssignableFrom (typeof (Duper[][])), true, "#12");
// Tests for vectors<->one dimensional arrays */
-#if TARGET_JVM // Lower bounds arrays are not supported for TARGET_JVM.
- Array arr1 = Array.CreateInstance (typeof (int), new int[] {1});
- Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13");
-#else
Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0});
Array arr2 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {10});
Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr1.GetType ()), true, "#13");
Assert.AreEqual (typeof (int[]).IsAssignableFrom (arr2.GetType ()), false, "#14");
-#endif // TARGET_JVM
// Test that arrays of enums can be cast to their base types
Assert.AreEqual (typeof (int[]).IsAssignableFrom (typeof (TypeCode[])), true, "#15");
}
[Test]
- [Category ("TargetJvmNotWorking")]
public void TestGetPropertyImpl ()
{
// Test getting property that is exact
typeof (long), new Type[0], null), "#2");
}
-#if !TARGET_JVM // StructLayout not supported for TARGET_JVM
[StructLayout(LayoutKind.Explicit, Pack = 4, Size = 64)]
public class Class1
{
Assert.AreEqual (LayoutKind.Explicit, attr3.Value);
Assert.AreEqual (CharSet.Unicode, attr3.CharSet);
}
-#endif // TARGET_JVM
[Test]
public void Namespace ()
struct B
{
+ #pragma warning disable 169
int value;
+ #pragma warning restore 169
}
[Test]
a1 = new string [10];
}
- class X
+ public class X
{
public static int Value;
}
Assert.IsNull (i);
}
-#if !TARGET_JVM && !MOBILE // Reflection.Emit is not supported for TARGET_JVM
+#if !MOBILE
[Test]
public void EqualsUnderlyingType ()
{
Assert.IsTrue (typeof (int).Equals (e));
}
-#endif // TARGET_JVM
+#endif
[Test]
public void Equals_Type_Null ()
<Compile Include="System.Text\EncoderReplacementFallback.cs" />\r
<Compile Include="System.Text\EncoderReplacementFallbackBuffer.cs" />\r
<Compile Include="System.Text\Encoding.cs" />\r
+ <Compile Include="System.Text\EncodingDecoder.cs" />\r
+ <Compile Include="System.Text\EncodingEncoder.cs" />\r
<Compile Include="System.Text\EncodingInfo.cs" />\r
<Compile Include="System.Text\Latin1Encoding.cs" />\r
<Compile Include="System.Text\MLangCodePageEncoding.cs" />\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <OutputType>Library</OutputType>
- <AssemblyName>mscorlib</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <NoConfig>true</NoConfig>
- <NoStdLib>true</NoStdLib>
- <CodePage>65001</CodePage>
- <UseVSHostingProcess>false</UseVSHostingProcess>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ProjectGuid>{72E6D902-9CE6-4F09-91E7-6D48B965DCFA}</ProjectGuid>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'basic|AnyCPU' ">
- <DefineConstants>INSIDE_CORLIB,NET_1_1,NET_2_0,LIBC,BOOTSTRAP_BASIC</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net_2_0|AnyCPU' ">
- <DefineConstants>INSIDE_CORLIB,NET_1_1,NET_2_0,LIBC</DefineConstants>
- <SignAssembly>true</SignAssembly>
- <AssemblyOriginatorKeyFile>..\mono.snk</AssemblyOriginatorKeyFile>
- </PropertyGroup>
- <ItemGroup>
- <EmbeddedResource Include="resources\collation.core.bin" />
- <EmbeddedResource Include="resources\collation.tailoring.bin" />
- <EmbeddedResource Include="resources\collation.cjkCHS.bin" />
- <EmbeddedResource Include="resources\collation.cjkCHT.bin" />
- <EmbeddedResource Include="resources\collation.cjkJA.bin" />
- <EmbeddedResource Include="resources\collation.cjkKO.bin" />
- <EmbeddedResource Include="resources\collation.cjkKOlv2.bin" />
- </ItemGroup>
- <Import Project="$(MSBuildProjectDirectory)\..\..\build\msbuild\Mono.Common.targets" />
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild" DependsOnTargets="SetupProject">
- </Target>
-</Project>
\ No newline at end of file
../System.Core/System/TimeZoneInfo.AdjustmentRule.cs
../System.Core/System/TimeZoneInfo.Android.cs
../System.Core/System/TimeZoneInfo.MonoTouch.cs
+../System.Core/System/TimeZoneInfo.Serialization.cs
../System.Core/System/TimeZoneInfo.TransitionTime.cs
System/TimeZoneNotFoundException.cs
System/TimeoutException.cs
System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs
System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs
System.Runtime.Serialization.Formatters.Binary/MessageFormatter.cs
+System.Runtime.Versioning/CompatibilitySwitch.cs
System.Runtime.Versioning/ComponentGuaranteesAttribute.cs
System.Runtime.Versioning/ComponentGuaranteesOptions.cs
System.Runtime.Versioning/ResourceConsumptionAttribute.cs
System.Text/EncoderReplacementFallback.cs
System.Text/EncoderReplacementFallbackBuffer.cs
System.Text/Encoding.cs
+System.Text/EncodingEncoder.cs
+System.Text/EncodingDecoder.cs
System.Text/EncodingInfo.cs
System.Text/Latin1Encoding.cs
System.Text/MLangCodePageEncoding.cs
System.Security.AccessControl/RegistrySecurityTest.cs
System.Security.AccessControl/SystemAclTest.cs
System.Security.Claims/ClaimsIdentityTest.cs
+System.Security.Claims/ClaimsPrincipalTest.cs
System.Security.Cryptography/AllTests2.cs
System.Security.Cryptography/AesCfbTest.cs
System.Security.Cryptography/AsymmetricAlgorithmTest.cs
System.Text/EncoderReplacementFallbackBufferTest.cs
System.Text/EncoderTest.cs
System.Text/EncodingTest.cs
+System.Text/EncodingTester.cs
System.Text/EncodingInfoTest.cs
System.Text/StringBuilderTest.cs
System.Text/TestEncoding.cs
set;
}
+ /* The GenericTypeArguments list may be null, in which case, this
+ * is an easier/safer way to check the count.
+ */
+ public int GenericTypeArgumentsCount {
+ get { return GenericTypeArguments != null ? GenericTypeArguments.Count : 0; }
+ }
+
/* This property tells if the above collections only correct value
* is the number of item in it to represent generic arguments
*/
set;
}
+ /* The GenericMemberArguments list may be null, in which case, this
+ * is an easier/safer way to check the count.
+ */
+ public int GenericMemberArgumentsCount {
+ get { return GenericMemberArguments != null ? GenericMemberArguments.Count : 0; }
+ }
+
public bool GenericMemberArgumentsIsNumeric {
get {
return GenericMemberArguments != null && GenericMemberArguments.FirstOrDefault () == null;
set;
}
+ /* The GenericTypeArguments list may be null, in which case, this
+ * is an easier/safer way to check the count.
+ */
+ public int MemberArgumentsCount {
+ get { return MemberArguments != null ? MemberArguments.Count : 0; }
+ }
+
/* This indicates that we actually want an inner part of the ecmadesc
* i.e. in case of T: we could want the members (*), ctor (C), methods (M), ...
*/
var sb = new StringBuilder ();
// Cref type
sb.Append (DescKind.ToString ()[0]);
+ sb.Append (":");
// Create the rest
ConstructCRef (sb);
sb.Append (TypeName);
if (GenericTypeArguments != null) {
sb.Append ('<');
- foreach (var t in GenericTypeArguments)
+ int i=0;
+ foreach (var t in GenericTypeArguments) {
+ if (i > 0) {
+ sb.Append (",");
+ }
t.ConstructCRef (sb);
+
+ i++;
+ }
sb.Append ('>');
}
if (NestedType != null) {
if (DescKind == Kind.Type)
return;
- if (MemberArguments != null) {
-
+ sb.Append (".");
+ sb.Append (MemberName);
+
+ if (MemberArguments != null && MemberArgumentsCount > 0) {
+ sb.Append ("(");
+ int i=0;
+ foreach (var a in MemberArguments) {
+ if (i > 0) {
+ sb.Append(",");
+ }
+ a.ConstructCRef (sb);
+ i++;
+ }
+ sb.Append (")");
}
}
static DocCacheHelper ()
{
try {
- var cacheValues = Config.Get ("cache").Split (',');
+ var cacheConfig = Config.Get ("cache");
+ if (cacheConfig == null) return;
+ var cacheValues = cacheConfig.Split (',');
if (cacheValues.Length == 2 && cacheValues[0].Equals ("file", StringComparison.Ordinal))
cacheBaseDirectory = cacheValues[1].Replace ("~", Environment.GetFolderPath (Environment.SpecialFolder.Personal));
} catch {}
Meta, // A node that's here to serve as a header for other node
}
+
+
// Common functionality between ecma-provider and ecmauncompiled-provider
internal class EcmaDoc
{
Tree tree,
IDocStorage storage,
Dictionary<string, XElement> nsSummaries,
- Func<XElement, string> indexGenerator = null)
+ Func<XElement, string> indexGenerator = null,
+ IEcmaProviderFileSource fileSource = null)
{
+ fileSource = fileSource ?? DefaultEcmaProviderFileSource.Default;
var root = tree.RootNode;
int resID = 0;
var asm = Path.GetDirectoryName (indexFilePath);
// default index generator uses a counter
indexGenerator = indexGenerator ?? (_ => resID++.ToString ());
- using (var reader = XmlReader.Create (File.OpenRead (indexFilePath))) {
+ using (var reader = fileSource.GetIndexReader (indexFilePath)) {
reader.ReadToFollowing ("Types");
var types = XElement.Load (reader.ReadSubtree ());
new XElement ("summary"),
new XElement ("remarks"));
//Add namespace summary and remarks data from file, if available
- var nsFileName = Path.Combine(asm, String.Format("ns-{0}.xml", nsName));
+ var nsFileName = fileSource.GetNamespaceXmlPath(asm, nsName);
+
if(File.Exists(nsFileName)){
- var nsEl = XElement.Load (nsFileName);
+ var nsEl = fileSource.GetNamespaceElement (nsFileName);
nsElements.Element ("summary").ReplaceWith (nsEl.Descendants ("summary").First ());
nsElements.Element ("remarks").ReplaceWith (nsEl.Descendants ("remarks").First ());
}else{
- Console.WriteLine ("Error reading namespace XML for " + nsName);
+ Console.WriteLine ("Error reading namespace XML for {0} at {1}", nsName, nsFileName);
}
foreach (var type in ns.Elements ("Type")) {
// Add the XML file corresponding to the type to our storage
var id = indexGenerator (type);
string typeFilePath;
- var typeDocument = EcmaDoc.LoadTypeDocument (asm, nsName, type.Attribute ("Name").Value, out typeFilePath);
+ var typeDocument = EcmaDoc.LoadTypeDocument (asm, nsName, type.Attribute ("Name").Value, out typeFilePath, fileSource);
if (typeDocument == null)
continue;
- using (var file = File.OpenRead (typeFilePath))
- storage.Store (id, file);
- nsElements.Add (ExtractClassSummary (typeFilePath));
+
+ // write the document (which may have been modified by the fileSource) to the storage
+ MemoryStream io = new MemoryStream ();
+ using (var writer = XmlWriter.Create (io)) {
+ typeDocument.WriteTo (writer);
+ }
+ io.Seek (0, SeekOrigin.Begin);
+ storage.Store (id, io);
+
+ nsElements.Add (ExtractClassSummary (typeDocument));
var typeCaption = EcmaDoc.GetTypeCaptionFromIndex (type);
var url = idPrefix + id + '#' + typeCaption + '/';
// Utility methods
- public static XDocument LoadTypeDocument (string basePath, string nsName, string typeName)
+ public static XDocument LoadTypeDocument (string basePath, string nsName, string typeName, IEcmaProviderFileSource fileSource = null)
{
string dummy;
- return LoadTypeDocument (basePath, nsName, typeName, out dummy);
+ return LoadTypeDocument (basePath, nsName, typeName, out dummy, fileSource ?? DefaultEcmaProviderFileSource.Default);
}
- public static XDocument LoadTypeDocument (string basePath, string nsName, string typeName, out string finalPath)
+ public static XDocument LoadTypeDocument (string basePath, string nsName, string typeName, out string finalPath, IEcmaProviderFileSource fileSource = null)
{
- finalPath = Path.Combine (basePath, nsName, Path.ChangeExtension (typeName, ".xml"));
+ fileSource = fileSource ?? DefaultEcmaProviderFileSource.Default;
+
+ finalPath = fileSource.GetTypeXmlPath (basePath, nsName, typeName);
if (!File.Exists (finalPath)) {
Console.Error.WriteLine ("Warning: couldn't process type file `{0}' as it doesn't exist", finalPath);
return null;
XDocument doc = null;
try {
- doc = XDocument.Load (finalPath);
+ doc = fileSource.GetTypeDocument(finalPath);
} catch (Exception e) {
Console.WriteLine ("Document `{0}' is unparsable, {1}", finalPath, e.ToString ());
}
return nicename;
}
- static XElement ExtractClassSummary (string typeFilePath)
+ static XElement ExtractClassSummary (XDocument typeDoc)
{
- using (var reader = XmlReader.Create (typeFilePath)) {
- reader.ReadToFollowing ("Type");
- var name = reader.GetAttribute ("Name");
- var fullName = reader.GetAttribute ("FullName");
- reader.ReadToFollowing ("AssemblyName");
- var assemblyName = reader.ReadElementString ();
- var summary = reader.ReadToFollowing ("summary") ? XElement.Load (reader.ReadSubtree ()) : new XElement ("summary");
- var remarks = reader.ReadToFollowing ("remarks") ? XElement.Load (reader.ReadSubtree ()) : new XElement ("remarks");
-
- return new XElement ("class",
- new XAttribute ("name", name ?? string.Empty),
- new XAttribute ("fullname", fullName ?? string.Empty),
- new XAttribute ("assembly", assemblyName ?? string.Empty),
- summary,
- remarks);
- }
+ string name = typeDoc.Root.Attribute("Name").Value;
+ string fullName = typeDoc.Root.Attribute("FullName").Value;
+ string assemblyName = typeDoc.Root.Element("AssemblyInfo") != null ? typeDoc.Root.Element("AssemblyInfo").Element("AssemblyName").Value : string.Empty;
+ var docs = typeDoc.Root.Element("Docs");
+ var summary = docs.Element("summary") ?? new XElement("summary");
+ var remarks = docs.Element("remarks") ?? new XElement("remarks");
+ return new XElement ("class",
+ new XAttribute ("name", name ?? string.Empty),
+ new XAttribute ("fullname", fullName ?? string.Empty),
+ new XAttribute ("assembly", assemblyName ?? string.Empty),
+ summary,
+ remarks);
}
}
}
namespace Monodoc.Providers
{
+ public interface IEcmaProviderFileSource {
+ XmlReader GetIndexReader(string path);
+ XDocument GetTypeDocument(string path);
+ XElement GetNamespaceElement(string path);
+ string GetTypeXmlPath(string basePath, string nsName, string typeName);
+ string GetNamespaceXmlPath(string basePath, string ns);
+ XElement ExtractNamespaceSummary (string path);
+ }
+
+ internal class DefaultEcmaProviderFileSource : IEcmaProviderFileSource {
+ public static readonly IEcmaProviderFileSource Default = new DefaultEcmaProviderFileSource();
+
+ public XmlReader GetIndexReader(string path) {
+ return XmlReader.Create (File.OpenRead (path));
+ }
+
+ public XElement GetNamespaceElement(string path) {
+ return XElement.Load (path);
+ }
+
+ public string GetTypeXmlPath(string basePath, string nsName, string typeName) {
+ string finalPath = Path.Combine (basePath, nsName, Path.ChangeExtension (typeName, ".xml"));
+ return finalPath;
+ }
+
+ public XDocument GetTypeDocument(string path) {
+ return XDocument.Load (path);
+ }
+
+ public string GetNamespaceXmlPath(string basePath, string ns) {
+ string finalPath = Path.Combine(basePath, String.Format("ns-{0}.xml", ns));
+ return finalPath;
+ }
+
+ public XElement ExtractNamespaceSummary (string path)
+ {
+ using (var reader = XmlReader.Create (path)) {
+ reader.ReadToFollowing ("Namespace");
+ var name = reader.GetAttribute ("Name");
+ var summary = reader.ReadToFollowing ("summary") ? XElement.Load (reader.ReadSubtree ()) : new XElement ("summary");
+ var remarks = reader.ReadToFollowing ("remarks") ? XElement.Load (reader.ReadSubtree ()) : new XElement ("remarks");
+
+ return new XElement ("namespace",
+ new XAttribute ("ns", name ?? string.Empty),
+ summary,
+ remarks);
+ }
+ }
+ }
+
public class EcmaProvider : Provider
{
HashSet<string> directories = new HashSet<string> ();
+ IEcmaProviderFileSource fileSource;
public EcmaProvider ()
{
AddDirectory (baseDir);
}
+ public IEcmaProviderFileSource FileSource {
+ get {
+ if (fileSource == null) {
+ fileSource = new DefaultEcmaProviderFileSource();
+ }
+ return fileSource;
+ }
+ set { fileSource = value; }
+ }
+
public void AddDirectory (string directory)
{
if (string.IsNullOrEmpty (directory))
continue;
}
- EcmaDoc.PopulateTreeFromIndexFile (indexFilePath, EcmaHelpSource.EcmaPrefix, tree, storage, nsSummaries, _ => resID++.ToString ());
+ EcmaDoc.PopulateTreeFromIndexFile (indexFilePath, EcmaHelpSource.EcmaPrefix, tree, storage, nsSummaries, _ => resID++.ToString (), FileSource);
}
foreach (var summary in nsSummaries)
var masterSummary = new XElement ("elements",
directories
.SelectMany (d => Directory.EnumerateFiles (d, "ns-*.xml"))
- .Select (ExtractNamespaceSummary));
+ .Select (FileSource.ExtractNamespaceSummary));
storage.Store ("mastersummary.xml", masterSummary.ToString ());
}
- XElement ExtractNamespaceSummary (string nsFile)
- {
- using (var reader = XmlReader.Create (nsFile)) {
- reader.ReadToFollowing ("Namespace");
- var name = reader.GetAttribute ("Name");
- var summary = reader.ReadToFollowing ("summary") ? XElement.Load (reader.ReadSubtree ()) : new XElement ("summary");
- var remarks = reader.ReadToFollowing ("remarks") ? XElement.Load (reader.ReadSubtree ()) : new XElement ("remarks");
- return new XElement ("namespace",
- new XAttribute ("ns", name ?? string.Empty),
- summary,
- remarks);
- }
- }
public override void CloseTree (HelpSource hs, Tree tree)
{
--- /dev/null
+.assembly extern 'cs0012-24-missing'
+{
+}
+
+.assembly extern mscorlib
+{
+}
+
+.assembly 'CS0012-24-lib'
+{
+}
+
+.module 'cs0012-24-lib.dll'
+
+ .class public auto ansi beforefieldinit A
+ extends ['cs0012-24-missing']A0
+ {
+
+ .method public hidebysig specialname rtspecialname
+ instance default void '.ctor' () cil managed
+ {
+ ldarg.0
+ call instance void class ['cs0012-24-missing']A0::'.ctor'()
+ ret
+ }
+
+ .method public static hidebysig
+ default void Test () cil managed
+ {
+ ret
+ }
+
+ }
\ No newline at end of file
$(wildcard dlls/second/*.cs)
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 CS0012-17-lib.dll CS0012-18-lib.dll CS0012-21-lib.dll CS0012-22-lib.dll CS0012-23-lib.dll CS0019-71-lib.dll CS0029-26-lib.dll \
+ 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 CS0012-17-lib.dll CS0012-18-lib.dll CS0012-21-lib.dll CS0012-22-lib.dll CS0012-23-lib.dll CS0012-24-lib.dll CS0019-71-lib.dll CS0029-26-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 CS0246-29-lib.dll CS0229-3-lib.dll CS0229-4-lib.dll CS0266-25-lib.dll \
CS0315-2-lib.dll \
--- /dev/null
+// CS0012: The type `A0' is defined in an assembly that is not referenced. Consider adding a reference to assembly `cs0012-24-missing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
+// Line: 9
+// Compiler options: -r:CS0012-24-lib.dll
+
+public class X
+{
+ public static void Main ()
+ {
+ A.Test ();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0021: Cannot apply indexing with [] to an expression of type `object'
+// Line: 9
+
+class C
+{
+ public static void Main ()
+ {
+ var d = new object {
+ ["a"] = 1
+ };
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0023: The `?' operator cannot be applied to operand of type `int'
+// Line: 11
+
+using System;
+
+class C
+{
+ static void Main()
+ {
+ int k = 0;
+ var r = k?.ToString ();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0023: The `?' operator cannot be applied to operand of type `int*'
+// Line: 10
+// Compiler options: -unsafe
+
+class C
+{
+ unsafe static void Main ()
+ {
+ int* arr = null;
+ var v2 = arr?.ToString ();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0023: The `?' operator cannot be applied to operand of type `null'
+// Line: 8
+
+class C
+{
+ static void Main ()
+ {
+ var res = null?[0];
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0023: The `?' operator cannot be applied to operand of type `void'
+// Line: 10
+
+using System;
+
+class C
+{
+ static void Main ()
+ {
+ var v = Console.WriteLine ()?[0];
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0023: The `?' operator cannot be applied to operand of type `int'
+// Line: 9
+
+public class C
+{
+ static void Main()
+ {
+ string s = null;
+ var x = s?.Length?.ToString ();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0111: A member `Test.EmptyClass.~EmptyClass()' is already defined. Rename this member or use different parameter types
+// Line: 12
+
+namespace Test
+{
+ public class EmptyClass
+ {
+ ~EmptyClass ()
+ {
+ }
+
+ ~EmptyClass ()
+ {
+ }
+ }
+}
--- /dev/null
+// CS0111: A member `S3.S3(string)' is already defined. Rename this member or use different parameter types
+// Line: 6
+
+struct S3 (string s)
+{
+ public S3 (string s)
+ : this (1)
+ {
+ }
+
+ public S3 (int i)
+ : this ("")
+ {
+ }
+}
+++ /dev/null
-// CS0163: Control cannot fall through from one case label `case 1:' to another
-// Line: 14
-
-using System;
-using System.Collections.Generic;
-
-static class C
-{
- public static IEnumerable<int> Test (int key)
- {
- switch (key) {
- case 1:
- yield return 0;
- case 2:
- yield return 2;
- default:
- throw new ArgumentOutOfRangeException ("symbol:" + key);
- }
- }
-}
\ No newline at end of file
-// CS0163: Control cannot fall through from one case label `case 3:' to another
-// Line: 21
+// CS0163: Control cannot fall through from one case label `case 1:' to another
+// Line: 14
-public class Foo
+using System;
+using System.Collections.Generic;
+
+static class C
{
- public static void Main()
+ public static IEnumerable<int> Test (int key)
{
- int a=5;
- int b=10;
- int c;
-
- switch (a)
- {
- case 1: c=a+b;
- return;
-
- case 2: c=a-b;
- return;
-
- case 3: c=a*b;
+ switch (key) {
+ case 1:
+ yield return 0;
+ case 2:
+ yield return 2;
+ default:
+ throw new ArgumentOutOfRangeException ("symbol:" + key);
}
}
-}
+}
\ No newline at end of file
--- /dev/null
+// CS0165: Use of unassigned local variable `v'
+// Line: 19
+
+using System;
+
+class X
+{
+ void Foo (out int value)
+ {
+ value = 1;
+ }
+
+ public static void Main ()
+ {
+ int v;
+ X x = null;
+
+ x?.Foo (out v);
+ Console.WriteLine (v);
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0165: Use of unassigned local variable `a'
+// Line: 16
+
+class Test
+{
+ public static bool Foo (out int v)
+ {
+ v = 0;
+ return false;
+ }
+
+ static void Main()
+ {
+ int a;
+ bool b = false;
+ if ((b || Foo (out a)) && b)
+ return;
+ else
+ System.Console.WriteLine (a);
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0165: Use of unassigned local variable `a'
+// Line: 17
+
+class Test
+{
+ public static bool Foo (out int v)
+ {
+ v = 0;
+ return false;
+ }
+
+ static void Main()
+ {
+ int a;
+ bool b = false;
+
+ if ((b && Foo (out a)) || b) {
+ System.Console.WriteLine (a);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0165: Use of unassigned local variable `v'
+// Line: 19
+
+using System;
+
+class X
+{
+ int this [int v] {
+ get {
+ return 1;
+ }
+ set {
+ }
+ }
+
+ public static void Main ()
+ {
+ int v;
+ X x = null;
+
+ var r = x?[v = 2];
+ Console.WriteLine (v);
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0165: Use of unassigned local variable `a'
+// Line: 14
+
+class C
+{
+ static void Main ()
+ {
+ bool x = true, y = true, z = true;
+
+ int a;
+ if (x ? y : (z || Foo (out a)))
+ System.Console.WriteLine (z);
+ else
+ System.Console.WriteLine (a);
+ }
+
+ static bool Foo (out int f)
+ {
+ f = 1;
+ return true;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0171: Field `S1.s2' must be fully assigned before control leaves the constructor
+// Line: 11
+
+using System;
+
+struct S1
+{
+ S2 s2;
+
+ public S1 (int arg)
+ {
+ }
+}
+
+struct S2
+{
+ int field;
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Foo<T>(out T)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 8
+
+public class C
+{
+ public static void Main ()
+ {
+ Foo (out var y);
+ }
+
+ static void Foo<T> (out T t)
+ {
+ t = default (T);
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0426: The nested type `WriteLINE' does not exist in the type `System.Console'
+// Line: 10
+
+using System;
+
+public class Test
+{
+ public static void Main ()
+ {
+ var x = nameof (Console.WriteLINE);
+ }
+}
--- /dev/null
+// CS0429: Unreachable expression code detected
+// Line: 24
+// Compiler options: -warnaserror
+
+using System;
+
+struct S
+{
+}
+
+class C
+{
+ public static implicit operator S (C c)
+ {
+ return new S ();
+ }
+}
+
+class Program
+{
+ static void Main ()
+ {
+ C c = new C ();
+ Console.WriteLine (c ?? new S ());
+ }
+}
--- /dev/null
+// CS0464: The result of comparing type `E?' with null is always `false'
+// Line: 14
+// Compiler options: -warnaserror
+
+enum E
+{
+}
+
+class X
+{
+ public static void Main ()
+ {
+ E u = 0;
+ var b = u < (E?) null;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0472: The result of comparing value type `int' with null is always `false'
+// Line: 12
+// Compiler options: -warnaserror
+
+using System;
+
+class X
+{
+ public static void Main ()
+ {
+ int i = 0;
+ var x = i == default (byte?);
+ }
+}
--- /dev/null
+// CS0472: The result of comparing value type `E' with null is always `false'
+// Line: 14
+// Compiler options: -warnaserror
+
+enum E
+{
+}
+
+class X
+{
+ public static void Main ()
+ {
+ E u = 0;
+ var b = u == (E?)null;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0516: Constructor `Sample.Sample()' cannot call itself
+// Line: 6
+
+struct Sample {
+ public Sample ()
+ : this ()
+ {
+ }
+}
// CS0516: Constructor `Sample.Sample()' cannot call itself
-// Line: 5
+// Line: 6
class Sample {
- public Sample (): this () {}
+ public Sample ()
+ : this ()
+ {
+ }
}
-
-
-
--- /dev/null
+// CS0531: `I.P': interface members cannot have a definition
+// Line: 6
+
+interface I
+{
+ int P => 1;
+}
\ No newline at end of file
+++ /dev/null
-// CS0568: Structs cannot contain explicit parameterless constructors
-// Line: 5
-struct A {
- int a;
- A () { a = 1; }
-}
-
-class D {
- static void Main ()
- {
- A [] a = new A [10];
-
- }
-}
--- /dev/null
+// CS0619: `S.S()' is obsolete: `ctor'
+// Line: 18
+
+using System;
+
+struct S
+{
+ [Obsolete ("ctor", true)]
+ public S ()
+ {
+ }
+}
+
+class C
+{
+ public static void Main ()
+ {
+ new S ();
+ }
+}
--- /dev/null
+// CS0815: An implicitly typed local variable declaration cannot be initialized with `void'
+// Line: 8
+
+class X
+{
+ public static void Main ()
+ {
+ Foo (out var x = Main ());
+ }
+
+ static void Foo (out int i)
+ {
+ i = 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0841: A local variable `x' cannot be used before it is declared
+// Line: 8
+
+class X
+{
+ public static void Main ()
+ {
+ Foo (x, out var x);
+ }
+
+ static void Foo (int arg, out int value)
+ {
+ value = 3;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1001: Identifier expected
+// Line: 8
+
+class X
+{
+ public static void Main ()
+ {
+ var r = nameof (List<int2>);
+ }
+}
\ No newline at end of file
+++ /dev/null
-// CS1008: Type byte, sbyte, short, ushort, int, uint, long or ulong expected
-// Line: 3
-enum Test : System.Int16
-{
- One
-}
-
-class X
-{
- static void Main ()
- { }
-}
-
-
+++ /dev/null
-// CS1031: Type expected
-// Line: 8
-
-using System;
-
-class M
-{
- public static void Main ()
- {
- Type t = typeof (this);
- }
-}
-
// CS1031: Type expected
-// Line: 17
+// Line: 8
using System;
-class C<T>
-{
- class G<U>
- {
- }
-}
-
class M
{
public static void Main ()
{
- Type t = typeof (C<int>.G<>);
+ Type t = typeof (this);
}
}
--- /dev/null
+// CS1061: Type `int' does not contain a definition for `GetValueOrDefault' and no extension method `GetValueOrDefault' of type `int' could be found. Are you missing an assembly reference?
+// Line: 9
+
+class C
+{
+ static void Main ()
+ {
+ int? i = 4;
+ var m = i?.GetValueOrDefault ();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1501: No overload for method `Bar' takes `2' arguments
+// Line: 19
+
+using System;
+
+class T
+{
+ void Foo (int arg, Action a)
+ {
+ }
+
+ void Foo (string title, Action a)
+ {
+ }
+
+ void Bar ()
+ {
+ Foo (arg: 1, a: () => {
+ Bar ("a", "b");
+ });
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1501: Argument `#1' cannot convert `ref string' expression to type `ref int'
+// Line: 8
+
+class C
+{
+ public static void Main ()
+ {
+ Foo (ref var x = "");
+ }
+
+ static void Foo (ref int i)
+ {
+ }
+}
\ No newline at end of file
-// CS1525: Unexpected symbol `ref', expecting `.', `?', `[', `<operator>', or `identifier'
+// CS1525: Unexpected symbol `ref'
// Line: 8
public class Test
--- /dev/null
+// CS1615: Argument `#1' does not require `out' modifier. Consider removing `out' modifier
+// Line: 8
+
+public class C
+{
+ public static void Main ()
+ {
+ Foo (out var y);
+ }
+
+ static void Foo (int x)
+ {
+ }
+
+ static void Foo (string x)
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1644: Feature `null propagating operator' cannot be used because it is not part of the C# 5.0 language specification
+// Line: 10
+// Compiler options: -langversion:5
+
+class C
+{
+ static void Main ()
+ {
+ object o = null;
+ string s = o?.ToString ();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1644: Feature `null propagating operator' cannot be used because it is not part of the C# 5.0 language specification
+// Line: 10
+// Compiler options: -langversion:5
+
+class C
+{
+ static void Main ()
+ {
+ string[] a = null;
+ var s = a?[0];
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1644: Feature `nameof operator' cannot be used because it is not part of the C# 5.0 language specification
+// Line: 10
+// Compiler options: -langversion:5
+
+class C
+{
+ static void Main ()
+ {
+ var n = nameof (Main);
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1644: Feature `dictionary initializer' cannot be used because it is not part of the C# 5.0 language specification
+// Line: 12
+// Compiler options: -langversion:5
+
+using System.Collections.Generic;
+
+class C
+{
+ public static void Main ()
+ {
+ var d = new Dictionary<string, int> {
+ ["a"] = 1
+ };
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1644: Feature `struct parameterless instance constructor' cannot be used because it is not part of the C# 5.0 language specification
+// Line: 12
+// Compiler options: -langversion:5
+
+struct S
+{
+ public S ()
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1644: Feature `struct instance member initializer' cannot be used because it is not part of the C# 5.0 language specification
+// Line: 12
+// Compiler options: -langversion:5
+
+struct S
+{
+ int i = 0;
+}
\ No newline at end of file
--- /dev/null
+// CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 5.0 language specification
+// Line: 12
+// Compiler options: -langversion:5
+
+class C
+{
+ public static void Main ()
+ {
+ int.TryParse ("0", out var v);
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS7003: Unbound generic name is not valid in this context
+// Line: 10
+
+class G<T>
+{
+}
+
+class C
+{
+ G<> field;
+}
\ No newline at end of file
--- /dev/null
+// CS7003: Unbound generic name is not valid in this context
+// Line: 10
+
+class G<T>
+{
+}
+
+class C
+{
+ const string f = nameof (G<>);
+}
\ No newline at end of file
--- /dev/null
+// CS7003: Unbound generic name is not valid in this context
+// Line: 4
+
+using SCGL = System.Collections.Generic.List<>;
\ No newline at end of file
--- /dev/null
+// CS7003: Unbound generic name is not valid in this context
+// Line: 17
+
+using System;
+
+class C<T>
+{
+ public class G<U>
+ {
+ }
+}
+
+class M
+{
+ public static void Main ()
+ {
+ Type t = typeof (C<int>.G<>);
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS8046: An expression tree cannot contain a declaration expression
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ static void Main()
+ {
+ Expression<Func<bool>> e = () => Out (out int x);
+ }
+
+ static bool Out (out int value)
+ {
+ value = 3;
+ return true;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS8047: Declaration expression cannot be used in this context
+// Line: 8
+
+public class C
+{
+ public static void Main ()
+ {
+ dynamic target = 3;
+ var x = new Test (target, out var y);
+ }
+}
+
+class Test
+{
+ public Test (int x, out int y)
+ {
+ y = 0;
+ }
+}
\ No newline at end of file
+++ /dev/null
-// CS0573: `A.a': Structs without explicit constructors cannot contain members with initializers
-// Line: 5
-
-partial struct A {
- int a = 1;
-}
+++ /dev/null
-// CS0573: `A.a': Structs without explicit constructors cannot contain members with initializers
-// Line: 5
-
-struct A {
- int a = 1;
-}
+++ /dev/null
-// CS8054: `S.P': Structs without explicit constructors cannot contain members with initializers
-// Line: 6
-
-struct S
-{
- public decimal P { get; } = -3;
-}
\ No newline at end of file
--- /dev/null
+// CS8070: Control cannot fall out of switch statement through final case label `case 3:'
+// Line: 20
+
+public class Foo
+{
+ public static void Main()
+ {
+ int a=5;
+ int b=10;
+ int c;
+
+ switch (a)
+ {
+ case 1: c=a+b;
+ return;
+
+ case 2: c=a-b;
+ return;
+
+ case 3: c=a*b;
+ }
+ }
+}
--- /dev/null
+// CS8071: Type arguments are not allowed in the nameof operator
+// Line: 10
+
+using SCGL = System.Collections.Generic.List<int>;
+
+class X
+{
+ public static int Main ()
+ {
+ var x = nameof (SCGL.Contains);
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS8071: Type arguments are not allowed in the nameof operator
+// Line: 16
+
+class G<T>
+{
+ class N
+ {
+ public int Foo;
+ }
+}
+
+class Test
+{
+ public static void Main ()
+ {
+ var n = nameof (G<int>.N.Foo);
+ }
+}
--- /dev/null
+// CS8072: An expression tree cannot contain a null propagating operator
+// Line: 14
+
+using System;
+using System.Linq.Expressions;
+
+public class C
+{
+ public void TestMethod () { }
+
+ static void Main ()
+ {
+ C c = null;
+ Expression<Action> e = () => c?.TestMethod ();
+ }
+}
--- /dev/null
+// CS8072: An expression tree cannot contain a null propagating operator
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ static int Main ()
+ {
+ Expression<Func<string, char?>> e = l => l?[1];
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS8074: Expression tree cannot contain a dictionary initializer
+// Line: 13
+
+using System;
+using System.Collections.Generic;
+using System.Linq.Expressions;
+
+class C
+{
+ public static void Main ()
+ {
+ Expression<Func<Dictionary<string, int>>> l = () => new Dictionary<string, int> {
+ ["a"] = 1
+ };
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS8075: `A.A()': Structs parameterless instance constructor must be public
+// Line: 6
+
+struct A
+{
+ A ()
+ {
+ }
+}
#include "defs.h"
+/* this resolves "unresolved symbol _snprintf" on Windows */
+#if defined (_MSC_VER)
+#define snprintf _snprintf
+#endif
+
/* The line size must be a positive integer. One hundred was chosen */
/* because few lines in Yacc input grammars exceed 100 characters. */
/* Note that if a line exceeds LINESIZE characters, the line buffer */
if ((lineno - (a_lineno + comment_lines)) > 2)
{
- char mname[20];
- char line_define[256];
+ char mname[28];
+ char *line_define;
+ // the maximum size of of an unsigned int in characters is 20, with 8 for 'case_()\0'
sprintf(mname, "case_%d()", nrules - 2);
putc(' ', f); putc(' ', f);
methods = REALLOC (methods, maxmethods*sizeof(char *));
}
+ line_define = NEW2(snprintf(NULL, 0, line_format, a_lineno, input_file_name)+1, char);
sprintf(line_define, line_format, a_lineno, input_file_name);
mbody = NEW2(5+strlen(line_define)+1+strlen(mname)+strlen(buffer)+1, char);
strcat(mbody, line_define);
strcat(mbody, buffer);
methods[nmethods++] = mbody;
+
+ FREE(line_define);
}
else
{
// this argument is generated during compilation which speeds up dispatch
// by about 25%
//
- method_parameters = ParametersCompiled.Prefix (method_parameters,
- new Parameter (null, null, 0, null, loc), ec.Module.Compiler.BuiltinTypes.Object);
+ // Unused as it breaks compatibility
+ //
+ // method_parameters = ParametersCompiled.Prefix (method_parameters,
+ // new Parameter (null, null, 0, null, loc), ec.Module.Compiler.BuiltinTypes.Object);
}
if (storey == null && hoisted_tparams == null)
Default = 3, // argument created from default parameter value
DynamicTypeName = 4, // System.Type argument for dynamic binding
ExtensionType = 5, // Instance expression inserted as the first argument
+
+ // Conditional instance expression inserted as the first argument
+ ExtensionTypeConditionalAccess = 5 | ConditionalAccessFlag,
+
+ ConditionalAccessFlag = 1 << 7
}
public readonly AType ArgType;
get { return ArgType == AType.Default; }
}
+ public bool IsExtensionType {
+ get {
+ return (ArgType & AType.ExtensionType) == AType.ExtensionType;
+ }
+ }
+
public Parameter.Modifier Modifier {
get {
switch (ArgType) {
public virtual void Emit (EmitContext ec)
{
if (!IsByRef) {
- Expr.Emit (ec);
+ if (ArgType == AType.ExtensionTypeConditionalAccess) {
+ var ie = new InstanceEmitter (Expr, false);
+ ie.Emit (ec, true);
+ } else {
+ Expr.Emit (ec);
+ }
+
return;
}
args.Add (new Argument (awaiter, Argument.AType.Ref));
args.Add (new Argument (new CompilerGeneratedThis (CurrentType, Location), Argument.AType.Ref));
using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
- mg.EmitCall (ec, args);
+ mg.EmitCall (ec, args, true);
}
}
args.Add (new Argument (exceptionVariable));
using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
- mg.EmitCall (ec, args);
+ mg.EmitCall (ec, args, true);
}
}
}
using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
- mg.EmitCall (ec, args);
+ mg.EmitCall (ec, args, true);
}
}
((IntConstant) right).Value);
return new IntConstant (ec.BuiltinTypes, res, left.Location);
- } else {
- throw new Exception ( "Unexepected modulus input: " + left);
}
+
+ if (left is DecimalConstant) {
+ decimal res;
+
+ if (ec.ConstantCheckState)
+ res = checked (((DecimalConstant) left).Value %
+ ((DecimalConstant) right).Value);
+ else
+ res = unchecked (((DecimalConstant) left).Value %
+ ((DecimalConstant) right).Value);
+
+ return new DecimalConstant (ec.BuiltinTypes, res, left.Location);
+ }
+
+ throw new Exception ( "Unexepected modulus input: " + left);
} catch (DivideByZeroException){
ec.Report.Error (20, loc, "Division by constant zero");
} catch (OverflowException){
public abstract class TypeContainer : MemberCore
{
public readonly MemberKind Kind;
- public readonly string Basename;
protected List<TypeContainer> containers;
: base (parent, name, attrs)
{
this.Kind = kind;
- if (name != null)
- this.Basename = name.Basename;
-
defined_names = new Dictionary<string, MemberCore> ();
}
public virtual void AddPartial (TypeDefinition next_part)
{
MemberCore mc;
- (PartialContainer ?? this).defined_names.TryGetValue (next_part.Basename, out mc);
+ (PartialContainer ?? this).defined_names.TryGetValue (next_part.MemberName.Basename, out mc);
AddPartial (next_part, mc as TypeDefinition);
}
containers.Remove (cont);
var tc = Parent == Module ? Module : this;
- tc.defined_names.Remove (cont.Basename);
+ tc.defined_names.Remove (cont.MemberName.Basename);
}
public virtual void VerifyMembers ()
public override void AddTypeContainer (TypeContainer tc)
{
- AddNameToContainer (tc, tc.Basename);
+ AddNameToContainer (tc, tc.MemberName.Basename);
base.AddTypeContainer (tc);
}
}
}
- public virtual void RegisterFieldForInitialization (MemberCore field, FieldInitializer expression)
+ public void RegisterFieldForInitialization (MemberCore field, FieldInitializer expression)
{
if (IsPartialPart)
PartialContainer.RegisterFieldForInitialization (field, expression);
initialized_static_fields.Add (expression);
} else {
+ if (Kind == MemberKind.Struct && Compiler.Settings.Version < LanguageVersion.V_6) {
+ Report.FeatureIsNotAvailable (Compiler, expression.Location, "struct instance member initializer");
+ }
+
if (initialized_fields == null)
initialized_fields = new List<FieldInitializer> (4);
//
// Field is re-initialized to its default value => removed
//
- if (fi.IsDefaultInitializer && ec.Module.Compiler.Settings.Optimize)
+ if (fi.IsDefaultInitializer && Kind != MemberKind.Struct && ec.Module.Compiler.Settings.Optimize)
continue;
ec.AssignmentInfoOffset += fi.AssignmentOffset;
CreateMetadataName (sb);
TypeBuilder = Module.CreateBuilder (sb.ToString (), TypeAttr, type_size);
} else {
- TypeBuilder = parent_def.TypeBuilder.DefineNestedType (Basename, TypeAttr, null, type_size);
+ TypeBuilder = parent_def.TypeBuilder.DefineNestedType (MemberName.Basename, TypeAttr, null, type_size);
}
if (DeclaringAssembly.Importer != null)
public SourceMethodBuilder CreateMethodSymbolEntry ()
{
- if (Module.DeclaringAssembly.SymbolWriter == null)
+ if (Module.DeclaringAssembly.SymbolWriter == null || (ModFlags & Modifiers.DEBUGGER_HIDDEN) != 0)
return null;
var source_file = GetCompilationSourceFile ();
{
base.RemoveContainer (cont);
Members.Remove (cont);
- Cache.Remove (cont.Basename);
+ Cache.Remove (cont.MemberName.Basename);
}
protected virtual bool DoResolveTypeParameters ()
if (Kind == MemberKind.Class)
c.Initializer = new GeneratedBaseInitializer (Location, PrimaryConstructorBaseArguments);
- if (PrimaryConstructorParameters != null && !is_static)
+ if (PrimaryConstructorParameters != null && !is_static) {
c.IsPrimaryConstructor = true;
+ c.caching_flags |= Flags.MethodOverloadsExist;
+ }
AddConstructor (c, true);
if (PrimaryConstructorBlock == null) {
CheckProtectedModifier ();
if (PrimaryConstructorParameters != null) {
+
foreach (Parameter p in PrimaryConstructorParameters.FixedParameters) {
if (p.Name == MemberName.Name) {
Report.Error (8039, p.Location, "Primary constructor of type `{0}' has parameter of same name as containing type",
protected override bool DoDefineMembers ()
{
- if (PrimaryConstructorParameters != null)
+ var res = base.DoDefineMembers ();
+
+ if (PrimaryConstructorParameters != null || (initialized_fields != null && !HasUserDefaultConstructor ())) {
generated_primary_constructor = DefineDefaultConstructor (false);
+ generated_primary_constructor.Define ();
+ }
- return base.DoDefineMembers ();
+ return res;
}
public override void Emit ()
base.Emit ();
}
- bool HasExplicitConstructor ()
+ bool HasUserDefaultConstructor ()
{
- foreach (var m in Members) {
+ foreach (var m in PartialContainer.Members) {
var c = m as Constructor;
if (c == null)
continue;
- if (!c.ParameterInfo.IsEmpty)
+ if (!c.IsStatic && c.ParameterInfo.IsEmpty)
return true;
}
base_type = Compiler.BuiltinTypes.ValueType;
return ifaces;
}
-
- public override void RegisterFieldForInitialization (MemberCore field, FieldInitializer expression)
- {
- if ((field.ModFlags & Modifiers.STATIC) == 0 && !HasExplicitConstructor ()) {
- Report.Error (8054, field.Location, "`{0}': Structs without explicit constructors cannot contain members with initializers",
- field.GetSignatureForError ());
-
- return;
- }
-
- base.RegisterFieldForInitialization (field, expression);
- }
}
/// <summary>
}
}
+ public ConditionalAccessContext ConditionalAccess { get; set; }
+
public TypeSpec CurrentType {
get { return member_context.CurrentType; }
}
public List<TryFinally> TryFinallyUnwind { get; set; }
+ public Label RecursivePatternLabel { get; set; }
+
#endregion
public void AddStatementEpilog (IExpressionCleanup cleanupExpression)
#endif
}
+ public void CloseConditionalAccess (TypeSpec type)
+ {
+ if (type != null)
+ Emit (OpCodes.Newobj, Nullable.NullableInfo.GetConstructor (type));
+
+ MarkLabel (ConditionalAccess.EndLabel);
+ ConditionalAccess = null;
+ }
+
//
// Creates a nested container in this context for all dynamic compiler generated stuff
//
// bool array can actually store any byte value
//
ig.Emit (OpCodes.Ldelem_U1);
- ig.Emit (OpCodes.Ldc_I4_1);
- ig.Emit (OpCodes.And);
+ ig.Emit (OpCodes.Ldc_I4_0);
+ ig.Emit (OpCodes.Cgt_Un);
break;
case BuiltinTypeSpec.Type.Byte:
ig.Emit (OpCodes.Ldelem_U1);
break;
case BuiltinTypeSpec.Type.Bool:
ig.Emit (OpCodes.Ldind_I1);
- ig.Emit (OpCodes.Ldc_I4_1);
- ig.Emit (OpCodes.And);
+ ig.Emit (OpCodes.Ldc_I4_0);
+ ig.Emit (OpCodes.Cgt_Un);
break;
case BuiltinTypeSpec.Type.ULong:
case BuiltinTypeSpec.Type.Long:
}
}
+ public class ConditionalAccessContext
+ {
+ public ConditionalAccessContext (TypeSpec type, Label endLabel)
+ {
+ Type = type;
+ EndLabel = endLabel;
+ }
+
+ public bool Statement { get; set; }
+ public Label EndLabel { get; private set; }
+ public TypeSpec Type { get; private set; }
+ }
+
struct CallEmitter
{
public Expression InstanceExpression;
//
- // When set leaves an extra copy of all arguments on the stack
+ // When call has to leave an extra copy of all arguments on the stack
//
public bool DuplicateArguments;
//
public bool HasAwaitArguments;
+ public bool ConditionalAccess;
+
//
// When dealing with await arguments the original arguments are converted
// into a new set with hoisted stack results
public void Emit (EmitContext ec, MethodSpec method, Arguments Arguments, Location loc)
{
- EmitPredefined (ec, method, Arguments, loc);
+ EmitPredefined (ec, method, Arguments, false, loc);
}
- public void EmitPredefined (EmitContext ec, MethodSpec method, Arguments Arguments, Location? loc = null)
+ public void EmitStatement (EmitContext ec, MethodSpec method, Arguments Arguments, Location loc)
+ {
+ EmitPredefined (ec, method, Arguments, true, loc);
+ }
+
+ public void EmitPredefined (EmitContext ec, MethodSpec method, Arguments Arguments, bool statement = false, Location? loc = null)
{
Expression instance_copy = null;
if (method.IsStatic) {
call_op = OpCodes.Call;
} else {
- if (IsVirtualCallRequired (InstanceExpression, method)) {
- call_op = OpCodes.Callvirt;
- } else {
- call_op = OpCodes.Call;
- }
+ call_op = IsVirtualCallRequired (InstanceExpression, method) ? OpCodes.Callvirt : OpCodes.Call;
if (HasAwaitArguments) {
instance_copy = InstanceExpression.EmitToField (ec);
- if (Arguments == null)
- EmitCallInstance (ec, instance_copy, method.DeclaringType, call_op);
+ var ie = new InstanceEmitter (instance_copy, IsAddressCall (instance_copy, call_op, method.DeclaringType));
+
+ if (Arguments == null) {
+ ie.EmitLoad (ec);
+ }
} else if (!InstanceExpressionOnStack) {
- var instance_on_stack_type = EmitCallInstance (ec, InstanceExpression, method.DeclaringType, call_op);
+ var ie = new InstanceEmitter (InstanceExpression, IsAddressCall (InstanceExpression, call_op, method.DeclaringType));
+ ie.Emit (ec, ConditionalAccess);
if (DuplicateArguments) {
ec.Emit (OpCodes.Dup);
if (Arguments != null && Arguments.Count != 0) {
- lt = new LocalTemporary (instance_on_stack_type);
+ lt = new LocalTemporary (ie.GetStackType (ec));
lt.Store (ec);
instance_copy = lt;
}
EmittedArguments = Arguments.Emit (ec, DuplicateArguments, HasAwaitArguments);
if (EmittedArguments != null) {
if (instance_copy != null) {
- EmitCallInstance (ec, instance_copy, method.DeclaringType, call_op);
+ var ie = new InstanceEmitter (instance_copy, IsAddressCall (instance_copy, call_op, method.DeclaringType));
+ ie.Emit (ec, ConditionalAccess);
if (lt != null)
lt.Release (ec);
if (method.Parameters.HasArglist) {
var varargs_types = GetVarargsTypes (method, Arguments);
ec.Emit (call_op, method, varargs_types);
- return;
+ } else {
+ //
+ // If you have:
+ // this.DoFoo ();
+ // and DoFoo is not virtual, you can omit the callvirt,
+ // because you don't need the null checking behavior.
+ //
+ ec.Emit (call_op, method);
}
+ //
+ // Pop the return value if there is one and stack should be empty
//
- // If you have:
- // this.DoFoo ();
- // and DoFoo is not virtual, you can omit the callvirt,
- // because you don't need the null checking behavior.
+ if (statement && method.ReturnType.Kind != MemberKind.Void)
+ ec.Emit (OpCodes.Pop);
+ }
+
+ static MetaType[] GetVarargsTypes (MethodSpec method, Arguments arguments)
+ {
+ AParametersCollection pd = method.Parameters;
+
+ Argument a = arguments[pd.Count - 1];
+ Arglist list = (Arglist) a.Expr;
+
+ return list.ArgumentTypes;
+ }
+
+ //
+ // Used to decide whether call or callvirt is needed
+ //
+ static bool IsVirtualCallRequired (Expression instance, MethodSpec method)
+ {
+ //
+ // There are 2 scenarious where we emit callvirt
+ //
+ // Case 1: A method is virtual and it's not used to call base
+ // Case 2: A method instance expression can be null. In this casen callvirt ensures
+ // correct NRE exception when the method is called
+ //
+ var decl_type = method.DeclaringType;
+ if (decl_type.IsStruct || decl_type.IsEnum)
+ return false;
+
+ if (instance is BaseThis)
+ return false;
+
//
- ec.Emit (call_op, method);
+ // It's non-virtual and will never be null and it can be determined
+ // whether it's known value or reference type by verifier
+ //
+ if (!method.IsVirtual && Expression.IsNeverNull (instance) && !instance.Type.IsGenericParameter)
+ return false;
+
+ return true;
+ }
+
+ static bool IsAddressCall (Expression instance, OpCode callOpcode, TypeSpec declaringType)
+ {
+ var instance_type = instance.Type;
+ return (instance_type.IsStructOrEnum && (callOpcode == OpCodes.Callvirt || (callOpcode == OpCodes.Call && declaringType.IsStruct))) ||
+ instance_type.IsGenericParameter || declaringType.IsNullableType;
+ }
+ }
+
+ public struct InstanceEmitter
+ {
+ readonly Expression instance;
+ readonly bool addressRequired;
+
+ public InstanceEmitter (Expression instance, bool addressLoad)
+ {
+ this.instance = instance;
+ this.addressRequired = addressLoad;
}
- static TypeSpec EmitCallInstance (EmitContext ec, Expression instance, TypeSpec declaringType, OpCode callOpcode)
+ public void Emit (EmitContext ec, bool conditionalAccess)
+ {
+ Label NullOperatorLabel;
+ Nullable.Unwrap unwrap;
+
+ if (conditionalAccess && Expression.IsNeverNull (instance))
+ conditionalAccess = false;
+
+ if (conditionalAccess) {
+ NullOperatorLabel = ec.DefineLabel ();
+ unwrap = instance as Nullable.Unwrap;
+ } else {
+ NullOperatorLabel = new Label ();
+ unwrap = null;
+ }
+
+ IMemoryLocation instance_address = null;
+ bool conditional_access_dup = false;
+
+ if (unwrap != null) {
+ unwrap.Store (ec);
+ unwrap.EmitCheck (ec);
+ ec.Emit (OpCodes.Brtrue_S, NullOperatorLabel);
+ } else {
+ if (conditionalAccess && addressRequired) {
+ //
+ // Don't allocate temp variable when instance load is cheap and load and load-address
+ // operate on same memory
+ //
+ instance_address = instance as VariableReference;
+ if (instance_address == null)
+ instance_address = instance as LocalTemporary;
+
+ if (instance_address == null) {
+ EmitLoad (ec);
+ ec.Emit (OpCodes.Dup);
+ ec.EmitLoadFromPtr (instance.Type);
+
+ conditional_access_dup = true;
+ } else {
+ instance.Emit (ec);
+ }
+
+ if (instance.Type.Kind == MemberKind.TypeParameter)
+ ec.Emit (OpCodes.Box, instance.Type);
+ } else {
+ EmitLoad (ec);
+
+ if (conditionalAccess) {
+ conditional_access_dup = !IsInexpensiveLoad ();
+ if (conditional_access_dup)
+ ec.Emit (OpCodes.Dup);
+ }
+ }
+
+ if (conditionalAccess) {
+ ec.Emit (OpCodes.Brtrue_S, NullOperatorLabel);
+
+ if (conditional_access_dup)
+ ec.Emit (OpCodes.Pop);
+ }
+ }
+
+ if (conditionalAccess) {
+ if (!ec.ConditionalAccess.Statement) {
+ if (ec.ConditionalAccess.Type.IsNullableType)
+ Nullable.LiftedNull.Create (ec.ConditionalAccess.Type, Location.Null).Emit (ec);
+ else
+ ec.EmitNull ();
+ }
+
+ ec.Emit (OpCodes.Br, ec.ConditionalAccess.EndLabel);
+ ec.MarkLabel (NullOperatorLabel);
+
+ if (instance_address != null) {
+ instance_address.AddressOf (ec, AddressOp.Load);
+ } else if (unwrap != null) {
+ unwrap.Emit (ec);
+ var tmp = ec.GetTemporaryLocal (unwrap.Type);
+ ec.Emit (OpCodes.Stloc, tmp);
+ ec.Emit (OpCodes.Ldloca, tmp);
+ ec.FreeTemporaryLocal (tmp, unwrap.Type);
+ } else if (!conditional_access_dup) {
+ instance.Emit (ec);
+ }
+ }
+ }
+
+ public void EmitLoad (EmitContext ec)
{
var instance_type = instance.Type;
//
// Push the instance expression
//
- if ((instance_type.IsStructOrEnum && (callOpcode == OpCodes.Callvirt || (callOpcode == OpCodes.Call && declaringType.IsStruct))) ||
- instance_type.IsGenericParameter || declaringType.IsNullableType) {
+ if (addressRequired) {
//
// If the expression implements IMemoryLocation, then
// we can optimize and use AddressOf on the
temp.AddressOf (ec, AddressOp.Load);
}
- return ReferenceContainer.MakeType (ec.Module, instance_type);
+ return;
}
- if (instance_type.IsStructOrEnum) {
- instance.Emit (ec);
+ instance.Emit (ec);
+
+ // Only to make verifier happy
+ if (RequiresBoxing ())
ec.Emit (OpCodes.Box, instance_type);
- return ec.BuiltinTypes.Object;
- }
+ }
+
+ public TypeSpec GetStackType (EmitContext ec)
+ {
+ var instance_type = instance.Type;
+
+ if (addressRequired)
+ return ReferenceContainer.MakeType (ec.Module, instance_type);
+
+ if (instance_type.IsStructOrEnum)
+ return ec.Module.Compiler.BuiltinTypes.Object;
- instance.Emit (ec);
return instance_type;
}
- static MetaType[] GetVarargsTypes (MethodSpec method, Arguments arguments)
+ bool RequiresBoxing ()
{
- AParametersCollection pd = method.Parameters;
+ var instance_type = instance.Type;
+ if (instance_type.IsGenericParameter && !(instance is This) && TypeSpec.IsReferenceType (instance_type))
+ return true;
- Argument a = arguments[pd.Count - 1];
- Arglist list = (Arglist) a.Expr;
+ if (instance_type.IsStructOrEnum)
+ return true;
- return list.ArgumentTypes;
+ return false;
}
- //
- // Used to decide whether call or callvirt is needed
- //
- static bool IsVirtualCallRequired (Expression instance, MethodSpec method)
+ bool IsInexpensiveLoad ()
{
- //
- // There are 2 scenarious where we emit callvirt
- //
- // Case 1: A method is virtual and it's not used to call base
- // Case 2: A method instance expression can be null. In this casen callvirt ensures
- // correct NRE exception when the method is called
- //
- var decl_type = method.DeclaringType;
- if (decl_type.IsStruct || decl_type.IsEnum)
- return false;
+ if (instance is Constant)
+ return instance.IsSideEffectFree;
- if (instance is BaseThis)
+ if (RequiresBoxing ())
return false;
- //
- // It's non-virtual and will never be null and it can be determined
- // whether it's known value or reference type by verifier
- //
- if (!method.IsVirtual && (instance is This || instance is New || instance is ArrayCreation || instance is DelegateCreation) &&
- !instance.Type.IsGenericParameter)
- return false;
+ var vr = instance as VariableReference;
+ if (vr != null)
+ return !vr.IsRef;
- return true;
+ if (instance is LocalTemporary)
+ return true;
+
+ var fe = instance as FieldExpr;
+ if (fe != null)
+ return fe.IsStatic || fe.InstanceExpression is This;
+
+ return false;
}
}
}
}
public class StringConstant : Constant {
- public readonly string Value;
-
public StringConstant (BuiltinTypes types, string s, Location loc)
: this (types.String, s, loc)
{
Value = s;
}
+ protected StringConstant (Location loc)
+ : base (loc)
+ {
+ }
+
+ public string Value { get; protected set; }
+
public override object GetValue ()
{
return Value;
}
}
+ class NameOf : StringConstant
+ {
+ readonly SimpleName name;
+
+ public NameOf (SimpleName name)
+ : base (name.Location)
+ {
+ this.name = name;
+ }
+
+ protected override Expression DoResolve (ResolveContext rc)
+ {
+ throw new NotSupportedException ();
+ }
+
+ bool ResolveArgumentExpression (ResolveContext rc, Expression expr)
+ {
+ var sn = expr as SimpleName;
+ if (sn != null) {
+ Value = sn.Name;
+
+ if (rc.Module.Compiler.Settings.Version < LanguageVersion.V_6)
+ rc.Report.FeatureIsNotAvailable (rc.Module.Compiler, Location, "nameof operator");
+
+ if (sn.HasTypeArguments) {
+ // TODO: csc compatible but unhelpful error message
+ rc.Report.Error (1001, loc, "Identifier expected");
+ return true;
+ }
+
+ sn.LookupNameExpression (rc, MemberLookupRestrictions.IgnoreArity | MemberLookupRestrictions.IgnoreAmbiguity);
+ return true;
+ }
+
+ var ma = expr as MemberAccess;
+ if (ma != null) {
+ FullNamedExpression fne = ma.LeftExpression as ATypeNameExpression;
+ if (fne == null) {
+ var qam = ma as QualifiedAliasMember;
+ if (qam == null)
+ return false;
+
+ fne = qam.CreateExpressionFromAlias (rc);
+ if (fne == null)
+ return true;
+ }
+
+ Value = ma.Name;
+
+ if (rc.Module.Compiler.Settings.Version < LanguageVersion.V_6)
+ rc.Report.FeatureIsNotAvailable (rc.Module.Compiler, Location, "nameof operator");
+
+ if (ma.HasTypeArguments) {
+ // TODO: csc compatible but unhelpful error message
+ rc.Report.Error (1001, loc, "Identifier expected");
+ return true;
+ }
+
+ var left = fne.ResolveAsTypeOrNamespace (rc, true);
+ if (left == null)
+ return true;
+
+ var ns = left as NamespaceExpression;
+ if (ns != null) {
+ FullNamedExpression retval = ns.LookupTypeOrNamespace (rc, ma.Name, 0, LookupMode.NameOf, loc);
+ if (retval == null)
+ ns.Error_NamespaceDoesNotExist (rc, ma.Name, 0);
+
+ return true;
+ }
+
+ if (left.Type.IsGenericOrParentIsGeneric && left.Type.GetDefinition () != left.Type) {
+ rc.Report.Error (8071, loc, "Type arguments are not allowed in the nameof operator");
+ }
+
+ var mexpr = MemberLookup (rc, false, left.Type, ma.Name, 0, MemberLookupRestrictions.IgnoreArity | MemberLookupRestrictions.IgnoreAmbiguity, loc);
+ if (mexpr == null) {
+ ma.Error_IdentifierNotFound (rc, left.Type);
+ return true;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public Expression ResolveOverload (ResolveContext rc, Arguments args)
+ {
+ if (args == null || args.Count != 1) {
+ name.Error_NameDoesNotExist (rc);
+ return null;
+ }
+
+ var arg = args [0];
+ var res = ResolveArgumentExpression (rc, arg.Expr);
+ if (!res) {
+ name.Error_NameDoesNotExist (rc);
+ return null;
+ }
+
+ type = rc.BuiltinTypes.String;
+ eclass = ExprClass.Value;
+ return this;
+ }
+ }
+
//
// Null constant can have its own type, think of `default (Foo)'
//
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
+using System.Diagnostics;
namespace Mono.CSharp
{
{
Normal = 0,
Probing = 1,
- IgnoreAccessibility = 2
+ IgnoreAccessibility = 2,
+ NameOf = 3
}
//
TryWithCatchScope = 1 << 15,
+ ConditionalAccessReceiver = 1 << 16,
+
///
/// Indicates the current context is in probing mode, no errors are reported.
///
public class FlowAnalysisContext
{
readonly CompilerContext ctx;
+ DefiniteAssignmentBitSet conditional_access;
public FlowAnalysisContext (CompilerContext ctx, ParametersBlock parametersBlock, int definiteAssignmentLength)
{
return dat;
}
+ public void BranchConditionalAccessDefiniteAssignment ()
+ {
+ if (conditional_access == null)
+ conditional_access = BranchDefiniteAssignment ();
+ }
+
+ public void ConditionalAccessEnd ()
+ {
+ Debug.Assert (conditional_access != null);
+ DefiniteAssignment = conditional_access;
+ conditional_access = null;
+ }
+
public bool IsDefinitelyAssigned (VariableInfo variable)
{
return variable.IsAssigned (DefiniteAssignment);
if (target_type.Kind == MemberKind.InternalCompilerType)
return target_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic;
- return TypeSpec.IsReferenceType (target_type);
+ return TypeSpec.IsReferenceType (target_type) || target_type.Kind == MemberKind.PointerType;
}
//
%token MAKEREF
%token ASYNC
%token AWAIT
+%token INTERR_OPERATOR
/* C# keywords which are not really keywords */
%token GET
;
named_argument
- : identifier_inside_body COLON opt_named_modifier expression_or_error
+ : identifier_inside_body COLON opt_named_modifier named_argument_expr
{
if (lang_version <= LanguageVersion.V_3)
FeatureIsNotAvailable (GetLocation ($1), "named argument");
lbag.AddLocation ($$, GetLocation($2));
}
;
+
+named_argument_expr
+ : expression_or_error
+ | declaration_expression
+ ;
opt_named_modifier
: /* empty */ { $$ = null; }
// Was added earlier in the case of body being eof for full ast
}
- method_body
+ method_body_expression_block
{
Method method = (Method) $1;
method.Block = (ToplevelBlock) $3;
}
;
+method_body_expression_block
+ : method_body
+ | expression_block
+ ;
+
method_body
: block
- | expression_block
| SEMICOLON { $$ = null; }
;
var property = new Property (current_type, type, (Modifiers) $2,
(MemberName) $4, (Attributes) $1);
- if (type.Type != null && type.Type.Kind == MemberKind.Void)
- report.Error (547, GetLocation ($3), "`{0}': property or indexer cannot have void type", property.GetSignatureForError ());
-
property.Get = new Property.GetMethod (property, Modifiers.COMPILER_GENERATED, null, property.Location);
property.Get.Block = (ToplevelBlock) $6;
+ if (current_container.Kind == MemberKind.Interface) {
+ report.Error (531, property.Get.Block.StartLocation,
+ "`{0}': interface members cannot have a definition", property.GetSignatureForError ());
+ }
+
+ if (type.Type != null && type.Type.Kind == MemberKind.Void)
+ report.Error (547, GetLocation ($3), "`{0}': property or indexer cannot have void type", property.GetSignatureForError ());
+
current_type.AddMember (property);
current_local_parameters = null;
current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;
start_block (GetLocation ($1));
}
- expression SEMICOLON
+ property_initializer SEMICOLON
{
--lexer.parsing_block;
((Property)current_property).Initializer = (Expression) $3;
}
;
+property_initializer
+ : expression
+ | array_initializer
+ ;
+
indexer_declaration
: opt_attributes opt_modifiers
member_type indexer_declaration_name OPEN_BRACKET
: opt_attributes opt_modifiers operator_declarator
{
}
- method_body
+ method_body_expression_block
{
OperatorDeclaration decl = (OperatorDeclaration) $3;
if (decl != null) {
: operator_type OPERATOR overloadable_operator OPEN_PARENS
{
valid_param_mod = ParameterModifierType.DefaultValue;
+ if ((Operator.OpType) $3 == Operator.OpType.Is)
+ valid_param_mod |= ParameterModifierType.Out;
}
opt_formal_parameter_list CLOSE_PARENS
{
report.Error (1535, loc, "Overloaded unary operator `{0}' takes one parameter",
Operator.GetName (op));
}
+ } else if (op == Operator.OpType.Is) {
+ // TODO: Special checks for is operator
} else {
if (p_count == 1) {
report.Error (1019, loc, "Overloadable unary operator expected");
| OP_LT { $$ = Operator.OpType.LessThan; }
| OP_GE { $$ = Operator.OpType.GreaterThanOrEqual; }
| OP_LE { $$ = Operator.OpType.LessThanOrEqual; }
+ | IS
+ {
+ if (lang_version != LanguageVersion.Experimental)
+ FeatureIsNotAvailable (GetLocation ($1), "is user operator");
+
+ $$ = Operator.OpType.Is;
+ }
;
conversion_operator_declarator
if (lt.Value != current_container.MemberName.Name) {
report.Error (1520, c.Location, "Class, struct, or interface method must have a return type");
} else if ((mods & Modifiers.STATIC) != 0) {
+ if (!current_local_parameters.IsEmpty) {
+ report.Error (132, c.Location, "`{0}': The static constructor must be parameterless",
+ c.GetSignatureForError ());
+ }
+
if ((mods & Modifiers.AccessibilityMask) != 0){
report.Error (515, c.Location,
"`{0}': static constructor cannot have an access modifier",
c.GetSignatureForError ());
}
+ } else {
+ if (current_type.Kind == MemberKind.Struct && current_local_parameters.IsEmpty) {
+ if (lang_version < LanguageVersion.V_6)
+ FeatureIsNotAvailable (GetLocation ($3), "struct parameterless instance constructor");
+
+ if ((mods & Modifiers.PUBLIC) == 0) {
+ report.Error (8075, c.Location, "`{0}': Structs parameterless instance constructor must be public", c.GetSignatureForError ());
+ }
+ }
}
current_type.AddConstructor (c);
: /* empty */
| COLON type
{
- var te = $2 as TypeExpression;
- if (te == null || !EnumSpec.IsValidUnderlyingType (te.Type)) {
- Enum.Error_1008 (GetLocation ($2), report);
- }
$$ = $2;
}
| COLON error
$$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) $3, lt1.Location);
lbag.AddLocation ($$, GetLocation ($2));
}
+ | qualified_alias_member IDENTIFIER generic_dimension
+ {
+ var lt1 = (LocatedToken) $1;
+ var lt2 = (LocatedToken) $2;
+
+ $$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) $3, lt1.Location);
+ lbag.AddLocation ($$, GetLocation ($2));
+ }
;
member_name
$$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location);
lbag.AddLocation ($$, GetLocation ($2));
}
+ | namespace_or_type_expr DOT IDENTIFIER generic_dimension
+ {
+ var lt = (LocatedToken) $3;
+ $$ = new MemberAccess ((Expression) $1, lt.Value, (int) $4, lt.Location);
+ lbag.AddLocation ($$, GetLocation ($2));
+ }
;
simple_name_expr
var lt = (LocatedToken) $1;
$$ = new SimpleName (lt.Value, (TypeArguments)$2, lt.Location);
}
+ | IDENTIFIER generic_dimension
+ {
+ var lt = (LocatedToken) $1;
+ $$ = new SimpleName (lt.Value, (int) $2, lt.Location);
+ }
;
-
+
//
// Generics arguments (any type, without attributes)
//
//
type
: type_expression_or_array
- | VOID
- {
- Expression.Error_VoidInvalidInTheContext (GetLocation ($1), report);
- $$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));
- }
+ | void_invalid
;
simple_type
: type_expression
- | VOID
- {
- Expression.Error_VoidInvalidInTheContext (GetLocation ($1), report);
- $$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));
- }
+ | void_invalid
;
parameter_type
: type_expression_or_array
| VOID
{
- report.Error (1536, GetLocation ($1), "Invalid parameter type `void'");
+ report.Error (1536, GetLocation ($1), "Invalid parameter type `void'");
$$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));
- }
+ }
;
type_expression_or_array
{
$$ = new ComposedCast ((ATypeNameExpression) $1, (ComposedTypeSpecifier) $2);
}
- | builtin_types opt_nullable
+ | builtin_type_expression
+ ;
+
+void_invalid
+ : VOID
+ {
+ Expression.Error_VoidInvalidInTheContext (GetLocation ($1), report);
+ $$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));
+ }
+ ;
+
+builtin_type_expression
+ : builtin_types opt_nullable
{
if ($2 != null)
$$ = new ComposedCast ((FullNamedExpression) $1, (ComposedTypeSpecifier) $2);
primary_expression
- : primary_expression_or_type
+ : type_name_expression
| literal
| array_creation_expression
| parenthesized_expression
| undocumented_expressions
;
-primary_expression_or_type
- : IDENTIFIER opt_type_argument_list
- {
- var lt = (LocatedToken) $1;
- $$ = new SimpleName (lt.Value, (TypeArguments)$2, lt.Location);
- }
+type_name_expression
+ : simple_name_expr
| IDENTIFIER GENERATE_COMPLETION {
var lt = (LocatedToken) $1;
$$ = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location);
$$ = new ParenthesizedExpression ((Expression) $2, GetLocation ($1));
}
;
-
+
member_access
: primary_expression DOT identifier_inside_body opt_type_argument_list
{
$$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location);
lbag.AddLocation ($$, GetLocation ($2));
}
+ | primary_expression DOT identifier_inside_body generic_dimension
+ {
+ var lt = (LocatedToken) $3;
+ $$ = new MemberAccess ((Expression) $1, lt.Value, (int) $4, lt.Location);
+ lbag.AddLocation ($$, GetLocation ($2));
+ }
+ | primary_expression INTERR_OPERATOR DOT identifier_inside_body opt_type_argument_list
+ {
+ if (lang_version < LanguageVersion.V_6)
+ FeatureIsNotAvailable (GetLocation ($2), "null propagating operator");
+
+ var lt = (LocatedToken) $4;
+ $$ = new ConditionalMemberAccess ((Expression) $1, lt.Value, (TypeArguments) $5, lt.Location);
+ lbag.AddLocation ($$, GetLocation ($2), GetLocation ($3));
+ }
| builtin_types DOT identifier_inside_body opt_type_argument_list
{
var lt = (LocatedToken) $3;
$$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) $3, lt1.Location);
lbag.AddLocation ($$, GetLocation ($2));
}
+ | qualified_alias_member identifier_inside_body generic_dimension
+ {
+ var lt1 = (LocatedToken) $1;
+ var lt2 = (LocatedToken) $2;
+
+ $$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) $3, lt1.Location);
+ lbag.AddLocation ($$, GetLocation ($2));
+ }
| primary_expression DOT GENERATE_COMPLETION {
$$ = new CompletionMemberAccess ((Expression) $1, null,GetLocation ($3));
}
else
$$ = new CollectionElementInitializer ((List<Expression>)$2, GetLocation ($1));
- lbag.AddLocation ($$, GetLocation ($2));
+ lbag.AddLocation ($$, GetLocation ($3));
+ }
+ | OPEN_BRACKET_EXPR expression_list CLOSE_BRACKET ASSIGN initializer_value
+ {
+ if (lang_version < LanguageVersion.V_6)
+ FeatureIsNotAvailable (GetLocation ($1), "dictionary initializer");
+
+ $$ = new DictionaryElementInitializer ((List<Expression>)$2, (Expression) $5, GetLocation ($1));
+ lbag.AddLocation ($$, GetLocation ($3), GetLocation ($4));
}
| OPEN_BRACE CLOSE_BRACE
{
$$ = new Argument ((Expression) $2, Argument.AType.Ref);
lbag.AddLocation ($$, GetLocation ($1));
}
+ | REF declaration_expression
+ {
+ $$ = new Argument ((Expression) $2, Argument.AType.Ref);
+ }
| OUT variable_reference
{
$$ = new Argument ((Expression) $2, Argument.AType.Out);
lbag.AddLocation ($$, GetLocation ($1));
}
+ | OUT declaration_expression
+ {
+ $$ = new Argument ((Expression) $2, Argument.AType.Out);
+ }
| ARGLIST OPEN_PARENS argument_list CLOSE_PARENS
{
$$ = new Argument (new Arglist ((Arguments) $3, GetLocation ($1)));
}
;
+declaration_expression
+ : OPEN_PARENS declaration_expression CLOSE_PARENS
+ {
+ $$ = new ParenthesizedExpression ((Expression) $2, GetLocation ($1));
+ lbag.AddLocation ($$, GetLocation ($1), GetLocation ($3));
+ }
+/*
+ | CHECKED open_parens_any declaration_expression CLOSE_PARENS
+ {
+ $$ = new CheckedExpr ((Expression) $3, GetLocation ($1));
+ lbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));
+ }
+ | UNCHECKED open_parens_any declaration_expression CLOSE_PARENS
+ {
+ $$ = new UnCheckedExpr ((Expression) $3, GetLocation ($1));
+ lbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));
+ }
+*/
+ | variable_type identifier_inside_body
+ {
+ if (lang_version < LanguageVersion.V_6)
+ FeatureIsNotAvailable (GetLocation ($1), "declaration expression");
+
+ var lt = (LocatedToken) $2;
+ var lv = new LocalVariable (current_block, lt.Value, lt.Location);
+ current_block.AddLocalName (lv);
+ $$ = new DeclarationExpression ((FullNamedExpression) $1, lv);
+ }
+ | variable_type identifier_inside_body ASSIGN expression
+ {
+ if (lang_version < LanguageVersion.V_6)
+ FeatureIsNotAvailable (GetLocation ($1), "declaration expression");
+
+ var lt = (LocatedToken) $2;
+ var lv = new LocalVariable (current_block, lt.Value, lt.Location);
+ current_block.AddLocalName (lv);
+ $$ = new DeclarationExpression ((FullNamedExpression) $1, lv) {
+ Initializer = (Expression) $4
+ };
+ }
+ ;
+
variable_reference
: expression
;
$$ = new ElementAccess ((Expression) $1, (Arguments) $3, GetLocation ($2));
lbag.AddLocation ($$, GetLocation ($4));
}
+ | primary_expression INTERR_OPERATOR OPEN_BRACKET_EXPR expression_list_arguments CLOSE_BRACKET
+ {
+ if (lang_version < LanguageVersion.V_6)
+ FeatureIsNotAvailable (GetLocation ($2), "null propagating operator");
+
+ $$ = new ElementAccess ((Expression) $1, (Arguments) $4, GetLocation ($3)) {
+ ConditionalAccess = true
+ };
+
+ lbag.AddLocation ($$, GetLocation ($2), GetLocation ($5));
+ }
| primary_expression OPEN_BRACKET_EXPR expression_list_arguments error
{
Error_SyntaxError (yyToken);
;
typeof_expression
- : TYPEOF
- {
- lexer.TypeOfParsing = true;
- }
- open_parens_any typeof_type_expression CLOSE_PARENS
+ : TYPEOF open_parens_any typeof_type_expression CLOSE_PARENS
{
- lexer.TypeOfParsing = false;
- $$ = new TypeOf ((FullNamedExpression) $4, GetLocation ($1));
- lbag.AddLocation ($$, GetLocation ($3), GetLocation ($5));
+ $$ = new TypeOf ((FullNamedExpression) $3, GetLocation ($1));
+ lbag.AddLocation ($$, GetLocation ($2), GetLocation ($4));
}
;
typeof_type_expression
: type_and_void
- | unbound_type_name
| error
{
Error_TypeExpected (lexer.Location);
$$ = null;
}
;
-
-unbound_type_name
- : identifier_inside_body generic_dimension
- {
- var lt = (LocatedToken) $1;
-
- $$ = new SimpleName (lt.Value, (int) $2, lt.Location);
- }
- | qualified_alias_member identifier_inside_body generic_dimension
- {
- var lt1 = (LocatedToken) $1;
- var lt2 = (LocatedToken) $2;
-
- $$ = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) $3, lt1.Location);
- lbag.AddLocation ($$, GetLocation ($2));
- }
- | unbound_type_name DOT identifier_inside_body
- {
- var lt = (LocatedToken) $3;
-
- $$ = new MemberAccess ((Expression) $1, lt.Value, lt.Location);
- }
- | unbound_type_name DOT identifier_inside_body generic_dimension
- {
- var lt = (LocatedToken) $3;
-
- $$ = new MemberAccess ((Expression) $1, lt.Value, (int) $4, lt.Location);
- }
- | namespace_or_type_expr DOT identifier_inside_body generic_dimension
- {
- var tne = (ATypeNameExpression) $1;
- if (tne.HasTypeArguments)
- Error_TypeExpected (GetLocation ($4));
-
- var lt = (LocatedToken) $3;
- $$ = new MemberAccess (tne, lt.Value, (int) $4, lt.Location);
- }
- ;
generic_dimension
: GENERIC_DIMENSION
$$ = new Binary (Binary.Operator.Subtraction, (Expression) $1, (Expression) $3);
lbag.AddLocation ($$, GetLocation ($2));
}
- | additive_expression AS type
- {
- $$ = new As ((Expression) $1, (Expression) $3, GetLocation ($2));
- }
- | additive_expression IS type
- {
- $$ = new Is ((Expression) $1, (Expression) $3, GetLocation ($2));
- }
- | additive_expression PLUS error
+ | additive_expression PLUS error
{
Error_SyntaxError (yyToken);
$$ = new Binary (Binary.Operator.Subtraction, (Expression) $1, null);
lbag.AddLocation ($$, GetLocation ($2));
}
+ | additive_expression AS type
+ {
+ $$ = new As ((Expression) $1, (Expression) $3, GetLocation ($2));
+ }
+ | additive_expression IS pattern_type_expr opt_identifier
+ {
+ var is_expr = new Is ((Expression) $1, (Expression) $3, GetLocation ($2));
+ if ($4 != null) {
+ if (lang_version != LanguageVersion.Experimental)
+ FeatureIsNotAvailable (GetLocation ($4), "type pattern matching");
+
+ var lt = (LocatedToken) $4;
+ is_expr.Variable = new LocalVariable (current_block, lt.Value, lt.Location);
+ current_block.AddLocalName (is_expr.Variable);
+ }
+
+ $$ = is_expr;
+ }
+ | additive_expression IS pattern_expr
+ {
+ var is_expr = new Is ((Expression) $1, (Expression) $3, GetLocation ($2));
+ if (lang_version != LanguageVersion.Experimental)
+ FeatureIsNotAvailable (GetLocation ($2), "pattern matching");
+
+ $$ = is_expr;
+ }
| additive_expression AS error
{
Error_SyntaxError (yyToken);
}
;
+pattern_type_expr
+ : variable_type
+ ;
+
+pattern_expr
+ : literal
+ | PLUS prefixed_unary_expression
+ {
+ $$ = new Unary (Unary.Operator.UnaryPlus, (Expression) $2, GetLocation ($1));
+ }
+ | MINUS prefixed_unary_expression
+ {
+ $$ = new Unary (Unary.Operator.UnaryNegation, (Expression) $2, GetLocation ($1));
+ }
+ | sizeof_expression
+ | default_value_expression
+ | OPEN_PARENS_CAST type CLOSE_PARENS prefixed_unary_expression
+ {
+ $$ = new Cast ((FullNamedExpression) $2, (Expression) $4, GetLocation ($1));
+ lbag.AddLocation ($$, GetLocation ($3));
+ }
+ | STAR
+ {
+ $$ = new WildcardPattern (GetLocation ($1));
+ }
+ | pattern_expr_invocation
+ | pattern_property
+ ;
+
+pattern_expr_invocation
+ : type_name_expression OPEN_PARENS opt_pattern_list CLOSE_PARENS
+ {
+ $$ = new RecursivePattern ((ATypeNameExpression) $1, (Arguments) $3, GetLocation ($2));
+ }
+ ;
+
+pattern_property
+ : type_name_expression OPEN_BRACE pattern_property_list CLOSE_BRACE
+ {
+ $$ = new PropertyPattern ((ATypeNameExpression) $1, (List<PropertyPatternMember>) $3, GetLocation ($2));
+ }
+ ;
+
+pattern_property_list
+ : pattern_property_entry
+ {
+ var list = new List<PropertyPatternMember> ();
+ list.Add ((PropertyPatternMember) $1);
+ $$ = list;
+ }
+ | pattern_property_list COMMA pattern_property_entry
+ {
+ var list = (List<PropertyPatternMember>) $1;
+ list.Add ((PropertyPatternMember) $3);
+ $$ = list;
+ }
+ ;
+
+pattern_property_entry
+ : identifier_inside_body IS pattern
+ {
+ var lt = (LocatedToken) $1;
+ $$ = new PropertyPatternMember (lt.Value, (Expression) $3, lt.Location);
+ }
+ ;
+
+pattern
+ : pattern_expr
+ | pattern_type_expr opt_identifier
+ {
+ if ($2 != null) {
+ var lt = (LocatedToken) $2;
+ var variable = new LocalVariable (current_block, lt.Value, lt.Location);
+ current_block.AddLocalName (variable);
+ }
+ }
+ ;
+
+opt_pattern_list
+ : /* empty */
+ {
+ $$ = new Arguments (0);
+ }
+ | pattern_list
+ ;
+
+pattern_list
+ : pattern_argument
+ {
+ Arguments args = new Arguments (4);
+ args.Add ((Argument) $1);
+ $$ = args;
+ }
+ | pattern_list COMMA pattern_argument
+ {
+ Arguments args = (Arguments) $1;
+ if (args [args.Count - 1] is NamedArgument && !($3 is NamedArgument))
+ Error_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]);
+
+ args.Add ((Argument) $3);
+ $$ = args;
+ }
+ ;
+
+pattern_argument
+ : pattern
+ {
+ $$ = new Argument ((Expression) $1);
+ }
+ | IDENTIFIER COLON pattern
+ {
+ var lt = (LocatedToken) $1;
+ $$ = new NamedArgument (lt.Value, lt.Location, (Expression) $3);
+ }
+ ;
+
shift_expression
: additive_expression
| shift_expression OP_SHIFT_LEFT additive_expression
* > The expressions are converted into types during semantic analysis.
*/
variable_type_simple
- : primary_expression_or_type opt_nullable
+ : type_name_expression opt_nullable
{
// Ok, the above "primary_expression" is there to get rid of
// both reduce/reduce and shift/reduces in the grammar, it should
// SimpleName is when you have
// Blah i;
- Expression expr = (Expression) $1;
+ var expr = (ATypeNameExpression) $1;
if ($2 == null) {
- SimpleName sn = expr as SimpleName;
- if (sn != null && sn.Name == "var")
- $$ = new VarExpr (sn.Location);
+ if (expr.Name == "var" && expr is SimpleName)
+ $$ = new VarExpr (expr.Location);
else
$$ = $1;
- } else if (expr is ATypeNameExpression) {
- $$ = new ComposedCast ((ATypeNameExpression)expr, (ComposedTypeSpecifier) $2);
} else {
- Error_ExpectingTypeName (expr);
- $$ = null;
- }
- }
- | primary_expression_or_type pointer_stars
- {
- ATypeNameExpression expr = $1 as ATypeNameExpression;
-
- if (expr != null) {
$$ = new ComposedCast (expr, (ComposedTypeSpecifier) $2);
- } else {
- Error_ExpectingTypeName ((Expression)$1);
- $$ = expr;
}
}
- | builtin_types opt_nullable
- {
- if ($2 == null)
- $$ = $1;
- else
- $$ = new ComposedCast ((FullNamedExpression) $1, (ComposedTypeSpecifier) $2);
- }
- | builtin_types pointer_stars
- {
- $$ = new ComposedCast ((FullNamedExpression) $1, (ComposedTypeSpecifier) $2);
- }
- | VOID pointer_stars
- {
- $$ = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1)), (ComposedTypeSpecifier) $2);
- }
- | VOID
+ | type_name_expression pointer_stars
{
- Expression.Error_VoidInvalidInTheContext (GetLocation ($1), report);
- $$ = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation ($1));
+ var expr = (ATypeNameExpression) $1;
+ $$ = new ComposedCast (expr, (ComposedTypeSpecifier) $2);
}
+ | builtin_type_expression
+ | void_invalid
;
pointer_stars
Error_SyntaxError (yyToken);
$$ = new SwitchLabel ((Expression) $2, GetLocation ($1));
}
+ | CASE pattern_expr_invocation COLON
+ {
+ if (lang_version != LanguageVersion.Experimental)
+ FeatureIsNotAvailable (GetLocation ($2), "pattern matching");
+
+ $$ = new SwitchLabel ((Expression) $2, GetLocation ($1)) {
+ PatternMatching = true
+ };
+ lbag.AddLocation ($$, GetLocation ($3));
+ }
| DEFAULT_COLON
{
$$ = new SwitchLabel (null, GetLocation ($1));
case Token.OP_AND_ASSIGN:
case Token.OP_XOR_ASSIGN:
case Token.OP_OR_ASSIGN:
+ case Token.INTERR_OPERATOR:
return "<operator>";
case Token.BOOL:
bool handle_get_set = false;
bool handle_remove_add = false;
bool handle_where;
- bool handle_typeof = false;
bool lambda_arguments_parsing;
List<Location> escaped_identifiers;
int parsing_generic_less_than;
get { return handle_where; }
set { handle_where = value; }
}
-
- public bool TypeOfParsing {
- get { return handle_typeof; }
- set { handle_typeof = value; }
- }
public XmlCommentState doc_state {
get { return xml_doc_state; }
case Token.BYTE:
case Token.CHAR:
case Token.DECIMAL:
+ case Token.DOUBLE:
case Token.FLOAT:
case Token.LONG:
case Token.OBJECT:
return true;
}
- bool parse_less_than ()
+ bool parse_less_than (ref int genericDimension)
{
start:
int the_token = token ();
case Token.VOID:
break;
case Token.OP_GENERICS_GT:
+ genericDimension = 1;
+ return true;
case Token.IN:
case Token.OUT:
return true;
+ case Token.COMMA:
+ do {
+ ++genericDimension;
+ the_token = token ();
+ } while (the_token == Token.COMMA);
+
+ if (the_token == Token.OP_GENERICS_GT) {
+ ++genericDimension;
+ return true;
+ }
+ return false;
default:
return false;
}
else if (the_token == Token.INTERR_NULLABLE || the_token == Token.STAR)
goto again;
else if (the_token == Token.OP_GENERICS_LT) {
- if (!parse_less_than ())
+ if (!parse_less_than (ref genericDimension))
return false;
goto again;
} else if (the_token == Token.OPEN_BRACKET) {
return false;
}
- bool parse_generic_dimension (out int dimension)
- {
- dimension = 1;
-
- again:
- int the_token = token ();
- if (the_token == Token.OP_GENERICS_GT)
- return true;
- else if (the_token == Token.COMMA) {
- dimension++;
- goto again;
- }
-
- return false;
- }
-
public int peek_token ()
{
int the_token;
return Token.OP_COALESCING;
}
- switch (current_token) {
- case Token.CLOSE_PARENS:
- case Token.TRUE:
- case Token.FALSE:
- case Token.NULL:
- case Token.LITERAL:
- return Token.INTERR;
+ if (d == '.') {
+ return Token.INTERR_OPERATOR;
}
if (d != ' ') {
current_token = Token.NONE;
int next_token;
int parens = 0;
-
- switch (xtoken ()) {
+ int generics = 0;
+ int brackets = 0;
+
+ var nt = xtoken ();
+ switch (nt) {
+ case Token.DOT:
+ case Token.OPEN_BRACKET_EXPR:
+ next_token = Token.INTERR_OPERATOR;
+ break;
case Token.LITERAL:
case Token.TRUE:
case Token.FALSE:
next_token = -1;
++parens;
break;
-
+
+ case Token.OP_GENERICS_LT:
+ case Token.OP_GENERICS_LT_DECL:
+ case Token.GENERIC_DIMENSION:
+ next_token = -1;
+ ++generics;
+ break;
+
default:
next_token = -1;
break;
case Token.COMMA:
case Token.SEMICOLON:
case Token.OPEN_BRACE:
- case Token.CLOSE_PARENS:
case Token.IN:
next_token = Token.INTERR_NULLABLE;
break;
++parens;
goto default;
+ case Token.OPEN_BRACKET:
+ case Token.OPEN_BRACKET_EXPR:
+ ++brackets;
+ goto default;
+
+ case Token.CLOSE_PARENS:
+ --parens;
+ goto default;
+
+ case Token.OP_GENERICS_LT:
+ case Token.OP_GENERICS_LT_DECL:
+ case Token.GENERIC_DIMENSION:
+ ++generics;
+ goto default;
+
default:
int ntoken;
int interrs = 1;
case Token.CLOSE_BRACE:
--braces;
continue;
+ case Token.OP_GENERICS_LT:
+ case Token.OP_GENERICS_LT_DECL:
+ case Token.GENERIC_DIMENSION:
+ ++generics;
+ continue;
+ case Token.OPEN_BRACKET:
+ case Token.OPEN_BRACKET_EXPR:
+ ++brackets;
+ continue;
+ case Token.CLOSE_BRACKET:
+ --brackets;
+ continue;
case Token.CLOSE_PARENS:
if (parens > 0) {
--parens;
continue;
}
+ PopPosition ();
+ return Token.INTERR_NULLABLE;
+
+ case Token.OP_GENERICS_GT:
+ if (generics > 0) {
+ --generics;
+ continue;
+ }
+
PopPosition ();
return Token.INTERR_NULLABLE;
}
if (parens != 0)
continue;
+
+ if (ntoken == Token.COMMA) {
+ if (generics != 0 || brackets != 0)
+ continue;
+
+ PopPosition ();
+ return Token.INTERR_NULLABLE;
+ }
if (ntoken == Token.COLON) {
if (++colons == interrs)
int TokenizeLessThan ()
{
int d;
- if (handle_typeof) {
- PushPosition ();
- if (parse_generic_dimension (out d)) {
- val = d;
- DiscardPosition ();
- return Token.GENERIC_DIMENSION;
- }
- PopPosition ();
- }
// Save current position and parse next token.
PushPosition ();
- if (parse_less_than ()) {
+ int generic_dimension = 0;
+ if (parse_less_than (ref generic_dimension)) {
if (parsing_generic_declaration && (parsing_generic_declaration_doc || token () != Token.DOT)) {
d = Token.OP_GENERICS_LT_DECL;
} else {
+ if (generic_dimension > 0) {
+ val = generic_dimension;
+ DiscardPosition ();
+ return Token.GENERIC_DIMENSION;
+ }
+
d = Token.OP_GENERICS_LT;
}
PopPosition ();
return name + "`" + args.Count;
}
-
- public static string MakeName (string name, int count)
- {
- return name + "`" + count;
- }
}
public class SimpleMemberName
//
public abstract class DelegateCreation : Expression, OverloadResolver.IErrorHandler
{
+ bool conditional_access_receiver;
protected MethodSpec constructor_method;
protected MethodGroupExpr method_group;
var invoke_method = Delegate.GetInvokeMethod (type);
+ if (!ec.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {
+ if (method_group.HasConditionalAccess ()) {
+ conditional_access_receiver = true;
+ ec.Set (ResolveContext.Options.ConditionalAccessReceiver);
+ }
+ }
+
Arguments arguments = CreateDelegateMethodArguments (ec, invoke_method.Parameters, invoke_method.Parameters.Types, loc);
method_group = method_group.OverloadResolve (ec, ref arguments, this, OverloadResolver.Restrictions.CovariantDelegate);
+
+ if (conditional_access_receiver)
+ ec.With (ResolveContext.Options.ConditionalAccessReceiver, false);
+
if (method_group == null)
return null;
public override void Emit (EmitContext ec)
{
- if (method_group.InstanceExpression == null)
+ if (conditional_access_receiver)
+ ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());
+
+ if (method_group.InstanceExpression == null) {
ec.EmitNull ();
- else
- method_group.InstanceExpression.Emit (ec);
+ } else {
+ var ie = new InstanceEmitter (method_group.InstanceExpression, false);
+ ie.Emit (ec, method_group.ConditionalAccess);
+ }
var delegate_method = method_group.BestCandidate;
}
ec.Emit (OpCodes.Newobj, constructor_method);
+
+ if (conditional_access_receiver)
+ ec.CloseConditionalAccess (null);
}
- public override void FlowAnalysis (FlowAnalysisContext fc) {
+ public override void FlowAnalysis (FlowAnalysisContext fc)
+ {
base.FlowAnalysis (fc);
method_group.FlowAnalysis (fc);
+
+ if (conditional_access_receiver)
+ fc.ConditionalAccessEnd ();
}
void Error_ConversionFailed (ResolveContext ec, MethodSpec method, Expression return_type)
class DelegateInvocation : ExpressionStatement
{
readonly Expression InstanceExpr;
+ readonly bool conditionalAccessReceiver;
Arguments arguments;
MethodSpec method;
- public DelegateInvocation (Expression instance_expr, Arguments args, Location loc)
+ public DelegateInvocation (Expression instance_expr, Arguments args, bool conditionalAccessReceiver, Location loc)
{
this.InstanceExpr = instance_expr;
this.arguments = args;
+ this.conditionalAccessReceiver = conditionalAccessReceiver;
this.loc = loc;
}
return null;
type = method.ReturnType;
+ if (conditionalAccessReceiver)
+ type = LiftMemberType (ec, type);
+
eclass = ExprClass.Value;
return this;
}
public override void Emit (EmitContext ec)
{
+ if (conditionalAccessReceiver) {
+ ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());
+ }
+
//
// Invocation on delegates call the virtual Invoke member
// so we are always `instance' calls
//
var call = new CallEmitter ();
call.InstanceExpression = InstanceExpr;
- call.EmitPredefined (ec, method, arguments, loc);
+ call.Emit (ec, method, arguments, loc);
+
+ if (conditionalAccessReceiver)
+ ec.CloseConditionalAccess (type.IsNullableType && type != method.ReturnType ? type : null);
}
public override void EmitStatement (EmitContext ec)
{
- Emit (ec);
- //
- // Pop the return value if there is one
- //
- if (type.Kind != MemberKind.Void)
- ec.Emit (OpCodes.Pop);
+ if (conditionalAccessReceiver) {
+ ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ()) {
+ Statement = true
+ };
+ }
+
+ var call = new CallEmitter ();
+ call.InstanceExpression = InstanceExpr;
+ call.EmitStatement (ec, method, arguments, loc);
+
+ if (conditionalAccessReceiver)
+ ec.CloseConditionalAccess (null);
}
public override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)
this.loc = loc;
}
- public override TypeSpec ResolveAsType (IMemberContext ec)
+ public override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments)
{
eclass = ExprClass.Type;
type = ec.Module.Compiler.BuiltinTypes.Dynamic;
protected bool DoResolveCore (ResolveContext rc)
{
+ foreach (var arg in arguments) {
+ if (arg.Type == InternalType.VarOutType) {
+ // Should be special error message about dynamic dispatch
+ rc.Report.Error (8047, arg.Expr.Location, "Declaration expression cannot be used in this context");
+ }
+ }
+
if (rc.CurrentTypeParameters != null && rc.CurrentTypeParameters[0].IsMethodTypeParameter)
context_mvars = rc.CurrentTypeParameters;
}
}
- Expression target = new DelegateInvocation (new MemberAccess (site_field_expr, "Target", loc).Resolve (bc), args, loc).Resolve (bc);
+ Expression target = new DelegateInvocation (new MemberAccess (site_field_expr, "Target", loc).Resolve (bc), args, false, loc).Resolve (bc);
if (target != null)
target.Emit (ec);
}
// This is used if the expression should be resolved as a type or namespace name.
// the default implementation fails.
//
- public virtual TypeSpec ResolveAsType (IMemberContext mc)
+ public virtual TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments = false)
{
- ResolveContext ec = new ResolveContext (mc);
- Expression e = Resolve (ec);
+ var rc = mc as ResolveContext ?? new ResolveContext (mc);
+ Expression e = Resolve (rc);
if (e != null)
- e.Error_UnexpectedKind (ec, ResolveFlags.Type, loc);
+ e.Error_UnexpectedKind (rc, ResolveFlags.Type, loc);
return null;
}
{
return type.GetDefinition ().GetSignatureForError ();
}
+
+ public static bool IsNeverNull (Expression expr)
+ {
+ if (expr is This || expr is New || expr is ArrayCreation || expr is DelegateCreation || expr is ConditionalMemberAccess)
+ return true;
+
+ var c = expr as Constant;
+ if (c != null)
+ return !c.IsNull;
+
+ var tc = expr as TypeCast;
+ if (tc != null)
+ return IsNeverNull (tc.Child);
+
+ return false;
+ }
+
+ protected static bool IsNullPropagatingValid (TypeSpec type)
+ {
+ switch (type.Kind) {
+ case MemberKind.Struct:
+ return type.IsNullableType;
+ case MemberKind.Enum:
+ case MemberKind.Void:
+ case MemberKind.PointerType:
+ return false;
+ case MemberKind.InternalCompilerType:
+ return type.BuiltinType == BuiltinTypeSpec.Type.Dynamic;
+ default:
+ return true;
+ }
+ }
+
+ public virtual bool HasConditionalAccess ()
+ {
+ return false;
+ }
+
+ protected static TypeSpec LiftMemberType (ResolveContext rc, TypeSpec type)
+ {
+ return TypeSpec.IsValueType (type) && !type.IsNullableType ?
+ Nullable.NullableInfo.MakeType (rc.Module, type) :
+ type;
+ }
/// <summary>
/// Resolves an expression and performs semantic analysis on it.
if (ctors == null) {
switch (type.Kind) {
case MemberKind.Struct:
+ // Every struct has implicit default constructor if not provided by user
+ if (args == null)
+ return null;
+
rc.Report.SymbolRelatedToPreviousError (type);
// Report meaningful error for struct as they always have default ctor in C# context
OverloadResolver.Error_ConstructorMismatch (rc, type, args == null ? 0 : args.Count, loc);
break;
case MemberKind.MissingType:
case MemberKind.InternalCompilerType:
+// LAMESPEC: dynamic is not really object
+// if (type.BuiltinType == BuiltinTypeSpec.Type.Object)
+// goto default;
break;
default:
rc.Report.SymbolRelatedToPreviousError (type);
return null;
}
+ if (args == null && type.IsStruct) {
+ bool includes_empty = false;
+ foreach (MethodSpec ctor in ctors) {
+ if (ctor.Parameters.IsEmpty) {
+ includes_empty = true;
+ }
+ }
+
+ if (!includes_empty)
+ return null;
+ }
+
var r = new OverloadResolver (ctors, OverloadResolver.Restrictions.NoBaseMembers, loc);
if (!rc.HasSet (ResolveContext.Options.BaseInitializer)) {
r.InstanceQualifier = new ConstructorInstanceQualifier (type);
None = 0,
InvocableOnly = 1,
ExactArity = 1 << 2,
- ReadAccess = 1 << 3
+ ReadAccess = 1 << 3,
+ EmptyArguments = 1 << 4,
+ IgnoreArity = 1 << 5,
+ IgnoreAmbiguity = 1 << 6
}
//
}
if (non_method != null) {
- if (ambig_non_method != null && rc != null) {
+ if (ambig_non_method != null && rc != null && (restrictions & MemberLookupRestrictions.IgnoreAmbiguity) == 0) {
var report = rc.Module.Compiler.Report;
report.SymbolRelatedToPreviousError (non_method);
report.SymbolRelatedToPreviousError (ambig_non_method);
ec.Report.Error (1944, loc, "An expression tree cannot contain an unsafe pointer operation");
}
+ protected void Error_NullShortCircuitInsideExpressionTree (ResolveContext rc)
+ {
+ rc.Report.Error (8072, loc, "An expression tree cannot contain a null propagating operator");
+ }
+
public virtual void FlowAnalysis (FlowAnalysisContext fc)
{
}
+ //
+ // Special version of flow analysis for expressions which can return different
+ // on-true and on-false result. Used by &&, ||, ?: expressions
+ //
+ public virtual void FlowAnalysisConditional (FlowAnalysisContext fc)
+ {
+ FlowAnalysis (fc);
+ fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
+ }
+
/// <summary>
/// Returns an expression that can be used to invoke operator true
/// on the expression if it exists.
(targs == null || targs.Equals (atne.targs));
}
+ protected void Error_OpenGenericTypeIsNotAllowed (IMemberContext mc)
+ {
+ mc.Module.Compiler.Report.Error (7003, Location, "Unbound generic name is not valid in this context");
+ }
+
public override int GetHashCode ()
{
return Name.GetHashCode ();
return SimpleNameResolve (ec, right_side);
}
+ public void Error_NameDoesNotExist (ResolveContext rc)
+ {
+ rc.Report.Error (103, loc, "The name `{0}' does not exist in the current context", Name);
+ }
+
protected virtual void Error_TypeOrNamespaceNotFound (IMemberContext ctx)
{
if (ctx.CurrentType != null) {
}
}
- public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc)
+ public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)
{
FullNamedExpression fne = mc.LookupNamespaceOrType (Name, Arity, LookupMode.Normal, loc);
return ct;
}
+ if (!allowUnboundTypeArguments)
+ Error_OpenGenericTypeIsNotAllowed (mc);
+
return new GenericOpenTypeExpr (fne.Type, loc);
}
rc.Report.Error (135, loc, "`{0}' conflicts with a declaration in a child block", Name);
}
- return ResolveAsTypeOrNamespace (rc);
+ return ResolveAsTypeOrNamespace (rc, false);
}
}
return mg;
}
+ if (Name == "nameof")
+ return new NameOf (this);
+
if (errorMode) {
if (variable_found) {
rc.Report.Error (841, loc, "A local variable `{0}' cannot be used before it is declared", Name);
e = rc.LookupNamespaceOrType (Name, -System.Math.Max (1, Arity), LookupMode.Probing, loc);
if (e != null) {
- if (e.Type.Arity != Arity) {
+ if (e.Type.Arity != Arity && (restrictions & MemberLookupRestrictions.IgnoreArity) == 0) {
Error_TypeArgumentsCannotBeUsed (rc, e.Type, loc);
return e;
}
}
}
- rc.Report.Error (103, loc, "The name `{0}' does not exist in the current context", Name);
+ Error_NameDoesNotExist (rc);
}
return ErrorExpression.Instance;
throw new NotSupportedException ("ET");
}
- public abstract FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc);
+ public abstract FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments);
//
// This is used to resolve the expression as a type, a null
// value will be returned if the expression is not a type
// reference
//
- public override TypeSpec ResolveAsType (IMemberContext mc)
+ public override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments = false)
{
- FullNamedExpression fne = ResolveAsTypeOrNamespace (mc);
+ FullNamedExpression fne = ResolveAsTypeOrNamespace (mc, allowUnboundTypeArguments);
if (fne == null)
return null;
/// </summary>
public abstract class TypeExpr : FullNamedExpression
{
- public sealed override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc)
+ public sealed override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)
{
ResolveAsType (mc);
return this;
loc = l;
}
- public sealed override TypeSpec ResolveAsType (IMemberContext ec)
+ public sealed override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments = false)
{
return type;
}
throw new NotImplementedException ();
}
- public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc)
+ public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)
{
return this;
}
/// </summary>
public abstract class MemberExpr : Expression, OverloadResolver.IInstanceQualifier
{
+ protected bool conditional_access_receiver;
+
//
// An instance expression associated with this member, if it's a
// non-static member
get;
}
+ public bool ConditionalAccess { get; set; }
+
protected abstract TypeSpec DeclaringType {
get;
}
return InstanceExpression != null && InstanceExpression.ContainsEmitWithAwait ();
}
+ public override bool HasConditionalAccess ()
+ {
+ return ConditionalAccess || (InstanceExpression != null && InstanceExpression.HasConditionalAccess ());
+ }
+
static bool IsSameOrBaseQualifier (TypeSpec type, TypeSpec qtype)
{
do {
public override void FlowAnalysis (FlowAnalysisContext fc)
{
- if (InstanceExpression != null)
+ if (InstanceExpression != null) {
InstanceExpression.FlowAnalysis (fc);
+
+ if (ConditionalAccess) {
+ fc.BranchConditionalAccessDefiniteAssignment ();
+ }
+ }
+ }
+
+ protected void ResolveConditionalAccessReceiver (ResolveContext rc)
+ {
+ if (!rc.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {
+ if (HasConditionalAccess ()) {
+ conditional_access_receiver = true;
+ rc.Set (ResolveContext.Options.ConditionalAccessReceiver);
+ }
+ }
}
public bool ResolveInstanceExpression (ResolveContext rc, Expression rhs)
public virtual MemberExpr ResolveMemberAccess (ResolveContext ec, Expression left, SimpleName original)
{
- if (left != null && left.IsNull && TypeSpec.IsReferenceType (left.Type)) {
+ if (left != null && !ConditionalAccess && left.IsNull && TypeSpec.IsReferenceType (left.Type)) {
ec.Report.Warning (1720, 1, left.Location,
"Expression will always cause a `{0}'", "System.NullReferenceException");
}
protected void EmitInstance (EmitContext ec, bool prepare_for_load)
{
- TypeSpec instance_type = InstanceExpression.Type;
- if (TypeSpec.IsValueType (instance_type)) {
- if (InstanceExpression is IMemoryLocation) {
- ((IMemoryLocation) InstanceExpression).AddressOf (ec, AddressOp.Load);
- } else {
- // Cannot release the temporary variable when its address
- // is required to be on stack for any parent
- LocalTemporary t = new LocalTemporary (instance_type);
- InstanceExpression.Emit (ec);
- t.Store (ec);
- t.AddressOf (ec, AddressOp.Store);
- }
- } else {
- InstanceExpression.Emit (ec);
-
- // Only to make verifier happy
- if (instance_type.IsGenericParameter && !(InstanceExpression is This) && TypeSpec.IsReferenceType (instance_type))
- ec.Emit (OpCodes.Box, instance_type);
- }
+ var inst = new InstanceEmitter (InstanceExpression, TypeSpec.IsValueType (InstanceExpression.Type));
+ inst.Emit (ec, ConditionalAccess);
if (prepare_for_load)
ec.Emit (OpCodes.Dup);
get { return true; }
}
+ public override void FlowAnalysis (FlowAnalysisContext fc)
+ {
+ if (ConditionalAccess) {
+ fc.BranchConditionalAccessDefiniteAssignment ();
+ }
+ }
+
//
// For extension methodgroup we are not looking for base members but parent
// namespace extension methods
return null;
var cand = candidates;
- arguments.Insert (0, new Argument (ExtensionExpression, Argument.AType.ExtensionType));
+ var atype = ConditionalAccess ? Argument.AType.ExtensionTypeConditionalAccess : Argument.AType.ExtensionType;
+ arguments.Insert (0, new Argument (ExtensionExpression, atype));
var res = base.OverloadResolve (ec, ref arguments, ehandler ?? this, restr);
// Restore candidates in case we are running in probing mode
if (IsConditionallyExcluded)
ec.Report.Error (765, loc,
"Partial methods with only a defining declaration or removed conditional methods cannot be used in an expression tree");
-
+
+ if (ConditionalAccess)
+ Error_NullShortCircuitInsideExpressionTree (ec);
+
return new TypeOfMethod (best_candidate, loc);
}
{
throw new NotSupportedException ();
}
-
- public void EmitCall (EmitContext ec, Arguments arguments)
+
+ public void EmitCall (EmitContext ec, Arguments arguments, bool statement)
{
var call = new CallEmitter ();
call.InstanceExpression = InstanceExpression;
- call.Emit (ec, best_candidate, arguments, loc);
+ call.ConditionalAccess = ConditionalAccess;
+
+ if (statement)
+ call.EmitStatement (ec, best_candidate, arguments, loc);
+ else
+ call.Emit (ec, best_candidate, arguments, loc);
+ }
+
+ public void EmitCall (EmitContext ec, Arguments arguments, TypeSpec conditionalAccessReceiver, bool statement)
+ {
+ ec.ConditionalAccess = new ConditionalAccessContext (conditionalAccessReceiver, ec.DefineLabel ()) {
+ Statement = statement
+ };
+
+ EmitCall (ec, arguments, statement);
+
+ ec.CloseConditionalAccess (!statement && best_candidate_return != conditionalAccessReceiver && conditionalAccessReceiver.IsNullableType ? conditionalAccessReceiver : null);
}
public override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec target, bool expl)
// one being the virtual base for the parameter types and modifiers.
//
// A return value rates candidate method compatibility,
- // 0 = the best, int.MaxValue = the worst
// -1 = fatal error
+ // 0 = the best, int.MaxValue = the worst
//
int IsApplicable (ResolveContext ec, ref Arguments arguments, int arg_count, ref MemberSpec candidate, IParametersMember pm, ref bool params_expanded_form, ref bool dynamicArgument, ref TypeSpec returnType, bool errorMode)
{
+ //
+ // Each step has allocated 10 values, it can overflow for
+ // more than 10 arguments but that's ok as it's used for
+ // better error reporting only
+ //
+ const int ArgumentCountMismatch = 1000000000;
+ const int NamedArgumentsMismatch = 100000000;
+ const int DefaultArgumentMismatch = 10000000;
+ const int UnexpectedTypeArguments = 1000000;
+ const int TypeArgumentsMismatch = 100000;
+ const int InflatedTypesMismatch = 10000;
+
// Parameters of most-derived type used mainly for named and optional parameters
var pd = pm.Parameters;
param_count--;
} else if (arg_count > param_count) {
int args_gap = System.Math.Abs (arg_count - param_count);
- return int.MaxValue - 10000 + args_gap;
+ return ArgumentCountMismatch + args_gap;
} else if (arg_count < param_count - optional_count) {
int args_gap = System.Math.Abs (param_count - optional_count - arg_count);
- return int.MaxValue - 10000 + args_gap;
+ return ArgumentCountMismatch + args_gap;
}
} else if (arg_count != param_count) {
int args_gap = System.Math.Abs (arg_count - param_count);
if (!cpd.HasParams)
- return int.MaxValue - 10000 + args_gap;
+ return ArgumentCountMismatch + args_gap;
if (arg_count < param_count - 1)
- return int.MaxValue - 10000 + args_gap;
+ return ArgumentCountMismatch + args_gap;
}
// Resize to fit optional arguments
// Named parameter not found
if (index < 0)
- return (i + 1) * 3;
+ return NamedArgumentsMismatch - i;
// already reordered
if (index == i)
++arg_count;
temp = null;
} else {
- if (index == arg_count)
- return (i + 1) * 3;
+ if (index == arg_count)
+ return NamedArgumentsMismatch - i - 1;
temp = arguments [index];
// Don't do any expensive checks when the candidate cannot succeed
//
if (arg_count != param_count && !cpd.HasParams)
- return (param_count - arg_count) * 2 + 1;
+ return DefaultArgumentMismatch - System.Math.Abs (param_count - arg_count);
var dep = candidate.GetMissingDependencies ();
if (dep != null) {
if (type_arguments != null) {
var g_args_count = ms.Arity;
if (g_args_count != type_arguments.Count)
- return int.MaxValue - 20000 + System.Math.Abs (type_arguments.Count - g_args_count);
+ return TypeArgumentsMismatch - System.Math.Abs (type_arguments.Count - g_args_count);
if (type_arguments.Arguments != null)
ms = ms.MakeGenericMethod (ec, type_arguments.Arguments);
TypeSpec[] i_args = ti.InferMethodArguments (ec, ms);
if (i_args == null)
- return ti.InferenceScore - 20000;
+ return TypeArgumentsMismatch - ti.InferenceScore;
//
// Clear any error messages when the result was success
if (i_args.Length != 0) {
if (!errorMode) {
- foreach (var ta in i_args) {
+ for (int i = 0; i < i_args.Length; ++i) {
+ var ta = i_args [i];
if (!ta.IsAccessible (ec))
- return ti.InferenceScore - 10000;
+ return TypeArgumentsMismatch - i;
}
}
//
if (!CheckInflatedArguments (ms)) {
candidate = ms;
- return int.MaxValue - 25000;
+ return InflatedTypesMismatch;
}
//
ptypes = pd.Types;
} else {
if (type_arguments != null)
- return int.MaxValue - 15000;
+ return UnexpectedTypeArguments;
ptypes = cpd.Types;
}
score = 1;
if (!params_expanded_form) {
- if (a.ArgType == Argument.AType.ExtensionType) {
+ if (a.IsExtensionType) {
//
// Indentity, implicit reference or boxing conversion must exist for the extension parameter
//
// is used and argument is not of dynamic type
//
if (((argument.Modifier | param_mod) & Parameter.Modifier.RefOutMask) != 0) {
- if (argument.Type != parameter) {
+ var arg_type = argument.Type;
+
+ if ((argument.Modifier & Parameter.Modifier.RefOutMask) != (param_mod & Parameter.Modifier.RefOutMask)) {
+ //
+ // Using dynamic for ref/out parameter can still succeed at runtime
+ //
+ if (arg_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && (argument.Modifier & Parameter.Modifier.RefOutMask) == 0 && (restrictions & Restrictions.CovariantDelegate) == 0)
+ return -1;
+
+ return 1;
+ }
+
+ if (arg_type != parameter) {
+ if (arg_type == InternalType.VarOutType)
+ return 0;
+
//
// Do full equality check after quick path
//
- if (!TypeSpecComparer.IsEqual (argument.Type, parameter)) {
+ if (!TypeSpecComparer.IsEqual (arg_type, parameter)) {
//
// Using dynamic for ref/out parameter can still succeed at runtime
//
- if (argument.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && (argument.Modifier & Parameter.Modifier.RefOutMask) == 0 && (restrictions & Restrictions.CovariantDelegate) == 0)
+ if (arg_type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && (argument.Modifier & Parameter.Modifier.RefOutMask) == 0 && (restrictions & Restrictions.CovariantDelegate) == 0)
return -1;
return 2;
}
}
- if ((argument.Modifier & Parameter.Modifier.RefOutMask) != (param_mod & Parameter.Modifier.RefOutMask)) {
- //
- // Using dynamic for ref/out parameter can still succeed at runtime
- //
- if (argument.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && (argument.Modifier & Parameter.Modifier.RefOutMask) == 0 && (restrictions & Restrictions.CovariantDelegate) == 0)
- return -1;
-
- return 1;
- }
-
} else {
if (argument.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic && (restrictions & Restrictions.CovariantDelegate) == 0)
return -1;
}
if (best_candidate_dynamic) {
- if (args[0].ArgType == Argument.AType.ExtensionType) {
+ if (args[0].IsExtensionType) {
rc.Report.Error (1973, loc,
"Type `{0}' does not contain a member `{1}' and the best extension method overload `{2}' cannot be dynamically dispatched. Consider calling the method without the extension method syntax",
args [0].Type.GetSignatureForError (), best_candidate.Name, best_candidate.GetSignatureForError ());
if ((a.Modifier & Parameter.Modifier.RefOutMask) != (p_mod & Parameter.Modifier.RefOutMask))
break;
- if (a.Expr.Type == pt || TypeSpecComparer.IsEqual (a.Expr.Type, pt))
+ var arg_type = a.Type;
+ if (arg_type == pt)
continue;
- break;
+ if (arg_type == InternalType.VarOutType) {
+ //
+ // Set underlying variable type based on parameter type
+ //
+ ((DeclarationExpression)a.Expr).Variable.Type = pt;
+ continue;
+ }
+
+ if (!TypeSpecComparer.IsEqual (arg_type, pt))
+ break;
}
NamedArgument na = a as NamedArgument;
}
Expression conv;
- if (a.ArgType == Argument.AType.ExtensionType) {
+ if (a.IsExtensionType) {
if (a.Expr.Type == pt || TypeSpecComparer.IsEqual (a.Expr.Type, pt)) {
conv = a.Expr;
} else {
}
if (a_idx != arg_count) {
+ //
+ // Convert all var out argument to error type for less confusing error reporting
+ // when no matching overload is found
+ //
+ for (; a_idx < arg_count; a_idx++) {
+ var arg = args [a_idx];
+ if (arg == null)
+ continue;
+
+ if (arg.Type == InternalType.VarOutType) {
+ ((DeclarationExpression)arg.Expr).Variable.Type = InternalType.ErrorType;
+ }
+ }
+
ReportArgumentMismatch (ec, a_pos, member, a, pd, pt);
return false;
}
public override Expression CreateExpressionTree (ResolveContext ec)
{
+ if (ConditionalAccess) {
+ Error_NullShortCircuitInsideExpressionTree (ec);
+ }
+
return CreateExpressionTree (ec, true);
}
bool lvalue_instance = rhs != null && IsInstance && spec.DeclaringType.IsStruct;
if (rhs != this) {
+ ResolveConditionalAccessReceiver (ec);
+
if (ResolveInstanceExpression (ec, rhs)) {
// Resolve the field's instance expression while flow analysis is turned
// off: when accessing a field "a.b", we must check whether the field
}
DoBestMemberChecks (ec, spec);
+
+ if (conditional_access_receiver)
+ ec.With (ResolveContext.Options.ConditionalAccessReceiver, false);
}
var fb = spec as FixedFieldSpec;
variable_info = var.VariableInfo.GetStructFieldInfo (Name);
}
+ if (ConditionalAccess) {
+ if (conditional_access_receiver)
+ type = LiftMemberType (ec, type);
+
+ if (InstanceExpression.IsNull)
+ return Constant.CreateConstantFromValue (type, null, loc);
+ }
+
eclass = ExprClass.Variable;
return this;
}
return null;
}
- override public Expression DoResolveLValue (ResolveContext ec, Expression right_side)
+ public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
+ if (ConditionalAccess)
+ throw new NotSupportedException ("null propagating operator assignment");
+
if (spec is FixedFieldSpec) {
// It could be much better error message but we want to be error compatible
Error_ValueAssignment (ec, right_side);
}
base.FlowAnalysis (fc);
+
+ if (conditional_access_receiver)
+ fc.ConditionalAccessEnd ();
}
public override int GetHashCode ()
ec.Emit (OpCodes.Ldsfld, spec);
} else {
- if (!prepared)
+ if (!prepared) {
+ if (conditional_access_receiver)
+ ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());
+
EmitInstance (ec, false);
+ }
// Optimization for build-in types
if (type.IsStruct && type == ec.CurrentType && InstanceExpression.Type == type) {
ec.Emit (OpCodes.Ldfld, spec);
}
}
+
+ if (conditional_access_receiver) {
+ ec.CloseConditionalAccess (type.IsNullableType && type != spec.MemberType ? type : null);
+ }
}
if (leave_copy) {
}
if (IsInstance) {
+ if (ConditionalAccess)
+ throw new NotImplementedException ("null operator assignment");
+
if (has_await_source)
source = source.EmitToField (ec);
public override Expression CreateExpressionTree (ResolveContext ec)
{
+ if (ConditionalAccess) {
+ Error_NullShortCircuitInsideExpressionTree (ec);
+ }
+
Arguments args;
if (IsSingleDimensionalArrayLength ()) {
args = new Arguments (1);
// Special case: length of single dimension array property is turned into ldlen
//
if (IsSingleDimensionalArrayLength ()) {
+ if (conditional_access_receiver) {
+ ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());
+ }
+
EmitInstance (ec, false);
+
ec.Emit (OpCodes.Ldlen);
ec.Emit (OpCodes.Conv_I4);
+
+ if (conditional_access_receiver) {
+ ec.CloseConditionalAccess (type);
+ }
+
return;
}
if (args == null)
call.InstanceExpressionOnStack = true;
- call.Emit (ec, Setter, args, loc);
+ if (ConditionalAccess) {
+ call.ConditionalAccess = true;
+ }
+
+ if (leave_copy)
+ call.Emit (ec, Setter, args, loc);
+ else
+ call.EmitStatement (ec, Setter, args, loc);
if (temp != null) {
temp.Emit (ec);
}
}
+ public override void FlowAnalysis (FlowAnalysisContext fc)
+ {
+ base.FlowAnalysis (fc);
+
+ if (conditional_access_receiver)
+ fc.ConditionalAccessEnd ();
+ }
+
protected override Expression OverloadResolve (ResolveContext rc, Expression right_side)
{
eclass = ExprClass.PropertyAccess;
protected override Expression DoResolve (ResolveContext ec)
{
if (eclass == ExprClass.Unresolved) {
+ ResolveConditionalAccessReceiver (ec);
+
var expr = OverloadResolve (ec, null);
if (expr == null)
return null;
if (expr != this)
return expr.Resolve (ec);
+
+ if (conditional_access_receiver) {
+ type = LiftMemberType (ec, type);
+ ec.With (ResolveContext.Options.ConditionalAccessReceiver, false);
+ }
}
if (!ResolveGetter (ec))
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
+ if (ConditionalAccess)
+ throw new NotSupportedException ("null propagating operator assignment");
+
if (right_side == EmptyExpression.OutAccess) {
// TODO: best_candidate can be null at this point
INamedBlockVariable variable = null;
return this;
}
+ void EmitConditionalAccess (EmitContext ec, ref CallEmitter call, MethodSpec method, Arguments arguments)
+ {
+ ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());
+
+ call.Emit (ec, method, arguments, loc);
+
+ ec.CloseConditionalAccess (method.ReturnType != type && type.IsNullableType ? type : null);
+ }
+
//
// Implements the IAssignMethod interface for assignments
//
public virtual void Emit (EmitContext ec, bool leave_copy)
{
var call = new CallEmitter ();
+ call.ConditionalAccess = ConditionalAccess;
call.InstanceExpression = InstanceExpression;
if (has_await_arguments)
call.HasAwaitArguments = true;
else
call.DuplicateArguments = emitting_compound_assignment;
- call.Emit (ec, Getter, Arguments, loc);
+ if (conditional_access_receiver)
+ EmitConditionalAccess (ec, ref call, Getter, Arguments);
+ else
+ call.Emit (ec, Getter, Arguments, loc);
if (call.HasAwaitArguments) {
InstanceExpression = call.InstanceExpression;
Arguments args = new Arguments (1);
args.Add (new Argument (source));
+ // TODO: Wrong, needs receiver
+// if (NullShortCircuit) {
+// ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());
+// }
+
var call = new CallEmitter ();
call.InstanceExpression = InstanceExpression;
- call.Emit (ec, op, args, loc);
+ call.ConditionalAccess = ConditionalAccess;
+ call.EmitStatement (ec, op, args, loc);
+
+// if (NullShortCircuit)
+// ec.CloseConditionalAccess (null);
}
#endregion
{
class EnumTypeExpr : TypeExpr
{
- public override TypeSpec ResolveAsType (IMemberContext ec)
+ public override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments)
{
type = ec.CurrentType;
eclass = ExprClass.Type;
if (expr is EnumConstant)
expr = ((EnumConstant) expr).Child;
- var underlying = ((Enum) Parent).UnderlyingType;
+ var en = (Enum)Parent;
+ var underlying = en.UnderlyingType;
if (expr != null) {
expr = expr.ImplicitConversionRequired (rc, underlying);
if (expr != null && !IsValidEnumType (expr.Type)) {
- Enum.Error_1008 (Location, Report);
+ en.Error_UnderlyingType (Location);
expr = null;
}
}
AddMember (em);
}
- public static void Error_1008 (Location loc, Report Report)
+ public void Error_UnderlyingType (Location loc)
{
Report.Error (1008, loc,
"Type byte, sbyte, short, ushort, int, uint, long or ulong expected");
protected override void DoDefineContainer ()
{
- ((EnumSpec) spec).UnderlyingType = underlying_type_expr == null ? Compiler.BuiltinTypes.Int : underlying_type_expr.Type;
+ TypeSpec ut;
+ if (underlying_type_expr != null) {
+ ut = underlying_type_expr.ResolveAsType (this);
+ if (!EnumSpec.IsValidUnderlyingType (ut)) {
+ Error_UnderlyingType (underlying_type_expr.Location);
+ ut = null;
+ }
+ } else {
+ ut = null;
+ }
+
+ if (ut == null)
+ ut = Compiler.BuiltinTypes.Int;
+
+ ((EnumSpec) spec).UnderlyingType = ut;
TypeBuilder.DefineField (UnderlyingValueField, UnderlyingType.GetMetaInfo (),
FieldAttributes.Public | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName);
if (current_container.Containers != null)
{
- var existing = current_container.Containers.FirstOrDefault (l => l.Basename == tc.Basename);
+ var existing = current_container.Containers.FirstOrDefault (l => l.MemberName.Basename == tc.MemberName.Basename);
if (existing != null) {
current_container.RemoveContainer (existing);
undo_actions.Add (() => current_container.AddTypeContainer (existing));
public override void Emit (EmitContext ec)
{
var call = new CallEmitter ();
- call.EmitPredefined (ec, oper, arguments, loc);
+ call.Emit (ec, oper, arguments, loc);
}
public override void FlowAnalysis (FlowAnalysisContext fc)
}
public override void FlowAnalysis (FlowAnalysisContext fc)
+ {
+ FlowAnalysis (fc, false);
+ }
+
+ public override void FlowAnalysisConditional (FlowAnalysisContext fc)
+ {
+ FlowAnalysis (fc, true);
+ }
+
+ void FlowAnalysis (FlowAnalysisContext fc, bool conditional)
{
if (Oper == Operator.AddressOf) {
var vr = Expr as VariableReference;
return;
}
- Expr.FlowAnalysis (fc);
+ if (Oper == Operator.LogicalNot && conditional) {
+ Expr.FlowAnalysisConditional (fc);
- if (Oper == Operator.LogicalNot) {
var temp = fc.DefiniteAssignmentOnTrue;
fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse;
fc.DefiniteAssignmentOnFalse = temp;
+ } else {
+ Expr.FlowAnalysis (fc);
}
}
return expr.ContainsEmitWithAwait ();
}
- protected override Expression DoResolve (ResolveContext ec)
+ protected Expression ResolveCommon (ResolveContext rc)
{
- probe_type_expr = ProbeType.ResolveAsType (ec);
- if (probe_type_expr == null)
- return null;
-
- expr = expr.Resolve (ec);
+ expr = expr.Resolve (rc);
if (expr == null)
return null;
+ ResolveProbeType (rc);
+ if (probe_type_expr == null)
+ return this;
+
if (probe_type_expr.IsStatic) {
- ec.Report.Error (7023, loc, "The second operand of `is' or `as' operator cannot be static type `{0}'",
+ rc.Report.Error (7023, loc, "The second operand of `is' or `as' operator cannot be static type `{0}'",
probe_type_expr.GetSignatureForError ());
return null;
}
if (expr.Type.IsPointer || probe_type_expr.IsPointer) {
- ec.Report.Error (244, loc, "The `{0}' operator cannot be applied to an operand of pointer type",
+ rc.Report.Error (244, loc, "The `{0}' operator cannot be applied to an operand of pointer type",
OperatorName);
return null;
}
if (expr.Type == InternalType.AnonymousMethod || expr.Type == InternalType.MethodGroup) {
- ec.Report.Error (837, loc, "The `{0}' operator cannot be applied to a lambda expression, anonymous method, or method group",
+ rc.Report.Error (837, loc, "The `{0}' operator cannot be applied to a lambda expression, anonymous method, or method group",
OperatorName);
return null;
}
return this;
}
+ protected virtual void ResolveProbeType (ResolveContext rc)
+ {
+ probe_type_expr = ProbeType.ResolveAsType (rc);
+ }
+
public override void EmitSideEffect (EmitContext ec)
{
expr.EmitSideEffect (ec);
public class Is : Probe
{
Nullable.Unwrap expr_unwrap;
+ MethodSpec number_mg;
+ Arguments number_args;
public Is (Expression expr, Expression probe_type, Location l)
: base (expr, probe_type, l)
get { return "is"; }
}
+ public LocalVariable Variable { get; set; }
+
public override Expression CreateExpressionTree (ResolveContext ec)
{
+ if (Variable != null)
+ throw new NotSupportedException ();
+
Arguments args = Arguments.CreateForExpressionTree (ec, null,
expr.CreateExpressionTree (ec),
new TypeOf (probe_type_expr, loc));
return CreateExpressionFactoryCall (ec, "TypeIs", args);
}
-
+
+ Expression CreateConstantResult (ResolveContext rc, bool result)
+ {
+ if (result)
+ rc.Report.Warning (183, 1, loc, "The given expression is always of the provided (`{0}') type",
+ probe_type_expr.GetSignatureForError ());
+ else
+ rc.Report.Warning (184, 1, loc, "The given expression is never of the provided (`{0}') type",
+ probe_type_expr.GetSignatureForError ());
+
+ var c = new BoolConstant (rc.BuiltinTypes, result, loc);
+ return expr.IsSideEffectFree ?
+ ReducedExpression.Create (c, this) :
+ new SideEffectConstant (c, this, loc);
+ }
+
public override void Emit (EmitContext ec)
{
+ if (probe_type_expr == null) {
+ if (ProbeType is WildcardPattern) {
+ expr.EmitSideEffect (ec);
+ ProbeType.Emit (ec);
+ } else {
+ EmitPatternMatch (ec);
+ }
+ return;
+ }
+
+ EmitLoad (ec);
+
+ if (expr_unwrap == null) {
+ ec.EmitNull ();
+ ec.Emit (OpCodes.Cgt_Un);
+ }
+ }
+
+ public override void EmitBranchable (EmitContext ec, Label target, bool on_true)
+ {
+ if (probe_type_expr == null) {
+ EmitPatternMatch (ec);
+ } else {
+ EmitLoad (ec);
+ }
+
+ ec.Emit (on_true ? OpCodes.Brtrue : OpCodes.Brfalse, target);
+ }
+
+ void EmitPatternMatch (EmitContext ec)
+ {
+ var no_match = ec.DefineLabel ();
+ var end = ec.DefineLabel ();
+
if (expr_unwrap != null) {
expr_unwrap.EmitCheck (ec);
+
+ if (ProbeType.IsNull) {
+ ec.EmitInt (0);
+ ec.Emit (OpCodes.Ceq);
+ return;
+ }
+
+ ec.Emit (OpCodes.Brfalse_S, no_match);
+ expr_unwrap.Emit (ec);
+ ProbeType.Emit (ec);
+ ec.Emit (OpCodes.Ceq);
+ ec.Emit (OpCodes.Br_S, end);
+ ec.MarkLabel (no_match);
+ ec.EmitInt (0);
+ ec.MarkLabel (end);
return;
}
- expr.Emit (ec);
+ if (number_args != null && number_args.Count == 3) {
+ var ce = new CallEmitter ();
+ ce.Emit (ec, number_mg, number_args, loc);
+ return;
+ }
+
+ var probe_type = ProbeType.Type;
+
+ Expr.Emit (ec);
+ ec.Emit (OpCodes.Isinst, probe_type);
+ ec.Emit (OpCodes.Dup);
+ ec.Emit (OpCodes.Brfalse, no_match);
- // Only to make verifier happy
- if (probe_type_expr.IsGenericParameter && TypeSpec.IsValueType (expr.Type))
- ec.Emit (OpCodes.Box, expr.Type);
+ bool complex_pattern = ProbeType is ComplexPatternExpression;
+ Label prev = ec.RecursivePatternLabel;
+ if (complex_pattern)
+ ec.RecursivePatternLabel = ec.DefineLabel ();
- ec.Emit (OpCodes.Isinst, probe_type_expr);
- ec.EmitNull ();
- ec.Emit (OpCodes.Cgt_Un);
+ if (number_mg != null) {
+ var ce = new CallEmitter ();
+ ce.Emit (ec, number_mg, number_args, loc);
+ } else {
+ if (TypeSpec.IsValueType (probe_type))
+ ec.Emit (OpCodes.Unbox_Any, probe_type);
+
+ ProbeType.Emit (ec);
+ if (complex_pattern) {
+ ec.EmitInt (1);
+ } else {
+ ec.Emit (OpCodes.Ceq);
+ }
+ }
+ ec.Emit (OpCodes.Br_S, end);
+ ec.MarkLabel (no_match);
+
+ ec.Emit (OpCodes.Pop);
+
+ if (complex_pattern)
+ ec.MarkLabel (ec.RecursivePatternLabel);
+
+ ec.RecursivePatternLabel = prev;
+
+ ec.EmitInt (0);
+ ec.MarkLabel (end);
}
- public override void EmitBranchable (EmitContext ec, Label target, bool on_true)
+ void EmitLoad (EmitContext ec)
{
+ Label no_value_label = new Label ();
+
if (expr_unwrap != null) {
expr_unwrap.EmitCheck (ec);
+
+ if (Variable == null)
+ return;
+
+ ec.Emit (OpCodes.Dup);
+ no_value_label = ec.DefineLabel ();
+ ec.Emit (OpCodes.Brfalse_S, no_value_label);
+ expr_unwrap.Emit (ec);
} else {
expr.Emit (ec);
+
+ // Only to make verifier happy
+ if (probe_type_expr.IsGenericParameter && TypeSpec.IsValueType (expr.Type))
+ ec.Emit (OpCodes.Box, expr.Type);
+
ec.Emit (OpCodes.Isinst, probe_type_expr);
- }
- ec.Emit (on_true ? OpCodes.Brtrue : OpCodes.Brfalse, target);
+ }
+
+ if (Variable != null) {
+ bool value_on_stack;
+ if (probe_type_expr.IsGenericParameter || probe_type_expr.IsNullableType) {
+ ec.Emit (OpCodes.Dup);
+ ec.Emit (OpCodes.Unbox_Any, probe_type_expr);
+ value_on_stack = true;
+ } else {
+ value_on_stack = false;
+ }
+
+ Variable.CreateBuilder (ec);
+ Variable.EmitAssign (ec);
+
+ if (expr_unwrap != null) {
+ ec.MarkLabel (no_value_label);
+ } else if (!value_on_stack) {
+ Variable.Emit (ec);
+ }
+ }
}
- Expression CreateConstantResult (ResolveContext rc, bool result)
+ protected override Expression DoResolve (ResolveContext rc)
{
- if (result)
- rc.Report.Warning (183, 1, loc, "The given expression is always of the provided (`{0}') type",
- probe_type_expr.GetSignatureForError ());
- else
- rc.Report.Warning (184, 1, loc, "The given expression is never of the provided (`{0}') type",
- probe_type_expr.GetSignatureForError ());
+ if (ResolveCommon (rc) == null)
+ return null;
- var c = new BoolConstant (rc.BuiltinTypes, result, loc);
- return expr.IsSideEffectFree ?
- ReducedExpression.Create (c, this) :
- new SideEffectConstant (c, this, loc);
+ type = rc.BuiltinTypes.Bool;
+ eclass = ExprClass.Value;
+
+ if (probe_type_expr == null)
+ return ResolveMatchingExpression (rc);
+
+ var res = ResolveResultExpression (rc);
+ if (Variable != null) {
+ if (res is Constant)
+ throw new NotImplementedException ("constant in type pattern matching");
+
+ Variable.Type = probe_type_expr;
+ var bc = rc as BlockContext;
+ if (bc != null)
+ Variable.PrepareAssignmentAnalysis (bc);
+ }
+
+ return res;
}
- protected override Expression DoResolve (ResolveContext ec)
+ public override void FlowAnalysis (FlowAnalysisContext fc)
{
- if (base.DoResolve (ec) == null)
- return null;
+ base.FlowAnalysis (fc);
+
+ if (Variable != null)
+ fc.SetVariableAssigned (Variable.VariableInfo, true);
+ }
+
+ protected override void ResolveProbeType (ResolveContext rc)
+ {
+ if (!(ProbeType is TypeExpr) && rc.Module.Compiler.Settings.Version == LanguageVersion.Experimental) {
+ if (ProbeType is PatternExpression) {
+ ProbeType.Resolve (rc);
+ return;
+ }
+
+ //
+ // Have to use session recording because we don't have reliable type probing
+ // mechanism (similar issue as in attributes resolving)
+ //
+ // TODO: This is still wrong because ResolveAsType can be destructive
+ //
+ var type_printer = new SessionReportPrinter ();
+ var prev_recorder = rc.Report.SetPrinter (type_printer);
+
+ probe_type_expr = ProbeType.ResolveAsType (rc);
+ type_printer.EndSession ();
+
+ if (probe_type_expr != null) {
+ type_printer.Merge (rc.Report.Printer);
+ rc.Report.SetPrinter (prev_recorder);
+ return;
+ }
+
+ var vexpr = ProbeType as VarExpr;
+ if (vexpr != null && vexpr.InferType (rc, expr)) {
+ probe_type_expr = vexpr.Type;
+ rc.Report.SetPrinter (prev_recorder);
+ return;
+ }
+
+ var expr_printer = new SessionReportPrinter ();
+ rc.Report.SetPrinter (expr_printer);
+ ProbeType = ProbeType.Resolve (rc);
+ expr_printer.EndSession ();
+
+ if (ProbeType != null) {
+ expr_printer.Merge (rc.Report.Printer);
+ } else {
+ type_printer.Merge (rc.Report.Printer);
+ }
+
+ rc.Report.SetPrinter (prev_recorder);
+ return;
+ }
+
+ base.ResolveProbeType (rc);
+ }
+
+ Expression ResolveMatchingExpression (ResolveContext rc)
+ {
+ var mc = ProbeType as Constant;
+ if (mc != null) {
+ if (!Convert.ImplicitConversionExists (rc, ProbeType, Expr.Type)) {
+ ProbeType.Error_ValueCannotBeConverted (rc, Expr.Type, false);
+ return null;
+ }
+
+ if (mc.IsNull)
+ return new Binary (Binary.Operator.Equality, Expr, mc).Resolve (rc);
+
+ var c = Expr as Constant;
+ if (c != null) {
+ c = ConstantFold.BinaryFold (rc, Binary.Operator.Equality, c, mc, loc);
+ if (c != null)
+ return c;
+ }
+
+ if (Expr.Type.IsNullableType) {
+ expr_unwrap = new Nullable.Unwrap (Expr);
+ expr_unwrap.Resolve (rc);
+ ProbeType = Convert.ImplicitConversion (rc, ProbeType, expr_unwrap.Type, loc);
+ } else if (ProbeType.Type == Expr.Type) {
+ // TODO: Better error handling
+ return new Binary (Binary.Operator.Equality, Expr, mc, loc).Resolve (rc);
+ } else if (ProbeType.Type.IsEnum || (ProbeType.Type.BuiltinType >= BuiltinTypeSpec.Type.Byte && ProbeType.Type.BuiltinType <= BuiltinTypeSpec.Type.Decimal)) {
+ var helper = rc.Module.CreatePatterMatchingHelper ();
+ number_mg = helper.NumberMatcher.Spec;
+
+ //
+ // There are actually 3 arguments but the first one is already on the stack
+ //
+ number_args = new Arguments (3);
+ if (!ProbeType.Type.IsEnum)
+ number_args.Add (new Argument (Expr));
+
+ number_args.Add (new Argument (Convert.ImplicitConversion (rc, ProbeType, rc.BuiltinTypes.Object, loc)));
+ number_args.Add (new Argument (new BoolLiteral (rc.BuiltinTypes, ProbeType.Type.IsEnum, loc)));
+ }
+
+ return this;
+ }
+
+ if (ProbeType is PatternExpression) {
+ if (!(ProbeType is WildcardPattern) && !Convert.ImplicitConversionExists (rc, ProbeType, Expr.Type)) {
+ ProbeType.Error_ValueCannotBeConverted (rc, Expr.Type, false);
+ }
+ return this;
+ }
+
+ // TODO: Better error message
+ rc.Report.Error (150, ProbeType.Location, "A constant value is expected");
+ return this;
+ }
+
+ Expression ResolveResultExpression (ResolveContext ec)
+ {
TypeSpec d = expr.Type;
bool d_is_nullable = false;
d_is_nullable = true;
}
}
-
- type = ec.BuiltinTypes.Bool;
- eclass = ExprClass.Value;
+
TypeSpec t = probe_type_expr;
bool t_is_nullable = false;
if (t.IsNullableType) {
// D and T are the same value types but D can be null
//
if (d_is_nullable && !t_is_nullable) {
- expr_unwrap = Nullable.Unwrap.Create (expr, false);
+ expr_unwrap = Nullable.Unwrap.Create (expr, true);
return this;
}
}
}
+ class WildcardPattern : PatternExpression
+ {
+ public WildcardPattern (Location loc)
+ : base (loc)
+ {
+ }
+
+ protected override Expression DoResolve (ResolveContext rc)
+ {
+ eclass = ExprClass.Value;
+ type = rc.BuiltinTypes.Object;
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ec.EmitInt (1);
+ }
+ }
+
+ class RecursivePattern : ComplexPatternExpression
+ {
+ MethodGroupExpr operator_mg;
+ Arguments operator_args;
+
+ public RecursivePattern (ATypeNameExpression typeExpresion, Arguments arguments, Location loc)
+ : base (typeExpresion, loc)
+ {
+ Arguments = arguments;
+ }
+
+ public Arguments Arguments { get; private set; }
+
+ protected override Expression DoResolve (ResolveContext rc)
+ {
+ type = TypeExpression.ResolveAsType (rc);
+ if (type == null)
+ return null;
+
+ var operators = MemberCache.GetUserOperator (type, Operator.OpType.Is, true);
+ if (operators == null) {
+ Error_TypeDoesNotContainDefinition (rc, type, Operator.GetName (Operator.OpType.Is) + " operator");
+ return null;
+ }
+
+ var ops = FindMatchingOverloads (operators);
+ if (ops == null) {
+ // TODO: better error message
+ Error_TypeDoesNotContainDefinition (rc, type, Operator.GetName (Operator.OpType.Is) + " operator");
+ return null;
+ }
+
+ bool dynamic_args;
+ Arguments.Resolve (rc, out dynamic_args);
+ if (dynamic_args)
+ throw new NotImplementedException ("dynamic argument");
+
+ var op = FindBestOverload (rc, ops);
+ if (op == null) {
+ // TODO: better error message
+ Error_TypeDoesNotContainDefinition (rc, type, Operator.GetName (Operator.OpType.Is) + " operator");
+ return null;
+ }
+
+ var op_types = op.Parameters.Types;
+ operator_args = new Arguments (op_types.Length);
+ operator_args.Add (new Argument (new EmptyExpression (type)));
+
+ for (int i = 0; i < Arguments.Count; ++i) {
+ // TODO: Needs releasing optimization
+ var lt = new LocalTemporary (op_types [i + 1]);
+ operator_args.Add (new Argument (lt, Argument.AType.Out));
+
+ if (comparisons == null)
+ comparisons = new Expression[Arguments.Count];
+
+ int arg_comp_index;
+ Expression expr;
+
+ var arg = Arguments [i];
+ var named = arg as NamedArgument;
+ if (named != null) {
+ arg_comp_index = op.Parameters.GetParameterIndexByName (named.Name) - 1;
+ expr = Arguments [arg_comp_index].Expr;
+ } else {
+ arg_comp_index = i;
+ expr = arg.Expr;
+ }
+
+ comparisons [arg_comp_index] = ResolveComparison (rc, expr, lt);
+ }
+
+ operator_mg = MethodGroupExpr.CreatePredefined (op, type, loc);
+
+ eclass = ExprClass.Value;
+ return this;
+ }
+
+ List<MethodSpec> FindMatchingOverloads (IList<MemberSpec> members)
+ {
+ int arg_count = Arguments.Count + 1;
+ List<MethodSpec> best = null;
+ foreach (MethodSpec method in members) {
+ var pm = method.Parameters;
+ if (pm.Count != arg_count)
+ continue;
+
+ // TODO: Needs more thorough operator checks elsewhere to avoid doing this every time
+ bool ok = true;
+ for (int ii = 1; ii < pm.Count; ++ii) {
+ if ((pm.FixedParameters [ii].ModFlags & Parameter.Modifier.OUT) == 0) {
+ ok = false;
+ break;
+ }
+ }
+
+ if (!ok)
+ continue;
+
+ if (best == null)
+ best = new List<MethodSpec> ();
+
+ best.Add (method);
+ }
+
+ return best;
+ }
+
+ MethodSpec FindBestOverload (ResolveContext rc, List<MethodSpec> methods)
+ {
+ for (int ii = 0; ii < Arguments.Count; ++ii) {
+ var arg = Arguments [ii];
+ var expr = arg.Expr;
+ if (expr is WildcardPattern)
+ continue;
+
+ var na = arg as NamedArgument;
+ for (int i = 0; i < methods.Count; ++i) {
+ var pd = methods [i].Parameters;
+
+ int index;
+ if (na != null) {
+ index = pd.GetParameterIndexByName (na.Name);
+ if (index < 1) {
+ methods.RemoveAt (i--);
+ continue;
+ }
+ } else {
+ index = ii + 1;
+ }
+
+ var m = pd.Types [index];
+ if (!Convert.ImplicitConversionExists (rc, expr, m))
+ methods.RemoveAt (i--);
+ }
+ }
+
+ if (methods.Count != 1)
+ return null;
+
+ return methods [0];
+ }
+
+ public override void EmitBranchable (EmitContext ec, Label target, bool on_true)
+ {
+ operator_mg.EmitCall (ec, operator_args, false);
+ ec.Emit (OpCodes.Brfalse, target);
+
+ base.EmitBranchable (ec, target, on_true);
+ }
+
+ static Expression ResolveComparison (ResolveContext rc, Expression expr, LocalTemporary lt)
+ {
+ if (expr is WildcardPattern)
+ return new EmptyExpression (expr.Type);
+
+ var recursive = expr as RecursivePattern;
+ expr = Convert.ImplicitConversionRequired (rc, expr, lt.Type, expr.Location);
+ if (expr == null)
+ return null;
+
+ if (recursive != null) {
+ recursive.SetParentInstance (lt);
+ return expr;
+ }
+
+ // TODO: Better error handling
+ return new Binary (Binary.Operator.Equality, lt, expr, expr.Location).Resolve (rc);
+ }
+
+ public void SetParentInstance (Expression instance)
+ {
+ operator_args [0] = new Argument (instance);
+ }
+ }
+
+ class PropertyPattern : ComplexPatternExpression
+ {
+ LocalTemporary instance;
+
+ public PropertyPattern (ATypeNameExpression typeExpresion, List<PropertyPatternMember> members, Location loc)
+ : base (typeExpresion, loc)
+ {
+ Members = members;
+ }
+
+ public List<PropertyPatternMember> Members { get; private set; }
+
+ protected override Expression DoResolve (ResolveContext rc)
+ {
+ type = TypeExpression.ResolveAsType (rc);
+ if (type == null)
+ return null;
+
+ comparisons = new Expression[Members.Count];
+
+ // TODO: optimize when source is VariableReference, it'd save dup+pop
+ instance = new LocalTemporary (type);
+
+ for (int i = 0; i < Members.Count; i++) {
+ var lookup = Members [i];
+
+ var member = MemberLookup (rc, false, type, lookup.Name, 0, Expression.MemberLookupRestrictions.ExactArity, loc);
+ if (member == null) {
+ member = MemberLookup (rc, true, type, lookup.Name, 0, Expression.MemberLookupRestrictions.ExactArity, loc);
+ if (member != null) {
+ Expression.ErrorIsInaccesible (rc, member.GetSignatureForError (), loc);
+ continue;
+ }
+ }
+
+ if (member == null) {
+ Expression.Error_TypeDoesNotContainDefinition (rc, Location, Type, lookup.Name);
+ continue;
+ }
+
+ var pe = member as PropertyExpr;
+ if (pe == null || member is FieldExpr) {
+ rc.Report.Error (-2001, lookup.Location, "`{0}' is not a valid pattern member", lookup.Name);
+ continue;
+ }
+
+ // TODO: Obsolete checks
+ // TODO: check accessibility
+ if (pe != null && !pe.PropertyInfo.HasGet) {
+ rc.Report.Error (-2002, lookup.Location, "Property `{0}.get' accessor is required", pe.GetSignatureForError ());
+ continue;
+ }
+
+ var expr = lookup.Expr.Resolve (rc);
+ if (expr == null)
+ continue;
+
+ var me = (MemberExpr)member;
+ me.InstanceExpression = instance;
+
+ comparisons [i] = ResolveComparison (rc, expr, me);
+ }
+
+ eclass = ExprClass.Value;
+ return this;
+ }
+
+ static Expression ResolveComparison (ResolveContext rc, Expression expr, Expression instance)
+ {
+ if (expr is WildcardPattern)
+ return new EmptyExpression (expr.Type);
+
+ return new Is (instance, expr, expr.Location).Resolve (rc);
+ }
+
+ public override void EmitBranchable (EmitContext ec, Label target, bool on_true)
+ {
+ instance.Store (ec);
+
+ base.EmitBranchable (ec, target, on_true);
+ }
+ }
+
+ class PropertyPatternMember
+ {
+ public PropertyPatternMember (string name, Expression expr, Location loc)
+ {
+ Name = name;
+ Expr = expr;
+ Location = loc;
+ }
+
+ public string Name { get; private set; }
+ public Expression Expr { get; private set; }
+ public Location Location { get; private set; }
+ }
+
+ abstract class PatternExpression : Expression
+ {
+ protected PatternExpression (Location loc)
+ {
+ this.loc = loc;
+ }
+
+ public override Expression CreateExpressionTree (ResolveContext ec)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ abstract class ComplexPatternExpression : PatternExpression
+ {
+ protected Expression[] comparisons;
+
+ protected ComplexPatternExpression (ATypeNameExpression typeExpresion, Location loc)
+ : base (loc)
+ {
+ TypeExpression = typeExpresion;
+ }
+
+ public ATypeNameExpression TypeExpression { get; private set; }
+
+ public override void Emit (EmitContext ec)
+ {
+ EmitBranchable (ec, ec.RecursivePatternLabel, false);
+ }
+
+ public override void EmitBranchable (EmitContext ec, Label target, bool on_true)
+ {
+ if (comparisons != null) {
+ foreach (var comp in comparisons) {
+ comp.EmitBranchable (ec, target, false);
+ }
+ }
+ }
+ }
+
/// <summary>
/// Implementation of the `as' operator.
/// </summary>
public class As : Probe {
- Expression resolved_type;
-
+
public As (Expression expr, Expression probe_type, Location l)
: base (expr, probe_type, l)
{
protected override Expression DoResolve (ResolveContext ec)
{
- if (resolved_type == null) {
- resolved_type = base.DoResolve (ec);
-
- if (resolved_type == null)
- return null;
- }
+ if (ResolveCommon (ec) == null)
+ return null;
type = probe_type_expr;
eclass = ExprClass.Value;
return expr;
}
}
+
+ public class DeclarationExpression : Expression, IMemoryLocation
+ {
+ LocalVariableReference lvr;
+
+ public DeclarationExpression (FullNamedExpression variableType, LocalVariable variable)
+ {
+ VariableType = variableType;
+ Variable = variable;
+ this.loc = variable.Location;
+ }
+
+ public LocalVariable Variable { get; set; }
+ public Expression Initializer { get; set; }
+ public FullNamedExpression VariableType { get; set; }
+
+ public void AddressOf (EmitContext ec, AddressOp mode)
+ {
+ Variable.CreateBuilder (ec);
+
+ if (Initializer != null) {
+ lvr.EmitAssign (ec, Initializer, false, false);
+ }
+
+ lvr.AddressOf (ec, mode);
+ }
+
+ protected override void CloneTo (CloneContext clonectx, Expression t)
+ {
+ var target = (DeclarationExpression) t;
+
+ target.VariableType = (FullNamedExpression) VariableType.Clone (clonectx);
+
+ if (Initializer != null)
+ target.Initializer = Initializer.Clone (clonectx);
+ }
+
+ public override Expression CreateExpressionTree (ResolveContext rc)
+ {
+ rc.Report.Error (8046, loc, "An expression tree cannot contain a declaration expression");
+ return null;
+ }
+
+ bool DoResolveCommon (ResolveContext rc)
+ {
+ var var_expr = VariableType as VarExpr;
+ if (var_expr != null) {
+ type = InternalType.VarOutType;
+ } else {
+ type = VariableType.ResolveAsType (rc);
+ if (type == null)
+ return false;
+ }
+
+ if (Initializer != null) {
+ Initializer = Initializer.Resolve (rc);
+
+ if (var_expr != null && Initializer != null && var_expr.InferType (rc, Initializer)) {
+ type = var_expr.Type;
+ }
+ }
+
+ Variable.Type = type;
+ lvr = new LocalVariableReference (Variable, loc);
+
+ eclass = ExprClass.Variable;
+ return true;
+ }
+
+ protected override Expression DoResolve (ResolveContext rc)
+ {
+ if (DoResolveCommon (rc))
+ lvr.Resolve (rc);
+
+ return this;
+ }
+
+ public override Expression DoResolveLValue (ResolveContext rc, Expression right_side)
+ {
+ if (lvr == null && DoResolveCommon (rc))
+ lvr.ResolveLValue (rc, right_side);
+
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ throw new NotImplementedException ();
+ }
+ }
//
// C# 2.0 Default value expression
}
public Binary (Operator oper, Expression left, Expression right)
+ : this (oper, left, right, left.Location)
+ {
+ }
+
+ public Binary (Operator oper, Expression left, Expression right, Location loc)
{
this.oper = oper;
this.left = left;
this.right = right;
- this.loc = left.Location;
+ this.loc = loc;
}
#region Properties
public override void FlowAnalysis (FlowAnalysisContext fc)
{
+ //
+ // Optimized version when on-true/on-false data are not needed
+ //
if ((oper & Operator.LogicalMask) == 0) {
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
left.FlowAnalysis (fc);
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
right.FlowAnalysis (fc);
return;
}
- //
- // Optimized version when on-true/on-false data are not needed
- //
- bool set_on_true_false;
- if (fc.DefiniteAssignmentOnTrue == null && fc.DefiniteAssignmentOnFalse == null) {
- fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignment;
- set_on_true_false = false;
- } else {
- set_on_true_false = true;
- }
-
- left.FlowAnalysis (fc);
- var left_fc = fc.DefiniteAssignment;
+ left.FlowAnalysisConditional (fc);
var left_fc_ontrue = fc.DefiniteAssignmentOnTrue;
var left_fc_onfalse = fc.DefiniteAssignmentOnFalse;
fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment = new DefiniteAssignmentBitSet (
oper == Operator.LogicalOr ? left_fc_onfalse : left_fc_ontrue);
- right.FlowAnalysis (fc);
- fc.DefiniteAssignment = left_fc;
+ right.FlowAnalysisConditional (fc);
+
+ if (oper == Operator.LogicalOr)
+ fc.DefiniteAssignment = (left_fc_onfalse | (fc.DefiniteAssignmentOnFalse & fc.DefiniteAssignmentOnTrue)) & left_fc_ontrue;
+ else
+ fc.DefiniteAssignment = (left_fc_ontrue | (fc.DefiniteAssignmentOnFalse & fc.DefiniteAssignmentOnTrue)) & left_fc_onfalse;
+ }
- if (!set_on_true_false) {
- fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignmentOnTrue = null;
+ public override void FlowAnalysisConditional (FlowAnalysisContext fc)
+ {
+ if ((oper & Operator.LogicalMask) == 0) {
+ base.FlowAnalysisConditional (fc);
return;
}
+ left.FlowAnalysisConditional (fc);
+ var left_fc_ontrue = fc.DefiniteAssignmentOnTrue;
+ var left_fc_onfalse = fc.DefiniteAssignmentOnFalse;
+
+ fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment = new DefiniteAssignmentBitSet (
+ oper == Operator.LogicalOr ? left_fc_onfalse : left_fc_ontrue);
+ right.FlowAnalysisConditional (fc);
+
+ var lc = left as Constant;
if (oper == Operator.LogicalOr) {
- fc.DefiniteAssignmentOnTrue = new DefiniteAssignmentBitSet (left_fc_ontrue);
fc.DefiniteAssignmentOnFalse = left_fc_onfalse | fc.DefiniteAssignmentOnFalse;
+ if (lc != null && lc.IsDefaultValue)
+ fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse;
+ else
+ fc.DefiniteAssignmentOnTrue = new DefiniteAssignmentBitSet (left_fc_ontrue & (left_fc_onfalse | fc.DefiniteAssignmentOnTrue));
} else {
fc.DefiniteAssignmentOnTrue = left_fc_ontrue | fc.DefiniteAssignmentOnTrue;
- fc.DefiniteAssignmentOnFalse = new DefiniteAssignmentBitSet (left_fc_onfalse);
+ if (lc != null && !lc.IsDefaultValue)
+ fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignmentOnTrue;
+ else
+ fc.DefiniteAssignmentOnFalse = new DefiniteAssignmentBitSet ((left_fc_ontrue | fc.DefiniteAssignmentOnFalse) & left_fc_onfalse);
}
}
return lifted.Resolve (rc);
}
} else if (rtype.IsNullableType && Nullable.NullableInfo.GetUnderlyingType (rtype).IsEnum) {
- if (left.IsNull) {
+ Nullable.Unwrap unwrap = null;
+ if (left.IsNull || right.IsNull) {
if (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion))
left = Convert.ImplicitConversion (rc, left, rtype, left.Location);
if ((oper & Operator.BitwiseMask) != 0)
return Nullable.LiftedNull.CreateFromExpression (rc, this);
+ if (right.IsNull)
+ return CreateLiftedValueTypeResult (rc, left.Type);
+
// Equality operators are valid between E? and null
expr = left;
+ unwrap = new Nullable.Unwrap (right);
} else {
expr = Convert.ImplicitConversion (rc, left, Nullable.NullableInfo.GetUnderlyingType (rtype), loc);
if (expr == null)
var lifted = new Nullable.LiftedBinaryOperator (this);
lifted.Left = expr;
lifted.Right = right;
+ lifted.UnwrapRight = unwrap;
return lifted.Resolve (rc);
}
} else if (ltype.IsNullableType && Nullable.NullableInfo.GetUnderlyingType (ltype).IsEnum) {
- if (right.IsNull) {
+ Nullable.Unwrap unwrap = null;
+ if (right.IsNull || left.IsNull) {
if (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion))
right = Convert.ImplicitConversion (rc, right, ltype, right.Location);
if ((oper & Operator.BitwiseMask) != 0)
return Nullable.LiftedNull.CreateFromExpression (rc, this);
+ if (left.IsNull)
+ return CreateLiftedValueTypeResult (rc, right.Type);
+
// Equality operators are valid between E? and null
expr = right;
+ unwrap = new Nullable.Unwrap (left);
} else {
expr = Convert.ImplicitConversion (rc, right, Nullable.NullableInfo.GetUnderlyingType (ltype), loc);
if (expr == null)
if (expr != null) {
var lifted = new Nullable.LiftedBinaryOperator (this);
lifted.Left = left;
+ lifted.UnwrapLeft = unwrap;
lifted.Right = expr;
return lifted.Resolve (rc);
}
var ptypes = best_original.Parameters.Types;
if (left.IsNull || right.IsNull) {
+ //
+ // The lifted operator produces a null value if one or both operands are null
+ //
+ if ((oper & (Operator.ArithmeticMask | Operator.ShiftMask | Operator.BitwiseMask)) != 0) {
+ type = oper_method.ReturnType;
+ return Nullable.LiftedNull.CreateFromExpression (rc, this);
+ }
+
//
// The lifted operator produces the value false if one or both operands are null for
// relational operators.
//
- if ((oper & Operator.ComparisonMask) != 0) {
+ if ((oper & Operator.RelationalMask) != 0) {
//
// CSC BUG: This should be different warning, csc reports CS0458 with bool? which is wrong
// because return type is actually bool
//
- // For some reason CSC does not report this warning for equality operators
- //
return CreateLiftedValueTypeResult (rc, left.IsNull ? ptypes [1] : ptypes [0]);
}
- // The lifted operator produces a null value if one or both operands are null
- //
- if ((oper & (Operator.ArithmeticMask | Operator.ShiftMask | Operator.BitwiseMask)) != 0) {
- type = oper_method.ReturnType;
- return Nullable.LiftedNull.CreateFromExpression (rc, this);
+ if ((oper & Operator.EqualityMask) != 0 && ((left.IsNull && !right.Type.IsNullableType) || !left.Type.IsNullableType)) {
+ return CreateLiftedValueTypeResult (rc, left.IsNull ? ptypes [1] : ptypes [0]);
}
}
var method = res.ResolveMember<MethodSpec> (new ResolveContext (ec.MemberContext), ref arguments);
if (method != null) {
var call = new CallEmitter ();
- call.EmitPredefined (ec, method, arguments);
+ call.EmitPredefined (ec, method, arguments, false);
}
}
public override void FlowAnalysis (FlowAnalysisContext fc)
{
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
-
- expr.FlowAnalysis (fc);
- var da_true = fc.DefiniteAssignmentOnTrue;
- var da_false = fc.DefiniteAssignmentOnFalse;
+ expr.FlowAnalysisConditional (fc);
+ var expr_true = fc.DefiniteAssignmentOnTrue;
+ var expr_false = fc.DefiniteAssignmentOnFalse;
- fc.DefiniteAssignment = new DefiniteAssignmentBitSet (da_true);
+ fc.DefiniteAssignment = new DefiniteAssignmentBitSet (expr_true);
true_expr.FlowAnalysis (fc);
var true_fc = fc.DefiniteAssignment;
- fc.DefiniteAssignment = new DefiniteAssignmentBitSet (da_false);
+ fc.DefiniteAssignment = new DefiniteAssignmentBitSet (expr_false);
false_expr.FlowAnalysis (fc);
fc.DefiniteAssignment &= true_fc;
- if (fc.DefiniteAssignmentOnTrue != null)
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignment;
- if (fc.DefiniteAssignmentOnFalse != null)
- fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
+ }
+
+ public override void FlowAnalysisConditional (FlowAnalysisContext fc)
+ {
+ expr.FlowAnalysisConditional (fc);
+ var expr_true = fc.DefiniteAssignmentOnTrue;
+ var expr_false = fc.DefiniteAssignmentOnFalse;
+
+ fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment = new DefiniteAssignmentBitSet (expr_true);
+ true_expr.FlowAnalysisConditional (fc);
+ var true_fc = fc.DefiniteAssignment;
+ var true_da_true = fc.DefiniteAssignmentOnTrue;
+ var true_da_false = fc.DefiniteAssignmentOnFalse;
+
+ fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment = new DefiniteAssignmentBitSet (expr_false);
+ false_expr.FlowAnalysisConditional (fc);
+
+ fc.DefiniteAssignment &= true_fc;
+ fc.DefiniteAssignmentOnTrue = true_da_true & fc.DefiniteAssignmentOnTrue;
+ fc.DefiniteAssignmentOnFalse = true_da_false & fc.DefiniteAssignmentOnFalse;
}
protected override void CloneTo (CloneContext clonectx, Expression t)
void DoResolveBase (ResolveContext ec)
{
+ eclass = ExprClass.Variable;
+ type = local_info.Type;
+
//
// If we are referencing a variable from the external block
// flag it for capturing
storey.CaptureLocalVariable (ec, local_info);
}
}
-
- eclass = ExprClass.Variable;
- type = local_info.Type;
}
protected override Expression DoResolve (ResolveContext ec)
{
local_info.SetIsUsed ();
- DoResolveBase (ec);
+ DoResolveBase (ec);
+
+ if (local_info.Type == InternalType.VarOutType) {
+ ec.Report.Error (8048, loc, "Cannot use uninitialized variable `{0}'",
+ GetSignatureForError ());
+
+ type = InternalType.ErrorType;
+ }
+
return this;
}
fc.SetVariableAssigned (variable_info);
}
}
-
+
/// <summary>
/// Invocation of methods or delegates.
/// </summary>
protected Arguments arguments;
protected Expression expr;
protected MethodGroupExpr mg;
+ bool conditional_access_receiver;
public Invocation (Expression expr, Arguments arguments)
{
return CreateExpressionFactoryCall (ec, "Call", args);
}
- protected override Expression DoResolve (ResolveContext ec)
+ protected override Expression DoResolve (ResolveContext rc)
+ {
+ if (!rc.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {
+ if (expr.HasConditionalAccess ()) {
+ conditional_access_receiver = true;
+ using (rc.Set (ResolveContext.Options.ConditionalAccessReceiver)) {
+ return DoResolveInvocation (rc);
+ }
+ }
+ }
+
+ return DoResolveInvocation (rc);
+ }
+
+ Expression DoResolveInvocation (ResolveContext ec)
{
Expression member_expr;
var atn = expr as ATypeNameExpression;
if (atn != null) {
member_expr = atn.LookupNameExpression (ec, MemberLookupRestrictions.InvocableOnly | MemberLookupRestrictions.ReadAccess);
- if (member_expr != null)
+ if (member_expr != null) {
+ var name_of = member_expr as NameOf;
+ if (name_of != null) {
+ return name_of.ResolveOverload (ec, arguments);
+ }
+
member_expr = member_expr.Resolve (ec);
+ }
} else {
member_expr = expr.Resolve (ec);
}
if (mg == null) {
if (expr_type != null && expr_type.IsDelegate) {
- invoke = new DelegateInvocation (member_expr, arguments, loc);
+ invoke = new DelegateInvocation (member_expr, arguments, conditional_access_receiver, loc);
invoke = invoke.Resolve (ec);
if (invoke == null || !dynamic_arg)
return invoke;
var method = mg.BestCandidate;
type = mg.BestCandidateReturnType;
-
+ if (conditional_access_receiver)
+ type = LiftMemberType (ec, type);
+
if (arguments == null && method.DeclaringType.BuiltinType == BuiltinTypeSpec.Type.Object && method.Name == Destructor.MetadataName) {
if (mg.IsBase)
ec.Report.Error (250, loc, "Do not directly call your base class Finalize method. It is called automatically from your destructor");
if (mg.IsConditionallyExcluded)
return;
- mg.FlowAnalysis (fc);
+ mg.FlowAnalysis (fc);
if (arguments != null)
arguments.FlowAnalysis (fc);
+
+ if (conditional_access_receiver)
+ fc.ConditionalAccessEnd ();
}
public override string GetSignatureForError ()
return mg.GetSignatureForError ();
}
+ public override bool HasConditionalAccess ()
+ {
+ return expr.HasConditionalAccess ();
+ }
+
//
// If a member is a method or event, or if it is a constant, field or property of either a delegate type
// or the type dynamic, then the member is invocable
if (mg.IsConditionallyExcluded)
return;
- mg.EmitCall (ec, arguments);
+ if (conditional_access_receiver)
+ mg.EmitCall (ec, arguments, type, false);
+ else
+ mg.EmitCall (ec, arguments, false);
}
public override void EmitStatement (EmitContext ec)
{
- Emit (ec);
+ if (mg.IsConditionallyExcluded)
+ return;
- //
- // Pop the return value if there is one
- //
- if (type.Kind != MemberKind.Void)
- ec.Emit (OpCodes.Pop);
+ if (conditional_access_receiver)
+ mg.EmitCall (ec, arguments, type, true);
+ else
+ mg.EmitCall (ec, arguments, true);
}
public override SLE.Expression MakeExpression (BuilderContext ctx)
return null;
}
- //
- // Any struct always defines parameterless constructor
- //
- if (type.IsStruct && arguments == null)
- return this;
-
bool dynamic;
if (arguments != null) {
arguments.Resolve (ec, out dynamic);
return this;
}
- bool DoEmitTypeParameter (EmitContext ec)
+ void DoEmitTypeParameter (EmitContext ec)
{
var m = ec.Module.PredefinedMembers.ActivatorCreateInstance.Resolve (loc);
if (m == null)
- return true;
+ return;
var ctor_factory = m.MakeGenericMethod (ec.MemberContext, type);
- var tparam = (TypeParameterSpec) type;
-
- if (tparam.IsReferenceType) {
- ec.Emit (OpCodes.Call, ctor_factory);
- return true;
- }
-
- // Allow DoEmit() to be called multiple times.
- // We need to create a new LocalTemporary each time since
- // you can't share LocalBuilders among ILGeneators.
- LocalTemporary temp = new LocalTemporary (type);
-
- Label label_activator = ec.DefineLabel ();
- Label label_end = ec.DefineLabel ();
-
- temp.AddressOf (ec, AddressOp.Store);
- ec.Emit (OpCodes.Initobj, type);
-
- temp.Emit (ec);
- ec.Emit (OpCodes.Box, type);
- ec.Emit (OpCodes.Brfalse, label_activator);
-
- temp.AddressOf (ec, AddressOp.Store);
- ec.Emit (OpCodes.Initobj, type);
- temp.Emit (ec);
- temp.Release (ec);
- ec.Emit (OpCodes.Br_S, label_end);
-
- ec.MarkLabel (label_activator);
-
ec.Emit (OpCodes.Call, ctor_factory);
- ec.MarkLabel (label_end);
- return true;
}
//
//
public virtual bool Emit (EmitContext ec, IMemoryLocation target)
{
- bool is_value_type = TypeSpec.IsValueType (type);
+ bool is_value_type = type.IsStructOrEnum;
VariableReference vr = target as VariableReference;
if (target != null && is_value_type && (vr != null || method == null)) {
}
}
- if (type is TypeParameterSpec)
- return DoEmitTypeParameter (ec);
+ if (type is TypeParameterSpec) {
+ DoEmitTypeParameter (ec);
+ return true;
+ }
ec.MarkCallEntry (loc);
ec.Emit (OpCodes.Newobj, method);
public override void Emit (EmitContext ec)
{
LocalTemporary v = null;
- if (method == null && TypeSpec.IsValueType (type)) {
+ if (method == null && type.IsStructOrEnum) {
// TODO: Use temporary variable from pool
v = new LocalTemporary (type);
}
// Pointer types are allowed without explicit unsafe, they are just tokens
//
using (ec.Set (ResolveContext.Options.UnsafeScope)) {
- typearg = QueriedType.ResolveAsType (ec);
+ typearg = QueriedType.ResolveAsType (ec, true);
}
if (typearg == null)
}
}
- public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext ec)
+ public FullNamedExpression CreateExpressionFromAlias (IMemberContext mc)
{
- if (alias == GlobalAlias) {
- expr = new NamespaceExpression (ec.Module.GlobalRootNamespace, loc);
- return base.ResolveAsTypeOrNamespace (ec);
- }
+ if (alias == GlobalAlias)
+ return new NamespaceExpression (mc.Module.GlobalRootNamespace, loc);
- int errors = ec.Module.Compiler.Report.Errors;
- expr = ec.LookupNamespaceAlias (alias);
+ int errors = mc.Module.Compiler.Report.Errors;
+ var expr = mc.LookupNamespaceAlias (alias);
if (expr == null) {
- if (errors == ec.Module.Compiler.Report.Errors)
- ec.Module.Compiler.Report.Error (432, loc, "Alias `{0}' not found", alias);
+ if (errors == mc.Module.Compiler.Report.Errors)
+ mc.Module.Compiler.Report.Error (432, loc, "Alias `{0}' not found", alias);
+
return null;
}
-
- return base.ResolveAsTypeOrNamespace (ec);
+
+ return expr;
}
- protected override Expression DoResolve (ResolveContext ec)
+ public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)
+ {
+ expr = CreateExpressionFromAlias (mc);
+ if (expr == null)
+ return null;
+
+ return base.ResolveAsTypeOrNamespace (mc, allowUnboundTypeArguments);
+ }
+
+ protected override Expression DoResolve (ResolveContext rc)
{
- return ResolveAsTypeOrNamespace (ec);
+ return ResolveAsTypeOrNamespace (rc, false);
}
public override string GetSignatureForError ()
return alias + "::" + name;
}
+ public override bool HasConditionalAccess ()
+ {
+ return false;
+ }
+
public override Expression LookupNameExpression (ResolveContext rc, MemberLookupRestrictions restrictions)
{
if ((restrictions & MemberLookupRestrictions.InvocableOnly) != 0) {
expr.Error_OperatorCannotBeApplied (rc, loc, ".", type);
}
+ public override bool HasConditionalAccess ()
+ {
+ return LeftExpression.HasConditionalAccess ();
+ }
+
public static bool IsValidDotExpression (TypeSpec type)
{
const MemberKind dot_kinds = MemberKind.Class | MemberKind.Struct | MemberKind.Delegate | MemberKind.Enum |
expr = null;
}
} else {
- expr = expr.Resolve (rc, flags);
+ using (rc.Set (ResolveContext.Options.ConditionalAccessReceiver)) {
+ expr = expr.Resolve (rc, flags);
+ }
}
if (expr == null)
return new DynamicMemberBinder (Name, args, loc);
}
+ var cma = this as ConditionalMemberAccess;
+ if (cma != null) {
+ if (!IsNullPropagatingValid (expr.Type)) {
+ expr.Error_OperatorCannotBeApplied (rc, loc, "?", expr.Type);
+ return null;
+ }
+
+ if (expr_type.IsNullableType) {
+ expr = Nullable.Unwrap.Create (expr, true).Resolve (rc);
+ expr_type = expr.Type;
+ }
+ }
+
if (!IsValidDotExpression (expr_type)) {
Error_OperatorCannotBeApplied (rc, expr_type);
return null;
emg.SetTypeArguments (rc, targs);
}
+ if (cma != null)
+ emg.ConditionalAccess = true;
+
// TODO: it should really skip the checks bellow
return emg.Resolve (rc);
}
sn = null;
}
+ if (cma != null) {
+ me.ConditionalAccess = true;
+ }
+
me = me.ResolveMemberAccess (rc, expr, sn);
if (Arity > 0) {
return me;
}
- public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext rc)
+ public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext rc, bool allowUnboundTypeArguments)
{
FullNamedExpression fexpr = expr as FullNamedExpression;
if (fexpr == null) {
return null;
}
- FullNamedExpression expr_resolved = fexpr.ResolveAsTypeOrNamespace (rc);
+ FullNamedExpression expr_resolved = fexpr.ResolveAsTypeOrNamespace (rc, allowUnboundTypeArguments);
if (expr_resolved == null)
return null;
if (retval == null) {
ns.Error_NamespaceDoesNotExist (rc, Name, Arity);
- } else if (HasTypeArguments) {
- retval = new GenericTypeExpr (retval.Type, targs, loc);
- if (retval.ResolveAsType (rc) == null)
- return null;
+ } else if (Arity > 0) {
+ if (HasTypeArguments) {
+ retval = new GenericTypeExpr (retval.Type, targs, loc);
+ if (retval.ResolveAsType (rc) == null)
+ return null;
+ } else {
+ if (!allowUnboundTypeArguments)
+ Error_OpenGenericTypeIsNotAllowed (rc);
+
+ retval = new GenericOpenTypeExpr (retval.Type, loc);
+ }
}
return retval;
nested = MemberCache.FindNestedType (expr_type, Name, Arity);
if (nested == null) {
if (expr_type == tnew_expr) {
- Error_IdentifierNotFound (rc, expr_type, Name);
+ Error_IdentifierNotFound (rc, expr_type);
return null;
}
if (HasTypeArguments) {
texpr = new GenericTypeExpr (nested, targs, loc);
} else {
+ if (!allowUnboundTypeArguments || expr_resolved is GenericTypeExpr) // && HasTypeArguments
+ Error_OpenGenericTypeIsNotAllowed (rc);
+
texpr = new GenericOpenTypeExpr (nested, loc);
}
} else if (expr_resolved is GenericOpenTypeExpr) {
return texpr;
}
- protected virtual void Error_IdentifierNotFound (IMemberContext rc, TypeSpec expr_type, string identifier)
+ public void Error_IdentifierNotFound (IMemberContext rc, TypeSpec expr_type)
{
var nested = MemberCache.FindNestedType (expr_type, Name, -System.Math.Max (1, Arity));
}
}
+ public class ConditionalMemberAccess : MemberAccess
+ {
+ public ConditionalMemberAccess (Expression expr, string identifier, TypeArguments args, Location loc)
+ : base (expr, identifier, args, loc)
+ {
+ }
+
+ public override bool HasConditionalAccess ()
+ {
+ return true;
+ }
+ }
+
/// <summary>
/// Implements checked expressions
/// </summary>
this.Arguments = args;
}
+ public bool ConditionalAccess { get; set; }
+
public override Location StartLocation {
get {
return Expr.StartLocation;
// We perform some simple tests, and then to "split" the emit and store
// code we create an instance of a different class, and return that.
//
- Expression CreateAccessExpression (ResolveContext ec)
+ Expression CreateAccessExpression (ResolveContext ec, bool conditionalAccessReceiver)
{
+ Expr = Expr.Resolve (ec);
+ if (Expr == null)
+ return null;
+
+ type = Expr.Type;
+
+ if (ConditionalAccess && !IsNullPropagatingValid (type)) {
+ Error_OperatorCannotBeApplied (ec, loc, "?", type);
+ return null;
+ }
+
if (type.IsArray)
- return (new ArrayAccess (this, loc));
+ return new ArrayAccess (this, loc) {
+ ConditionalAccess = ConditionalAccess,
+ ConditionalAccessReceiver = conditionalAccessReceiver
+ };
if (type.IsPointer)
return MakePointerAccess (ec, type);
var indexers = MemberCache.FindMembers (type, MemberCache.IndexerNameAlias, false);
if (indexers != null || type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
- return new IndexerExpr (indexers, type, this);
- }
+ var indexer = new IndexerExpr (indexers, type, this) {
+ ConditionalAccess = ConditionalAccess
+ };
- if (type != InternalType.ErrorType) {
- ec.Report.Error (21, loc, "Cannot apply indexing with [] to an expression of type `{0}'",
- type.GetSignatureForError ());
+ if (conditionalAccessReceiver)
+ indexer.SetConditionalAccessReceiver ();
+
+ return indexer;
}
+ Error_CannotApplyIndexing (ec, type, loc);
+
return null;
}
return CreateExpressionFactoryCall (ec, "ArrayIndex", args);
}
+ public static void Error_CannotApplyIndexing (ResolveContext rc, TypeSpec type, Location loc)
+ {
+ if (type != InternalType.ErrorType) {
+ rc.Report.Error (21, loc, "Cannot apply indexing with [] to an expression of type `{0}'",
+ type.GetSignatureForError ());
+ }
+ }
+
+ public override bool HasConditionalAccess ()
+ {
+ return ConditionalAccess || Expr.HasConditionalAccess ();
+ }
+
Expression MakePointerAccess (ResolveContext rc, TypeSpec type)
{
if (Arguments.Count != 1){
return new Indirection (p, loc);
}
- protected override Expression DoResolve (ResolveContext ec)
+ protected override Expression DoResolve (ResolveContext rc)
{
- Expr = Expr.Resolve (ec);
- if (Expr == null)
- return null;
+ Expression expr;
+ if (!rc.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {
+ if (HasConditionalAccess ()) {
+ using (rc.Set (ResolveContext.Options.ConditionalAccessReceiver)) {
+ expr = CreateAccessExpression (rc, true);
+ if (expr == null)
+ return null;
- type = Expr.Type;
+ return expr.Resolve (rc);
+ }
+ }
+ }
- // TODO: Create 1 result for Resolve and ResolveLValue ?
- var res = CreateAccessExpression (ec);
- if (res == null)
+ expr = CreateAccessExpression (rc, false);
+ if (expr == null)
return null;
- return res.Resolve (ec);
+ return expr.Resolve (rc);
}
public override Expression DoResolveLValue (ResolveContext ec, Expression rhs)
{
- Expr = Expr.Resolve (ec);
- if (Expr == null)
- return null;
-
- type = Expr.Type;
-
- var res = CreateAccessExpression (ec);
+ var res = CreateAccessExpression (ec, false);
if (res == null)
return null;
public override void FlowAnalysis (FlowAnalysisContext fc)
{
Expr.FlowAnalysis (fc);
+
+ if (ConditionalAccess)
+ fc.BranchConditionalAccessDefiniteAssignment ();
+
Arguments.FlowAnalysis (fc);
}
loc = l;
}
+ public bool ConditionalAccess { get; set; }
+
+ public bool ConditionalAccessReceiver { get; set; }
+
public void AddressOf (EmitContext ec, AddressOp mode)
{
var ac = (ArrayContainer) ea.Expr.Type;
public override Expression CreateExpressionTree (ResolveContext ec)
{
+ if (ConditionalAccess)
+ Error_NullShortCircuitInsideExpressionTree (ec);
+
return ea.CreateExpressionTree (ec);
}
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
+ if (ConditionalAccess)
+ throw new NotSupportedException ("null propagating operator assignment");
+
return DoResolve (ec);
}
UnsafeError (ec, ea.Location);
}
+ if (ConditionalAccessReceiver)
+ type = LiftMemberType (ec, type);
+
foreach (Argument a in ea.Arguments) {
- if (a is NamedArgument)
- ElementAccess.Error_NamedArgument ((NamedArgument) a, ec.Report);
+ var na = a as NamedArgument;
+ if (na != null)
+ ElementAccess.Error_NamedArgument (na, ec.Report);
a.Expr = ConvertExpressionToArrayIndex (ec, a.Expr);
}
{
if (prepareAwait) {
ea.Expr = ea.Expr.EmitToField (ec);
- } else if (duplicateArguments) {
- ea.Expr.Emit (ec);
- ec.Emit (OpCodes.Dup);
-
- var copy = new LocalTemporary (ea.Expr.Type);
- copy.Store (ec);
- ea.Expr = copy;
} else {
- ea.Expr.Emit (ec);
+ var ie = new InstanceEmitter (ea.Expr, false);
+ ie.Emit (ec, ConditionalAccess);
+
+ if (duplicateArguments) {
+ ec.Emit (OpCodes.Dup);
+
+ var copy = new LocalTemporary (ea.Expr.Type);
+ copy.Store (ec);
+ ea.Expr = copy;
+ }
}
var dup_args = ea.Arguments.Emit (ec, duplicateArguments, prepareAwait);
public void Emit (EmitContext ec, bool leave_copy)
{
- var ac = ea.Expr.Type as ArrayContainer;
-
if (prepared) {
ec.EmitLoadFromPtr (type);
} else {
LoadInstanceAndArguments (ec, false, true);
}
+ if (ConditionalAccessReceiver)
+ ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());
+
+ var ac = (ArrayContainer) ea.Expr.Type;
LoadInstanceAndArguments (ec, false, false);
ec.EmitArrayLoad (ac);
+
+ if (ConditionalAccessReceiver)
+ ec.CloseConditionalAccess (type.IsNullableType && type != ac.Element ? type : null);
}
if (leave_copy) {
//
// Indexer access expression
//
- sealed class IndexerExpr : PropertyOrIndexerExpr<IndexerSpec>, OverloadResolver.IBaseMembersProvider
+ class IndexerExpr : PropertyOrIndexerExpr<IndexerSpec>, OverloadResolver.IBaseMembersProvider
{
IList<MemberSpec> indexers;
Arguments arguments;
TypeSpec queried_type;
public IndexerExpr (IList<MemberSpec> indexers, TypeSpec queriedType, ElementAccess ea)
- : base (ea.Location)
+ : this (indexers, queriedType, ea.Expr, ea.Arguments, ea.Location)
+ {
+ }
+
+ public IndexerExpr (IList<MemberSpec> indexers, TypeSpec queriedType, Expression instance, Arguments args, Location loc)
+ : base (loc)
{
this.indexers = indexers;
this.queried_type = queriedType;
- this.InstanceExpression = ea.Expr;
- this.arguments = ea.Arguments;
+ this.InstanceExpression = instance;
+ this.arguments = args;
}
#region Properties
public override Expression CreateExpressionTree (ResolveContext ec)
{
+ if (ConditionalAccess) {
+ Error_NullShortCircuitInsideExpressionTree (ec);
+ }
+
Arguments args = Arguments.CreateForExpressionTree (ec, arguments,
InstanceExpression.CreateExpressionTree (ec),
new TypeOfMethod (Getter, loc));
public override void FlowAnalysis (FlowAnalysisContext fc)
{
- // TODO: Check the order
base.FlowAnalysis (fc);
arguments.FlowAnalysis (fc);
+
+ if (conditional_access_receiver)
+ fc.ConditionalAccessEnd ();
}
public override string GetSignatureForError ()
target.arguments = arguments.Clone (clonectx);
}
+ public void SetConditionalAccessReceiver ()
+ {
+ conditional_access_receiver = true;
+ }
+
public override void SetTypeArguments (ResolveContext ec, TypeArguments ta)
{
Error_TypeArgumentsCannotBeUsed (ec, "indexer", GetSignatureForError (), loc);
// nothing, as we only exist to not do anything.
}
+ public override void EmitBranchable (EmitContext ec, Label target, bool on_true)
+ {
+ }
+
public override void EmitSideEffect (EmitContext ec)
{
}
this.loc = left.Location;
}
- public override TypeSpec ResolveAsType (IMemberContext ec)
+ public override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments)
{
type = left.ResolveAsType (ec);
if (type == null)
{
this.Name = name;
}
+
+ public bool IsDictionaryInitializer {
+ get {
+ return Name == null;
+ }
+ }
protected override void CloneTo (CloneContext clonectx, Expression t)
{
if (source == null)
return EmptyExpressionStatement.Instance;
- var t = ec.CurrentInitializerVariable.Type;
+ if (!ResolveElement (ec))
+ return null;
+
+ if (source is CollectionOrObjectInitializers) {
+ Expression previous = ec.CurrentInitializerVariable;
+ ec.CurrentInitializerVariable = target;
+ source = source.Resolve (ec);
+ ec.CurrentInitializerVariable = previous;
+ if (source == null)
+ return null;
+
+ eclass = source.eclass;
+ type = source.Type;
+ return this;
+ }
+
+ return base.DoResolve (ec);
+ }
+
+ public override void EmitStatement (EmitContext ec)
+ {
+ if (source is CollectionOrObjectInitializers)
+ source.Emit (ec);
+ else
+ base.EmitStatement (ec);
+ }
+
+ protected virtual bool ResolveElement (ResolveContext rc)
+ {
+ var t = rc.CurrentInitializerVariable.Type;
if (t.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
Arguments args = new Arguments (1);
- args.Add (new Argument (ec.CurrentInitializerVariable));
+ args.Add (new Argument (rc.CurrentInitializerVariable));
target = new DynamicMemberBinder (Name, args, loc);
} else {
- var member = MemberLookup (ec, false, t, Name, 0, MemberLookupRestrictions.ExactArity, loc);
+ var member = MemberLookup (rc, false, t, Name, 0, MemberLookupRestrictions.ExactArity, loc);
if (member == null) {
- member = Expression.MemberLookup (ec, true, t, Name, 0, MemberLookupRestrictions.ExactArity, loc);
+ member = Expression.MemberLookup (rc, true, t, Name, 0, MemberLookupRestrictions.ExactArity, loc);
if (member != null) {
// TODO: ec.Report.SymbolRelatedToPreviousError (member);
- ErrorIsInaccesible (ec, member.GetSignatureForError (), loc);
- return null;
+ ErrorIsInaccesible (rc, member.GetSignatureForError (), loc);
+ return false;
}
}
if (member == null) {
- Error_TypeDoesNotContainDefinition (ec, loc, t, Name);
- return null;
+ Error_TypeDoesNotContainDefinition (rc, loc, t, Name);
+ return false;
}
var me = member as MemberExpr;
if (me is EventExpr) {
- me = me.ResolveMemberAccess (ec, null, null);
+ me = me.ResolveMemberAccess (rc, null, null);
} else if (!(member is PropertyExpr || member is FieldExpr)) {
- ec.Report.Error (1913, loc,
+ rc.Report.Error (1913, loc,
"Member `{0}' cannot be initialized. An object initializer may only be used for fields, or properties",
member.GetSignatureForError ());
- return null;
+ return false;
}
if (me.IsStatic) {
- ec.Report.Error (1914, loc,
+ rc.Report.Error (1914, loc,
"Static field or property `{0}' cannot be assigned in an object initializer",
me.GetSignatureForError ());
}
target = me;
- me.InstanceExpression = ec.CurrentInitializerVariable;
- }
-
- if (source is CollectionOrObjectInitializers) {
- Expression previous = ec.CurrentInitializerVariable;
- ec.CurrentInitializerVariable = target;
- source = source.Resolve (ec);
- ec.CurrentInitializerVariable = previous;
- if (source == null)
- return null;
-
- eclass = source.eclass;
- type = source.Type;
- return this;
+ me.InstanceExpression = rc.CurrentInitializerVariable;
}
- return base.DoResolve (ec);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- if (source is CollectionOrObjectInitializers)
- source.Emit (ec);
- else
- base.EmitStatement (ec);
+ return true;
}
}
return base.DoResolve (ec);
}
}
+
+ class DictionaryElementInitializer : ElementInitializer
+ {
+ readonly Arguments args;
+
+ public DictionaryElementInitializer (List<Expression> arguments, Expression initializer, Location loc)
+ : base (null, initializer, loc)
+ {
+ this.args = new Arguments (arguments.Count);
+ foreach (var arg in arguments)
+ this.args.Add (new Argument (arg));
+ }
+
+ public override Expression CreateExpressionTree (ResolveContext ec)
+ {
+ ec.Report.Error (8074, loc, "Expression tree cannot contain a dictionary initializer");
+ return null;
+ }
+
+ protected override bool ResolveElement (ResolveContext rc)
+ {
+ var init = rc.CurrentInitializerVariable;
+ var type = init.Type;
+
+ var indexers = MemberCache.FindMembers (type, MemberCache.IndexerNameAlias, false);
+ if (indexers == null && type.BuiltinType != BuiltinTypeSpec.Type.Dynamic) {
+ ElementAccess.Error_CannotApplyIndexing (rc, type, loc);
+ return false;
+ }
+
+ target = new IndexerExpr (indexers, type, init, args, loc).Resolve (rc);
+ return true;
+ }
+ }
//
// A block of object or collection initializers
if (i == 0) {
if (element_initializer != null) {
element_names = new List<string> (initializers.Count);
- element_names.Add (element_initializer.Name);
- } else if (initializer is CompletingExpression){
+ if (!element_initializer.IsDictionaryInitializer)
+ element_names.Add (element_initializer.Name);
+ } else if (initializer is CompletingExpression) {
initializer.Resolve (ec);
throw new InternalErrorException ("This line should never be reached");
} else {
continue;
}
- if (!is_collection_initialization) {
+ if (!is_collection_initialization && !element_initializer.IsDictionaryInitializer) {
if (element_names.Contains (element_initializer.Name)) {
ec.Report.Error (1912, element_initializer.Location,
"An object initializer includes more than one member `{0}' initialization",
loc = parameter.Location;
}
- public override TypeSpec ResolveAsType (IMemberContext mc)
+ public override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments)
{
return parameter.Type;
}
throw new NotImplementedException ();
}
- public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext ec)
+ public override FullNamedExpression ResolveAsTypeOrNamespace (IMemberContext mc, bool allowUnboundTypeArguments)
{
throw new NotImplementedException ();
}
if (other.targs != null) {
foreach (var otarg in other.targs) {
- if (TypeSpecComparer.Override.IsEqual (BaseType, otarg)) {
+ if (TypeSpecComparer.Override.IsEqual (iface, otarg)) {
found = true;
break;
}
foreach (var ta in targs) {
var tps = ta as TypeParameterSpec;
IList<TypeSpec> ifaces;
+ TypeSpec b_type;
if (tps != null) {
- var b_type = tps.GetEffectiveBase ();
- if (b_type != null && b_type.BuiltinType != BuiltinTypeSpec.Type.Object && b_type.BuiltinType != BuiltinTypeSpec.Type.ValueType)
- cache.AddBaseType (b_type);
-
+ b_type = tps.GetEffectiveBase ();
ifaces = tps.InterfacesDefined;
} else {
+ b_type = ta;
ifaces = ta.Interfaces;
}
+ //
+ // Don't add base type which was inflated from base constraints but it's not valid
+ // in C# context
+ //
+ if (b_type != null && b_type.BuiltinType != BuiltinTypeSpec.Type.Object && b_type.BuiltinType != BuiltinTypeSpec.Type.ValueType && !b_type.IsStructOrEnum)
+ cache.AddBaseType (b_type);
+
if (ifaces != null) {
foreach (var iface_type in ifaces) {
cache.AddInterface (iface_type);
return type.GetSignatureForError ();
}
- public override TypeSpec ResolveAsType (IMemberContext mc)
+ public override TypeSpec ResolveAsType (IMemberContext mc, bool allowUnboundTypeArguments = false)
{
if (eclass != ExprClass.Unresolved)
return type;
//
// Tracks successful rate of type inference
//
- int score = int.MaxValue;
+ int score;
readonly Arguments arguments;
readonly int arg_count;
AnonymousMethodExpression am = a.Expr as AnonymousMethodExpression;
if (am != null) {
if (am.ExplicitTypeInference (tic, method_parameter))
- --score;
+ ++score;
continue;
}
if (a.IsByRef) {
- score -= tic.ExactInference (a.Type, method_parameter);
+ score += tic.ExactInference (a.Type, method_parameter);
continue;
}
continue;
if (TypeSpec.IsValueType (method_parameter)) {
- score -= tic.LowerBoundInference (a.Type, method_parameter);
+ score += tic.LowerBoundInference (a.Type, method_parameter);
continue;
}
//
// Otherwise an output type inference is made
//
- score -= tic.OutputTypeInference (ec, a.Expr, method_parameter);
+ score += tic.OutputTypeInference (ec, a.Expr, method_parameter);
}
//
if (arguments[i] == null)
continue;
- score -= tic.OutputTypeInference (ec, arguments[i].Expr, t_i);
+ score += tic.OutputTypeInference (ec, arguments[i].Expr, t_i);
}
}
// Some types cannot be used as type arguments
//
if ((bound.Type.Kind == MemberKind.Void && !voidAllowed) || bound.Type.IsPointer || bound.Type.IsSpecialRuntimeType ||
- bound.Type == InternalType.MethodGroup || bound.Type == InternalType.AnonymousMethod)
+ bound.Type == InternalType.MethodGroup || bound.Type == InternalType.AnonymousMethod || bound.Type == InternalType.VarOutType)
return;
var a = bounds [index];
continue;
}
- if (TypeManager.IsGenericType (t))
- return AllTypesAreFixed (TypeManager.GetTypeArguments (t));
+ if (t.IsGeneric && !AllTypesAreFixed (t.TypeArguments))
+ return false;
}
return true;
public string DefaultIndexerName;
public bool? CLSAttributeValue;
public TypeSpec CoClass;
+
+ static bool HasMissingType (ConstructorInfo ctor)
+ {
+#if STATIC
+ //
+ // Mimic odd csc behaviour where missing type on predefined
+ // attributes means the attribute is silently ignored. This can
+ // happen with PCL facades
+ //
+ foreach (var p in ctor.GetParameters ()) {
+ if (p.ParameterType.__ContainsMissingType)
+ return true;
+ }
+#endif
+
+ return false;
+ }
public static AttributesBag Read (MemberInfo mi, MetadataImporter importer)
{
if (dt.Namespace != "System")
continue;
+ if (HasMissingType (a.Constructor))
+ continue;
+
if (bag == null)
bag = new AttributesBag ();
if (dt.Namespace != "System.Runtime.InteropServices")
continue;
+ if (HasMissingType (a.Constructor))
+ continue;
+
if (bag == null)
bag = new AttributesBag ();
if ((name_entry.Modifiers & Modifiers.STATIC) != 0)
continue;
- //
- // Ignore user private fields for definite assignment. This is sort of unexpected but
- // rationale is to have consistent results when using reference assemblies which don't
- // include any private fields and full assemblies
- //
- if ((name_entry.Modifiers & (Modifiers.PRIVATE | Modifiers.BACKING_FIELD)) == Modifiers.PRIVATE)
- continue;
-
//
// Fixed size buffers are not subject to definite assignment checking
//
// Using container location because the interface can be implemented
// by base class
- container.Compiler.Report.Error (425, container.Location,
+ var tp = (tparams [i].MemberDefinition as MemberCore) ?? container;
+ container.Compiler.Report.Error (425, tp.Location,
"The constraints for type parameter `{0}' of method `{1}' must match the constraints for type parameter `{2}' of interface method `{3}'. Consider using an explicit interface implementation instead",
tparams[i].GetSignatureForError (), method.GetSignatureForError (),
base_tparams[i].GetSignatureForError (), baseMethod.GetSignatureForError ());
// This is used to track the Entry Point,
//
var settings = Compiler.Settings;
- if (settings.NeedsEntryPoint && MemberName.Name == "Main" && (settings.MainClass == null || settings.MainClass == Parent.TypeBuilder.FullName)) {
+ if (settings.NeedsEntryPoint && MemberName.Name == "Main" && !IsPartialDefinition && (settings.MainClass == null || settings.MainClass == Parent.TypeBuilder.FullName)) {
if (IsEntryPoint ()) {
if (Parent.DeclaringAssembly.EntryPoint == null) {
if (Parent.IsGenericOrParentIsGeneric || MemberName.IsGeneric) {
"`{0}': Struct constructors cannot call base constructors", caller_builder.GetSignatureForError ());
return this;
}
- } else {
- //
- // It is legal to have "this" initializers that take no arguments
- // in structs
- //
- // struct D { public D (int a) : this () {}
- //
- if (ec.CurrentType.IsStruct && argument_list == null)
- return this;
}
base_ctor = ConstructorLookup (ec, type, ref argument_list, loc);
var call = new CallEmitter ();
call.InstanceExpression = new CompilerGeneratedThis (type, loc);
- call.EmitPredefined (ec, base_ctor, argument_list);
+ call.EmitPredefined (ec, base_ctor, argument_list, false);
}
public override void EmitStatement (EmitContext ec)
protected override bool CheckBase ()
{
if ((ModFlags & Modifiers.STATIC) != 0) {
- if (!parameters.IsEmpty) {
- Report.Error (132, Location, "`{0}': The static constructor must be parameterless",
- GetSignatureForError ());
- return false;
- }
-
if ((caching_flags & Flags.MethodOverloadsExist) != 0)
Parent.MemberCache.CheckExistingMembersOverloads (this, parameters);
if ((caching_flags & Flags.MethodOverloadsExist) != 0)
Parent.MemberCache.CheckExistingMembersOverloads (this, parameters);
- if (Parent.PartialContainer.Kind == MemberKind.Struct && parameters.IsEmpty) {
- Report.Error (568, Location,
- "Structs cannot contain explicit parameterless constructors");
- return false;
- }
-
CheckProtectedModifier ();
return true;
protected override bool CheckBase ()
{
+ if ((caching_flags & Flags.MethodOverloadsExist) != 0)
+ CheckForDuplications ();
+
// Don't check base, destructors have special syntax
return true;
}
Implicit,
Explicit,
+ // Pattern matching
+ Is,
+
// Just because of enum
TOP
};
names [(int) OpType.LessThanOrEqual] = new string [] { "<=", "op_LessThanOrEqual" };
names [(int) OpType.Implicit] = new string [] { "implicit", "op_Implicit" };
names [(int) OpType.Explicit] = new string [] { "explicit", "op_Explicit" };
+ names [(int) OpType.Is] = new string[] { "is", "op_Is" };
}
public Operator (TypeDefinition parent, OpType type, FullNamedExpression ret_type, Modifiers mod_flags, ParametersCompiled parameters,
}
#endif
+ public sealed class PatternMatchingHelper : CompilerGeneratedContainer
+ {
+ public PatternMatchingHelper (ModuleContainer module)
+ : base (module, new MemberName ("<PatternMatchingHelper>", Location.Null),
+ Modifiers.STATIC | Modifiers.INTERNAL | Modifiers.DEBUGGER_HIDDEN)
+ {
+ }
+
+ public Method NumberMatcher { get; private set; }
+
+ protected override bool DoDefineMembers ()
+ {
+ if (!base.DoDefineMembers ())
+ return false;
+
+ NumberMatcher = GenerateNumberMatcher ();
+ return true;
+ }
+
+ Method GenerateNumberMatcher ()
+ {
+ var loc = Location;
+ var parameters = ParametersCompiled.CreateFullyResolved (
+ new [] {
+ new Parameter (new TypeExpression (Compiler.BuiltinTypes.Object, loc), "obj", 0, null, loc),
+ new Parameter (new TypeExpression (Compiler.BuiltinTypes.Object, loc), "value", 0, null, loc),
+ new Parameter (new TypeExpression (Compiler.BuiltinTypes.Bool, loc), "enumType", 0, null, loc),
+ },
+ new [] {
+ Compiler.BuiltinTypes.Object,
+ Compiler.BuiltinTypes.Object,
+ Compiler.BuiltinTypes.Bool
+ });
+
+ var m = new Method (this, new TypeExpression (Compiler.BuiltinTypes.Bool, loc),
+ Modifiers.PUBLIC | Modifiers.STATIC | Modifiers.DEBUGGER_HIDDEN, new MemberName ("NumberMatcher", loc),
+ parameters, null);
+
+ parameters [0].Resolve (m, 0);
+ parameters [1].Resolve (m, 1);
+ parameters [2].Resolve (m, 2);
+
+ ToplevelBlock top_block = new ToplevelBlock (Compiler, parameters, loc);
+ m.Block = top_block;
+
+ //
+ // if (enumType)
+ // return Equals (obj, value);
+ //
+ var equals_args = new Arguments (2);
+ equals_args.Add (new Argument (top_block.GetParameterReference (0, loc)));
+ equals_args.Add (new Argument (top_block.GetParameterReference (1, loc)));
+
+ var if_type = new If (
+ top_block.GetParameterReference (2, loc),
+ new Return (new Invocation (new SimpleName ("Equals", loc), equals_args), loc),
+ loc);
+
+ top_block.AddStatement (if_type);
+
+ //
+ // if (obj is Enum || obj == null)
+ // return false;
+ //
+
+ var if_enum = new If (
+ new Binary (Binary.Operator.LogicalOr,
+ new Is (top_block.GetParameterReference (0, loc), new TypeExpression (Compiler.BuiltinTypes.Enum, loc), loc),
+ new Binary (Binary.Operator.Equality, top_block.GetParameterReference (0, loc), new NullLiteral (loc))),
+ new Return (new BoolLiteral (Compiler.BuiltinTypes, false, loc), loc),
+ loc);
+
+ top_block.AddStatement (if_enum);
+
+
+ var system_convert = new MemberAccess (new QualifiedAliasMember ("global", "System", loc), "Convert", loc);
+ var expl_block = new ExplicitBlock (top_block, loc, loc);
+
+ //
+ // var converted = System.Convert.ChangeType (obj, System.Convert.GetTypeCode (value));
+ //
+ var lv_converted = LocalVariable.CreateCompilerGenerated (Compiler.BuiltinTypes.Object, top_block, loc);
+
+ var arguments_gettypecode = new Arguments (1);
+ arguments_gettypecode.Add (new Argument (top_block.GetParameterReference (1, loc)));
+
+ var gettypecode = new Invocation (new MemberAccess (system_convert, "GetTypeCode", loc), arguments_gettypecode);
+
+ var arguments_changetype = new Arguments (1);
+ arguments_changetype.Add (new Argument (top_block.GetParameterReference (0, loc)));
+ arguments_changetype.Add (new Argument (gettypecode));
+
+ var changetype = new Invocation (new MemberAccess (system_convert, "ChangeType", loc), arguments_changetype);
+
+ expl_block.AddStatement (new StatementExpression (new SimpleAssign (new LocalVariableReference (lv_converted, loc), changetype, loc)));
+
+
+ //
+ // return converted.Equals (value)
+ //
+ var equals_arguments = new Arguments (1);
+ equals_arguments.Add (new Argument (top_block.GetParameterReference (1, loc)));
+ var equals_invocation = new Invocation (new MemberAccess (new LocalVariableReference (lv_converted, loc), "Equals"), equals_arguments);
+ expl_block.AddStatement (new Return (equals_invocation, loc));
+
+ var catch_block = new ExplicitBlock (top_block, loc, loc);
+ catch_block.AddStatement (new Return (new BoolLiteral (Compiler.BuiltinTypes, false, loc), loc));
+ top_block.AddStatement (new TryCatch (expl_block, new List<Catch> () {
+ new Catch (catch_block, loc)
+ }, loc, false));
+
+ m.Define ();
+ m.PrepareEmit ();
+ AddMember (m);
+
+ return m;
+ }
+ }
+
+ PatternMatchingHelper pmh;
+
+ public PatternMatchingHelper CreatePatterMatchingHelper ()
+ {
+ if (pmh == null) {
+ pmh = new PatternMatchingHelper (this);
+
+ pmh.CreateContainer ();
+ pmh.DefineContainer ();
+ pmh.Define ();
+ AddCompilerGeneratedClass (pmh);
+ }
+
+ return pmh;
+ }
+
public CharSet? DefaultCharSet;
public TypeAttributes DefaultCharSetType = TypeAttributes.AnsiClass;
return null;
foreach (var ts in found) {
- if (ts.Arity == arity) {
+ if (ts.Arity == arity || mode == LookupMode.NameOf) {
if (best == null) {
if ((ts.Modifiers & Modifiers.INTERNAL) != 0 && !ts.MemberDefinition.IsInternalAsPublic (ctx.Module.DeclaringAssembly) && mode != LookupMode.IgnoreAccessibility)
continue;
if (arity == 0 && mode == LookupMode.Normal)
cached_types.Add (name, best);
+ if (best != null) {
+ var dep = best.GetMissingDependencies ();
+ if (dep != null)
+ ImportedTypeDefinition.Error_MissingDependency (ctx, dep, loc);
+ }
+
return best;
}
public void RemoveContainer (TypeContainer tc)
{
- types.Remove (tc.Basename);
- cached_types.Remove (tc.Basename);
+ IList<TypeSpec> found;
+ if (types.TryGetValue (tc.MemberName.Name, out found)) {
+ for (int i = 0; i < found.Count; ++i) {
+ if (tc.MemberName.Arity != found [i].Arity)
+ continue;
+
+ if (found.Count == 1)
+ types.Remove (tc.MemberName.Name);
+ else
+ found.RemoveAt (i);
+
+ break;
+ }
+ }
+
+ cached_types.Remove (tc.MemberName.Basename);
}
public void SetBuiltinType (BuiltinTypeSpec pts)
public override void AddTypeContainer (TypeContainer tc)
{
- string name = tc.Basename;
-
var mn = tc.MemberName;
+ var name = mn.Basename;
while (mn.Left != null) {
mn = mn.Left;
name = mn.Name;
public virtual void Define (NamespaceContainer ctx)
{
- resolved = expr.ResolveAsTypeOrNamespace (ctx);
+ resolved = expr.ResolveAsTypeOrNamespace (ctx, false);
var ns = resolved as NamespaceExpression;
if (ns != null)
return;
// We achieve that by introducing alias-context which redirect any local
// namespace or type resolve calls to parent namespace
//
- resolved = NamespaceExpression.ResolveAsTypeOrNamespace (new AliasContext (ctx));
+ resolved = NamespaceExpression.ResolveAsTypeOrNamespace (new AliasContext (ctx), false);
}
}
}
this.loc = loc;
}
- public override TypeSpec ResolveAsType (IMemberContext ec)
+ public override TypeSpec ResolveAsType (IMemberContext ec, bool allowUnboundTypeArguments = false)
{
eclass = ExprClass.Type;
}
public static TypeSpec GetEnumUnderlyingType (ModuleContainer module, TypeSpec nullableEnum)
+ {
+ return MakeType (module, EnumSpec.GetUnderlyingType (GetUnderlyingType (nullableEnum)));
+ }
+
+ public static TypeSpec MakeType (ModuleContainer module, TypeSpec underlyingType)
{
return module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (module,
- new[] { EnumSpec.GetUnderlyingType (GetUnderlyingType (nullableEnum)) });
+ new[] { underlyingType });
+
}
}
{
}
+ public override bool IsNull {
+ get {
+ return expr.IsNull;
+ }
+ }
+
public override bool ContainsEmitWithAwait ()
{
return unwrap.ContainsEmitWithAwait ();
}
if (!type.IsNullableType)
- type = rc.Module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (rc.Module, new[] { type });
+ type = NullableInfo.MakeType (rc.Module, type);
return Wrap.Create (expr, type);
}
if (right.IsNull)
return ReducedExpression.Create (left, this);
- if (Convert.ImplicitConversionExists (ec, right, unwrap.Type)) {
- left = unwrap;
- ltype = left.Type;
+ Expression conv;
+ if (right.Type.IsNullableType) {
+ conv = right.Type == ltype ? right : Convert.ImplicitNulableConversion (ec, right, ltype);
+ if (conv != null) {
+ right = conv;
+ type = ltype;
+ return this;
+ }
+ } else {
+ conv = Convert.ImplicitConversion (ec, right, unwrap.Type, loc);
+ if (conv != null) {
+ left = unwrap;
+ ltype = left.Type;
- //
- // If right is a dynamic expression, the result type is dynamic
- //
- if (right.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
- type = right.Type;
+ //
+ // If right is a dynamic expression, the result type is dynamic
+ //
+ if (right.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
+ type = right.Type;
+
+ // Need to box underlying value type
+ left = Convert.ImplicitBoxingConversion (left, ltype, type);
+ return this;
+ }
- // Need to box underlying value type
- left = Convert.ImplicitBoxingConversion (left, ltype, type);
+ right = conv;
+ type = ltype;
return this;
}
-
- right = Convert.ImplicitConversion (ec, right, ltype, loc);
- type = ltype;
- return this;
}
} else if (TypeSpec.IsReferenceType (ltype)) {
if (Convert.ImplicitConversionExists (ec, right, ltype)) {
return ReducedExpression.Create (right, this, false).Resolve (ec);
left = Convert.ImplicitConversion (ec, unwrap ?? left, rtype, loc);
+
+ if (TypeSpec.IsValueType (left.Type) && !left.Type.IsNullableType) {
+ Warning_UnreachableExpression (ec, right.Location);
+ return ReducedExpression.Create (left, this, false).Resolve (ec);
+ }
+
type = rtype;
return this;
}
public sealed class BackingField : Field
{
readonly Property property;
+ const Modifiers DefaultModifiers = Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | Modifiers.DEBUGGER_HIDDEN;
public BackingField (Property p, bool readOnly)
- : base (p.Parent, p.type_expr,
- Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (p.ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),
+ : base (p.Parent, p.type_expr, DefaultModifiers | (p.ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),
new MemberName ("<" + p.GetFullName (p.MemberName) + ">k__BackingField", p.Location), null)
{
this.property = p;
Location)));
args.Add (new Argument (new LocalVariableReference (obj1, Location)));
- var cas = Module.PredefinedMembers.InterlockedCompareExchange_T.Resolve (Location);
- if (cas == null)
- return;
-
- body.AddStatement (new StatementExpression (new SimpleAssign (
- new LocalVariableReference (obj1, Location),
- new Invocation (MethodGroupExpr.CreatePredefined (cas, cas.DeclaringType, Location), args))));
+ var cas = Module.PredefinedMembers.InterlockedCompareExchange_T.Get ();
+ if (cas == null) {
+ if (Module.PredefinedMembers.MonitorEnter_v4.Get () != null || Module.PredefinedMembers.MonitorEnter.Get () != null) {
+ // Workaround for cripled (e.g. microframework) mscorlib without CompareExchange
+ body.AddStatement (new Lock (
+ block.GetParameterReference (0, Location),
+ new StatementExpression (new SimpleAssign (
+ f_expr, args [1].Expr, Location), Location), Location));
+ } else {
+ Module.PredefinedMembers.InterlockedCompareExchange_T.Resolve (Location);
+ }
+ } else {
+ body.AddStatement (new StatementExpression (new SimpleAssign (
+ new LocalVariableReference (obj1, Location),
+ new Invocation (MethodGroupExpr.CreatePredefined (cas, cas.DeclaringType, Location), args))));
+ }
}
}
case LanguageVersion.V_5:
version = "5.0";
break;
+ case LanguageVersion.V_6:
+ version = "6.0";
+ break;
default:
throw new InternalErrorException ("Invalid feature version", compiler.Settings.Version);
}
V_4 = 4,
V_5 = 5,
V_6 = 6,
- Future = 100,
+ Experimental = 100,
- Default = LanguageVersion.Future,
+ Default = LanguageVersion.V_6,
}
public enum RuntimeVersion
case "6":
settings.Version = LanguageVersion.V_6;
return ParseResult.Success;
- case "future":
- settings.Version = LanguageVersion.Future;
+ case "experimental":
+ settings.Version = LanguageVersion.Experimental;
return ParseResult.Success;
+ case "future":
+ report.Warning (8000, 1, "Language version `future' is no longer supported");
+ goto case "6";
}
report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 6", value);
if (reachable) {
fc.UnreachableReported = false;
var res = DoFlowAnalysis (fc);
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = null;
return res;
}
protected override bool DoFlowAnalysis (FlowAnalysisContext fc)
{
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
-
- expr.FlowAnalysis (fc);
+ expr.FlowAnalysisConditional (fc);
var da_false = new DefiniteAssignmentBitSet (fc.DefiniteAssignmentOnFalse);
fc.DefiniteAssignment = fc.DefiniteAssignmentOnTrue;
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = null;
var res = TrueStatement.FlowAnalysis (fc);
{
var res = Statement.FlowAnalysis (fc);
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
- expr.FlowAnalysis (fc);
+ expr.FlowAnalysisConditional (fc);
fc.DefiniteAssignment = fc.DefiniteAssignmentOnFalse;
protected override bool DoFlowAnalysis (FlowAnalysisContext fc)
{
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
-
- expr.FlowAnalysis (fc);
+ expr.FlowAnalysisConditional (fc);
fc.DefiniteAssignment = fc.DefiniteAssignmentOnTrue;
var da_false = new DefiniteAssignmentBitSet (fc.DefiniteAssignmentOnFalse);
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = null;
Statement.FlowAnalysis (fc);
DefiniteAssignmentBitSet da_false;
if (Condition != null) {
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = fc.DefiniteAssignment;
-
- Condition.FlowAnalysis (fc);
+ Condition.FlowAnalysisConditional (fc);
fc.DefiniteAssignment = fc.DefiniteAssignmentOnTrue;
da_false = new DefiniteAssignmentBitSet (fc.DefiniteAssignmentOnFalse);
- fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = null;
} else {
da_false = fc.BranchDefiniteAssignment ();
}
}
}
+ public bool PatternMatching { get; set; }
+
public bool SectionStart { get; set; }
public Label GetILLabel (EmitContext ec)
// Resolves the expression, reduces it to a literal if possible
// and then converts it to the requested type.
//
- bool ResolveAndReduce (BlockContext rc)
+ bool ResolveAndReduce (BlockContext bc)
{
if (IsDefault)
return true;
- var c = label.ResolveLabelConstant (rc);
+ var switch_statement = bc.Switch;
+
+ if (PatternMatching) {
+ label = new Is (switch_statement.ExpressionValue, label, loc).Resolve (bc);
+ return label != null;
+ }
+
+ var c = label.ResolveLabelConstant (bc);
if (c == null)
return false;
- if (rc.Switch.IsNullable && c is NullLiteral) {
+ if (switch_statement.IsNullable && c is NullLiteral) {
converted = c;
return true;
}
- converted = c.ImplicitConversionRequired (rc, rc.Switch.SwitchType);
+ if (switch_statement.IsPatternMatching) {
+ label = new Is (switch_statement.ExpressionValue, label, loc).Resolve (bc);
+ return true;
+ }
+
+ converted = c.ImplicitConversionRequired (bc, switch_statement.SwitchType);
return converted != null;
}
class MissingBreak : Statement
{
- SwitchLabel label;
+ readonly SwitchLabel label;
public MissingBreak (SwitchLabel sl)
{
this.loc = sl.loc;
}
+ public bool FallOut { get; set; }
+
protected override void DoEmit (EmitContext ec)
{
}
protected override bool DoFlowAnalysis (FlowAnalysisContext fc)
{
- fc.Report.Error (163, loc, "Control cannot fall through from one case label `{0}' to another",
- label.GetSignatureForError ());
-
+ if (FallOut) {
+ fc.Report.Error (8070, loc, "Control cannot fall out of switch statement through final case label `{0}'",
+ label.GetSignatureForError ());
+ } else {
+ fc.Report.Error (163, loc, "Control cannot fall through from one case label `{0}' to another",
+ label.GetSignatureForError ());
+ }
return true;
}
}
}
}
+ public bool IsPatternMatching {
+ get {
+ return new_expr == null && SwitchType != null;
+ }
+ }
+
public List<SwitchLabel> RegisteredLabels {
get {
return case_labels;
}
}
+ public VariableReference ExpressionValue {
+ get {
+ return value;
+ }
+ }
+
//
// Determines the governing type for a switch. The returned
// expression might be the expression from the switch, or an
return;
}
+ if (sl.Converted == null)
+ return;
+
try {
if (string_labels != null) {
string string_value = sl.Converted.GetValue () as string;
else
string_labels.Add (string_value, sl);
} else {
- if (sl.Converted is NullLiteral) {
+ if (sl.Converted.IsNull) {
case_null = sl;
} else {
labels.Add (sl.Converted.GetValueAsLong (), sl);
}
}
+ Expression switch_expr;
if (new_expr == null) {
- if (Expr.Type != InternalType.ErrorType) {
- ec.Report.Error (151, loc,
- "A switch expression of type `{0}' cannot be converted to an integral type, bool, char, string, enum or nullable type",
- Expr.Type.GetSignatureForError ());
- }
+ if (ec.Module.Compiler.Settings.Version != LanguageVersion.Experimental) {
+ if (Expr.Type != InternalType.ErrorType) {
+ ec.Report.Error (151, loc,
+ "A switch expression of type `{0}' cannot be converted to an integral type, bool, char, string, enum or nullable type",
+ Expr.Type.GetSignatureForError ());
+ }
- return false;
- }
+ return false;
+ }
- SwitchType = new_expr.Type;
- if (SwitchType.IsNullableType) {
- new_expr = unwrap = Nullable.Unwrap.Create (new_expr, true);
- SwitchType = Nullable.NullableInfo.GetUnderlyingType (SwitchType);
- }
+ switch_expr = Expr;
+ SwitchType = Expr.Type;
+ } else {
+ switch_expr = new_expr;
+ SwitchType = new_expr.Type;
+ if (SwitchType.IsNullableType) {
+ new_expr = unwrap = Nullable.Unwrap.Create (new_expr, true);
+ SwitchType = Nullable.NullableInfo.GetUnderlyingType (SwitchType);
+ }
- if (SwitchType.BuiltinType == BuiltinTypeSpec.Type.Bool && ec.Module.Compiler.Settings.Version == LanguageVersion.ISO_1) {
- ec.Report.FeatureIsNotAvailable (ec.Module.Compiler, loc, "switch expression of boolean type");
- return false;
- }
+ if (SwitchType.BuiltinType == BuiltinTypeSpec.Type.Bool && ec.Module.Compiler.Settings.Version == LanguageVersion.ISO_1) {
+ ec.Report.FeatureIsNotAvailable (ec.Module.Compiler, loc, "switch expression of boolean type");
+ return false;
+ }
- if (block.Statements.Count == 0)
- return true;
+ if (block.Statements.Count == 0)
+ return true;
- if (SwitchType.BuiltinType == BuiltinTypeSpec.Type.String) {
- string_labels = new Dictionary<string, SwitchLabel> ();
- } else {
- labels = new Dictionary<long, SwitchLabel> ();
+ if (SwitchType.BuiltinType == BuiltinTypeSpec.Type.String) {
+ string_labels = new Dictionary<string, SwitchLabel> ();
+ } else {
+ labels = new Dictionary<long, SwitchLabel> ();
+ }
}
- case_labels = new List<SwitchLabel> ();
-
- var constant = new_expr as Constant;
+ var constant = switch_expr as Constant;
//
// Don't need extra variable for constant switch or switch with
//
// Store switch expression for comparison purposes
//
- value = new_expr as VariableReference;
+ value = switch_expr as VariableReference;
if (value == null && !HasOnlyDefaultSection ()) {
var current_block = ec.CurrentBlock;
ec.CurrentBlock = Block;
}
}
+ case_labels = new List<SwitchLabel> ();
+
Switch old_switch = ec.Switch;
ec.Switch = this;
var parent_los = ec.EnclosingLoopOrSwitch;
if (sl != null && sl.SectionStart) {
//
- // Section is marked already via constant switch or goto case
+ // Section is marked already via goto case
//
if (!sl.IsUnreachable) {
section_rc = new Reachability ();
continue;
}
- if (section_rc.IsUnreachable) {
+ if (constant_label != null && constant_label != sl)
+ section_rc = Reachability.CreateUnreachable ();
+ else if (section_rc.IsUnreachable) {
section_rc = new Reachability ();
} else {
if (prev_label != null) {
}
prev_label = sl;
-
- if (constant_label != null && constant_label != sl)
- section_rc = Reachability.CreateUnreachable ();
}
section_rc = s.MarkReachable (section_rc);
if (!section_rc.IsUnreachable && prev_label != null) {
prev_label.SectionStart = false;
- var s = new MissingBreak (prev_label);
+ var s = new MissingBreak (prev_label) {
+ FallOut = true
+ };
+
s.MarkReachable (rc);
block.Statements.Add (s);
}
var constant = label.Converted;
+ if (constant == null) {
+ label.Label.EmitBranchable (ec, label.GetILLabel (ec), true);
+ continue;
+ }
+
if (equal_method != null) {
value.Emit (ec);
constant.Emit (ec);
void EmitDispatch (EmitContext ec)
{
+ if (IsPatternMatching) {
+ EmitShortSwitch (ec);
+ return;
+ }
+
if (value == null) {
//
// Constant switch, we've already done the work if there is only 1 label
if (value != null) {
ec.Mark (loc);
+
+ var switch_expr = new_expr ?? Expr;
if (IsNullable) {
unwrap.EmitCheck (ec);
ec.Emit (OpCodes.Brfalse, nullLabel);
- value.EmitAssign (ec, new_expr, false, false);
- } else if (new_expr != value) {
- value.EmitAssign (ec, new_expr, false, false);
+ value.EmitAssign (ec, switch_expr, false, false);
+ } else if (switch_expr != value) {
+ value.EmitAssign (ec, switch_expr, false, false);
}
public override void AddEndDefiniteAssignment (FlowAnalysisContext fc)
{
- if (case_default == null)
+ if (case_default == null && !(new_expr is Constant))
return;
if (end_reachable_das == null)
var ce = new CallEmitter ();
ce.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);
- ce.EmitPredefined (ec, finally_host.Spec, new Arguments (0));
+ ce.EmitPredefined (ec, finally_host.Spec, new Arguments (0), true);
} else {
EmitFinallyBody (ec);
}
if (finally_host != null) {
var ce = new CallEmitter ();
ce.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);
- ce.EmitPredefined (ec, finally_host.Spec, new Arguments (0));
+ ce.EmitPredefined (ec, finally_host.Spec, new Arguments (0), true);
} else {
EmitFinallyBody (ec);
}
case MemberKind.Struct:
case MemberKind.Enum:
case MemberKind.Void:
+ case MemberKind.PointerType:
return false;
case MemberKind.InternalCompilerType:
//
public static readonly InternalType FakeInternalType = new InternalType ("<fake$type>");
public static readonly InternalType Namespace = new InternalType ("<namespace>");
public static readonly InternalType ErrorType = new InternalType ("<error>");
+ public static readonly InternalType VarOutType = new InternalType ("var out");
readonly string name;
}
}
+ void Test_18 (bool b, Action a)
+ {
+ var e = b ? () => { } : a;
+ }
+
+ void Test_19 (int[,] table)
+ {
+ var x = 1 > 0 ? table[5, 1] : 0;
+ }
+
static void Helper<T> (T arg)
{
}
{
public static int Main ()
{
+ DateTime? dt = null;
+ var res1 = default (DateTime?) == dt;
+ if (!res1)
+ return 5;
+
DateTime? a = default (DateTime?);
DateTime? b = default (DateTime?);
bool res = a == b;
if ((s & e) != null)
return 15;
+ var res1 = (E?) 1 == null;
+ if (res1)
+ return 16;
+
+ var res2 = null == (E?) 1;
+ if (res2)
+ return 17;
+
Console.WriteLine ("ok");
return 0;
--- /dev/null
+using System;
+
+class X
+{
+ static int Main ()
+ {
+ int? intArg = 1;
+ long? longArg = 2;
+
+ var g = intArg ?? longArg;
+ Console.WriteLine (g);
+ if (g != 1)
+ return 1;
+
+ intArg = null;
+ g = intArg ?? longArg;
+ Console.WriteLine (g);
+ if (g != 2)
+ return 2;
+
+ longArg = null;
+ g = intArg ?? longArg;
+ Console.WriteLine (g);
+ if (g != null)
+ return 3;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+interface IX<TI>
+{
+ void M<TO> () where TO : TI;
+}
+
+interface IY
+{
+}
+
+class CY : IY
+{
+}
+
+class A : IX<IY>
+{
+ public void M<TO> () where TO : IY
+ {
+ }
+
+ public static void Main ()
+ {
+ var a = new A ();
+ a.M<CY> ();
+ }
+}
\ No newline at end of file
--- /dev/null
+.assembly extern mscorlib
+{
+}
+
+.assembly 'gtest-623-lib'
+{
+}
+
+.module 'gtest-623-lib.dll'
+
+ .class public sequential ansi sealed beforefieldinit S
+ extends [mscorlib]System.ValueType
+ implements I {
+
+ .field public int32 Field
+
+ .method public hidebysig specialname rtspecialname
+ instance default void '.ctor' () cil managed
+ {
+ ldarg.0
+ ldc.i4.3
+ stfld int32 S::Field
+ ret
+ }
+
+ .method public final virtual hidebysig newslot
+ instance default int32 GetValue () cil managed
+ {
+ ldarg.0
+ ldfld int32 S::Field
+ ret
+ }
+ }
+
+ .class interface public auto ansi abstract I
+ {
+
+ .method public virtual hidebysig newslot abstract
+ instance default int32 GetValue () cil managed
+ {
+ }
+ }
--- /dev/null
+// Compiler options: -r:gtest-623-lib.dll
+
+using System;
+
+public class C
+{
+ static bool Test<T> () where T : struct, I
+ {
+ var t = new T ();
+ if (t.GetValue () != 3)
+ return false;
+
+ return true;
+ }
+
+ public static int Main ()
+ {
+ if (!Test<S> ())
+ return 1;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+class Model
+{
+ public int Value;
+}
+
+class C1<T1>
+{
+ public void Add (Func<T1, int> t)
+ {
+ }
+}
+
+abstract class C2<TModel>
+{
+ public abstract void ApplyImpl<U> (C1<U> c1) where U : TModel;
+}
+
+class C3 : C2<Model>
+{
+ public override void ApplyImpl<Foo> (C1<Foo> c1)
+ {
+ c1.Add (t => t.Value);
+ }
+}
+
+class Program
+{
+ static void Main ()
+ {
+ var v1 = new C1<Model> ();
+ var c3 = new C3 ();
+ c3.ApplyImpl (v1);
+ }
+}
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
+using System.Diagnostics;
public class Test
{
if (!(fields.Length > 0))
return 1;
object [] field_atts = fields[0].GetCustomAttributes (false);
- if (!(field_atts.Length > 0))
+ if (field_atts.Length != 2)
return 2;
- if (field_atts[0].GetType() != typeof (CompilerGeneratedAttribute))
+ if (field_atts[0].GetType() != typeof (DebuggerBrowsableAttribute))
return 3;
+ if (field_atts[1].GetType() != typeof (CompilerGeneratedAttribute))
+ return 4;
if (fields [0].Name != "<Foo>k__BackingField")
return 10;
{
public static int P { get; } = 4;
+ public static int[] PA { get; } = { 0, 2 };
+
public static int Main ()
{
if (P != 4)
return 1;
+ if (PA [1] != 2)
+ return 10;
+
var c = new C ();
if (c.P != -3)
return 2;
--- /dev/null
+struct S
+{
+ public decimal P { get; } = -3;
+}
+
+class X
+{
+ public static int Main ()
+ {
+ var s = new S ();
+ if (s.P != -3)
+ return 1;
+
+ return 0;
+ }
+}
\ No newline at end of file
}
}
+struct StructWithUserConstructor
+{
+ public StructWithUserConstructor ()
+ {
+
+ }
+}
+
class MemberAccessData
{
public bool BoolValue;
Assert<MyEnum> (0, e.Compile ().Invoke ());
}
+ void NewTest_8 ()
+ {
+ Expression<Func<DateTime>> e = () => new DateTime ();
+ AssertNodeType (e, ExpressionType.New);
+ Assert (null, ((NewExpression)e.Body).Constructor, "default ctor");
+
+ Expression<Func<StructWithUserConstructor>> e2 = () => new StructWithUserConstructor ();
+ AssertNodeType (e2, ExpressionType.New);
+ Assert ("Void .ctor()", ((NewExpression)e2.Body).Constructor.ToString (), "user ctor");
+ }
+
void NotTest ()
{
Expression<Func<bool, bool>> e = (bool a) => !a;
--- /dev/null
+using System;
+
+class D<T>
+{
+ public void S<U, V> (Func<U> ftu, Func<T, U, V> ftuv)
+ {
+ }
+}
+
+class Test
+{
+ static D<V> Factory<V> (V v)
+ {
+ return new D<V> ();
+ }
+
+ static void Main ()
+ {
+ var danon = Factory (new { q = 5 });
+
+ danon.S (
+ () => "x",
+ (l, str) => new { str }
+ );
+ }
+}
\ No newline at end of file
--- /dev/null
+public struct S
+{
+ public S (double left = 0, double top = 0)
+ : this ()
+ {
+ }
+}
+
+class X
+{
+ public static void Main ()
+ {
+ }
+}
\ No newline at end of file
using System;
+public enum FooEnum
+{
+ One,
+ Two
+};
+
class Foo
{
public static int y = 1;
return s;
}
+
+ const FooEnum foo = FooEnum.Two;
+
+ static void Test_3 ()
+ {
+ object obj;
+
+ switch (foo) {
+ case FooEnum.One:
+ obj = new object ();
+ break;
+ case FooEnum.Two:
+ obj = new object ();
+ break;
+ }
+
+ Console.WriteLine (obj);
+ }
}
}
}
+.class public auto ansi beforefieldinit A2
+ extends [mscorlib]System.Attribute
+{
+
+ .custom instance void class [mscorlib]System.AttributeUsageAttribute::'.ctor'(valuetype ['missing-lib']System.AttributeTargets) = (01 00 80 00 00 00 00 00 ) // ........
+
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ ldarg.0
+ call instance void [mscorlib]System.Attribute::.ctor()
+ ret
+ }
+}
+
.class public auto ansi beforefieldinit X extends [mscorlib]System.Object
{
.custom instance void A::.ctor(class [mscorlib]System.Type) = ( 01 00 44 58 58 2C 20 62 75 67 2D 31 2D 6C 69 62 // ..DXX, missing-lib
// Compilation test only for missing 2nd level dependecies
+[A2]
class Program
{
void Test ()
{
int f = 1;
int g;
- return f > 1 && OutCall (out g) && g > 1;
+ return f > 1 && OutCall (out g) && g > 1;
+ }
+
+ static void Test8 ()
+ {
+ bool x = true;
+
+ int a;
+ if (x ? OutCall (out a) : OutCall (out a))
+ System.Console.WriteLine (a);
+ else
+ System.Console.WriteLine (a);
}
static bool OutCall (out int arg)
+++ /dev/null
-using System;
-
-// C#6 change
-
-struct S1
-{
- S2 s2;
-
- public S1 (int arg)
- {
- }
-}
-
-struct S2
-{
- int field;
-}
-
-class X
-{
- public static void Main ()
- {
- }
-}
\ No newline at end of file
+// Compiler options: -unsafe
+
using System;
class BoolArrayWithByteValues
return 0;
}
+ static unsafe bool Ptr ()
+ {
+ bool rv;
+
+ var arr = new byte [256];
+ for (int i = 0; i < arr.Length; i++)
+ arr [i] = (byte) i;
+ fixed (byte* bptr = arr) {
+ rv = true;
+ for (int i = 0; i < arr.Length; i++) {
+ bool* boptr = (bool*)(bptr + i);
+ if (arr[i] > 0 && !*boptr)
+ rv = false;
+ System.Console.WriteLine ("#{0} = {1}", i, *boptr);
+ }
+ }
+
+ return rv;
+ }
+
static int Main()
{
var a = new bool[1];
if (res != 0)
return res;
+ if (!Ptr ())
+ return 6;
+
return 0;
}
}
\ No newline at end of file
--- /dev/null
+using System;
+
+struct S
+{
+}
+
+class C
+{
+ public static implicit operator S (C c)
+ {
+ return new S ();
+ }
+}
+
+class Program
+{
+ static void Main ()
+ {
+ C c = new C ();
+ var x = c ?? new S ();
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+class Test
+{
+ public static bool Foo (out int v)
+ {
+ v = 0;
+ return false;
+ }
+
+ static void Main()
+ {
+ bool b = false;
+
+ int a1;
+ var r1 = (false || Foo (out a1)) ? a1 : 1;
+
+ int a2;
+ var r2 = (true && Foo (out a2)) ? 2 : a2;
+
+ int a3;
+ var r3 = (b || Foo (out a3)) && Foo (out a3);
+ int b3 = a3;
+
+ int a4;
+ var r4 = ((b || Foo (out a4)) && Foo (out a4));
+ int b4 = a4;
+
+ int a5;
+ if ((b || Foo (out a5)) && (b || Foo (out a5)))
+ Console.WriteLine ();
+ else
+ Console.WriteLine (a5);
+ }
+}
--- /dev/null
+using System;
+using i = System.Int16;
+
+enum E : i
+{
+}
+
+class X
+{
+ public static void Main ()
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+struct S1
+{
+ public readonly int Value;
+
+ public S1 ()
+ {
+ Value = 17;
+ }
+}
+
+struct S2
+{
+ public readonly int Value = 23;
+}
+
+struct S3
+{
+ public readonly int Value = 11;
+
+ public S3 ()
+ {
+ Value = 5;
+ }
+}
+
+struct S4
+{
+ public readonly int Value = 11;
+
+ public S4 (int v)
+ {
+ }
+}
+
+struct S5
+{
+ public readonly int Value = 7;
+
+ public S5 (int v)
+ : this ()
+ {
+ this.Value += v;
+ }
+}
+
+class C
+{
+ static int Main ()
+ {
+ var s = new S1 ();
+ if (s.Value != 17)
+ return 1;
+
+ var s2 = new S2 ();
+ if (s2.Value != 23)
+ return 2;
+
+ var s3 = new S3 ();
+ if (s3.Value != 5)
+ return 3;
+
+ var s4 = new S4 (5);
+ if (s4.Value != 11)
+ return 4;
+
+ var s5 = new S5 (2);
+ if (s5.Value != 9)
+ return 5;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Reflection.Emit;
+using System.Reflection;
+
+class MainClass
+{
+ public static int Main ()
+ {
+ var dynMethod = new DynamicMethod ("Metoda", MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard,
+ null, Type.EmptyTypes, typeof (MainClass), true);
+ var generator = dynMethod.GetILGenerator ();
+
+ generator.Emit (OpCodes.Ldc_I4_7);
+ GenerateCodeCall (generator, (int a) => {
+ Console.WriteLine (a);
+ });
+
+ generator.Emit (OpCodes.Ret);
+
+ var deleg = (Action)dynMethod.CreateDelegate (typeof (Action));
+ deleg ();
+ return 0;
+ }
+
+ static void GenerateCodeCall<T1> (ILGenerator generator, Action<T1> a)
+ {
+ generator.Emit (OpCodes.Call, a.Method);
+ }
+}
+
-// Compiler options: -langversion:future
using System;
using System.Threading;
using System.Threading.Tasks;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
-
using System;
using System.Threading;
using System.Threading.Tasks;
-// Compiler options: -langversion:future
-
using System;
using System.Threading;
using System.Threading.Tasks;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
-
using System;
using System.Threading;
using System.Threading.Tasks;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
-
using System;
using System.Threading;
using System.Threading.Tasks;
-// Compiler options: -langversion:future
-
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
using System;
using System.Threading.Tasks;
using System.Threading;
-// Compiler options: -langversion:future
using System;
using System.Threading.Tasks;
-// Compiler options: -langversion:future
-
using System;
using System.Threading;
using System.Threading.Tasks;
--- /dev/null
+using System;
+using System.Threading.Tasks;
+using System.Runtime.CompilerServices;
+using System.Reflection;
+
+class CorrectEncodingOfNestedTypes
+{
+ static async Task<T> GetAsync<T>(string s) where T : new()
+ {
+ return await Task.Factory.StartNew(async () => {
+ var response = await Task.FromResult (s);
+ return (T)new object();
+ }).Unwrap();
+ }
+
+ public static int Main ()
+ {
+ var t = typeof (CorrectEncodingOfNestedTypes).GetNestedTypes (BindingFlags.NonPublic) [0].GetNestedTypes (BindingFlags.NonPublic) [0];
+ var m = t.GetMethods (BindingFlags.NonPublic | BindingFlags.Instance) [0];
+ var ca = (AsyncStateMachineAttribute) m.GetCustomAttributes (true) [0];
+ if (ca.StateMachineType.GetGenericArguments ().Length != 1)
+ return 1;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+class DeclarationExpression
+{
+ public static int Main ()
+ {
+ Out (out int o);
+ if (o != 3)
+ return 1;
+
+ if (Out (out int o1)) {
+ if (o1 != 3)
+ return 2;
+ }
+
+ Out (out int o2 = 2);
+ if (o2 != 3)
+ return 3;
+
+ Out (out var o3);
+ if (o3 != 3)
+ return 4;
+
+ Ref (ref int r = 2);
+ if (r != 7)
+ return 5;
+
+ Ref (ref ((var r2 = 3)));
+ if (r2 != 8)
+ return 6;
+
+ Out2 (str: "b", v: out var o5);
+ if (o5 != 9)
+ return 7;
+
+ Out3 (out var o6 = 9m);
+ if (o6.GetType () != typeof (decimal))
+ return 8;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+
+ static bool Out (out int value)
+ {
+ value = 3;
+ return true;
+ }
+
+ static bool Out2 (out int v, string str)
+ {
+ v = 9;
+ return true;
+ }
+
+ static void Out3<T> (out T t)
+ {
+ t = default (T);
+ }
+
+ static void Ref (ref int arg)
+ {
+ arg += 5;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+class Program
+{
+ static int Main ()
+ {
+ var c1 = new C {
+ ["aaa"] = 12,
+ };
+
+ if (c1.Dict ["aaa"] != 12)
+ return 1;
+
+ var c2 = new C {
+ ["a1"] = 5,
+ ["a2"] = 10,
+ Value = 20,
+ };
+
+ if (c2.Dict ["a1"] != 5)
+ return 2;
+
+ if (c2.Dict ["a2"] != 10)
+ return 3;
+
+ if (c2.Value != 20)
+ return 4;
+
+ return 0;
+ }
+}
+
+
+class C
+{
+ public Dictionary<string, int> Dict = new Dictionary<string, int> ();
+
+ public int Value;
+
+ public int this [string arg] {
+ get {
+ return Dict [arg];
+ }
+ set {
+ Dict [arg] = value;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+class Program
+{
+ static int Main ()
+ {
+ var c = new C {
+ ["l1"] = new C {
+ ["l2"] = new C () {
+ Value = 10
+ }
+ },
+ ["l5"] = {
+ ["51"] = new C () {
+ Value = 100
+ }
+ }
+ };
+
+ if (c ["l1"]["l2"].Value != 10)
+ return 1;
+
+ if (c ["l5"]["51"].Value != 100)
+ return 2;
+
+ return 0;
+ }
+}
+
+
+class C
+{
+ public Dictionary<string, C> Dict = new Dictionary<string, C> ();
+
+ public int Value;
+
+ public C this [string arg] {
+ get {
+ C c;
+ if (!Dict.TryGetValue (arg, out c)) {
+ c = new C ();
+ Dict [arg] = c;
+ }
+
+ return c;
+ }
+ set {
+ Dict [arg] = value;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+class X
+{
+ public static int Main ()
+ {
+ const string s = nameof (X);
+ System.Console.WriteLine (s);
+ if (s != "X")
+ return 1;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+using System.Collections.Generic;
+using SCG = System.Collections.Generic;
+//using SCGL = System.Collections.Generic.List<>;
+
+class A<T>
+{
+ public class B
+ {
+ public int Foo;
+ }
+}
+
+class X
+{
+ bool field;
+ long Prop { get; set; }
+ event Action ev;
+
+ public static int Main ()
+ {
+ int res;
+ var x = new X ();
+ res = x.SimpleName (1);
+ if (res != 0)
+ return res;
+
+ res = x.MemberAccess ();
+ if (res != 0)
+ return 20 + res;
+
+ res = x.QualifiedName ();
+ if (res != 0)
+ return 40 + res;
+
+ return 0;
+ }
+
+ static void GenMethod<T, U, V> ()
+ {
+ }
+
+ int SimpleName<T> (T arg)
+ {
+ const object c = null;
+ decimal d = 0;
+
+ if (nameof (T) != "T")
+ return 1;
+
+ if (nameof (arg) != "arg")
+ return 2;
+
+ if (nameof (c) != "c")
+ return 3;
+
+ if (nameof (d) != "d")
+ return 4;
+
+ if (nameof (field) != "field")
+ return 5;
+
+ if (nameof (Prop) != "Prop")
+ return 6;
+
+ if (nameof (@Main) != "Main")
+ return 7;
+
+ if (nameof (ev) != "ev")
+ return 8;
+
+ if (nameof (Int32) != "Int32")
+ return 9;
+
+ if (nameof (Action) != "Action")
+ return 10;
+
+ if (nameof (List) != "List")
+ return 11;
+
+ if (nameof (GenMethod) != "GenMethod")
+ return 12;
+
+ return 0;
+ }
+
+ int MemberAccess ()
+ {
+ if (nameof (X.field) != "field")
+ return 1;
+
+ if (nameof (X.Prop) != "Prop")
+ return 2;
+
+ if (nameof (Console.WriteLine) != "WriteLine")
+ return 3;
+
+ if (nameof (System.Collections.Generic.List) != "List")
+ return 4;
+
+ if (nameof (System.Collections) != "Collections")
+ return 5;
+
+ if (nameof (X.GenMethod) != "GenMethod")
+ return 6;
+
+ if (nameof (A<>.B) != "B")
+ return 7;
+
+ if (nameof (A<>.B.Foo) != "Foo")
+ return 7;
+
+ return 0;
+ }
+
+ int QualifiedName ()
+ {
+ if (nameof (global::System.Int32) != "Int32")
+ return 1;
+
+ if (nameof (SCG.List) != "List")
+ return 2;
+
+// if (nameof (SCGL.Contains) != "Contains")
+// return 3;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using T2;
+
+static class T2
+{
+ public static int nameof (string s)
+ {
+ return 2;
+ }
+}
+
+class X
+{
+ public static int Main ()
+ {
+ string s = "";
+ var v = nameof (s);
+ if (v != 2)
+ return 1;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+interface IA
+{
+ void M (int arg);
+ int Prop { get; set; }
+}
+
+interface IB
+{
+ void M (string arg);
+ void M<T> (T arg);
+ int Prop { get; set; }
+}
+
+interface I : IA, IB
+{
+ void Extra (string method = nameof (M), string prop = nameof (Prop));
+}
+
+class Ambiguous
+{
+ public static int Main ()
+ {
+ string res;
+ res = nameof (I.M);
+ if (res != "M")
+ return 1;
+
+ res = nameof (I.Prop);
+ if (res != "Prop")
+ return 2;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+struct S
+{
+ public int Prop { get; set; }
+}
+
+interface I
+{
+ int Method ();
+}
+
+class CI : I
+{
+ public int Method ()
+ {
+ return 33;
+ }
+
+ public int Prop { get; set; }
+}
+
+class C
+{
+ static int prop_calls;
+ static string Prop {
+ get {
+ ++prop_calls;
+ return null;
+ }
+ }
+
+ static int TestArray ()
+ {
+ int[] k = null;
+ var t1 = k?.ToString ();
+ if (t1 != null)
+ return 1;
+
+ var t2 = k?.GetLength (0);
+ if (t2 != null)
+ return 2;
+
+ var t3 = k?.Length;
+ if (t3 != null)
+ return 3;
+
+ var t4 = k?.GetLength (0).ToString () ?? "N";
+ if (t4 != "N")
+ return 4;
+
+ var t5 = k?.Length.ToString () ?? "N";
+ if (t5 != "N")
+ return 5;
+
+ k = new int[] { 3 };
+ var t11 = k?.ToString ();
+ if (t11.GetType () != typeof (string))
+ return 10;
+
+ var t12 = k?.GetLength (0);
+ if (t12.GetType () != typeof (int))
+ return 11;
+
+ var t13 = k?.Length;
+ if (t13.GetType () != typeof (int))
+ return 12;
+
+ return 0;
+ }
+
+ static int TestReferenceType ()
+ {
+ string s = null;
+ var t1 = s?.Split ();
+ if (t1 != null)
+ return 1;
+
+ var t2 = s?.Length;
+ if (t2 != null)
+ return 2;
+
+ var t3 = Prop?.Length;
+ if (t3 != null)
+ return 3;
+ if (prop_calls != 1)
+ return 4;
+
+ var t4 = Prop?.Split ();
+ if (t4 != null)
+ return 5;
+ if (prop_calls != 2)
+ return 6;
+
+ return 0;
+ }
+
+ static int TestGeneric<T> (T t) where T : class, I
+ {
+ var t1 = t?.Method ();
+ if (t1 != null)
+ return 1;
+
+ T[] at = null;
+ var t2 = at?.Length;
+ if (t2 != null)
+ return 2;
+
+ return 0;
+ }
+
+ static int TestNullable ()
+ {
+ int? i = 4;
+ var m = i?.CompareTo (3);
+ if (m.GetType () != typeof (int))
+ return 1;
+
+ if (m != 1)
+ return 2;
+
+ DateTime? dt = null;
+ dt?.ToString ();
+ if (dt?.ToString () != null)
+ return 3;
+
+ byte? b = 0;
+ if (b?.ToString () != "0")
+ return 4;
+
+ S? s = null;
+ var p1 = s?.Prop;
+ if (p1 != null)
+ return 5;
+
+ return 0;
+ }
+
+ static int Main ()
+ {
+ int res;
+ res = TestNullable ();
+ if (res != 0)
+ return 100 + res;
+
+ res = TestArray ();
+ if (res != 0)
+ return 200 + res;
+
+ res = TestReferenceType ();
+ if (res != 0)
+ return 300 + res;
+
+ CI ci = null;
+ res = TestGeneric<CI> (ci);
+ if (res != 0)
+ return 400 + res;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+class CI
+{
+ public long Field;
+ public sbyte? FieldNullable;
+ public object FieldReference;
+
+ public int Prop { get; set; }
+ public byte? PropNullable { get; set; }
+ public object PropReference { get; set; }
+
+ public event Action ev1;
+}
+
+class C
+{
+ static int TestProperty ()
+ {
+ CI ci = null;
+
+ var m1 = ci?.Prop;
+ var m2 = ci?.PropNullable;
+ var m3 = ci?.PropReference;
+
+ var m4 = ci?.Prop.ToString () ?? "N";
+ if (m4 != "N")
+ return 1;
+
+ var m5 = ci?.PropNullable.ToString () ?? "N";
+ if (m5 != "N")
+ return 2;
+
+ var m6 = ci?.PropReference.ToString () ?? "N";
+ if (m6 != "N")
+ return 3;
+
+// ci?.Prop = 6;
+
+ ci = new CI ();
+ m1 = ci?.Prop;
+ m2 = ci?.PropNullable;
+ m3 = ci?.PropReference;
+
+// ci?.Prop = 5;
+// if (ci.Prop != 5)
+// return 1;
+
+// TODO: It's not allowed for now
+// ci?.Prop += 4;
+// var pp1 = ci?.Prop = 4;
+// var pp2 = ci?.Prop += 4;
+
+ return 0;
+ }
+
+ static int TestField ()
+ {
+ CI ci = null;
+ var m1 = ci?.Field;
+ var m2 = ci?.FieldNullable;
+ var m3 = ci?.FieldReference;
+ var m4 = ci?.Field.ToString () ?? "N";
+ if (m4 != "N")
+ return 1;
+
+ var m5 = ci?.FieldNullable.ToString () ?? "N";
+ if (m5 != "N")
+ return 2;
+
+ var m6 = ci?.FieldReference.ToString () ?? "N";
+ if (m6 != "N")
+ return 3;
+
+// ci?.Field = 6;
+
+ ci = new CI ();
+ m1 = ci?.Field;
+ m2 = ci?.FieldNullable;
+ m3 = ci?.FieldReference;
+
+// ci?.Field = 5;
+// if (ci.Field != 5)
+// return 1;
+
+// TODO: It's not allowed for now
+// ci?.Field += 4;
+// var pp1 = ci?.Field = 4;
+// var pp2 = ci?.Field += 4;
+
+ return 0;
+ }
+/*
+ static int TestEvent ()
+ {
+ CI ci = null;
+ ci?.ev1 += null;
+
+ ci = new CI ();
+ ci?.ev1 += null;
+
+ return 0;
+ }
+*/
+ static int Main ()
+ {
+ int res;
+
+ res = TestProperty ();
+ if (res != 0)
+ return 10 + res;
+
+ res = TestField ();
+ if (res != 0)
+ return 20 + res;
+
+// res = TestEvent ();
+// if (res != 0)
+// return 30 + res;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+class C
+{
+ int field;
+
+ int Test1 ()
+ {
+ var x = this?.field;
+ if (x == null)
+ return 1;
+
+ var x2 = "abc"?.GetHashCode();
+ if (x2 == null)
+ return 2;
+
+ return 0;
+ }
+
+ static int Main ()
+ {
+ var c = new C ();
+ c.Test1 ();
+
+ const C c2 = null;
+ var res = c2?.field;
+ if (res != null)
+ return 1;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+public class D
+{
+ void Foo ()
+ {
+ }
+
+ public static void Main()
+ {
+ D d = null;
+ Action a = d?.Foo;
+ }
+}
--- /dev/null
+using System;
+
+class CI
+{
+ public string this [string i] { set { } get { return ""; } }
+ public int? this [int i] { set { } get { return 1; } }
+}
+
+class C
+{
+ static int TestArrayAccess ()
+ {
+ byte[] arr = null;
+ var v = arr? [0];
+ if (v != null)
+ return 1;
+
+ long?[] ar2 = null;
+ var v2 = ar2? [-1];
+ if (v2 != null)
+ return 2;
+
+ var v3 = arr? [0].GetHashCode () ?? 724;
+ if (v3 != 724)
+ return 3;
+
+// TODO: Disabled for now?
+// arr? [0] += 2;
+ return 0;
+ }
+
+ static int TestIndexerAccess ()
+ {
+ CI ci = null;
+ var v = ci? ["x"];
+ if (v != null)
+ return 1;
+
+ var v2 = ci? [0];
+ if (v2 != null)
+ return 2;
+
+ var v3 = ci? [0].GetHashCode () ?? 724;
+ if (v3 != 724)
+ return 3;
+
+// TODO: Disabled for now?
+// ci? [0] += 3;
+ return 0;
+ }
+
+ static int Main ()
+ {
+ int res;
+ res = TestArrayAccess ();
+ if (res != 0)
+ return 10 + res;
+
+ res = TestIndexerAccess ();
+ if (res != 0)
+ return 20 + res;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+public class C
+{
+ static int Main ()
+ {
+ string x = null;
+ var t1 = x?.ToString ().ToString ().ToString () ?? "t1";
+ if (t1 != "t1")
+ return 1;
+
+ var t2 = x?.ToString ().ToString ()?.ToString () ?? "t2";
+ if (t2 != "t2")
+ return 2;
+
+ var t3 = x?.ToString ()?.ToString ()?.ToString () ?? "t3";
+ if (t3 != "t3")
+ return 3;
+
+ var t4 = x?.ToString ().GetHashCode () ?? 9;
+ if (t4 != 9)
+ return 4;
+
+ var t5 = x?.ToString ()?.GetHashCode () ?? 8;
+ if (t5 != 8)
+ return 5;
+
+ var t6 = x?.ToString().Length;
+ if (t6 != null)
+ return 6;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+public static class C
+{
+ static int Main()
+ {
+ int[] a = null;
+ var r = a?.EM ().EM ().EM () ?? "N";
+ if (r != "N")
+ return 1;
+
+ a?.EM ().EM ();
+
+ return 0;
+ }
+
+ static string EM (this object arg)
+ {
+ if (arg == null)
+ throw new ApplicationException ();
+
+ return "";
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+interface I
+{
+ void Foo (bool expected);
+}
+
+struct S : I
+{
+ bool flag;
+
+ public void Foo (bool expected)
+ {
+ Console.WriteLine (flag);
+ if (expected != flag)
+ throw new ApplicationException ();
+
+ flag = true;
+ }
+}
+
+class Program
+{
+ static void M<T> (T x)
+ {
+ object s = x?.ToString ();
+ System.Console.WriteLine (s);
+
+ var h = x?.GetHashCode ();
+ System.Console.WriteLine (h);
+ }
+
+ static void M2<T> (T[] x)
+ {
+ object s = x?.ToString ();
+ System.Console.WriteLine (s);
+
+ var h = x?.GetHashCode ();
+ System.Console.WriteLine (h);
+ }
+
+ static void M2_2<T> (T[] x)
+ {
+ object s = x[0]?.ToString ();
+ System.Console.WriteLine (s);
+
+ var h = x[0]?.GetHashCode ();
+ System.Console.WriteLine (h);
+ }
+
+ static void M3<T> (T? x) where T : struct
+ {
+ object s = x?.ToString ();
+ System.Console.WriteLine (s);
+
+ var h = x?.GetHashCode ();
+ System.Console.WriteLine (h);
+ }
+
+ static void TestAddress_1<T> (T t) where T : I
+ {
+ t?.Foo (false);
+ t?.Foo (true);
+ }
+
+ static void TestAddress_2<T> (T[] t) where T : I
+ {
+ t[0]?.Foo (false);
+ t[0]?.Foo (true);
+ }
+
+ static void Main()
+ {
+ M<string> (null);
+ M (1);
+ M("X");
+
+ M2<int> (null);
+ M2<string> (null);
+ M2 (new [] { 1 });
+ M2 (new [] { "x" });
+
+ M2_2 (new string [1]);
+ M2_2 (new int [1]);
+
+ M3<int> (1);
+ M3<byte> (null);
+
+ TestAddress_1 (new S ());
+ var ar = new [] { new S () };
+ TestAddress_2 (ar);
+ }
+}
\ No newline at end of file
--- /dev/null
+delegate int D (int t);
+
+class X
+{
+ D d = delegate { return 4; };
+
+ public static int Main ()
+ {
+ X x = null;
+
+ var res = x?.d (55);
+ if (res != null)
+ return 1;
+
+ x?.d (1);
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+partial class X
+{
+ static partial void Main ();
+
+ static partial void Main ()
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -langversion:experimental
+
+using System;
+
+class TypePattern
+{
+ public static int Main ()
+ {
+ object o = 3;
+ bool r = o is System.String t1;
+ if (t1 != null)
+ return 1;
+
+ if (r)
+ return 2;
+
+ if (o is string t2)
+ return 3;
+
+ if (t2 != null)
+ return 4;
+
+ object o2 = (int?) 4;
+ bool r2 = o2 is byte? t3;
+
+ if (t3 != null)
+ return 5;
+
+ if (r2)
+ return 6;
+
+ long? l = 5;
+ bool r3 = l is long t4;
+ if (t4 != 5)
+ return 7;
+
+ if (!r3)
+ return 8;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -langversion:experimental
+
+using System;
+
+enum MyEnum : short
+{
+ V_4 = 4
+}
+
+class ConstantPattern
+{
+ static bool Generic<T> (T t) where T : class
+ {
+ return t is default (T);
+ }
+
+ public static int Main ()
+ {
+ bool b4 = false;
+ b4 = !b4;
+ object o = "x";
+ bool r1 = o is "y";
+ if (r1)
+ return 1;
+
+ r1 = o is "x";
+ if (!r1)
+ return 2;
+
+ string s = "o";
+ if (s is null)
+ return 3;
+
+ if (s is "oo")
+ return 4;
+
+ if (!(s is "o"))
+ return 5;
+
+ int? o3 = 4;
+ bool r3 = o3 is null;
+ if (r3)
+ return 6;
+
+ r3 = o3 is 4;
+ if (!r3)
+ return 7;
+
+ object o4 = (byte?)255;
+ var ggg = o4 is 255;
+ if (!ggg)
+ return 8;
+
+ if (o4 is null)
+ return 9;
+
+ object o5 = (double)-255;
+ if (!(o5 is -byte.MaxValue))
+ return 10;
+
+ object o6 = MyEnum.V_4;
+ bool r4 = o6 is 4;
+ if (r4)
+ return 11;
+
+ r4 = o6 is MyEnum.V_4;
+ if (!r4)
+ return 12;
+
+ ConstantPattern o7 = new ConstantPattern ();
+ if (!(o7 is ConstantPattern))
+ return 13;
+
+ if (!(o7 is object))
+ return 14;
+
+ object o8 = true;
+ if (o8 is false)
+ return 15;
+
+ if (!(o8 is true))
+ return 16;
+
+ if (Generic (""))
+ return 17;
+
+ if (!Generic<Delegate> (null))
+ return 18;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -langversion:experimental
+
+class WildcardPattern
+{
+ static int Main ()
+ {
+ long? o = 1;
+ bool b = o is *;
+ if (!b)
+ return 1;
+
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -langversion:experimental
+
+using System;
+
+class RecursivePattern
+{
+ static int Main ()
+ {
+ object o = null;
+ bool b = o is C1 (8);
+ if (b)
+ return 1;
+
+ o = new C1 ();
+ b = o is C1 (-4);
+ if (b)
+ return 2;
+
+ b = o is C1 (8);
+ if (!b)
+ return 3;
+
+ b = o is C1 (C1 (9), C1 (8));
+ if (b)
+ return 4;
+
+ b = o is C1 (C1 (*), C1 (8));
+ if (!b)
+ return 41;
+
+ b = o is C1 (0);
+ if (b)
+ return 5;
+
+ ValueType vt = new S ();
+ b = vt is S (null, 0);
+ if (b)
+ return 6;
+
+ b = vt is S (8, 0);
+ if (b)
+ return 7;
+
+ b = vt is S (8, 2);
+ if (!b)
+ return 8;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+}
+
+class C1
+{
+ public static bool operator is (C1 c, out int x)
+ {
+ x = 8;
+ return true;
+ }
+
+ public static bool operator is (C1 c, out C1 c2, out C1 c3)
+ {
+ c2 = null;
+ c3 = null;
+ return true;
+ }
+}
+
+struct S
+{
+ public static bool operator is (S s, out int? x, out decimal d)
+ {
+ x = 8;
+ d = 2;
+ return true;
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -langversion:experimental
+
+using System;
+
+class RecursiveNamedPattern
+{
+ public static int Main ()
+ {
+ object o = new C ();
+ bool b = o is C (name2: "", name1: -2);
+ if (b)
+ return 1;
+
+ b = o is C (name2: "n2", name1: -2);
+ if (!b)
+ return 2;
+
+ b = o is C ();
+ if (b)
+ return 3;
+
+ return 0;
+ }
+}
+
+class C
+{
+ public static bool operator is (C c, out long name1, out string name2)
+ {
+ name1 = -2;
+ name2 = "n2";
+ return true;
+ }
+
+ public static bool operator is (C c)
+ {
+ return false;
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -langversion:experimental
+
+using System;
+
+class RecursiveNamedPattern
+{
+ public static int Main ()
+ {
+ if (Switch_1 (null) != 4)
+ return 1;
+
+ if (Switch_1 ("x") != 5)
+ return 2;
+
+ if (Switch_1 (1) != 1)
+ return 3;
+
+ if (Switch_1 (new C1 ()) != 3)
+ return 4;
+
+ if (Switch_1 ((byte?) 1) != 1)
+ return 5;
+
+ if (Switch_2 (new C1 ()) != 3)
+ return 10;
+
+ if (Switch_2 (null) != 2)
+ return 11;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+
+ static int Switch_1 (object o)
+ {
+ switch (o) {
+ case 1:
+ return 1;
+ case C1 (3):
+ return 2;
+ case C1 (2):
+ return 3;
+ case null:
+ return 4;
+ default:
+ return 5;
+ }
+ }
+
+ static int Switch_2 (C1 o)
+ {
+ switch (o) {
+ case null:
+ return 2;
+ }
+
+ return 3;
+ }
+}
+
+public class C1
+{
+ public static bool operator is (C1 c1, out int i)
+ {
+ i = 2;
+ return true;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:experimental
+
+using System;
+
+class PropertyPattern
+{
+ static int Main ()
+ {
+ object o = new DateTime (2014, 8, 30);
+
+ if (!(o is DateTime { Day is 30 }))
+ return 1;
+
+ if (!(o is DateTime { Month is 8, Day is 30, Year is * }))
+ return 2;
+
+ if (o is X { Field is 30 })
+ return 3;
+
+ object o2 = new X () {
+ Field = new Y () {
+ Prop = 'f'
+ }
+ };
+
+ bool res2 = o2 is X { Field is Y { Prop is 'f' }, Field is Y (4) };
+ if (!res2)
+ return 4;
+
+ res2 = o2 is X { Field is Y { Prop is 'g' } };
+ if (res2)
+ return 5;
+
+ object o3 = new X () {
+ Value = 5
+ };
+
+ if (o3 is X { Value is 6 })
+ return 6;
+
+ if (!(o3 is X { Value is 5 }))
+ return 7;
+
+ object o4 = new X () {
+ NullableValue = 4
+ };
+
+ bool res3 = o4 is X { NullableValue is (byte) 4 };
+ if (!res3)
+ return 8;
+
+ Console.WriteLine("ok");
+ return 0;
+ }
+}
+
+class X
+{
+ public object Field { get; set; }
+
+ public object Value { get; set; }
+
+ public long? NullableValue { get; set; }
+}
+
+class Y
+{
+ public char Prop { get; set; }
+
+ public static bool operator is (Y y, out int x)
+ {
+ x = 4;
+ return true;
+ }
+}
}
}
+struct S2 (int arg)
+{
+ public readonly int v = arg;
+}
+
+struct S3 (string s = "arg")
+{
+ public readonly string V2 = s;
+
+ public S3 (int i, string s = "arg2")
+ : this (s)
+ {
+ }
+}
+
class X
{
public static int Main ()
if (new S ('x').y != 1)
return 2;
+ if (new S2 (2).v != 2)
+ return 3;
+
+ if (new S3 ("x").V2 != "x")
+ return 4;
+
+ if (new S3 (0).V2 != "arg2")
+ return 5;
+
return 0;
}
}
\ No newline at end of file
</method>\r
</type>\r
<type name="AssertDynamicObject">\r
- <method name="System.Object <BindGetIndex>m__0(System.Object, System.Dynamic.DynamicMetaObject)" attrs="145">\r
+ <method name="System.Object <BindGetIndex>m__0(System.Dynamic.DynamicMetaObject)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.Object <BindInvoke>m__1(System.Object, System.Dynamic.DynamicMetaObject)" attrs="145">\r
+ <method name="System.Object <BindInvoke>m__1(System.Dynamic.DynamicMetaObject)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.Object <BindInvokeMember>m__2(System.Object, System.Dynamic.DynamicMetaObject)" attrs="145">\r
+ <method name="System.Object <BindInvokeMember>m__2(System.Dynamic.DynamicMetaObject)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.Object <BindSetIndex>m__3(System.Object, System.Dynamic.DynamicMetaObject)" attrs="145">\r
+ <method name="System.Object <BindSetIndex>m__3(System.Dynamic.DynamicMetaObject)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
<type name="Tester">\r
- <method name="Void <BinaryAdd_1>m__0(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAdd_1>m__0(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>73</size>\r
</method>\r
- <method name="Void <BinaryAdd_2>m__1(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAdd_2>m__1(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>68</size>\r
</method>\r
- <method name="Void <BinaryAdd_3>m__2(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAdd_3>m__2(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>73</size>\r
</method>\r
- <method name="Void <BinaryAdd_4>m__3(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAdd_4>m__3(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>73</size>\r
</method>\r
- <method name="Void <BinaryAddChecked_1>m__4(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAddChecked_1>m__4(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>73</size>\r
</method>\r
- <method name="Void <BinaryAddChecked_2>m__5(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAddChecked_2>m__5(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>73</size>\r
</method>\r
- <method name="Void <BinaryAddAssign_1>m__6(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAddAssign_1>m__6(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryAddAssignChecked_1>m__7(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAddAssignChecked_1>m__7(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryAnd_1>m__8(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAnd_1>m__8(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>73</size>\r
</method>\r
- <method name="Void <BinaryAndAssign_1>m__9(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryAndAssign_1>m__9(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryDivide_1>m__A(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryDivide_1>m__A(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryDivideAssign_1>m__B(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryDivideAssign_1>m__B(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryEqual_1>m__C(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryEqual_1>m__C(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryExclusiveOr_1>m__D(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryExclusiveOr_1>m__D(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryExclusiveOrAssign_1>m__E(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryExclusiveOrAssign_1>m__E(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryGreaterThan_1>m__F(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryGreaterThan_1>m__F(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryGreaterThanOrEqual_1>m__10(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryGreaterThanOrEqual_1>m__10(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryLeftShift_1>m__11(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryLeftShift_1>m__11(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryLeftShiftAssign_1>m__12(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryLeftShiftAssign_1>m__12(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryLessThan_1>m__13(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryLessThan_1>m__13(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryLessThanOrEqual_1>m__14(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryLessThanOrEqual_1>m__14(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryModulo_1>m__15(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryModulo_1>m__15(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryModuloAssign_1>m__16(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryModuloAssign_1>m__16(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryMultiply_1>m__17(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryMultiply_1>m__17(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryMultiplyAssign_1>m__18(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryMultiplyAssign_1>m__18(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryNotEqual_1>m__19(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryNotEqual_1>m__19(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryOr_1>m__1A(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryOr_1>m__1A(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryOrAssign_1>m__1B(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryOrAssign_1>m__1B(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryRightShift_1>m__1C(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryRightShift_1>m__1C(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinaryRightShiftAssign_1>m__1D(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinaryRightShiftAssign_1>m__1D(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinarySubtract_1>m__1E(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinarySubtract_1>m__1E(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <BinarySubtractAssign_1>m__1F(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <BinarySubtractAssign_1>m__1F(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="System.Object <Convert_1>m__20(System.Object, System.Dynamic.ConvertBinder)" attrs="145">\r
+ <method name="System.Object <Convert_1>m__20(System.Dynamic.ConvertBinder)" attrs="145">\r
<size>58</size>\r
</method>\r
- <method name="System.Object <Convert_2>m__21(System.Object, System.Dynamic.ConvertBinder)" attrs="145">\r
+ <method name="System.Object <Convert_2>m__21(System.Dynamic.ConvertBinder)" attrs="145">\r
<size>58</size>\r
</method>\r
- <method name="System.Object <Convert_3>m__22(System.Object, System.Dynamic.ConvertBinder)" attrs="145">\r
+ <method name="System.Object <Convert_3>m__22(System.Dynamic.ConvertBinder)" attrs="145">\r
<size>58</size>\r
</method>\r
- <method name="System.Object <Convert_4>m__23(System.Object, System.Dynamic.ConvertBinder)" attrs="145">\r
+ <method name="System.Object <Convert_4>m__23(System.Dynamic.ConvertBinder)" attrs="145">\r
<size>58</size>\r
</method>\r
- <method name="System.Object <Convert_5>m__24(System.Object, System.Dynamic.ConvertBinder)" attrs="145">\r
+ <method name="System.Object <Convert_5>m__24(System.Dynamic.ConvertBinder)" attrs="145">\r
<size>67</size>\r
</method>\r
- <method name="Void <GetIndex_1>m__25(System.Object, System.Dynamic.GetIndexBinder, System.Object[])" attrs="145">\r
+ <method name="Void <GetIndex_1>m__25(System.Dynamic.GetIndexBinder, System.Object[])" attrs="145">\r
<size>93</size>\r
</method>\r
- <method name="Void <GetIndex_2>m__26(System.Object, System.Dynamic.GetIndexBinder, System.Object[])" attrs="145">\r
+ <method name="Void <GetIndex_2>m__26(System.Dynamic.GetIndexBinder, System.Object[])" attrs="145">\r
<size>112</size>\r
</method>\r
- <method name="System.Object <GetMember_1>m__27(System.Object, System.Dynamic.GetMemberBinder)" attrs="145">\r
+ <method name="System.Object <GetMember_1>m__27(System.Dynamic.GetMemberBinder)" attrs="145">\r
<size>75</size>\r
</method>\r
- <method name="Void <Invoke_1>m__28(System.Object, System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
+ <method name="Void <Invoke_1>m__28(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
<size>102</size>\r
</method>\r
- <method name="Void <Invoke_2>m__29(System.Object, System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
+ <method name="Void <Invoke_2>m__29(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Void <Invoke_4>m__2A(System.Object, System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
+ <method name="Void <Invoke_4>m__2A(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
<size>128</size>\r
</method>\r
- <method name="Void <Invoke_5>m__2B(System.Object, System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
+ <method name="Void <Invoke_5>m__2B(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
<size>92</size>\r
</method>\r
- <method name="Void <Invoke_5>m__2C(System.Object, System.Object)" attrs="145">\r
+ <method name="Void <Invoke_5>m__2C(System.Object)" attrs="145">\r
<size>94</size>\r
</method>\r
- <method name="Void <Invoke_6>m__2D(System.Object, System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
+ <method name="Void <Invoke_6>m__2D(System.Dynamic.InvokeBinder, System.Object[])" attrs="145">\r
<size>93</size>\r
</method>\r
- <method name="Void <InvokeMember_1>m__2E(System.Object, System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
+ <method name="Void <InvokeMember_1>m__2E(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
<size>111</size>\r
</method>\r
- <method name="Void <InvokeMember_3>m__2F(System.Object, System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
+ <method name="Void <InvokeMember_3>m__2F(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
<size>112</size>\r
</method>\r
- <method name="Void <InvokeMember_4>m__30(System.Object, System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
+ <method name="Void <InvokeMember_4>m__30(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
<size>111</size>\r
</method>\r
- <method name="Void <InvokeMember_7>m__31(System.Object, System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
+ <method name="Void <InvokeMember_7>m__31(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
<size>91</size>\r
</method>\r
- <method name="Void <InvokeMember_8>m__32(System.Object, System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
+ <method name="Void <InvokeMember_8>m__32(System.Dynamic.InvokeMemberBinder, System.Object[])" attrs="145">\r
<size>112</size>\r
</method>\r
- <method name="Void <SetIndex_1>m__33(System.Object, System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="145">\r
+ <method name="Void <SetIndex_1>m__33(System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="145">\r
<size>125</size>\r
</method>\r
- <method name="Void <SetIndex_2>m__34(System.Object, System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="145">\r
+ <method name="Void <SetIndex_2>m__34(System.Dynamic.SetIndexBinder, System.Object[], System.Object)" attrs="145">\r
<size>140</size>\r
</method>\r
- <method name="Void <SetMember_1>m__35(System.Object, System.Dynamic.SetMemberBinder, System.Object)" attrs="145">\r
+ <method name="Void <SetMember_1>m__35(System.Dynamic.SetMemberBinder, System.Object)" attrs="145">\r
<size>102</size>\r
</method>\r
- <method name="Void <SetMember_2>m__36(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <SetMember_2>m__36(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>69</size>\r
</method>\r
- <method name="Void <SetMember_2>m__37(System.Object, System.Dynamic.SetMemberBinder, System.Object)" attrs="145">\r
+ <method name="Void <SetMember_2>m__37(System.Dynamic.SetMemberBinder, System.Object)" attrs="145">\r
<size>77</size>\r
</method>\r
- <method name="System.Object <UnaryPlus_1>m__38(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryPlus_1>m__38(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>55</size>\r
</method>\r
- <method name="System.Object <UnaryMinus_1>m__39(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryMinus_1>m__39(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>55</size>\r
</method>\r
- <method name="System.Object <UnaryNot_1>m__3A(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryNot_1>m__3A(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>55</size>\r
</method>\r
- <method name="System.Object <UnaryOnesComplement_1>m__3B(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryOnesComplement_1>m__3B(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>55</size>\r
</method>\r
- <method name="System.Object <UnaryDecrement_1>m__3C(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryDecrement_1>m__3C(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>55</size>\r
</method>\r
- <method name="System.Object <UnaryDecrement_2>m__3D(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryDecrement_2>m__3D(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>59</size>\r
</method>\r
- <method name="System.Object <UnaryIncrement_1>m__3E(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryIncrement_1>m__3E(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>55</size>\r
</method>\r
- <method name="System.Object <UnaryIncrement_2>m__3F(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryIncrement_2>m__3F(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>59</size>\r
</method>\r
- <method name="System.Object <UnaryIsFalse_1>m__40(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryIsFalse_1>m__40(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>60</size>\r
</method>\r
- <method name="Void <UnaryIsFalse_1>m__41(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <UnaryIsFalse_1>m__41(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>69</size>\r
</method>\r
- <method name="System.Object <UnaryIsFalse_2>m__42(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryIsFalse_2>m__42(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>60</size>\r
</method>\r
- <method name="Void <UnaryIsFalse_2>m__43(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <UnaryIsFalse_2>m__43(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>69</size>\r
</method>\r
- <method name="System.Object <UnaryIsFalse_3>m__44(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryIsFalse_3>m__44(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>60</size>\r
</method>\r
- <method name="Void <UnaryIsFalse_3>m__45(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <UnaryIsFalse_3>m__45(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>68</size>\r
</method>\r
- <method name="System.Object <UnaryIsTrue_1>m__46(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryIsTrue_1>m__46(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>60</size>\r
</method>\r
- <method name="System.Object <UnaryIsTrue_2>m__47(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryIsTrue_2>m__47(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>60</size>\r
</method>\r
- <method name="Void <UnaryIsTrue_2>m__48(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <UnaryIsTrue_2>m__48(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>69</size>\r
</method>\r
- <method name="System.Object <UnaryIsTrue_3>m__49(System.Object, System.Dynamic.UnaryOperationBinder)" attrs="145">\r
+ <method name="System.Object <UnaryIsTrue_3>m__49(System.Dynamic.UnaryOperationBinder)" attrs="145">\r
<size>60</size>\r
</method>\r
- <method name="Void <UnaryIsTrue_3>m__4A(System.Object, System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
+ <method name="Void <UnaryIsTrue_3>m__4A(System.Dynamic.BinaryOperationBinder, System.Object)" attrs="145">\r
<size>74</size>\r
</method>\r
- <method name="Boolean <Main>m__4B(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__4B(System.Reflection.MethodInfo)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.String <Main>m__4C(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__4C(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__4D(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__4D(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__4E(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__4E(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<method name="Void IsTest()" attrs="129">\r
<size>69</size>\r
</method>\r
- <method name="Void <SubtractAssignEvent>m__0(System.Object)" attrs="145">\r
+ <method name="Void <SubtractAssignEvent>m__0()" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="Boolean <Main>m__1(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__1(System.Reflection.MethodInfo)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.String <Main>m__2(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__2(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__3(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__4(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__4(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Tester">\r
- <method name="Int32 <InvokeTest>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="Int32 <InvokeTest>m__0(System.String)" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Void <InvokeMember_Error>m__1(System.Object)" attrs="145">\r
+ <method name="Void <InvokeMember_Error>m__1()" attrs="145">\r
<size>112</size>\r
</method>\r
- <method name="Void <InvokeConstructor>m__2(System.Object, System.Decimal)" attrs="145">\r
+ <method name="Void <InvokeConstructor>m__2(System.Decimal)" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Int32 <IsEvent>m__3(System.Object)" attrs="145">\r
+ <method name="Int32 <IsEvent>m__3()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <IsEvent>m__4(System.Object)" attrs="145">\r
+ <method name="Int32 <IsEvent>m__4()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Boolean <Main>m__5(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__5(System.Reflection.MethodInfo)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.String <Main>m__6(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__6(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__7(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__7(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__8(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__8(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="DynamicAssignments">\r
- <method name="System.Object <Main>m__0(System.Object, System.Object)" attrs="145">\r
+ <method name="System.Object <Main>m__0(System.Object)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Int32 <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <Main>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>11</size>\r
</method>\r
- <method name="Void <Main>m__1(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__1()" attrs="145">\r
<size>11</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, Int32 ByRef)" attrs="145">\r
+ <method name="Int32 <Main>m__2(Int32 ByRef)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C`1[T]">\r
- <method name="Int32 <E>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <E>m__0(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="C+<Test2>c__AnonStorey0`1+<Test2>c__AnonStorey1`1[T]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- </type>\r
<type name="C+<Test2>c__AnonStorey0`1[T]">\r
<method name="Void <>m__0()" attrs="131">\r
<size>46</size>\r
<size>114</size>\r
</method>\r
</type>\r
- <type name="C+<Test2>c__AnonStorey0`1+<Test2>c__AnonStorey1`1[T]">\r
- <method name="Void <>m__0()" attrs="131">\r
- <size>118</size>\r
- </method>\r
- </type>\r
<type name="C+<<Test3`1>m__1>c__DynamicSite1`1+Container0[T]">\r
<method name="Void Invoke(System.Runtime.CompilerServices.CallSite, System.Object, T ByRef)" attrs="454">\r
<size>0</size>\r
<size>0</size>\r
</method>\r
</type>\r
+ <type name="C+<Test2>c__AnonStorey0`1+<Test2>c__AnonStorey1[T]">\r
+ <method name="Void <>m__0()" attrs="131">\r
+ <size>118</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
<type name="C">\r
- <method name="Void <Test`1>m__0[T](System.Object, T)" attrs="145">\r
+ <method name="Void <Test`1>m__0[T](T)" attrs="145">\r
<size>103</size>\r
</method>\r
- <method name="Void <Test3`1>m__1[T](System.Object, T)" attrs="145">\r
+ <method name="Void <Test3`1>m__1[T](T)" attrs="145">\r
<size>105</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.Object <Main>m__0(System.Object)" attrs="145">\r
+ <method name="System.Object <Main>m__0()" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Tester">\r
- <method name="Void <NonInvocable>m__0(System.Object)" attrs="145">\r
+ <method name="Void <NonInvocable>m__0()" attrs="145">\r
<size>86</size>\r
</method>\r
- <method name="Void <Using_1>m__1(System.Object)" attrs="145">\r
+ <method name="Void <Using_1>m__1()" attrs="145">\r
<size>92</size>\r
</method>\r
- <method name="Void <NullableConversion>m__2(System.Object)" attrs="145">\r
+ <method name="Void <NullableConversion>m__2()" attrs="145">\r
<size>106</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__3(System.Reflection.MethodInfo)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.String <Main>m__4(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__4(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__5(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__5(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__6(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__6(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<test name="gtest-052.cs">\r
<type name="Foo`1[T]">\r
<method name="T Create()" attrs="134">\r
- <size>44</size>\r
+ <size>14</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="System.String <Main>m__0(System.Object, Double)" attrs="145">\r
+ <method name="System.String <Main>m__0(Double)" attrs="145">\r
<size>25</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Double <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Double <Main>m__0(Int32)" attrs="145">\r
<size>21</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="MyTest">\r
- <method name="System.String <Main>m__0(System.Object, Double)" attrs="145">\r
+ <method name="System.String <Main>m__0(Double)" attrs="145">\r
<size>25</size>\r
</method>\r
</type>\r
<size>86</size>\r
</method>\r
<method name="Polynomial`1[E] Mul(Polynomial`1[E])" attrs="486">\r
- <size>235</size>\r
+ <size>203</size>\r
</method>\r
<method name="E Eval(E)" attrs="134">\r
- <size>114</size>\r
+ <size>84</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>20</size>\r
<test name="gtest-151.cs">\r
<type name="Test`1[T]">\r
<method name="Void .ctor()" attrs="6278">\r
- <size>16</size>\r
+ <size>14</size>\r
</method>\r
</type>\r
<type name="X">\r
<test name="gtest-153.cs">\r
<type name="MyClass`1[T]">\r
<method name="Void .ctor()" attrs="6278">\r
- <size>57</size>\r
+ <size>27</size>\r
</method>\r
</type>\r
<type name="X">\r
</method>\r
</type>\r
<type name="B">\r
- <method name="Int32 <M`1>m__0[X](System.Object, X)" attrs="145">\r
+ <method name="Int32 <M`1>m__0[X](X)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <N>m__1(System.Object, Int64)" attrs="145">\r
+ <method name="Int32 <N>m__1(Int64)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<test name="gtest-155.cs">\r
<type name="MyClass`1[T]">\r
<method name="Void .ctor()" attrs="6278">\r
- <size>57</size>\r
+ <size>27</size>\r
</method>\r
</type>\r
<type name="X">\r
<method name="U apply[T,U](T, Mapping`2)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="System.String <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="System.String <Main>m__0(Int32)" attrs="145">\r
<size>22</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Boolean <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="Boolean <Main>m__0(System.String)" attrs="145">\r
<size>20</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestClass">\r
- <method name="Void <a>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <a>m__0(Int32)" attrs="145">\r
<size>8</size>\r
</method>\r
</type>\r
<test name="gtest-325.cs">\r
<type name="SomeClass`1[T]">\r
<method name="Void Foo()" attrs="134">\r
- <size>38</size>\r
+ <size>8</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
<test name="gtest-327.cs">\r
<type name="Tester`1[T]">\r
<method name="Void Do()" attrs="134">\r
- <size>51</size>\r
+ <size>21</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="Thing">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__1(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__1()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Boolean <GetMethodGroup>m__0(System.Object)" attrs="145">\r
+ <method name="Boolean <GetMethodGroup>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C`2[A,B]">\r
- <method name="B <C>m__0(System.Object, B)" attrs="145">\r
+ <method name="B <C>m__0(B)" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="ConditionalParsing">\r
- <method name="Int32 <Test_12>m__0(System.Object)" attrs="145">\r
+ <method name="Void Test_18(Boolean, System.Action)" attrs="129">\r
+ <size>44</size>\r
+ </method>\r
+ <method name="Int32 <Test_12>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
+ <method name="Void <Test_18>m__1()" attrs="145">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void Test_19(Int32[,])" attrs="129">\r
+ <size>11</size>\r
+ </method>\r
</type>\r
</test>\r
<test name="gtest-410.cs">\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Maybe`1[System.String] <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="Maybe`1[System.String] <Main>m__0(System.String)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="Maybe`1[System.String] <Main>m__1(System.Object, System.String)" attrs="145">\r
+ <method name="Maybe`1[System.String] <Main>m__1(System.String)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="Maybe`1[System.String] <Main>m__2(System.Object, System.String)" attrs="145">\r
+ <method name="Maybe`1[System.String] <Main>m__2(System.String)" attrs="145">\r
<size>18</size>\r
</method>\r
</type>\r
<test name="gtest-435.cs">\r
<type name="testcase.Program">\r
<method name="Int32 Main()" attrs="150">\r
- <size>371</size>\r
+ <size>405</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
<test name="gtest-446.cs">\r
<type name="BugTest.Bug`1[T]">\r
<method name="Void CreateObject(T ByRef)" attrs="134">\r
- <size>43</size>\r
+ <size>13</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
<test name="gtest-471.cs">\r
<type name="Q">\r
<method name="Void bar[T](T ByRef)" attrs="145">\r
- <size>17</size>\r
+ <size>13</size>\r
</method>\r
<method name="Int32 Main()" attrs="150">\r
<size>19</size>\r
<test name="gtest-514.cs">\r
<type name="test2.Test`3[T,U,V]">\r
<method name="Void Method()" attrs="134">\r
- <size>128</size>\r
+ <size>35</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</type>\r
<type name="B">\r
<method name="G Foo[G]()" attrs="198">\r
- <size>18</size>\r
+ <size>14</size>\r
</method>\r
<method name="G Foo2[G]()" attrs="198">\r
<size>15</size>\r
<test name="gtest-551.cs">\r
<type name="Base`1[T]">\r
<method name="Void .ctor()" attrs="6278">\r
- <size>48</size>\r
+ <size>18</size>\r
</method>\r
</type>\r
<type name="Derived`1[T]">\r
</type>\r
<type name="G`1[T]">\r
<method name="Void Foo()" attrs="150">\r
- <size>61</size>\r
+ <size>31</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</type>\r
<type name="C">\r
<method name="Int32 Main()" attrs="150">\r
- <size>531</size>\r
+ <size>603</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="Combinator">\r
- <method name="System.Tuple`2[System.Int32,System.Int32] <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="System.Tuple`2[System.Int32,System.Int32] <Main>m__0(Int32)" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
<size>26</size>\r
</method>\r
<method name="TBase Constructor[T]()" attrs="145">\r
- <size>54</size>\r
+ <size>24</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>18</size>\r
</method>\r
</type>\r
</test>\r
+ <test name="gtest-621.cs">\r
+ <type name="X">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>267</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-622.cs">\r
+ <type name="CY">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="A">\r
+ <method name="Void M[TO]()" attrs="486">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void Main()" attrs="150">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-623.cs">\r
+ <type name="C">\r
+ <method name="Boolean Test[T]()" attrs="145">\r
+ <size>42</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>37</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-624.cs">\r
+ <type name="Model">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C1`1[T1]">\r
+ <method name="Void Add(System.Func`2[T1,System.Int32])" attrs="134">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C2`1[TModel]">\r
+ <method name="Void ApplyImpl[U](C1`1[U])" attrs="1478">\r
+ <size>0</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6276">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C3">\r
+ <method name="Void ApplyImpl[Foo](C1`1[Foo])" attrs="198">\r
+ <size>20</size>\r
+ </method>\r
+ <method name="Int32 <ApplyImpl`1>m__0[Foo](Foo)" attrs="145">\r
+ <size>19</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="Program">\r
+ <method name="Void Main()" attrs="145">\r
+ <size>21</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="gtest-anontype-01.cs">\r
<type name="Test">\r
<method name="Int32 Main()" attrs="150">\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Boolean <Main>m__0(System.Object, <>__AnonType0`2[System.String,System.Reflection.PropertyInfo])" attrs="145">\r
+ <method name="Boolean <Main>m__0(<>__AnonType0`2[System.String,System.Reflection.PropertyInfo])" attrs="145">\r
<size>21</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object, <>__AnonType0`2[System.String,System.Reflection.PropertyInfo])" attrs="145">\r
+ <method name="System.String <Main>m__1(<>__AnonType0`2[System.String,System.Reflection.PropertyInfo])" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
<size>8</size>\r
</method>\r
<method name="Int32 Main()" attrs="150">\r
- <size>301</size>\r
+ <size>336</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
<size>13</size>\r
</method>\r
<method name="Int32 Main()" attrs="150">\r
- <size>192</size>\r
+ <size>213</size>\r
</method>\r
<method name="Void .cctor()" attrs="6289">\r
- <size>7</size>\r
+ <size>22</size>\r
</method>\r
</type>\r
<type name="C">\r
<size>8</size>\r
</method>\r
</type>\r
+ <type name="S">\r
+ <method name="Int32[] get_PA()" attrs="2198">\r
+ <size>13</size>\r
+ </method>\r
+ </type>\r
+ <type name="S2">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>15</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-autoproperty-10.cs">\r
+ <type name="S">\r
+ <method name="System.Decimal get_P()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>14</size>\r
+ </method>\r
+ </type>\r
+ <type name="X">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>48</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="gtest-collectioninit-01.cs">\r
<type name="Test">\r
<method name="Void .cctor()" attrs="6289">\r
<size>69</size>\r
</method>\r
- <method name="System.String <Test>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Test>m__0(System.String)" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="System.String <Test>m__1(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Test>m__1(System.String)" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<method name="Void EqualTest_16()" attrs="129">\r
<size>185</size>\r
</method>\r
- <method name="Void <EqualTestDelegate_2>m__0(System.Object)" attrs="145">\r
+ <method name="Void <EqualTestDelegate_2>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <EqualTestDelegate_2>m__1(System.Object)" attrs="145">\r
+ <method name="Void <EqualTestDelegate_2>m__1()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <EqualTestDelegate_2>m__2(System.Object)" attrs="145">\r
+ <method name="Void <EqualTestDelegate_2>m__2()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <EqualTestDelegate_2>m__3(System.Object)" attrs="145">\r
+ <method name="Void <EqualTestDelegate_2>m__3()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <EqualTestDelegate_2>m__4(System.Object)" attrs="145">\r
+ <method name="Void <EqualTestDelegate_2>m__4()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="System.String <InvokeTest_2>m__5(System.Object, Int32)" attrs="145">\r
+ <method name="System.String <InvokeTest_2>m__5(Int32)" attrs="145">\r
<size>25</size>\r
</method>\r
- <method name="Boolean <Main>m__6(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__6(System.Reflection.MethodInfo)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.String <Main>m__7(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__7(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__8(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__8(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__9(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__9(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
+ <type name="StructWithUserConstructor">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>2</size>\r
+ </method>\r
+ </type>\r
+ <type name="Tester">\r
+ <method name="Void NewTest_8()" attrs="129">\r
+ <size>140</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="gtest-etree-02.cs">\r
<type name="M">\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Program+<Test>c__Iterator0`1+<Test>c__AnonStorey1`1[T]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- </type>\r
<type name="Program">\r
<method name="System.Collections.Generic.IEnumerable`1[System.Int32] Test[T](Int32)" attrs="145">\r
<size>30</size>\r
<size>14</size>\r
</method>\r
</type>\r
+ <type name="Program+<Test>c__Iterator0`1+<Test>c__AnonStorey1[T]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="gtest-etree-14.cs">\r
<type name="Person">\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Repro+<GetPersons>c__Iterator0`1+<GetPersons>c__AnonStorey1`1[T]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- </type>\r
<type name="Repro">\r
<method name="System.Collections.Generic.IEnumerable`1[T] GetPersons[T](System.Collections.Generic.IEnumerable`1[T], Int32)" attrs="145">\r
<size>37</size>\r
<size>14</size>\r
</method>\r
</type>\r
+ <type name="Repro+<GetPersons>c__Iterator0`1+<GetPersons>c__AnonStorey1[T]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="gtest-etree-15.cs">\r
<type name="Foo">\r
</method>\r
</type>\r
<type name="NotifyingPropertyTest">\r
- <method name="System.Object <CreateDependent_DependentsNull>m__0(System.Object)" attrs="145">\r
+ <method name="System.Object <CreateDependent_DependentsNull>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<method name="Void Method[T](System.Collections.Generic.IEnumerable`1[T], System.Func`2[T,System.Boolean])" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Boolean <Test`1>m__0[U](System.Object, System.String)" attrs="145">\r
+ <method name="Boolean <Test`1>m__0[U](System.String)" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
<method name="Void Main()" attrs="150">\r
<size>68</size>\r
</method>\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Mono.Rocks.Test">\r
- <method name="System.Nullable`1[System.Collections.Generic.KeyValuePair`2[System.Int32,System.Int32]] <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="System.Nullable`1[System.Collections.Generic.KeyValuePair`2[System.Int32,System.Int32]] <Main>m__0(Int32)" attrs="145">\r
<size>37</size>\r
</method>\r
</type>\r
<method name="System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()" attrs="481">\r
<size>14</size>\r
</method>\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="MyTest">\r
- <method name="System.String <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="System.String <Main>m__0(Int32)" attrs="145">\r
<size>22</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>11</size>\r
</method>\r
- <method name="Void <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Void <Main>m__2(Int32)" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="System.String <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__0(System.String)" attrs="145">\r
<size>19</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Demo">\r
- <method name="System.TimeSpan <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.TimeSpan <Main>m__0(System.String)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Demo">\r
- <method name="System.TimeSpan <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.TimeSpan <Main>m__0(System.String)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="Double <Main>m__1(System.Object, System.TimeSpan)" attrs="145">\r
+ <method name="Double <Main>m__1(System.TimeSpan)" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="System.String <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__0(System.String)" attrs="145">\r
<size>38</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>38</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestClass">\r
- <method name="Void <Main>m__0(System.Object, F)" attrs="145">\r
+ <method name="Void <Main>m__0(F)" attrs="145">\r
<size>31</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__1(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__1()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__2(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__2()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__3(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__3()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__4(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__4()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__5(System.Object, Boolean)" attrs="145">\r
+ <method name="Void <Main>m__5(Boolean)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="Boolean <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__1(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__2(Int32)" attrs="145">\r
<size>11</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__3(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="Int32 <Main>m__4(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__4(Int32)" attrs="145">\r
<size>11</size>\r
</method>\r
- <method name="Boolean <Main>m__5(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__5(Int32)" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <Main>m__6(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__6(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="System.String <Main>m__0(System.Object)" attrs="145">\r
+ <method name="System.String <Main>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object)" attrs="145">\r
+ <method name="System.String <Main>m__1()" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.String <Main>m__2(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__2(System.String)" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestUnary">\r
- <method name="Void <Bar>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <Bar>m__0(Int32)" attrs="145">\r
<size>6</size>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="System.String <Bar>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Bar>m__0(System.String)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__1(System.String)" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Void <Main>m__2(System.Object, System.String)" attrs="145">\r
+ <method name="Void <Main>m__2(System.String)" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="T <Foo`1>m__0[T](System.Object, T)" attrs="145">\r
+ <method name="T <Foo`1>m__0[T](T)" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Repro">\r
- <method name="Int32 <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="Int32 <Main>m__0(System.String)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Z">\r
- <method name="Void <Z>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Z>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.String <Bar>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Bar>m__0(System.String)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__1(System.String)" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Void <Main>m__2(System.Object, System.String)" attrs="145">\r
+ <method name="Void <Main>m__2(System.String)" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="MainClass">\r
- <method name="Int32 <Main>m__0(System.Object, Product)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Product)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Product <Main>m__1(System.Object, Product)" attrs="145">\r
+ <method name="Product <Main>m__1(Product)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="<>__AnonType0`2[System.Linq.IGrouping`2[System.Int32,Product],System.Collections.Generic.IEnumerable`1[Product]] <Main>m__2(System.Object, System.Linq.IGrouping`2[System.Int32,Product])" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Linq.IGrouping`2[System.Int32,Product],System.Collections.Generic.IEnumerable`1[Product]] <Main>m__2(System.Linq.IGrouping`2[System.Int32,Product])" attrs="145">\r
<size>56</size>\r
</method>\r
</type>\r
<type name="MainClass+<Main>c__AnonStorey0">\r
- <method name="System.Decimal <>m__1(System.Object, Product)" attrs="145">\r
+ <method name="System.Decimal <>m__1(Product)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.String <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__0(System.String)" attrs="145">\r
<size>20</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.String <>m__2(System.Object)" attrs="145">\r
+ <method name="System.String <>m__2()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="MonoBugs.Program">\r
- <method name="Void <Main>m__0(System.Object, MonoBugs.Foo`1[System.Int32])" attrs="145">\r
+ <method name="Void <Main>m__0(MonoBugs.Foo`1[System.Int32])" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.String[] <Main>m__0(System.Object, IB)" attrs="145">\r
+ <method name="System.String[] <Main>m__0(IB)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="IA`1[System.String][] <Main>m__1(System.Object, IB)" attrs="145">\r
+ <method name="IA`1[System.String][] <Main>m__1(IB)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="G`1[System.Int32][] <Main>m__0(System.Object, G`1[System.Int32][])" attrs="145">\r
+ <method name="G`1[System.Int32][] <Main>m__0(G`1[System.Int32][])" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Void <Main>m__0(System.Object, Int32[][])" attrs="145">\r
+ <method name="Void <Main>m__0(Int32[][])" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__1(System.Object, C`1[System.Int16][])" attrs="145">\r
+ <method name="Void <Main>m__1(C`1[System.Int16][])" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__2(System.Object, C`1[System.Int16[]][])" attrs="145">\r
+ <method name="Void <Main>m__2(C`1[System.Int16[]][])" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="System.Func`2[T,System.Object] <Method`1>m__0[T](System.Object, System.Object)" attrs="145">\r
+ <method name="System.Func`2[T,System.Object] <Method`1>m__0[T](System.Object)" attrs="145">\r
<size>33</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Byte <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Byte <Main>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<method name="Int32 Main()" attrs="145">\r
<size>161</size>\r
</method>\r
- <method name="Int32 <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ <method name="Int32 <Main>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int16 <Main>m__1(System.Object)" attrs="145">\r
+ <method name="Int16 <Main>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int16 <Main>m__2(System.Object)" attrs="145">\r
+ <method name="Int16 <Main>m__2()" attrs="145">\r
<size>9</size>\r
</method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-lambda-36.cs">\r
+ <type name="D`1[T]">\r
+ <method name="Void S[U,V](System.Func`1[U], System.Func`3[T,U,V])" attrs="134">\r
+ <size>2</size>\r
+ </method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
</type>\r
+ <type name="Test">\r
+ <method name="D`1[V] Factory[V](V)" attrs="145">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void Main()" attrs="145">\r
+ <size>78</size>\r
+ </method>\r
+ <method name="System.String <Main>m__0()" attrs="145">\r
+ <size>13</size>\r
+ </method>\r
+ <method name="<>__AnonType1`1[System.String] <Main>m__1(<>__AnonType0`1[System.Int32], System.String)" attrs="145">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="<>__AnonType0`1[<q>__T]">\r
+ <method name="<q>__T get_q()" attrs="2182">\r
+ <size>7</size>\r
+ </method>\r
+ <method name="Boolean Equals(System.Object)" attrs="198">\r
+ <size>39</size>\r
+ </method>\r
+ <method name="Int32 GetHashCode()" attrs="198">\r
+ <size>63</size>\r
+ </method>\r
+ <method name="System.String ToString()" attrs="198">\r
+ <size>67</size>\r
+ </method>\r
+ <method name="Void .ctor(<q>__T)" attrs="6278">\r
+ <size>14</size>\r
+ </method>\r
+ </type>\r
+ <type name="<>__AnonType1`1[<str>__T]">\r
+ <method name="<str>__T get_str()" attrs="2182">\r
+ <size>7</size>\r
+ </method>\r
+ <method name="Boolean Equals(System.Object)" attrs="198">\r
+ <size>39</size>\r
+ </method>\r
+ <method name="Int32 GetHashCode()" attrs="198">\r
+ <size>63</size>\r
+ </method>\r
+ <method name="System.String ToString()" attrs="198">\r
+ <size>67</size>\r
+ </method>\r
+ <method name="Void .ctor(<str>__T)" attrs="6278">\r
+ <size>14</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="gtest-linq-01.cs">\r
<type name="from.C">\r
</method>\r
</type>\r
<type name="from.C">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="System.Nullable`1[System.Boolean] <Main>m__2(System.Object, System.Nullable`1[System.Boolean])" attrs="145">\r
+ <method name="System.Nullable`1[System.Boolean] <Main>m__2(System.Nullable`1[System.Boolean])" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__3(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__4(System.Object, Int32, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__4(Int32, Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Boolean <Main>m__5(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__5(Int32)" attrs="145">\r
<size>18</size>\r
</method>\r
- <method name="Int32 <Main>m__6(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__6(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__7(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__7(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__8(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__8(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__9(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__9(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__A(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__A(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__B(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__B(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__C(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__C(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__D(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__D(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__E(System.Object, from.ITest)" attrs="145">\r
+ <method name="Int32 <Main>m__E(from.ITest)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__F(System.Object, Int32, from.ITest)" attrs="145">\r
+ <method name="Int32 <Main>m__F(Int32, from.ITest)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__10(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__10(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__11(System.Object, from.ITest)" attrs="145">\r
+ <method name="Int32 <Main>m__11(from.ITest)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__12(System.Object, Int32, from.ITest)" attrs="145">\r
+ <method name="Int32 <Main>m__12(Int32, from.ITest)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__13(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__13(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__14(System.Object, from.ITest)" attrs="145">\r
+ <method name="Int32 <Main>m__14(from.ITest)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType0`2[System.Int32,from.ITest] <Main>m__15(System.Object, Int32, from.ITest)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,from.ITest] <Main>m__15(Int32, from.ITest)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Int32 <Main>m__16(System.Object, <>__AnonType0`2[System.Int32,from.ITest])" attrs="145">\r
+ <method name="Int32 <Main>m__16(<>__AnonType0`2[System.Int32,from.ITest])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__17(System.Object, from.ITest)" attrs="145">\r
+ <method name="Int32 <Main>m__17(from.ITest)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__18(System.Object, <>__AnonType0`2[System.Int32,from.ITest], from.ITest)" attrs="145">\r
+ <method name="Int32 <Main>m__18(<>__AnonType0`2[System.Int32,from.ITest], from.ITest)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__19(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__19(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1A(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1A(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1B(System.Object, Int32, System.Collections.Generic.IEnumerable`1[System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__1B(Int32, System.Collections.Generic.IEnumerable`1[System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1C(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1C(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1D(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1D(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1E(System.Object, Int32, System.Collections.Generic.IEnumerable`1[System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__1E(Int32, System.Collections.Generic.IEnumerable`1[System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1F(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1F(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__20(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__20(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__21(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__21(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__22(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__22(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="System.Linq.IGrouping`2[System.Int32,System.Int32] <Main>m__23(System.Object, System.Linq.IGrouping`2[System.Int32,System.Int32])" attrs="145">\r
+ <method name="System.Linq.IGrouping`2[System.Int32,System.Int32] <Main>m__23(System.Linq.IGrouping`2[System.Int32,System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="<>__AnonType1`2[System.Int32,System.Int32] <Main>m__24(System.Object, Int32)" attrs="145">\r
+ <method name="<>__AnonType1`2[System.Int32,System.Int32] <Main>m__24(Int32)" attrs="145">\r
<size>18</size>\r
</method>\r
- <method name="Int32 <Main>m__25(System.Object, <>__AnonType1`2[System.Int32,System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__25(<>__AnonType1`2[System.Int32,System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType1`2[System.Int32,System.Int32] <Main>m__26(System.Object, Int32)" attrs="145">\r
+ <method name="<>__AnonType1`2[System.Int32,System.Int32] <Main>m__26(Int32)" attrs="145">\r
<size>18</size>\r
</method>\r
- <method name="<>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32] <Main>m__27(System.Object, <>__AnonType1`2[System.Int32,System.Int32])" attrs="145">\r
+ <method name="<>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32] <Main>m__27(<>__AnonType1`2[System.Int32,System.Int32])" attrs="145">\r
<size>23</size>\r
</method>\r
- <method name="Int32 <Main>m__28(System.Object, <>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__28(<>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="Int32 <Main>m__29(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__29(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__2A(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__2A(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32] <Main>m__2B(System.Object, System.Linq.IGrouping`2[System.Int32,System.Int32], Int32)" attrs="145">\r
+ <method name="<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32] <Main>m__2B(System.Linq.IGrouping`2[System.Int32,System.Int32], Int32)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Int32 <Main>m__2C(System.Object, <>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__2C(<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__2D(System.Object, <>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__2D(<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32] <Main>m__2E(System.Object, System.Linq.IGrouping`2[System.Int32,System.Int32], Int32)" attrs="145">\r
+ <method name="<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32] <Main>m__2E(System.Linq.IGrouping`2[System.Int32,System.Int32], Int32)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Int32 <Main>m__2F(System.Object, <>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__2F(<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__30(System.Object, <>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__30(<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32] <Main>m__31(System.Object, System.Linq.IGrouping`2[System.Int32,System.Int32], Int32)" attrs="145">\r
+ <method name="<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32] <Main>m__31(System.Linq.IGrouping`2[System.Int32,System.Int32], Int32)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Int32 <Main>m__32(System.Object, <>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__32(<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__33(System.Object, <>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__33(<>__AnonType3`2[System.Linq.IGrouping`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="System.Linq.IGrouping`2[System.Int32,System.Int32] <Main>m__34(System.Object, System.Linq.IGrouping`2[System.Int32,System.Int32])" attrs="145">\r
+ <method name="System.Linq.IGrouping`2[System.Int32,System.Int32] <Main>m__34(System.Linq.IGrouping`2[System.Int32,System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__35(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__35(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__36(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__36(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__37(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__37(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="<>__AnonType4`2[<>__AnonType1`2[System.Int32,System.Collections.Generic.IEnumerable`1[System.Int32]],System.Int32] <Main>m__38(System.Object, <>__AnonType1`2[System.Int32,System.Collections.Generic.IEnumerable`1[System.Int32]])" attrs="145">\r
+ <method name="<>__AnonType4`2[<>__AnonType1`2[System.Int32,System.Collections.Generic.IEnumerable`1[System.Int32]],System.Int32] <Main>m__38(<>__AnonType1`2[System.Int32,System.Collections.Generic.IEnumerable`1[System.Int32]])" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Int32 <Main>m__39(System.Object, <>__AnonType4`2[<>__AnonType1`2[System.Int32,System.Collections.Generic.IEnumerable`1[System.Int32]],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__39(<>__AnonType4`2[<>__AnonType1`2[System.Int32,System.Collections.Generic.IEnumerable`1[System.Int32]],System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="from.C+<Main>c__AnonStorey0">\r
- <method name="Int32 <>m__5(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <>m__5(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>11</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__2(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__3(Int32)" attrs="145">\r
<size>11</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Boolean <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__0(Int32)" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Boolean <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__1(Int32)" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__2(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__2(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="Int32 <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__3(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="OrderByTests">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__2(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__3(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="System.String <Main>m__4(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__4(System.String)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__5(System.Object, System.String)" attrs="145">\r
+ <method name="Int32 <Main>m__5(System.String)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__6(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__6(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="System.String <Main>m__7(System.Object, Data)" attrs="145">\r
+ <method name="System.String <Main>m__7(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__8(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__8(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="System.String <Main>m__9(System.Object, Data)" attrs="145">\r
+ <method name="System.String <Main>m__9(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__A(System.Object, Data)" attrs="145">\r
+ <method name="Boolean <Main>m__A(Data)" attrs="145">\r
<size>19</size>\r
</method>\r
- <method name="Int32 <Main>m__B(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__B(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="System.String <Main>m__C(System.Object, Data)" attrs="145">\r
+ <method name="System.String <Main>m__C(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__D(System.Object, Data)" attrs="145">\r
+ <method name="Boolean <Main>m__D(Data)" attrs="145">\r
<size>19</size>\r
</method>\r
- <method name="System.String <Main>m__E(System.Object, Data)" attrs="145">\r
+ <method name="System.String <Main>m__E(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="System.String <Main>m__F(System.Object, Data)" attrs="145">\r
+ <method name="System.String <Main>m__F(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Data <Main>m__10(System.Object, Data)" attrs="145">\r
+ <method name="Data <Main>m__10(Data)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Let">\r
- <method name="<>__AnonType0`2[System.Int32,System.Int32] <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.Int32] <Main>m__0(Int32)" attrs="145">\r
<size>18</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, <>__AnonType0`2[System.Int32,System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__1(<>__AnonType0`2[System.Int32,System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType0`2[System.Int32,System.Int32] <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.Int32] <Main>m__2(Int32)" attrs="145">\r
<size>18</size>\r
</method>\r
- <method name="<>__AnonType1`2[<>__AnonType0`2[System.Int32,System.Int32],System.Int32] <Main>m__3(System.Object, <>__AnonType0`2[System.Int32,System.Int32])" attrs="145">\r
+ <method name="<>__AnonType1`2[<>__AnonType0`2[System.Int32,System.Int32],System.Int32] <Main>m__3(<>__AnonType0`2[System.Int32,System.Int32])" attrs="145">\r
<size>23</size>\r
</method>\r
- <method name="Boolean <Main>m__4(System.Object, <>__AnonType1`2[<>__AnonType0`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Boolean <Main>m__4(<>__AnonType1`2[<>__AnonType0`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>26</size>\r
</method>\r
- <method name="Int32 <Main>m__5(System.Object, <>__AnonType1`2[<>__AnonType0`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__5(<>__AnonType1`2[<>__AnonType0`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="SelectMany">\r
- <method name="<>__AnonType0`2[System.Int32,System.String] <Main>m__0(System.Object, Int32, System.String)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.String] <Main>m__0(Int32, System.String)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Boolean <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__1(Int32)" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="<>__AnonType0`2[System.Int32,System.String] <Main>m__2(System.Object, Int32, System.String)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.String] <Main>m__2(Int32, System.String)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="<>__AnonType1`2[<>__AnonType0`2[System.Int32,System.String],System.Int32] <Main>m__3(System.Object, <>__AnonType0`2[System.Int32,System.String], Int32)" attrs="145">\r
+ <method name="<>__AnonType1`2[<>__AnonType0`2[System.Int32,System.String],System.Int32] <Main>m__3(<>__AnonType0`2[System.Int32,System.String], Int32)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Int32 <Main>m__4(System.Object, <>__AnonType1`2[<>__AnonType0`2[System.Int32,System.String],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__4(<>__AnonType1`2[<>__AnonType0`2[System.Int32,System.String],System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType2`3[System.Int32,System.Int32,System.Int32] <Main>m__5(System.Object, <>__AnonType1`2[<>__AnonType0`2[System.Int32,System.String],System.Int32])" attrs="145">\r
+ <method name="<>__AnonType2`3[System.Int32,System.Int32,System.Int32] <Main>m__5(<>__AnonType1`2[<>__AnonType0`2[System.Int32,System.String],System.Int32])" attrs="145">\r
<size>33</size>\r
</method>\r
- <method name="<>__AnonType0`2[System.Int32,System.String] <Main>m__6(System.Object, Int32, System.String)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.String] <Main>m__6(Int32, System.String)" attrs="145">\r
<size>16</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="TestA <Main>m__0(System.Object, TestA)" attrs="145">\r
+ <method name="TestA <Main>m__0(TestA)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Boolean <Main>m__1(System.Object, TestA)" attrs="145">\r
+ <method name="Boolean <Main>m__1(TestA)" attrs="145">\r
<size>25</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Join">\r
- <method name="Int32 <Main>m__0(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType0`1[System.String] <Main>m__2(System.Object, Data, Data)" attrs="145">\r
+ <method name="<>__AnonType0`1[System.String] <Main>m__2(Data, Data)" attrs="145">\r
<size>31</size>\r
</method>\r
- <method name="Int32 <Main>m__3(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__3(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__4(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__4(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType1`2[Data,Data] <Main>m__5(System.Object, Data, Data)" attrs="145">\r
+ <method name="<>__AnonType1`2[Data,Data] <Main>m__5(Data, Data)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Boolean <Main>m__6(System.Object, <>__AnonType1`2[Data,Data])" attrs="145">\r
+ <method name="Boolean <Main>m__6(<>__AnonType1`2[Data,Data])" attrs="145">\r
<size>30</size>\r
</method>\r
- <method name="<>__AnonType0`1[System.String] <Main>m__7(System.Object, <>__AnonType1`2[Data,Data])" attrs="145">\r
+ <method name="<>__AnonType0`1[System.String] <Main>m__7(<>__AnonType1`2[Data,Data])" attrs="145">\r
<size>41</size>\r
</method>\r
- <method name="Int32 <Main>m__8(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__8(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__9(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__9(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType0`1[System.String] <Main>m__A(System.Object, Data, Data)" attrs="145">\r
+ <method name="<>__AnonType0`1[System.String] <Main>m__A(Data, Data)" attrs="145">\r
<size>31</size>\r
</method>\r
- <method name="Int32 <Main>m__B(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__B(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__C(System.Object, Data)" attrs="145">\r
+ <method name="Int32 <Main>m__C(Data)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType1`2[Data,Data] <Main>m__D(System.Object, Data, Data)" attrs="145">\r
+ <method name="<>__AnonType1`2[Data,Data] <Main>m__D(Data, Data)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Int32 <Main>m__E(System.Object, <>__AnonType1`2[Data,Data])" attrs="145">\r
+ <method name="Int32 <Main>m__E(<>__AnonType1`2[Data,Data])" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="Data <Main>m__F(System.Object, <>__AnonType1`2[Data,Data])" attrs="145">\r
+ <method name="Data <Main>m__F(<>__AnonType1`2[Data,Data])" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="GroupJoin">\r
- <method name="Int32 <Main>m__0(System.Object, DataA)" attrs="145">\r
+ <method name="Int32 <Main>m__0(DataA)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, DataB)" attrs="145">\r
+ <method name="Int32 <Main>m__1(DataB)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]] <Main>m__2(System.Object, DataA, System.Collections.Generic.IEnumerable`1[DataB])" attrs="145">\r
+ <method name="<>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]] <Main>m__2(DataA, System.Collections.Generic.IEnumerable`1[DataB])" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="System.Collections.Generic.IEnumerable`1[DataB] <Main>m__3(System.Object, <>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]])" attrs="145">\r
+ <method name="System.Collections.Generic.IEnumerable`1[DataB] <Main>m__3(<>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]])" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="<>__AnonType1`2[System.String,System.String] <Main>m__4(System.Object, <>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]], DataB)" attrs="145">\r
+ <method name="<>__AnonType1`2[System.String,System.String] <Main>m__4(<>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]], DataB)" attrs="145">\r
<size>47</size>\r
</method>\r
- <method name="Int32 <Main>m__5(System.Object, DataA)" attrs="145">\r
+ <method name="Int32 <Main>m__5(DataA)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__6(System.Object, DataB)" attrs="145">\r
+ <method name="Int32 <Main>m__6(DataB)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]] <Main>m__7(System.Object, DataA, System.Collections.Generic.IEnumerable`1[DataB])" attrs="145">\r
+ <method name="<>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]] <Main>m__7(DataA, System.Collections.Generic.IEnumerable`1[DataB])" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="System.Collections.Generic.IEnumerable`1[DataB] <Main>m__8(System.Object, <>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]])" attrs="145">\r
+ <method name="System.Collections.Generic.IEnumerable`1[DataB] <Main>m__8(<>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]])" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="<>__AnonType1`2[System.String,System.String] <Main>m__9(System.Object, <>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]], DataB)" attrs="145">\r
+ <method name="<>__AnonType1`2[System.String,System.String] <Main>m__9(<>__AnonType0`2[DataA,System.Collections.Generic.IEnumerable`1[DataB]], DataB)" attrs="145">\r
<size>47</size>\r
</method>\r
- <method name="Int32 <Main>m__A(System.Object, DataA)" attrs="145">\r
+ <method name="Int32 <Main>m__A(DataA)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__B(System.Object, DataB)" attrs="145">\r
+ <method name="Int32 <Main>m__B(DataB)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="DataA <Main>m__C(System.Object, DataA, System.Collections.Generic.IEnumerable`1[DataB])" attrs="145">\r
+ <method name="DataA <Main>m__C(DataA, System.Collections.Generic.IEnumerable`1[DataB])" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Boolean <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__0(Int32)" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__2(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__3(Int32)" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <Main>m__4(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__4(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="NestedQuery">\r
- <method name="<>__AnonType0`2[System.String,System.Int32] <XX>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.String,System.Int32] <XX>m__0(System.String)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.Collections.Generic.IEnumerable`1[System.Char] <XX>m__1(System.Object, <>__AnonType0`2[System.String,System.Int32])" attrs="145">\r
+ <method name="System.Collections.Generic.IEnumerable`1[System.Char] <XX>m__1(<>__AnonType0`2[System.String,System.Int32])" attrs="145">\r
<size>117</size>\r
</method>\r
- <method name="Boolean <Main>m__2(System.Object, System.String)" attrs="145">\r
+ <method name="Boolean <Main>m__2(System.String)" attrs="145">\r
<size>18</size>\r
</method>\r
- <method name="System.Collections.Generic.IEnumerable`1[System.Char] <Main>m__3(System.Object, System.String)" attrs="145">\r
+ <method name="System.Collections.Generic.IEnumerable`1[System.Char] <Main>m__3(System.String)" attrs="145">\r
<size>44</size>\r
</method>\r
- <method name="<>__AnonType0`2[System.String,System.Int32] <Main>m__4(System.Object, System.String)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.String,System.Int32] <Main>m__4(System.String)" attrs="145">\r
<size>21</size>\r
</method>\r
- <method name="System.Collections.Generic.IEnumerable`1[System.Char] <Main>m__5(System.Object, <>__AnonType0`2[System.String,System.Int32])" attrs="145">\r
+ <method name="System.Collections.Generic.IEnumerable`1[System.Char] <Main>m__5(<>__AnonType0`2[System.String,System.Int32])" attrs="145">\r
<size>118</size>\r
</method>\r
- <method name="<>__AnonType1`2[System.Char,System.Int32] <XX>m__6(System.Object, Char)" attrs="145">\r
+ <method name="<>__AnonType1`2[System.Char,System.Int32] <XX>m__6(Char)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Char <XX>m__7(System.Object, <>__AnonType1`2[System.Char,System.Int32])" attrs="145">\r
+ <method name="Char <XX>m__7(<>__AnonType1`2[System.Char,System.Int32])" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="Boolean <Main>m__8(System.Object, Char)" attrs="145">\r
+ <method name="Boolean <Main>m__8(Char)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="<>__AnonType1`2[System.Char,System.Int32] <Main>m__9(System.Object, Char)" attrs="145">\r
+ <method name="<>__AnonType1`2[System.Char,System.Int32] <Main>m__9(Char)" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Char <Main>m__A(System.Object, <>__AnonType1`2[System.Char,System.Int32])" attrs="145">\r
+ <method name="Char <Main>m__A(<>__AnonType1`2[System.Char,System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="MethodDefinition <Foo>m__0(System.Object, MethodDefinition)" attrs="145">\r
+ <method name="MethodDefinition <Foo>m__0(MethodDefinition)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="NameCollisionTest.C">\r
- <method name="Int32 <Main>m__0(System.Object, NameCollisionTest.Data)" attrs="145">\r
+ <method name="Int32 <Main>m__0(NameCollisionTest.Data)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="Boolean <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__1(Int32)" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="System.Func`1[System.Collections.Generic.IEnumerable`1[System.Int32]] <Test_2>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="System.Func`1[System.Collections.Generic.IEnumerable`1[System.Int32]] <Test_2>m__0(Int32)" attrs="145">\r
<size>33</size>\r
</method>\r
</type>\r
<type name="C+<Test_1>c__AnonStorey0">\r
- <method name="<>__AnonType0`2[System.Int32,System.Int32] <>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.Int32] <>m__1(Int32)" attrs="145">\r
<size>16</size>\r
</method>\r
</type>\r
<type name="C+<Test_2>c__AnonStorey1">\r
- <method name="<>__AnonType0`2[System.Int32,System.Int32] <>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.Int32] <>m__1(Int32)" attrs="145">\r
<size>16</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="<>__AnonType0`2[System.Int32,System.Boolean] <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.Boolean] <Main>m__0(Int32)" attrs="145">\r
<size>50</size>\r
</method>\r
- <method name="Boolean <Main>m__1(System.Object, <>__AnonType0`2[System.Int32,System.Boolean])" attrs="145">\r
+ <method name="Boolean <Main>m__1(<>__AnonType0`2[System.Int32,System.Boolean])" attrs="145">\r
<size>19</size>\r
</method>\r
- <method name="Boolean <Main>m__2(System.Object, <>__AnonType0`2[System.Int32,System.Boolean])" attrs="145">\r
+ <method name="Boolean <Main>m__2(<>__AnonType0`2[System.Int32,System.Boolean])" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__3(Int32)" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Boolean <Main>m__4(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__4(Int32)" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Boolean <Main>m__5(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__5(Int32)" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Boolean <Main>m__6(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__6(Int32)" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="<>__AnonType1`2[System.Int32,System.Int32] <Main>m__7(System.Object, Int32)" attrs="145">\r
+ <method name="<>__AnonType1`2[System.Int32,System.Int32] <Main>m__7(Int32)" attrs="145">\r
<size>18</size>\r
</method>\r
- <method name="<>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32] <Main>m__8(System.Object, <>__AnonType1`2[System.Int32,System.Int32])" attrs="145">\r
+ <method name="<>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32] <Main>m__8(<>__AnonType1`2[System.Int32,System.Int32])" attrs="145">\r
<size>23</size>\r
</method>\r
- <method name="Boolean <Main>m__9(System.Object, <>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Boolean <Main>m__9(<>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Boolean <Main>m__A(System.Object, <>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Boolean <Main>m__A(<>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>23</size>\r
</method>\r
- <method name="Int32 <Main>m__B(System.Object, <>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__B(<>__AnonType2`2[<>__AnonType1`2[System.Int32,System.Int32],System.Int32])" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="Boolean <Main>m__C(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__C(Int32)" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Boolean <Main>m__D(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__D(Int32)" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Int32 <Main>m__E(System.Object, Int32, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__E(Int32, Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Boolean <Main>m__F(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__F(Int32)" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Boolean <Main>m__10(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__10(Int32)" attrs="145">\r
<size>39</size>\r
</method>\r
- <method name="Int32 <Main>m__11(System.Object, Int32, System.Collections.Generic.IEnumerable`1[System.Int32])" attrs="145">\r
+ <method name="Int32 <Main>m__11(Int32, System.Collections.Generic.IEnumerable`1[System.Int32])" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<method name="Void .cctor()" attrs="6289">\r
<size>28</size>\r
</method>\r
- <method name="Char <E>m__0(System.Object, Char)" attrs="145">\r
+ <method name="Char <E>m__0(Char)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Maybe`1[System.Int32] <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Maybe`1[System.Int32] <Main>m__0(Int32)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType0`2[System.Int32,System.Int32] <Main>m__1(System.Object, Int32, Int32)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Int32,System.Int32] <Main>m__1(Int32, Int32)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Maybe`1[System.Int32] <Main>m__2(System.Object, <>__AnonType0`2[System.Int32,System.Int32])" attrs="145">\r
+ <method name="Maybe`1[System.Int32] <Main>m__2(<>__AnonType0`2[System.Int32,System.Int32])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__3(System.Object, <>__AnonType0`2[System.Int32,System.Int32], Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__3(<>__AnonType0`2[System.Int32,System.Int32], Int32)" attrs="145">\r
<size>24</size>\r
</method>\r
</type>\r
<method name="Int32 Main()" attrs="150">\r
<size>362</size>\r
</method>\r
- <method name="System.String <Main>m__0(System.Object, OrderByBugExample.Foo)" attrs="145">\r
+ <method name="System.String <Main>m__0(OrderByBugExample.Foo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, OrderByBugExample.Foo)" attrs="145">\r
+ <method name="Int32 <Main>m__1(OrderByBugExample.Foo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, OrderByBugExample.Foo)" attrs="145">\r
+ <method name="Int32 <Main>m__2(OrderByBugExample.Foo)" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Int32 <Test>m__0(System.Object, A)" attrs="145">\r
+ <method name="Int32 <Test>m__0(A)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>162</size>\r
</method>\r
- <method name="System.Collections.Generic.IEnumerable`1[B] <Main>m__1(System.Object, A)" attrs="145">\r
+ <method name="System.Collections.Generic.IEnumerable`1[B] <Main>m__1(A)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="<>__AnonType0`2[A,B] <Main>m__2(System.Object, A, B)" attrs="145">\r
+ <method name="<>__AnonType0`2[A,B] <Main>m__2(A, B)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, <>__AnonType0`2[A,B])" attrs="145">\r
+ <method name="Boolean <Main>m__3(<>__AnonType0`2[A,B])" attrs="145">\r
<size>75</size>\r
</method>\r
- <method name="<>__AnonType1`2[A,B] <Main>m__4(System.Object, <>__AnonType0`2[A,B])" attrs="145">\r
+ <method name="<>__AnonType1`2[A,B] <Main>m__4(<>__AnonType0`2[A,B])" attrs="145">\r
<size>26</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.String <Main>m__0(System.Object, Test.C)" attrs="145">\r
+ <method name="System.String <Main>m__0(Test.C)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object, Test.C)" attrs="145">\r
+ <method name="System.String <Main>m__1(Test.C)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="System.String <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__0(System.String)" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<Main>c__AnonStorey0">\r
- <method name="<>__AnonType0`2[System.String,System.Boolean] <>m__1(System.Object, System.String)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.String,System.Boolean] <>m__1(System.String)" attrs="145">\r
<size>55</size>\r
</method>\r
- <method name="Boolean <>m__2(System.Object, <>__AnonType0`2[System.String,System.Boolean])" attrs="145">\r
+ <method name="Boolean <>m__2(<>__AnonType0`2[System.String,System.Boolean])" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="<>__AnonType0`2[System.Char,System.Collections.Generic.IEnumerable`1[System.Char]] <Main>m__0(System.Object, Char)" attrs="145">\r
+ <method name="<>__AnonType0`2[System.Char,System.Collections.Generic.IEnumerable`1[System.Char]] <Main>m__0(Char)" attrs="145">\r
<size>54</size>\r
</method>\r
- <method name="System.Collections.Generic.IEnumerable`1[System.Char] <Main>m__1(System.Object, <>__AnonType0`2[System.Char,System.Collections.Generic.IEnumerable`1[System.Char]])" attrs="145">\r
+ <method name="System.Collections.Generic.IEnumerable`1[System.Char] <Main>m__1(<>__AnonType0`2[System.Char,System.Collections.Generic.IEnumerable`1[System.Char]])" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Char <Main>m__2(System.Object, Char)" attrs="145">\r
+ <method name="Char <Main>m__2(Char)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0(Int32)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="IPackage <Main>m__0(System.Object, IPackageRepository)" attrs="145">\r
+ <method name="IPackage <Main>m__0(IPackageRepository)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="IPackage <Main>m__1(System.Object, IPackageRepository)" attrs="145">\r
+ <method name="IPackage <Main>m__1(IPackageRepository)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="CallerMemberTest">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="System.Object <Main>m__1(System.Object, Char)" attrs="145">\r
+ <method name="System.Object <Main>m__1(Char)" attrs="145">\r
<size>24</size>\r
</method>\r
</type>\r
<method name="Void TraceStatic2(Double, System.Decimal)" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>11</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Boolean <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="Boolean <Main>m__0(System.String)" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
</test>\r
+ <test name="gtest-optional-34.cs">\r
+ <type name="S">\r
+ <method name="Void .ctor(Double, Double)" attrs="6278">\r
+ <size>9</size>\r
+ </method>\r
+ </type>\r
+ <type name="X">\r
+ <method name="Void Main()" attrs="150">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="gtest-partial-01.cs">\r
<type name="B`1[U]">\r
<method name="Void .ctor()" attrs="6278">\r
</method>\r
</type>\r
<type name="D">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Main>m__0(System.Object, System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0(System.Object)" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Int32 <Main>m__0(System.Object, System.Object)" attrs="145">\r
+ <method name="Int32 <Main>m__0(System.Object)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</type>\r
<type name="Invariant`1[T]">\r
<method name="T get_Foo()" attrs="2534">\r
- <size>44</size>\r
+ <size>14</size>\r
</method>\r
<method name="Int32 Bar(T)" attrs="486">\r
<size>22</size>\r
<test name="test-146.cs">\r
<type name="Test">\r
<method name="Int32 Main()" attrs="150">\r
- <size>354</size>\r
+ <size>355</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Int32 <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <Main>m__0()" attrs="145">\r
<size>11</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <Main>m__1()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Double <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Double <Main>m__0(Int32)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Test>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <Test>m__0(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestClass">\r
- <method name="Void <Main>m__0(System.Object, Int32 ByRef)" attrs="145">\r
+ <method name="Void <Main>m__0(Int32 ByRef)" attrs="145">\r
<size>5</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Tests">\r
- <method name="Boolean <foo>m__0(System.Object, System.Object)" attrs="145">\r
+ <method name="Boolean <foo>m__0(System.Object)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<method name="System.String Test_2()" attrs="150">\r
<size>7</size>\r
</method>\r
+ <method name="Void Test_3()" attrs="145">\r
+ <size>20</size>\r
+ </method>\r
</type>\r
</test>\r
<test name="test-505.cs">\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>36</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="ClassMain">\r
- <method name="Void <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <Main>m__0(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test1.CC">\r
- <method name="Int32 <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <Main>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<test name="test-729.cs">\r
<type name="Primes.MainClass">\r
<method name="Int32 Main()" attrs="150">\r
- <size>148</size>\r
+ <size>149</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="A">\r
- <method name="Void <Test>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Test>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Void <Main>m__0(System.Object, System.Object, System.String)" attrs="145">\r
+ <method name="Void <Main>m__0(System.Object, System.String)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
+ <method name="Void Test8()" attrs="145">\r
+ <size>51</size>\r
+ </method>\r
</type>\r
</test>\r
<test name="test-881.cs">\r
</method>\r
</type>\r
</test>\r
- <test name="test-888.cs">\r
- <type name="S1">\r
- <method name="Void .ctor(Int32)" attrs="6278">\r
- <size>2</size>\r
- </method>\r
- </type>\r
- <type name="X">\r
- <method name="Void Main()" attrs="150">\r
- <size>2</size>\r
- </method>\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- </type>\r
- </test>\r
<test name="test-889.cs">\r
<type name="Test">\r
<method name="Void Main()" attrs="145">\r
<test name="test-898.cs">\r
<type name="BoolArrayWithByteValues">\r
<method name="Int32 Foo(Boolean ByRef)" attrs="145">\r
- <size>56</size>\r
+ <size>58</size>\r
</method>\r
<method name="Int32 Main()" attrs="145">\r
- <size>169</size>\r
+ <size>191</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
+ <method name="Boolean Ptr()" attrs="145">\r
+ <size>167</size>\r
+ </method>\r
</type>\r
</test>\r
<test name="test-899.cs">\r
</method>\r
</type>\r
</test>\r
+ <test name="test-903.cs">\r
+ <type name="C">\r
+ <method name="S op_Implicit(C)" attrs="2198">\r
+ <size>18</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="Program">\r
+ <method name="Void Main()" attrs="145">\r
+ <size>15</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-904.cs">\r
+ <type name="Test">\r
+ <method name="Boolean Foo(Int32 ByRef)" attrs="150">\r
+ <size>13</size>\r
+ </method>\r
+ <method name="Void Main()" attrs="145">\r
+ <size>172</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-905.cs">\r
+ <type name="X">\r
+ <method name="Void Main()" attrs="150">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-906.cs">\r
+ <type name="S1">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>10</size>\r
+ </method>\r
+ </type>\r
+ <type name="S2">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>9</size>\r
+ </method>\r
+ </type>\r
+ <type name="S3">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>17</size>\r
+ </method>\r
+ </type>\r
+ <type name="S4">\r
+ <method name="Void .ctor(Int32)" attrs="6278">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>9</size>\r
+ </method>\r
+ </type>\r
+ <type name="S5">\r
+ <method name="Void .ctor(Int32)" attrs="6278">\r
+ <size>22</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>8</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>161</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-91.cs">\r
<type name="Abstract">\r
<method name="Void .ctor()" attrs="6276">\r
<method name="Void .cctor()" attrs="6289">\r
<size>18</size>\r
</method>\r
- <method name="Void <f>m__0(System.Object)" attrs="145">\r
+ <method name="Void <f>m__0()" attrs="145">\r
<size>27</size>\r
</method>\r
</type>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="X+<Test>c__AnonStorey0`1+<Test>c__AnonStorey1`1[T]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- <method name="Void <>m__0()" attrs="131">\r
- <size>51</size>\r
- </method>\r
- </type>\r
<type name="Simple">\r
<method name="System.IAsyncResult BeginInvoke(System.AsyncCallback, System.Object)" attrs="454">\r
<size>0</size>\r
<size>0</size>\r
</method>\r
</type>\r
+ <type name="X+<Test>c__AnonStorey0`1+<Test>c__AnonStorey1[T]">\r
+ <method name="Void <>m__0()" attrs="131">\r
+ <size>51</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-anon-103.cs">\r
<type name="Foo`1[S]">\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Void <op_Implicit>m__0(System.Object)" attrs="145">\r
+ <method name="Void <op_Implicit>m__0()" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Void <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <Main>m__0(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Void <Main>m__1(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__2(System.Object, Int32[])" attrs="145">\r
+ <method name="Void <Main>m__2(Int32[])" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__3(System.Object, Int32[])" attrs="145">\r
+ <method name="Void <Main>m__3(Int32[])" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="TDelegate <CreateMethodUnscoped`1>m__0[TDelegate](System.Object, System.Object)" attrs="145">\r
+ <method name="TDelegate <CreateMethodUnscoped`1>m__0[TDelegate](System.Object)" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Int32 <SomeCaller>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <SomeCaller>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Test`1+<Hello>c__AnonStorey1`1+<Hello>c__AnonStorey0`1[T,S]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- <method name="Void <>m__0(T)" attrs="131">\r
- <size>66</size>\r
- </method>\r
- </type>\r
<type name="Foo`1[V]">\r
<method name="System.IAsyncResult BeginInvoke(V, System.AsyncCallback, System.Object)" attrs="454">\r
<size>0</size>\r
<size>0</size>\r
</method>\r
</type>\r
+ <type name="Test`1+<Hello>c__AnonStorey1`1+<Hello>c__AnonStorey0[T,S]">\r
+ <method name="Void <>m__0(T)" attrs="131">\r
+ <size>66</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-anon-116.cs">\r
<type name="TestFunc`1[T]">\r
</method>\r
</type>\r
<type name="TestClass">\r
- <method name="Void <a>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <a>m__0(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="T <Test2`1>m__0[T](System.Object, T)" attrs="145">\r
+ <method name="T <Test2`1>m__0[T](T)" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>24</size>\r
</method>\r
- <method name="System.String <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="System.String <Main>m__2(Int32)" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.String <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="System.String <Main>m__3(Int32)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Int32 <TestNaturalSort>m__0(System.Object, System.String, System.String)" attrs="145">\r
+ <method name="Int32 <TestNaturalSort>m__0(System.String, System.String)" attrs="145">\r
<size>114</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Boolean <Main>m__0(System.Object, System.Object)" attrs="145">\r
+ <method name="Boolean <Main>m__0(System.Object)" attrs="145">\r
<size>20</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C`1[T]">\r
- <method name="Void <Foo`1>m__0[U](System.Object)" attrs="145">\r
+ <method name="Void <Foo`1>m__0[U]()" attrs="145">\r
<size>6</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Int32 <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <Main>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Main>m__1(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__1()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Void <Main>m__2(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__2()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Void <Main>m__3(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__3()" attrs="145">\r
<size>62</size>\r
</method>\r
- <method name="Void <Main>m__4(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__4()" attrs="145">\r
<size>54</size>\r
</method>\r
- <method name="Void <Main>m__5(System.Object, E)" attrs="145">\r
+ <method name="Void <Main>m__5(E)" attrs="145">\r
<size>35</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="TDest <GetUpcaster`2>m__0[TSource,TDest](System.Object, TSource)" attrs="145">\r
+ <method name="TDest <GetUpcaster`2>m__0[TSource,TDest](TSource)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="TDest <GetDowncaster`2>m__1[TSource,TDest](System.Object, TSource)" attrs="145">\r
+ <method name="TDest <GetDowncaster`2>m__1[TSource,TDest](TSource)" attrs="145">\r
<size>20</size>\r
</method>\r
</type>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="X+<Test>c__AnonStorey0`1+<Test>c__AnonStorey1`1[T]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- <method name="Void <>m__0()" attrs="131">\r
- <size>51</size>\r
- </method>\r
- </type>\r
<type name="Simple">\r
<method name="System.IAsyncResult BeginInvoke(System.AsyncCallback, System.Object)" attrs="454">\r
<size>0</size>\r
<size>0</size>\r
</method>\r
</type>\r
+ <type name="X+<Test>c__AnonStorey0`1+<Test>c__AnonStorey1[T]">\r
+ <method name="Void <>m__0()" attrs="131">\r
+ <size>51</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-anon-131.cs">\r
<type name="A">\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Void <>m__1(System.Object, System.Object, System.EventArgs)" attrs="145">\r
+ <method name="Void <>m__1(System.Object, System.EventArgs)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="System.String <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="System.String <Main>m__0(System.String)" attrs="145">\r
<size>24</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C`1[T]">\r
- <method name="T <XX>m__0(System.Object)" attrs="145">\r
+ <method name="T <XX>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
</type>\r
<type name="C2`1[T]">\r
- <method name="C`1[T] <XX>m__0(System.Object)" attrs="145">\r
+ <method name="C`1[T] <XX>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="N1">\r
- <method name="T <XX`1>m__0[T](System.Object)" attrs="145">\r
+ <method name="T <XX`1>m__0[T]()" attrs="145">\r
<size>17</size>\r
</method>\r
</type>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Foo`1+<ContainsAll>c__AnonStorey0`1+<ContainsAll>c__AnonStorey1`1[T,U]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- </type>\r
<type name="Foo`1[T]">\r
<method name="Boolean ContainsAll[U](System.Collections.Generic.IEnumerable`1[U])" attrs="134">\r
<size>48</size>\r
</method>\r
</type>\r
+ <type name="Foo`1+<ContainsAll>c__AnonStorey0`1+<ContainsAll>c__AnonStorey1[T,U]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-anon-139.cs">\r
<type name="Test">\r
<method name="System.Decimal Average[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Decimal])" attrs="150">\r
<size>45</size>\r
</method>\r
- <method name="System.Decimal <Average`1>m__0[TSource](System.Object, System.Decimal, System.Decimal)" attrs="145">\r
+ <method name="System.Decimal <Average`1>m__0[TSource](System.Decimal, System.Decimal)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="System.Decimal <Average`1>m__1[TSource](System.Object, System.Decimal, System.Decimal)" attrs="145">\r
+ <method name="System.Decimal <Average`1>m__1[TSource](System.Decimal, System.Decimal)" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Void <Test_3`1>m__0[T](System.Object)" attrs="145">\r
+ <method name="Void <Test_3`1>m__0[T]()" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.Type <Test`1>m__0[T](System.Object)" attrs="145">\r
+ <method name="System.Type <Test`1>m__0[T]()" attrs="145">\r
<size>18</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Void <ThisCausesACrash`1>m__0[I](System.Object, System.Object, System.EventArgs)" attrs="145">\r
+ <method name="Void <ThisCausesACrash`1>m__0[I](System.Object, System.EventArgs)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <AnyMethod`1>m__0[T](System.Object)" attrs="145">\r
+ <method name="Void <AnyMethod`1>m__0[T]()" attrs="145">\r
<size>32</size>\r
</method>\r
</type>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="C+<Curry>c__AnonStorey0`3+<Curry>c__AnonStorey1`3[T1,T2,T3]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
+ <type name="C+<Curry>c__AnonStorey0`3+<Curry>c__AnonStorey1[T1,T2,T3]">\r
+ <method name="System.Action`1[T3] <>m__0(T2)" attrs="131">\r
+ <size>52</size>\r
</method>\r
- </type>\r
- <type name="C+<Curry>c__AnonStorey0`3+<Curry>c__AnonStorey1`3+<Curry>c__AnonStorey2`3[T1,T2,T3]">\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="C+<Curry>c__AnonStorey0`3+<Curry>c__AnonStorey1`3[T1,T2,T3]">\r
- <method name="System.Action`1[T3] <>m__0(T2)" attrs="131">\r
- <size>52</size>\r
- </method>\r
- </type>\r
- <type name="C+<Curry>c__AnonStorey0`3+<Curry>c__AnonStorey1`3+<Curry>c__AnonStorey2`3[T1,T2,T3]">\r
+ <type name="C+<Curry>c__AnonStorey0`3+<Curry>c__AnonStorey1+<Curry>c__AnonStorey2[T1,T2,T3]">\r
<method name="Void <>m__0(T3)" attrs="131">\r
<size>35</size>\r
</method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
</type>\r
<type name="Test">\r
- <method name="Void <Main>m__0(System.Object, Int32, Int32, Int32)" attrs="145">\r
+ <method name="Void <Main>m__0(Int32, Int32, Int32)" attrs="145">\r
<size>24</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Foo">\r
- <method name="Inner <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="Inner <Main>m__0(System.String)" attrs="145">\r
<size>21</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestComp.Program+MyClass">\r
- <method name="Void <UseATemplate>m__0(System.Object, System.Collections.Generic.List`1[System.Int32] ByRef)" attrs="145">\r
+ <method name="Void <UseATemplate>m__0(System.Collections.Generic.List`1[System.Int32] ByRef)" attrs="145">\r
<size>17</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="System.Object <Main>m__0(System.Object, System.Object)" attrs="145">\r
+ <method name="System.Object <Main>m__0(System.Object)" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X`1[T]">\r
- <method name="Void <Test>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Test>m__0()" attrs="145">\r
<size>8</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestGenericsSubtypeMatching.C">\r
- <method name="Void <Main>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="Void <Main>m__0(System.String)" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestGenericsSubtypeMatching.C">\r
- <method name="Void <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <Main>m__0(Int32)" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestCase+<Test>c__AnonStorey0`1[T]">\r
- <method name="Int32 <>m__1(System.Object, System.Collections.Generic.IList`1[System.Collections.Generic.IList`1[T]])" attrs="145">\r
+ <method name="Int32 <>m__1(System.Collections.Generic.IList`1[System.Collections.Generic.IList`1[T]])" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="T+<GetD>c__AnonStorey2`1+<GetD>c__AnonStorey0`1[T]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
+ <type name="D">\r
+ <method name="System.IAsyncResult BeginInvoke(System.Object, System.AsyncCallback, System.Object)" attrs="454">\r
+ <size>0</size>\r
+ </method>\r
+ <method name="Void EndInvoke(System.IAsyncResult)" attrs="454">\r
+ <size>0</size>\r
</method>\r
</type>\r
- <type name="T+<GetD>c__AnonStorey2`1+<GetD>c__AnonStorey1`1[T]">\r
+ <type name="T+<GetD>c__AnonStorey2`1+<GetD>c__AnonStorey0[T]">\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
+ </type>\r
+ <type name="T+<GetD>c__AnonStorey2`1+<GetD>c__AnonStorey1[T]">\r
<method name="Void <>m__0()" attrs="131">\r
<size>52</size>\r
</method>\r
- </type>\r
- <type name="D">\r
- <method name="System.IAsyncResult BeginInvoke(System.Object, System.AsyncCallback, System.Object)" attrs="454">\r
- <size>0</size>\r
- </method>\r
- <method name="Void EndInvoke(System.IAsyncResult)" attrs="454">\r
- <size>0</size>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
</method>\r
</type>\r
</test>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="T <Foo`1>m__0[T](System.Object, T)" attrs="145">\r
+ <method name="T <Foo`1>m__0[T](T)" attrs="145">\r
<size>77</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="A">\r
- <method name="Void <Test`2>m__0[T,U](System.Object)" attrs="145">\r
+ <method name="Void <Test`2>m__0[T,U]()" attrs="145">\r
<size>39</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>89</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="Int32 <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__0(Int32)" attrs="145">\r
<size>51</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__1(Int32)" attrs="145">\r
<size>46</size>\r
</method>\r
- <method name="Int32 <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <Main>m__2(Int32)" attrs="145">\r
<size>42</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>18</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
</test>\r
+ <test name="test-anon-172.cs">\r
+ <type name="MainClass">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>133</size>\r
+ </method>\r
+ <method name="Void GenerateCodeCall[T1](System.Reflection.Emit.ILGenerator, System.Action`1[T1])" attrs="145">\r
+ <size>19</size>\r
+ </method>\r
+ <method name="Void <Main>m__0(Int32)" attrs="145">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-anon-18.cs">\r
<type name="A">\r
<method name="Void Invoke()" attrs="454">\r
</method>\r
</type>\r
<type name="TestGotoLabels.GotoLabelsTest">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Void <Hello>m__1(System.Object, System.String)" attrs="145">\r
+ <method name="Void <Hello>m__1(System.String)" attrs="145">\r
<size>8</size>\r
</method>\r
- <method name="Void <Hello>m__2(System.Object, System.String)" attrs="145">\r
+ <method name="Void <Hello>m__2(System.String)" attrs="145">\r
<size>8</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="System.Object <Main>m__0(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.Object <Main>m__0(System.Reflection.MethodInfo)" attrs="145">\r
<size>26</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="DelegateInit">\r
- <method name="Void <_print>m__0(System.Object)" attrs="145">\r
+ <method name="Void <_print>m__0()" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Simple <Test>m__0(System.Object)" attrs="145">\r
+ <method name="Simple <Test>m__0()" attrs="145">\r
<size>45</size>\r
</method>\r
- <method name="Void <Test>m__1(System.Object)" attrs="145">\r
+ <method name="Void <Test>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="TestClass">\r
- <method name="Void <a>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <a>m__0(Int32)" attrs="145">\r
<size>8</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="Void <Print>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Print>m__0()" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Observable">\r
- <method name="Void <Main>m__0(System.Object, Observable)" attrs="145">\r
+ <method name="Void <Main>m__0(Observable)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Source">\r
- <method name="Void <AddSource>m__0(System.Object, System.Object, System.EventArgs)" attrs="145">\r
+ <method name="Void <AddSource>m__0(System.Object, System.EventArgs)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <Main>m__0(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Main>m__1(System.Object, System.String ByRef)" attrs="145">\r
+ <method name="Void <Main>m__1(System.String ByRef)" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="T">\r
- <method name="Void <Main>m__0(System.Object, System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0(System.Object)" attrs="145">\r
<size>16</size>\r
</method>\r
- <method name="Void <Test_1>m__1(System.Object, System.Object)" attrs="145">\r
+ <method name="Void <Test_1>m__1(System.Object)" attrs="145">\r
<size>32</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Foo">\r
- <method name="System.String[,] <Main>m__0(System.Object)" attrs="145">\r
+ <method name="System.String[,] <Main>m__0()" attrs="145">\r
<size>42</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Test">\r
- <method name="Boolean <TestMe>m__0(System.Object)" attrs="145">\r
+ <method name="Boolean <TestMe>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="DelegateTest">\r
- <method name="Void <Main>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Main>m__0()" attrs="145">\r
<size>19</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>18</size>\r
</method>\r
- <method name="Void <get_DoNothingEventHandler>m__0(System.Object, System.Object, System.EventArgs)" attrs="145">\r
+ <method name="Void <get_DoNothingEventHandler>m__0(System.Object, System.EventArgs)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="MainClass">\r
- <method name="Void <Test2>m__0(System.Object, System.String)" attrs="145">\r
+ <method name="Void <Test2>m__0(System.String)" attrs="145">\r
<size>28</size>\r
</method>\r
- <method name="Void <Test3>m__1(System.Object)" attrs="145">\r
+ <method name="Void <Test3>m__1()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <Test4>m__2(System.Object)" attrs="145">\r
+ <method name="Void <Test4>m__2()" attrs="145">\r
<size>32</size>\r
</method>\r
- <method name="Void <Test4>m__3(System.Object)" attrs="145">\r
+ <method name="Void <Test4>m__3()" attrs="145">\r
<size>29</size>\r
</method>\r
</type>\r
<type name="MainClass+<Test5>c__AnonStorey4">\r
- <method name="Int32 <>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <>m__1(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>42</size>\r
</method>\r
- <method name="Void <MyDelegate>m__0(System.Object, System.Object, System.EventArgs)" attrs="145">\r
+ <method name="Void <MyDelegate>m__0(System.Object, System.EventArgs)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="C <field>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="C <field>m__0(Int32)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C+<Test>c__AnonStorey2">\r
- <method name="Void <>m__2(System.Object)" attrs="145">\r
+ <method name="Void <>m__2()" attrs="145">\r
<size>4</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="BaseTest.MainClass">\r
- <method name="Void <Main>m__0(System.Object, System.Object, System.EventArgs)" attrs="145">\r
+ <method name="Void <Main>m__0(System.Object, System.EventArgs)" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Test>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Test>m__0()" attrs="145">\r
<size>63</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="Void <RunAsync>m__0(System.Object)" attrs="145">\r
+ <method name="Void <RunAsync>m__0()" attrs="145">\r
<size>62</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="System.Threading.Tasks.Task`1[System.Decimal] <Main>m__0(System.Object, System.Decimal)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Decimal] <Main>m__0(System.Decimal)" attrs="145">\r
<size>41</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="System.Threading.Tasks.Task`1[System.Int16] <Main>m__0(System.Object, Int16)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int16] <Main>m__0(Int16)" attrs="145">\r
<size>41</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="AsyncTypeInference">\r
- <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0(Int32)" attrs="145">\r
<size>33</size>\r
</method>\r
- <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__1(Int32)" attrs="145">\r
<size>33</size>\r
</method>\r
- <method name="System.Threading.Tasks.Task <Main>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task <Main>m__2(Int32)" attrs="145">\r
<size>33</size>\r
</method>\r
- <method name="System.Threading.Tasks.Task <Main>m__3(System.Object, Int32)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task <Main>m__3(Int32)" attrs="145">\r
<size>33</size>\r
</method>\r
- <method name="Int32 <TT>m__4(System.Object)" attrs="145">\r
+ <method name="Int32 <TT>m__4()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="AsyncTypeInference+<Main>c__async2">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="AsyncTypeInference+<Main>c__async5">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="System.Threading.Tasks.Task`1[System.Int16] <Main>m__0(System.Object, System.String)" attrs="145">\r
- <size>33</size>\r
- </method>\r
</type>\r
<type name="Test+<Main>c__async3">\r
<method name="Void MoveNext()" attrs="486">\r
<size>13</size>\r
</method>\r
</type>\r
+ <type name="Test">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int16] <Main>m__0(System.String)" attrs="145">\r
+ <size>33</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-async-10.cs">\r
<type name="C">\r
</method>\r
</type>\r
<type name="C+<TestCompositionCall_1>c__async0">\r
- <method name="System.String <>m__0(System.Object)" attrs="145">\r
+ <method name="System.String <>m__0()" attrs="145">\r
<size>21</size>\r
</method>\r
- <method name="System.String <>m__1(System.Object)" attrs="145">\r
+ <method name="System.String <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="C+<TestCompositionCall_2>c__async1">\r
- <method name="System.String <>m__0(System.Object)" attrs="145">\r
+ <method name="System.String <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="C+<TestCompositionCall_3>c__async2">\r
- <method name="Byte <>m__0(System.Object)" attrs="145">\r
+ <method name="Byte <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<TestCompositionPair_1>c__async3">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<TestCompositionPair_2>c__async4">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<TestCompositionPair_3>c__async5">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<TestCompositionPair_4>c__async6">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="G`1+<TestStack_1>c__async0[T]">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<TestStack_1>c__async0">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<TestStack_2>c__async1">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<TestStack_3>c__async2">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<TestStack_4>c__async3">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</type>\r
<type name="Tester+<ArrayAccessTest_1>c__async0">\r
<method name="Void MoveNext()" attrs="486">\r
- <size>337</size>\r
+ <size>338</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_2>c__async1">\r
</type>\r
<type name="Tester+<ArrayAccessTest_10>c__async9">\r
<method name="Void MoveNext()" attrs="486">\r
- <size>234</size>\r
+ <size>235</size>\r
</method>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester">\r
- <method name="Boolean <Main>m__0(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__0(System.Reflection.MethodInfo)" attrs="145">\r
<size>45</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__1(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__2(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__2(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__3(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_1>c__async0">\r
- <method name="Boolean <>m__0(System.Object)" attrs="145">\r
+ <method name="Boolean <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_2>c__async1">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Double <>m__3(System.Object)" attrs="145">\r
+ <method name="Double <>m__3()" attrs="145">\r
<size>17</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_3>c__async2">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="System.Decimal <>m__2(System.Object)" attrs="145">\r
+ <method name="System.Decimal <>m__2()" attrs="145">\r
<size>19</size>\r
</method>\r
- <method name="Int32 <>m__3(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__3()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="System.Decimal <>m__4(System.Object)" attrs="145">\r
+ <method name="System.Decimal <>m__4()" attrs="145">\r
<size>19</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_4>c__async3">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="System.String <>m__1(System.Object)" attrs="145">\r
+ <method name="System.String <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_5>c__async4">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_6>c__async5">\r
- <method name="Int64 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int64 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_7>c__async6">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_8>c__async7">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Byte <>m__1(System.Object)" attrs="145">\r
+ <method name="Byte <>m__1()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_9>c__async8">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__3(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__3()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__4(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__4()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__5(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__5()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="S <>m__6(System.Object)" attrs="145">\r
+ <method name="S <>m__6()" attrs="145">\r
<size>25</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_10>c__async9">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<ArrayAccessTest_11>c__asyncA">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<AssignTest_1>c__asyncB">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<AssignTest_2>c__asyncC">\r
- <method name="System.Nullable`1[System.SByte] <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.SByte] <>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
</type>\r
<type name="Tester+<AssignTest_3>c__asyncD">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<BinaryTest_1>c__asyncE">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<BinaryTest_3>c__async10">\r
- <method name="System.Nullable`1[System.Boolean] <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Boolean] <>m__0()" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__1(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Boolean] <>m__1()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__2(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Boolean] <>m__2()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__3(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Boolean] <>m__3()" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__4(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Boolean] <>m__4()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__5(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Boolean] <>m__5()" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
<type name="Tester+<BinaryTest_4>c__async11">\r
- <method name="System.Nullable`1[System.Int16] <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Int16] <>m__0()" attrs="145">\r
<size>14</size>\r
</method>\r
- <method name="System.Nullable`1[System.Byte] <>m__1(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Byte] <>m__1()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="System.Nullable`1[System.Decimal] <>m__2(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Decimal] <>m__2()" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.Nullable`1[System.Decimal] <>m__3(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Decimal] <>m__3()" attrs="145">\r
<size>17</size>\r
</method>\r
</type>\r
<type name="Tester+<CallTest_1>c__async14">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<CallTest_2>c__async15">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
</type>\r
<type name="Tester+<CallTest_3>c__async16">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<CallTest_4>c__async17">\r
- <method name="E <>m__0(System.Object)" attrs="145">\r
+ <method name="E <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<CastTest_1>c__async19">\r
- <method name="System.Decimal <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Decimal <>m__0()" attrs="145">\r
<size>15</size>\r
</method>\r
</type>\r
<type name="Tester+<CoalescingTest_1>c__async1B">\r
- <method name="System.String <>m__0(System.Object)" attrs="145">\r
+ <method name="System.String <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="System.String <>m__1(System.Object)" attrs="145">\r
+ <method name="System.String <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<CoalescingTest_2>c__async1C">\r
- <method name="System.Nullable`1[System.Int16] <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.Int16] <>m__0()" attrs="145">\r
<size>17</size>\r
</method>\r
- <method name="Byte <>m__1(System.Object)" attrs="145">\r
+ <method name="Byte <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<ConditionalTest_1>c__async1D">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<ConditionalTest_2>c__async1E">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<ConditionalTest_3>c__async1F">\r
- <method name="Boolean <>m__0(System.Object)" attrs="145">\r
+ <method name="Boolean <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<ConditionalTest_4>c__async20">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<DelegateInvoke_4>c__async21">\r
- <method name="Int32 <>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <>m__0(Int32)" attrs="145">\r
<size>11</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<FieldTest_1>c__async23">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<IndexerTest_1>c__async24">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<IndexerTest_2>c__async25">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<IndexerTest_3>c__async26">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<IndexerTest_4>c__async27">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<IndexerTest_5>c__async28">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<IndexerTest_6>c__async29">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<IsTest_1>c__async2B">\r
- <method name="Tester <>m__0(System.Object)" attrs="145">\r
+ <method name="Tester <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<IsTest_2>c__async2C">\r
- <method name="System.Nullable`1[System.UInt32] <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Nullable`1[System.UInt32] <>m__0()" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
<type name="Tester+<LogicalUserOperator_1>c__async2D">\r
- <method name="Base <>m__0(System.Object)" attrs="145">\r
+ <method name="Base <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Base <>m__1(System.Object)" attrs="145">\r
+ <method name="Base <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<LogicalUserOperator_2>c__async2E">\r
- <method name="Base <>m__0(System.Object)" attrs="145">\r
+ <method name="Base <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<LogicalUserOperator_3>c__async2F">\r
- <method name="Base <>m__0(System.Object)" attrs="145">\r
+ <method name="Base <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Base <>m__1(System.Object)" attrs="145">\r
+ <method name="Base <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<NewTest_1>c__async30">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<NewTest_2>c__async31">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="System.String <>m__1(System.Object)" attrs="145">\r
+ <method name="System.String <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<NewDelegate_1_0>c__async33">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<NewInitTest_1>c__async34">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__3(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__3()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__4(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__4()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__5(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__5()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<NewInitTest_2>c__async35">\r
- <method name="System.String <>m__0(System.Object)" attrs="145">\r
+ <method name="System.String <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="System.String <>m__1(System.Object)" attrs="145">\r
+ <method name="System.String <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__3(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__3()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<NewArrayInitTest_1>c__async36">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<NewArrayInitTest_2>c__async37">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<NewArrayInitTest_3>c__async38">\r
- <method name="Byte <>m__0(System.Object)" attrs="145">\r
+ <method name="Byte <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<NewArrayInitTest_4>c__async39">\r
- <method name="UInt16 <>m__0(System.Object)" attrs="145">\r
+ <method name="UInt16 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="UInt16 <>m__1(System.Object)" attrs="145">\r
+ <method name="UInt16 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<NewArrayInitTest_5>c__async3A">\r
- <method name="S <>m__0(System.Object)" attrs="145">\r
+ <method name="S <>m__0()" attrs="145">\r
<size>25</size>\r
</method>\r
</type>\r
<type name="Tester+<NewArrayInitTest_6>c__async3B">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<PropertyTest_1>c__async3D">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<PropertyTest_2>c__async3E">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<PropertyTest_3>c__async3F">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__2(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__2()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<StringConcatTest_1>c__async40">\r
- <method name="System.String <>m__0(System.Object)" attrs="145">\r
+ <method name="System.String <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="System.String <>m__1(System.Object)" attrs="145">\r
+ <method name="System.String <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="System.String <>m__2(System.Object)" attrs="145">\r
+ <method name="System.String <>m__2()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<UnaryTest_1>c__async41">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<UnaryTest_3>c__async43">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<VariableInitializer_1>c__async44">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
- <method name="Int32 <>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0(System.Object)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0()" attrs="145">\r
<size>33</size>\r
</method>\r
</type>\r
<type name="C+<TestResult>c__async0">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<Main>c__async1">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</type>\r
<type name="Tester+<NewInitTestGen>c__async0`1[T]">\r
<method name="Void MoveNext()" attrs="486">\r
- <size>295</size>\r
+ <size>305</size>\r
</method>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<NewInitTestGen>c__async0`1[T]">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<type name="Tester+<NewInitCol>c__async1">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Tester">\r
- <method name="Boolean <Main>m__0(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__0(System.Reflection.MethodInfo)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__1(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__2(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__2(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__3(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<type name="Tester+<SwitchTest_1>c__async0">\r
- <method name="System.String <>m__0(System.Object)" attrs="145">\r
+ <method name="System.String <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<Using_1>c__async1">\r
- <method name="Base <>m__0(System.Object)" attrs="145">\r
+ <method name="Base <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Tester <>m__1(System.Object)" attrs="145">\r
+ <method name="Tester <>m__1()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Base <>m__2(System.Object)" attrs="145">\r
+ <method name="Base <>m__2()" attrs="145">\r
<size>13</size>\r
</method>\r
- <method name="Base <>m__3(System.Object)" attrs="145">\r
+ <method name="Base <>m__3()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<Foreach_1>c__async2">\r
- <method name="System.Collections.Generic.List`1[System.Int32] <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Collections.Generic.List`1[System.Int32] <>m__0()" attrs="145">\r
<size>36</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Tester">\r
- <method name="Boolean <Main>m__0(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__0(System.Reflection.MethodInfo)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__1(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__2(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__2(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__3(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<type name="Tester+<TestException_1>c__async0">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="Tester+<TestException_2>c__async1">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="Tester+<TestException_3>c__async2">\r
- <method name="System.Threading.Tasks.Task <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task <>m__0()" attrs="145">\r
<size>33</size>\r
</method>\r
</type>\r
<type name="Tester+<TestException_4>c__async3">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<TestException_5>c__async4">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="Tester+<TestException_6>c__async5">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="Tester+<TestException_7>c__async6">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<type name="Tester+<TestException_3>c__async2+<TestException_3>c__async7">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- </type>\r
- <type name="Tester+<Lambda_3>c__async2`1+<Lambda_3>c__AnonStorey6`1[T]">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- </type>\r
- <type name="Tester+<Lambda_2>c__async1+<Lambda_2>c__AnonStorey4">\r
<method name="Int32 <>m__0()" attrs="131">\r
<size>26</size>\r
</method>\r
</type>\r
- <type name="Tester+<Lambda_3>c__async2`1+<Lambda_3>c__AnonStorey6`1[T]">\r
- <method name="Int32 <>m__0()" attrs="131">\r
- <size>14</size>\r
- </method>\r
- </type>\r
<type name="Tester+<Lambda_1>c__async0">\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
<size>13</size>\r
</method>\r
</type>\r
+ <type name="Tester+<Lambda_3>c__async2`1+<Lambda_3>c__AnonStorey6[T]">\r
+ <method name="Int32 <>m__0()" attrs="131">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-async-19.cs">\r
<type name="C">\r
</method>\r
</type>\r
<type name="Tester">\r
- <method name="Boolean <Main>m__0(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__0(System.Reflection.MethodInfo)" attrs="145">\r
<size>20</size>\r
</method>\r
- <method name="System.String <Main>m__1(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="System.String <Main>m__1(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__2(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__2(System.Reflection.MethodInfo)" attrs="145">\r
<size>15</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, Boolean)" attrs="145">\r
+ <method name="Boolean <Main>m__3(Boolean)" attrs="145">\r
<size>12</size>\r
</method>\r
</type>\r
<type name="Tester+<Add_1>c__async0">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<AssignCompound_1>c__async1">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="Tester+<Convert_1>c__async2">\r
- <method name="System.Object <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Object <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
<type name="Tester+<Invocation_1>c__async3">\r
- <method name="System.Object <>m__0(System.Object)" attrs="145">\r
+ <method name="System.Object <>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="AwaitNS.Formals">\r
- <method name="Void <M1>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Void <M1>m__0(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <M1>m__1(System.Object, Int32)" attrs="145">\r
+ <method name="Void <M1>m__1(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Void <M1>m__2(System.Object, Int32)" attrs="145">\r
+ <method name="Void <M1>m__2(Int32)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>21</size>\r
</method>\r
</type>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="Int32 <CompilationTestOnly>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <CompilationTestOnly>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="ConsoleApplication1.Program">\r
- <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0(System.Object)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0()" attrs="145">\r
<size>47</size>\r
</method>\r
- <method name="Int32 <Main>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <Main>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Int32 <>m__0(Int32)" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="N.M.C">\r
- <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0(System.Object)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0()" attrs="145">\r
<size>33</size>\r
</method>\r
- <method name="Boolean <Main>m__1(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__1(System.Reflection.MethodInfo)" attrs="145">\r
<size>24</size>\r
</method>\r
- <method name="Boolean <Main>m__2(System.Object, System.Type)" attrs="145">\r
+ <method name="Boolean <Main>m__2(System.Type)" attrs="145">\r
<size>24</size>\r
</method>\r
- <method name="Boolean <Main>m__3(System.Object, System.Reflection.MethodInfo)" attrs="145">\r
+ <method name="Boolean <Main>m__3(System.Reflection.MethodInfo)" attrs="145">\r
<size>24</size>\r
</method>\r
</type>\r
<type name="N.M.C+<NestedAsyncAnonymousMethod>c__async1">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>27</size>\r
</method>\r
</type>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="Program">\r
- <method name="Void <Main>m__0(System.Object, C)" attrs="145">\r
+ <method name="Void <Main>m__0(C)" attrs="145">\r
<size>35</size>\r
</method>\r
</type>\r
<type name="Program+<Main>c__async1">\r
- <method name="Void <>m__0(System.Object)" attrs="145">\r
+ <method name="Void <>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="AmbiguousGeneric">\r
- <method name="Int32 <ReturnOne>m__0(System.Object)" attrs="145">\r
- <size>9</size>\r
- </method>\r
- </type>\r
- <type name="AmbiguousGeneric+<NestedVoidTestSuccess>c__async0">\r
- <method name="System.Threading.Tasks.Task`1[System.Int32] <>m__0(System.Object)" attrs="145">\r
- <size>33</size>\r
- </method>\r
- </type>\r
<type name="AmbiguousGeneric+<NestedVoidTestSuccess>c__async0+<NestedVoidTestSuccess>c__async5">\r
<method name="Void MoveNext()" attrs="486">\r
<size>162</size>\r
<size>13</size>\r
</method>\r
</type>\r
+ <type name="AmbiguousGeneric">\r
+ <method name="Int32 <ReturnOne>m__0()" attrs="145">\r
+ <size>9</size>\r
+ </method>\r
+ </type>\r
+ <type name="AmbiguousGeneric+<NestedVoidTestSuccess>c__async0">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int32] <>m__0()" attrs="145">\r
+ <size>33</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-async-42.cs">\r
<type name="A">\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Void <>m__0(System.Object, Player)" attrs="145">\r
+ <method name="Void <>m__0(Player)" attrs="145">\r
<size>2</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="System.Threading.Tasks.Task <Main>m__0(System.Object)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task <Main>m__0()" attrs="145">\r
<size>33</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Boolean <Call>m__0(System.Object)" attrs="145">\r
+ <method name="Boolean <Call>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="X">\r
- <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0(System.Object)" attrs="145">\r
+ <method name="System.Threading.Tasks.Task`1[System.Int32] <Main>m__0()" attrs="145">\r
<size>33</size>\r
</method>\r
</type>\r
<method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
</test>\r
+ <test name="test-async-75.cs">\r
+ <type name="CorrectEncodingOfNestedTypes">\r
+ <method name="System.Threading.Tasks.Task`1[T] GetAsync[T](System.String)" attrs="145">\r
+ <size>41</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>91</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="CorrectEncodingOfNestedTypes+<GetAsync>c__async0`1[T]">\r
+ <method name="Void MoveNext()" attrs="486">\r
+ <size>218</size>\r
+ </method>\r
+ <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
+ <size>13</size>\r
+ </method>\r
+ </type>\r
+ <type name="CorrectEncodingOfNestedTypes+<GetAsync>c__async0`1+<GetAsync>c__AnonStorey5[T]">\r
+ <method name="System.Threading.Tasks.Task`1[T] <>m__0()" attrs="131">\r
+ <size>41</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="CorrectEncodingOfNestedTypes+<GetAsync>c__async0`1+<GetAsync>c__AnonStorey5+<GetAsync>c__async4[T]">\r
+ <method name="Void MoveNext()" attrs="486">\r
+ <size>190</size>\r
+ </method>\r
+ <method name="Void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine)" attrs="486">\r
+ <size>13</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-cls-00.cs">\r
<type name="CLSCLass_6">\r
<method name="Void add_Disposed(Delegate)" attrs="2182">\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <Test_1>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Test_1>m__0()" attrs="145">\r
<size>6</size>\r
</method>\r
- <method name="Void <Test_2>m__1(System.Object)" attrs="145">\r
+ <method name="Void <Test_2>m__1()" attrs="145">\r
<size>7</size>\r
</method>\r
- <method name="Void <Test_3>m__2(System.Object)" attrs="145">\r
+ <method name="Void <Test_3>m__2()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Int32 <Test_4>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <Test_4>m__0()" attrs="145">\r
<size>10</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
<type name="C">\r
- <method name="Void <RunAsync>m__0(System.Object)" attrs="145">\r
+ <method name="Void <RunAsync>m__0()" attrs="145">\r
<size>2</size>\r
</method>\r
- <method name="Int32 <RunAsync_2>m__1(System.Object)" attrs="145">\r
+ <method name="Int32 <RunAsync_2>m__1()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<type name="C+<Test_3>c__async2">\r
- <method name="Int32 <>m__0(System.Object)" attrs="145">\r
+ <method name="Int32 <>m__0()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Program <Test_4>m__0(System.Object)" attrs="145">\r
+ <method name="Program <Test_4>m__0()" attrs="145">\r
<size>13</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
</test>\r
+ <test name="test-decl-expr-01.cs">\r
+ <type name="DeclarationExpression">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>252</size>\r
+ </method>\r
+ <method name="Boolean Out(Int32 ByRef)" attrs="145">\r
+ <size>13</size>\r
+ </method>\r
+ <method name="Boolean Out2(Int32 ByRef, System.String)" attrs="145">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void Out3[T](T ByRef)" attrs="145">\r
+ <size>17</size>\r
+ </method>\r
+ <method name="Void Ref(Int32 ByRef)" attrs="145">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-dictinit-01.cs">\r
+ <type name="Program">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>181</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="Int32 get_Item(System.String)" attrs="2182">\r
+ <size>21</size>\r
+ </method>\r
+ <method name="Void set_Item(System.String, Int32)" attrs="2182">\r
+ <size>15</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>18</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-dictinit-02.cs">\r
+ <type name="Program">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>182</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="C get_Item(System.String)" attrs="2182">\r
+ <size>50</size>\r
+ </method>\r
+ <method name="Void set_Item(System.String, C)" attrs="2182">\r
+ <size>15</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>18</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-ex-filter-01.cs">\r
<type name="X">\r
<method name="Int32 Main()" attrs="150">\r
<method name="Int32 Main()" attrs="145">\r
<size>21</size>\r
</method>\r
- <method name="System.String <get_Prop2>m__0(System.Object)" attrs="145">\r
- <size>13</size>\r
- </method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>29</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
+ <type name="C">\r
+ <method name="System.String <get_Prop2>m__0()" attrs="145">\r
+ <size>13</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-externalias-01.cs">\r
<type name="Test">\r
</method>\r
</type>\r
</test>\r
+ <test name="test-nameof-01.cs">\r
+ <type name="X">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>20</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-nameof-02.cs">\r
+ <type name="A`1[T]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="A`1+B[T]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="X">\r
+ <method name="Int64 get_Prop()" attrs="2177">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Prop(Int64)" attrs="2177">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Void add_ev(System.Action)" attrs="2177">\r
+ <size>42</size>\r
+ </method>\r
+ <method name="Void remove_ev(System.Action)" attrs="2177">\r
+ <size>42</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>83</size>\r
+ </method>\r
+ <method name="Void GenMethod[T,U,V]()" attrs="145">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Int32 SimpleName[T](T)" attrs="129">\r
+ <size>17</size>\r
+ </method>\r
+ <method name="Int32 MemberAccess()" attrs="129">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Int32 QualifiedName()" attrs="129">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-nameof-03.cs">\r
+ <type name="T2">\r
+ <method name="Int32 nameof(System.String)" attrs="150">\r
+ <size>10</size>\r
+ </method>\r
+ </type>\r
+ <type name="X">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>37</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-nameof-04.cs">\r
+ <type name="Ambiguous">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>68</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-01.cs">\r
+ <type name="S">\r
+ <method name="Int32 get_Prop()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Prop(Int32)" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ </type>\r
+ <type name="CI">\r
+ <method name="Int32 Method()" attrs="486">\r
+ <size>11</size>\r
+ </method>\r
+ <method name="Int32 get_Prop()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Prop(Int32)" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="System.String get_Prop()" attrs="2193">\r
+ <size>22</size>\r
+ </method>\r
+ <method name="Int32 TestArray()" attrs="145">\r
+ <size>477</size>\r
+ </method>\r
+ <method name="Int32 TestReferenceType()" attrs="145">\r
+ <size>229</size>\r
+ </method>\r
+ <method name="Int32 TestGeneric[T](T)" attrs="145">\r
+ <size>118</size>\r
+ </method>\r
+ <method name="Int32 TestNullable()" attrs="145">\r
+ <size>386</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>120</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-02.cs">\r
+ <type name="CI">\r
+ <method name="Int32 get_Prop()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Prop(Int32)" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Byte] get_PropNullable()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_PropNullable(System.Nullable`1[System.Byte])" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Void add_ev1(System.Action)" attrs="2182">\r
+ <size>42</size>\r
+ </method>\r
+ <method name="Void remove_ev1(System.Action)" attrs="2182">\r
+ <size>42</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>64</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ <method name="Int32 TestProperty()" attrs="145">\r
+ <size>359</size>\r
+ </method>\r
+ <method name="Int32 TestField()" attrs="145">\r
+ <size>351</size>\r
+ </method>\r
+ </type>\r
+ <type name="CI">\r
+ <method name="System.Object get_PropReference()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_PropReference(System.Object)" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-03.cs">\r
+ <type name="C">\r
+ <method name="Int32 Test1()" attrs="129">\r
+ <size>82</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>62</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-04.cs">\r
+ <type name="D">\r
+ <method name="Void Foo()" attrs="129">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void Main()" attrs="150">\r
+ <size>26</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-05.cs">\r
+ <type name="CI">\r
+ <method name="Void set_Item(System.String, System.String)" attrs="2182">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="System.String get_Item(System.String)" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Item(Int32, System.Nullable`1[System.Int32])" attrs="2182">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Int32] get_Item(Int32)" attrs="2182">\r
+ <size>15</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="Int32 TestArrayAccess()" attrs="145">\r
+ <size>206</size>\r
+ </method>\r
+ <method name="Int32 TestIndexerAccess()" attrs="145">\r
+ <size>188</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>64</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-06.cs">\r
+ <type name="C">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>459</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-07.cs">\r
+ <type name="C">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>93</size>\r
+ </method>\r
+ <method name="System.String EM(System.Object)" attrs="145">\r
+ <size>26</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-08.cs">\r
+ <type name="Program">\r
+ <method name="Void M[T](T)" attrs="145">\r
+ <size>88</size>\r
+ </method>\r
+ <method name="Void M2[T](T[])" attrs="145">\r
+ <size>64</size>\r
+ </method>\r
+ <method name="Void M2_2[T](T[])" attrs="145">\r
+ <size>114</size>\r
+ </method>\r
+ <method name="Void M3[T](System.Nullable`1[T])" attrs="145">\r
+ <size>106</size>\r
+ </method>\r
+ <method name="Void Main()" attrs="145">\r
+ <size>165</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="S">\r
+ <method name="Void Foo(Boolean)" attrs="486">\r
+ <size>38</size>\r
+ </method>\r
+ </type>\r
+ <type name="Program">\r
+ <method name="Void TestAddress_1[T](T)" attrs="145">\r
+ <size>56</size>\r
+ </method>\r
+ <method name="Void TestAddress_2[T](T[])" attrs="145">\r
+ <size>82</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-null-operator-09.cs">\r
+ <type name="D">\r
+ <method name="Int32 Invoke(Int32)" attrs="454">\r
+ <size>0</size>\r
+ </method>\r
+ <method name="System.IAsyncResult BeginInvoke(Int32, System.AsyncCallback, System.Object)" attrs="454">\r
+ <size>0</size>\r
+ </method>\r
+ <method name="Int32 EndInvoke(System.IAsyncResult)" attrs="454">\r
+ <size>0</size>\r
+ </method>\r
+ <method name="Void .ctor(Object, IntPtr)" attrs="6278">\r
+ <size>0</size>\r
+ </method>\r
+ </type>\r
+ <type name="X">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>88</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>42</size>\r
+ </method>\r
+ <method name="Int32 <d>m__0(Int32)" attrs="145">\r
+ <size>10</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-partial-01.cs">\r
<type name="Foo.Hello">\r
<method name="Void .ctor()" attrs="6278">\r
</method>\r
</type>\r
<type name="Mono.Sms.Main">\r
- <method name="Void <Test>m__0(System.Object)" attrs="145">\r
+ <method name="Void <Test>m__0()" attrs="145">\r
<size>7</size>\r
</method>\r
</type>\r
</method>\r
</type>\r
</test>\r
+ <test name="test-partial-33.cs">\r
+ <type name="X">\r
+ <method name="Void Main()" attrs="145">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-pattern-01.cs">\r
+ <type name="TypePattern">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>227</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-pattern-02.cs">\r
+ <type name="ConstantPattern">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>609</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="<PatternMatchingHelper>">\r
+ <method name="Boolean NumberMatcher(System.Object, System.Object, Boolean)" attrs="150">\r
+ <size>69</size>\r
+ </method>\r
+ </type>\r
+ <type name="ConstantPattern">\r
+ <method name="Boolean Generic[T](T)" attrs="145">\r
+ <size>28</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-pattern-03.cs">\r
+ <type name="WildcardPattern">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>33</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-pattern-04.cs">\r
+ <type name="RecursivePattern">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>750</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C1">\r
+ <method name="Boolean op_Is(C1, Int32 ByRef)" attrs="2198">\r
+ <size>13</size>\r
+ </method>\r
+ <method name="Boolean op_Is(C1, C1 ByRef, C1 ByRef)" attrs="2198">\r
+ <size>16</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="S">\r
+ <method name="Boolean op_Is(S, System.Nullable`1[System.Int32] ByRef, System.Decimal ByRef)" attrs="2198">\r
+ <size>34</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-pattern-05.cs">\r
+ <type name="RecursiveNamedPattern">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>204</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="Boolean op_Is(C, Int64 ByRef, System.String ByRef)" attrs="2198">\r
+ <size>22</size>\r
+ </method>\r
+ <method name="Boolean op_Is(C)" attrs="2198">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-pattern-06.cs">\r
+ <type name="RecursiveNamedPattern">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>182</size>\r
+ </method>\r
+ <method name="Int32 Switch_1(System.Object)" attrs="145">\r
+ <size>149</size>\r
+ </method>\r
+ <method name="Int32 Switch_2(C1)" attrs="145">\r
+ <size>28</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C1">\r
+ <method name="Boolean op_Is(C1, Int32 ByRef)" attrs="2198">\r
+ <size>13</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="<PatternMatchingHelper>">\r
+ <method name="Boolean NumberMatcher(System.Object, System.Object, Boolean)" attrs="150">\r
+ <size>69</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="test-pattern-07.cs">\r
+ <type name="PropertyPattern">\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>684</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="X">\r
+ <method name="System.Object get_Field()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Field(System.Object)" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="Y">\r
+ <method name="Char get_Prop()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Prop(Char)" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Boolean op_Is(Y, Int32 ByRef)" attrs="2198">\r
+ <size>13</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="X">\r
+ <method name="System.Object get_Value()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Value(System.Object)" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ </type>\r
+ <type name="<PatternMatchingHelper>">\r
+ <method name="Boolean NumberMatcher(System.Object, System.Object, Boolean)" attrs="150">\r
+ <size>69</size>\r
+ </method>\r
+ </type>\r
+ <type name="X">\r
+ <method name="System.Nullable`1[System.Int64] get_NullableValue()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_NullableValue(System.Nullable`1[System.Int64])" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-primary-ctor-01.cs">\r
<type name="Simple">\r
<method name="Int32 get_Property()" attrs="2177">\r
</type>\r
<type name="X">\r
<method name="Int32 Main()" attrs="150">\r
- <size>69</size>\r
+ <size>180</size>\r
</method>\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
</type>\r
+ <type name="S2">\r
+ <method name="Void .ctor(Int32)" attrs="6278">\r
+ <size>8</size>\r
+ </method>\r
+ </type>\r
+ <type name="S3">\r
+ <method name="Void .ctor(Int32, String)" attrs="6278">\r
+ <size>9</size>\r
+ </method>\r
+ <method name="Void .ctor(String)" attrs="6278">\r
+ <size>8</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-primary-ctor-08.cs">\r
<type name="S">\r
<method name="Void .ctor()" attrs="6278">\r
<size>7</size>\r
</method>\r
- <method name="Boolean <Main>m__0(System.Object, Int32)" attrs="145">\r
+ <method name="Boolean <Main>m__0(Int32)" attrs="145">\r
<size>14</size>\r
</method>\r
</type>\r
<PropertyGroup>\r
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
+ <ProductVersion>8.0.30703</ProductVersion>\r
<SchemaVersion>2.0</SchemaVersion>\r
<ProjectGuid>{0831DD4E-B428-4D6C-90B1-2206DBD4F92E}</ProjectGuid>\r
<OutputType>Exe</OutputType>\r
<WarningLevel>4</WarningLevel>\r
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <Externalconsole>true</Externalconsole>\r
</PropertyGroup>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
<DebugType>pdbonly</DebugType>\r
-rm -Rf Test/en.actual Test/html.actual
-rm -f monodocer1.exe*
+Test/DocTest-DropNS-classic-secondary.dll:
+ @echo $(value @)
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic-secondary.cs
+
+Test/DocTest-DropNS-classic.dll:
+ @echo $(value @)
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-classic.cs
+
+Test/DocTest-DropNS-unified.dll:
+ $(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest-DropNS-unified.cs
+
Test/DocTest.dll:
$(CSCOMPILE) $(TEST_CSCFLAGS) -debug -unsafe -target:library -out:$@ Test/DocTest.cs
-rm -f Test/DocTest.dll
$(MAKE) TEST_CSCFLAGS=$(TEST_CSCFLAGS) Test/DocTest.dll
+check-monodocer-dropns-classic: $(PROGRAM)
+ # tests the simplest --dropns case, a single class where the root namespace was dropped.
+ -rm -Rf Test/en.actual
+ $(MAKE) Test/DocTest-DropNS-classic.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll
+ $(MAKE) update-monodocer-dropns-unified
+ diff --exclude=.svn -rup Test/en.expected-dropns-classic-v1 Test/en.actual
+
+check-monodocer-dropns-classic-withsecondary: $(PROGRAM)
+ # tests case where a secondary assembly is included with a --dropns parameter
+ -rm -Rf Test/en.actual
+ $(MAKE) Test/DocTest-DropNS-classic.dll
+ $(MAKE) Test/DocTest-DropNS-classic-secondary.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic.dll Test/DocTest-DropNS-classic-secondary.dll
+ $(MAKE) update-monodocer-dropns-unified-withsecondary
+ diff --exclude=.svn -rup Test/en.expected-dropns-classic-withsecondary Test/en.actual
+
+update-monodocer-dropns-unified: $(PROGRAM)
+ $(MAKE) Test/DocTest-DropNS-unified.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
+
+update-monodocer-dropns-unified-withsecondary: $(PROGRAM)
+ $(MAKE) Test/DocTest-DropNS-unified.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-unified.dll Test/DocTest-DropNS-classic-secondary.dll --dropns Test/DocTest-DropNS-unified.dll=MyFramework
+
+update-monodocer-dropns-classic-secondary: $(PROGRAM)
+ $(MAKE) Test/DocTest-DropNS-classic-secondary.dll
+ $(MONO) $(PROGRAM) update --exceptions=all -o Test/en.actual Test/DocTest-DropNS-classic-secondary.dll
+
+
check-monodocer-update: $(PROGRAM)
find Test/en.expected -name \*.xml -exec rm "{}" \;
$(MAKE) Test/DocTest.dll-v1
check-monodocer-importecmadoc-update \
check-monodocer-importslashdoc-update \
check-monodocer-update \
+ check-monodocer-dropns-classic \
+ check-monodocer-dropns-classic-withsecondary \
check-monodocer-delete-update \
check-mdoc-export-html-update \
check-mdoc-export-msxdoc-update \
- check-mdoc-validate-update
+ check-mdoc-validate-update
+
using Monodoc;
using Monodoc.Providers;
using Mono.Options;
+using System.IO;
+using System.Xml.Linq;
+using System.Xml.XPath;
+using Monodoc.Ecma;
namespace Mono.Documentation {
-
+
public class MDocAssembler : MDocCommand {
static readonly string[] ValidFormats = {
"ecma",
"xhtml"
};
+ string droppedNamespace = null;
+
public static Option[] CreateFormatOptions (MDocCommand self, Dictionary<string, List<string>> formats)
{
string cur_format = "ecma";
public override void Run (IEnumerable<string> args)
{
+ bool replaceNTypes = false;
var formats = new Dictionary<string, List<string>> ();
string prefix = "tree";
var formatOptions = CreateFormatOptions (this, formats);
"If not specified, `tree' is the default PREFIX.",
v => prefix = v },
formatOptions [1],
+ {"dropns=","The namespace that has been dropped from this version of the assembly.", v => droppedNamespace = v },
+ {"ntypes","Replace references to native types with their original types.", v => replaceNTypes=true },
};
List<string> extra = Parse (options, args, "assemble",
"[OPTIONS]+ DIRECTORIES",
list.Add (ecma);
sort = true;
}
+ ecma.FileSource = new MDocFileSource(droppedNamespace, string.IsNullOrWhiteSpace(droppedNamespace) ? ApiStyle.Unified : ApiStyle.Classic) {
+ ReplaceNativeTypes = replaceNTypes
+ };
foreach (string dir in formats [format])
ecma.AddDirectory (dir);
break;
}
}
+ /// <summary>
+ /// A custom provider file source that lets us modify the source files before they are processed by monodoc.
+ /// </summary>
+ internal class MDocFileSource : IEcmaProviderFileSource {
+ private string droppedNamespace;
+ private bool shouldDropNamespace = false;
+ private ApiStyle styleToDrop;
+
+ public bool ReplaceNativeTypes { get; set; }
+
+ /// <param name="ns">The namespace that is being dropped.</param>
+ /// <param name="style">The style that is being dropped.</param>
+ public MDocFileSource(string ns, ApiStyle style)
+ {
+ droppedNamespace = ns;
+ shouldDropNamespace = !string.IsNullOrWhiteSpace (ns);
+ styleToDrop = style;
+ }
+
+ public XmlReader GetIndexReader(string path)
+ {
+ XDocument doc = XDocument.Load (path);
+
+ DropApiStyle (doc, path);
+ DropNSFromDocument (doc);
+
+ // now put the modified contents into a stream for the XmlReader that monodoc will use.
+ MemoryStream io = new MemoryStream ();
+ using (var writer = XmlWriter.Create (io)) {
+ doc.WriteTo (writer);
+ }
+ io.Seek (0, SeekOrigin.Begin);
+
+ return XmlReader.Create (io);
+ }
+
+ public XElement GetNamespaceElement(string path)
+ {
+ var element = XElement.Load (path);
+
+ var attributes = element.Descendants ().Concat(new XElement[] { element }).SelectMany (n => n.Attributes ());
+ var textNodes = element.Nodes ().OfType<XText> ();
+
+ DropNS (attributes, textNodes);
+
+ return element;
+ }
+
+ void DropApiStyle(XDocument doc, string path)
+ {
+ string styleString = styleToDrop.ToString ().ToLower ();
+ var items = doc
+ .Descendants ()
+ .Where (n => n.Attributes ()
+ .Any (a => a.Name.LocalName == "apistyle" && a.Value == styleString))
+ .ToArray ();
+
+ foreach (var element in items) {
+ element.Remove ();
+ }
+
+ if (styleToDrop == ApiStyle.Classic && ReplaceNativeTypes) {
+ RewriteCrefsIfNecessary (doc, path);
+ }
+ }
+
+ void RewriteCrefsIfNecessary (XDocument doc, string path)
+ {
+ // we also have to rewrite crefs
+ var sees = doc.Descendants ().Where (d => d.Name.LocalName == "see").ToArray ();
+ foreach (var see in sees) {
+ var cref = see.Attribute ("cref");
+ if (cref == null) {
+ continue;
+ }
+ EcmaUrlParser parser = new EcmaUrlParser ();
+ EcmaDesc reference;
+ if (!parser.TryParse (cref.Value, out reference)) {
+ continue;
+ }
+ if ((new EcmaDesc.Kind[] {
+ EcmaDesc.Kind.Constructor,
+ EcmaDesc.Kind.Method
+ }).Any (k => k == reference.DescKind)) {
+ string ns = reference.Namespace;
+ string type = reference.TypeName;
+ string memberName = reference.MemberName;
+ if (reference.MemberArguments != null) {
+ XDocument refDoc = FindReferenceDoc (path, doc, ns, type);
+ if (refDoc == null) {
+ continue;
+ }
+ // look in the refDoc for the memberName, and match on parameters and # of type parameters
+ var overloads = refDoc.XPathSelectElements ("//Member[@MemberName='" + memberName + "']").ToArray ();
+ // Do some initial filtering to find members that could potentially match (based on parameter and typeparam counts)
+ var members = overloads.Where (e => reference.MemberArgumentsCount == e.XPathSelectElements ("Parameters/Parameter[not(@apistyle) or @apistyle='classic']").Count () && reference.GenericMemberArgumentsCount == e.XPathSelectElements ("TypeParameters/TypeParameter[not(@apistyle) or @apistyle='classic']").Count ()).Select (m => new {
+ Node = m,
+ AllParameters = m.XPathSelectElements ("Parameters/Parameter").ToArray (),
+ Parameters = m.XPathSelectElements ("Parameters/Parameter[not(@apistyle) or @apistyle='classic']").ToArray (),
+ NewParameters = m.XPathSelectElements ("Parameters/Parameter[@apistyle='unified']").ToArray ()
+ }).ToArray ();
+ // now find the member that matches on types
+ var member = members.FirstOrDefault (m => reference.MemberArguments.All (r => m.Parameters.Any (mp => mp.Attribute ("Type").Value.Contains (r.TypeName))));
+ if (member == null || member.NewParameters.Length == 0)
+ continue;
+ foreach (var arg in reference.MemberArguments) {
+ // find the "classic" parameter
+ var oldParam = member.Parameters.First (p => p.Attribute ("Type").Value.Contains (arg.TypeName));
+ var newParam = member.NewParameters.FirstOrDefault (p => oldParam.Attribute ("Name").Value == p.Attribute ("Name").Value);
+ if (newParam != null) {
+ // this means there was a change made, and we should try to convert this cref
+ arg.TypeName = NativeTypeManager.ConvertToNativeType (arg.TypeName);
+ }
+ }
+ var rewrittenReference = reference.ToEcmaCref ();
+ Console.WriteLine ("From {0} to {1}", cref.Value, rewrittenReference);
+ cref.Value = rewrittenReference;
+ }
+ }
+ }
+ }
+
+ XDocument FindReferenceDoc (string currentPath, XDocument currentDoc, string ns, string type)
+ {
+ if (currentPath.Length <= 1) {
+ return null;
+ }
+ // build up the supposed path to the doc
+ string dir = Path.GetDirectoryName (currentPath);
+ if (dir.Equals (currentPath)) {
+ return null;
+ }
+
+ string supposedPath = Path.Combine (dir, ns, type + ".xml");
+
+ // if it's the current path, return currentDoc
+ if (supposedPath == currentPath) {
+ return currentDoc;
+ }
+
+ if (!File.Exists (supposedPath)) {
+ // hmm, file not there, look one directory up
+ return FindReferenceDoc (dir, currentDoc, ns, type);
+ }
+
+ // otherwise, load the XDoc and return
+ return XDocument.Load (supposedPath);
+ }
+
+ void DropNSFromDocument (XDocument doc)
+ {
+ var attributes = doc.Descendants ().SelectMany (n => n.Attributes ());
+ var textNodes = doc.DescendantNodes().OfType<XText> ().ToArray();
+
+ DropNS (attributes, textNodes);
+ }
+
+ void DropNS(IEnumerable<XAttribute> attributes, IEnumerable<XText> textNodes)
+ {
+ if (!shouldDropNamespace) {
+ return;
+ }
+
+ string nsString = string.Format ("{0}.", droppedNamespace);
+ foreach (var attr in attributes) {
+ if (attr.Value.Contains (nsString)) {
+ attr.Value = attr.Value.Replace (nsString, string.Empty);
+ }
+ }
+
+ foreach (var textNode in textNodes) {
+ if (textNode.Value.Contains (nsString)) {
+ textNode.Value = textNode.Value.Replace (nsString, string.Empty);
+ }
+ }
+ }
+
+
+ /// <param name="nsName">This is the type's name in the processed XML content.
+ /// If dropping the namespace, we'll need to append it so that it's found in the source.</param>
+ /// <param name="typeName">Type name.</param>
+ public string GetTypeXmlPath(string basePath, string nsName, string typeName)
+ {
+ string nsNameToUse = nsName;
+ if (shouldDropNamespace) {
+ nsNameToUse = string.Format ("{0}.{1}", droppedNamespace, nsName);
+
+ var droppedPath = BuildTypeXmlPath (basePath, typeName, nsNameToUse);
+ var origPath = BuildTypeXmlPath (basePath, typeName, nsName);
+
+ if (!File.Exists (droppedPath)) {
+ if (File.Exists (origPath)) {
+ return origPath;
+ }
+ }
+
+ return droppedPath;
+ } else {
+
+ var finalPath = BuildTypeXmlPath (basePath, typeName, nsNameToUse);
+
+ return finalPath;
+ }
+ }
+
+ static string BuildTypeXmlPath (string basePath, string typeName, string nsNameToUse)
+ {
+ string finalPath = Path.Combine (basePath, nsNameToUse, Path.ChangeExtension (typeName, ".xml"));
+ return finalPath;
+ }
+
+ static string BuildNamespaceXmlPath (string basePath, string ns)
+ {
+ var nsFileName = Path.Combine (basePath, String.Format ("ns-{0}.xml", ns));
+ return nsFileName;
+ }
+
+ /// <returns>The namespace for path, with the dropped namespace so it can be used to pick the right file if we're dropping it.</returns>
+ /// <param name="ns">This namespace will already have "dropped" the namespace.</param>
+ public string GetNamespaceXmlPath(string basePath, string ns)
+ {
+ string nsNameToUse = ns;
+ if (shouldDropNamespace) {
+ nsNameToUse = string.Format ("{0}.{1}", droppedNamespace, ns);
+
+ var droppedPath = BuildNamespaceXmlPath (basePath, nsNameToUse);
+ var origPath = BuildNamespaceXmlPath (basePath, ns);
+
+ if (!File.Exists (droppedPath) && File.Exists(origPath)) {
+ return origPath;
+ }
+
+ return droppedPath;
+ } else {
+ var path = BuildNamespaceXmlPath (basePath, ns);
+ return path;
+ }
+ }
+
+ public XDocument GetTypeDocument(string path)
+ {
+ var doc = XDocument.Load (path);
+ DropApiStyle (doc, path);
+ DropNSFromDocument (doc);
+
+ return doc;
+ }
+
+ public XElement ExtractNamespaceSummary (string path)
+ {
+ using (var reader = GetIndexReader (path)) {
+ reader.ReadToFollowing ("Namespace");
+ var name = reader.GetAttribute ("Name");
+ var summary = reader.ReadToFollowing ("summary") ? XElement.Load (reader.ReadSubtree ()) : new XElement ("summary");
+ var remarks = reader.ReadToFollowing ("remarks") ? XElement.Load (reader.ReadSubtree ()) : new XElement ("remarks");
+
+ return new XElement ("namespace",
+ new XAttribute ("ns", name ?? string.Empty),
+ summary,
+ remarks);
+ }
+ }
+ }
}
{ "update-ecma-xml", new MDocUpdateEcmaXml () },
{ "validate", new MDocValidator () },
{ "index", new MDocIndex () },
+ { "preserve", new MDocPreserve () }
};
bool showVersion = false;
using StringToXmlNodeMap = System.Collections.Generic.Dictionary<string, System.Xml.XmlNode>;
namespace Mono.Documentation {
+ static class NativeTypeManager {
+
+ static Dictionary<string, string> toNativeType = new Dictionary<string,string>(){
+
+ {"int", "nint"},
+ {"Int32", "nint"},
+ {"System.Int32", "System.nint"},
+ {"uint", "nuint"},
+ {"UInt32", "nuint"},
+ {"System.UInt32", "System.nuint"},
+ {"float", "nfloat"},
+ {"Single", "nfloat"},
+ {"System.Single", "System.nfloat"},
+ {"SizeF", "CoreGraphics.CGSize"},
+ {"System.Drawing.SizeF", "CoreGraphics.CGSize"},
+ {"PointF", "CoreGraphics.CGPoint"},
+ {"System.Drawing.PointF", "CoreGraphics.CGPoint"},
+ {"RectangleF", "CoreGraphics.CGRect" },
+ {"System.Drawing.RectangleF", "CoreGraphics.CGRect"}
+ };
+
+ static Dictionary<string, string> fromNativeType = new Dictionary<string,string>(){
+
+ {"nint", "int"},
+ {"System.nint", "System.Int32"},
+ {"nuint", "uint"},
+ {"System.nuint", "System.UInt32"},
+ {"nfloat", "float"},
+ {"System.nfloat", "System.Single"},
+ {"CoreGraphics.CGSize", "System.Drawing.SizeF"},
+ {"CoreGraphics.CGPoint", "System.Drawing.PointF"},
+ {"CoreGraphics.CGRect", "System.Drawing.RectangleF"},
+ {"MonoTouch.CoreGraphics.CGSize", "System.Drawing.SizeF"},
+ {"MonoTouch.CoreGraphics.CGPoint", "System.Drawing.PointF"},
+ {"MonoTouch.CoreGraphics.CGRect", "System.Drawing.RectangleF"}
+ };
+
+ public static string ConvertToNativeType(string typename) {
+ string nvalue;
+
+ bool isOut=false;
+ bool isArray=false;
+ string valueToCompare = StripToComparableType (typename, ref isOut, ref isArray);
+
+ if (toNativeType.TryGetValue (valueToCompare, out nvalue)) {
+
+ if (isArray) {
+ nvalue += "[]";
+ }
+ if (isOut) {
+ nvalue += "&";
+ }
+ return nvalue;
+ }
+ return typename;
+ }
+ public static string ConvertFromNativeType(string typename) {
+ string nvalue;
+
+ bool isOut=false;
+ bool isArray=false;
+ string valueToCompare = StripToComparableType (typename, ref isOut, ref isArray);
+
+ if (fromNativeType.TryGetValue (valueToCompare, out nvalue)) {
+ if (isArray) {
+ nvalue += "[]";
+ }
+ if (isOut) {
+ nvalue += "&";
+ }
+ return nvalue;
+ }
+ // it wasn't one of the native types ... just return it
+ return typename;
+ }
+ static string StripToComparableType (string typename, ref bool isOut, ref bool isArray)
+ {
+ string valueToCompare = typename;
+ if (typename.EndsWith ("[]")) {
+ valueToCompare = typename.Substring (0, typename.Length - 2);
+ isArray = true;
+ }
+ if (typename.EndsWith ("&")) {
+ valueToCompare = typename.Substring (0, typename.Length - 1);
+ isOut = true;
+ }
+ if (typename.Contains ("<")) {
+ // TODO: Need to recursively process generic parameters
+ }
+ return valueToCompare;
+ }
+
+ public static string GetTranslatedName(TypeReference t) {
+ string typename = t.FullName;
+
+ bool isInAssembly = MDocUpdater.IsInAssemblies (t.Module.Name);
+ if (isInAssembly && !typename.StartsWith ("System") && MDocUpdater.HasDroppedNamespace (t)) {
+ string nameWithDropped = string.Format ("{0}.{1}", MDocUpdater.droppedNamespace, typename);
+ return nameWithDropped;
+ }
+ return typename;
+ }
+ }
class MDocUpdater : MDocCommand
{
string srcPath;
HashSet<string> forwardedTypes = new HashSet<string> ();
+ public static string droppedNamespace = string.Empty;
+
+ public static bool HasDroppedNamespace(TypeDefinition forType)
+ {
+ return HasDroppedNamespace(forType.Module);
+ }
+
+ public static bool HasDroppedNamespace(MemberReference forMember)
+ {
+ return HasDroppedNamespace(forMember.Module);
+ }
+
+ public static bool HasDroppedNamespace(AssemblyDefinition forAssembly)
+ {
+ return HasDroppedNamespace(forAssembly.MainModule);
+ }
+
+ public static bool HasDroppedNamespace(ModuleDefinition forModule)
+ {
+ return !string.IsNullOrWhiteSpace (droppedNamespace) && droppedAssemblies.Any(da => da == forModule.Name);
+ }
+
+
+ static List<string> droppedAssemblies = new List<string>();
+
+ public string PreserveTag { get; set; }
+ public static MDocUpdater Instance { get; private set; }
+ public static bool SwitchingToMagicTypes { get; private set; }
+
public override void Run (IEnumerable<string> args)
{
+ Instance = this;
show_exceptions = DebugOutput;
var types = new List<string> ();
var p = new OptionSet () {
{ "type=",
"Only update documentation for {TYPE}.",
v => types.Add (v) },
+ { "dropns=",
+ "When processing assembly {ASSEMBLY}, strip off leading namespace {PREFIX}:\n" +
+ " e.g. --dropns ASSEMBLY=PREFIX",
+ v => {
+ var parts = v.Split ('=');
+ if (parts.Length != 2) { Console.Error.WriteLine ("Invalid dropns input"); return; }
+ var assembly = Path.GetFileName (parts [0].Trim ());
+ var prefix = parts [1].Trim();
+ droppedAssemblies.Add (assembly);
+ droppedNamespace = prefix;
+ } },
+ { "ntypes",
+ "If the new assembly is switching to 'magic types', then this switch should be defined.",
+ v => SwitchingToMagicTypes = true },
+ { "preserve",
+ "Do not delete members that don't exist in the assembly, but rather mark them as preserved.",
+ v => PreserveTag = "true" },
};
var assemblies = Parse (p, args, "update",
"[OPTIONS]+ ASSEMBLIES",
Console.WriteLine("Members Added: {0}, Members Deleted: {1}", additions, deletions);
}
-
+ public static bool IsInAssemblies(string name) {
+ var query = Instance.assemblies.Where (a => a.MainModule.Name == name).ToArray ();
+ return query.Length > 0;
+ }
void AddImporter (string path)
{
try {
return new IndexForTypes (this, indexFile, CreateIndexStub ());
}
+ /// <summary>Constructs the presumed path to the type's documentation file</summary>
+ /// <returns><c>true</c>, if the type file was found, <c>false</c> otherwise.</returns>
+ /// <param name="result">A typle that contains 1) the 'reltypefile', 2) the 'typefile', and 3) the file info</param>
+ bool TryFindTypeFile(string nsname, string typename, string basepath, out Tuple<string, string, FileInfo> result) {
+ string reltypefile = DocUtils.PathCombine (nsname, typename + ".xml");
+ string typefile = Path.Combine (basepath, reltypefile);
+ System.IO.FileInfo file = new System.IO.FileInfo(typefile);
+
+ result = new Tuple<string, string, FileInfo> (reltypefile, typefile, file);
+
+ return file.Exists;
+ }
+
public string DoUpdateType (TypeDefinition type, string basepath, string dest)
{
if (type.Namespace == null)
// Must get the A+B form of the type name.
string typename = GetTypeFileName(type);
-
- string reltypefile = DocUtils.PathCombine (DocUtils.GetNamespace (type), typename + ".xml");
- string typefile = Path.Combine (basepath, reltypefile);
- System.IO.FileInfo file = new System.IO.FileInfo(typefile);
+ string nsname = DocUtils.GetNamespace (type);
+
+ // Find the file, if it exists
+ string[] searchLocations = new string[] {
+ nsname
+ };
+
+ if (MDocUpdater.HasDroppedNamespace (type)) {
+ // If dropping namespace, types may have moved into a couple of different places.
+ var newSearchLocations = searchLocations.Union (new string[] {
+ string.Format ("{0}.{1}", droppedNamespace, nsname),
+ nsname.Replace (droppedNamespace + ".", string.Empty),
+ MDocUpdater.droppedNamespace
+ });
+
+ searchLocations = newSearchLocations.ToArray ();
+ }
+
+ string reltypefile="", typefile="";
+ System.IO.FileInfo file = null;
+
+ foreach (var f in searchLocations) {
+ Tuple<string, string, FileInfo> result;
+ bool fileExists = TryFindTypeFile (f, typename, basepath, out result);
+
+ if (fileExists) {
+ reltypefile = result.Item1;
+ typefile = result.Item2;
+ file = result.Item3;
+
+ break;
+ }
+ }
+
+ if (file == null || !file.Exists) {
+ // we were not able to find a file, let's use the original type informatio.
+ // so that we create the stub in the right place.
+ Tuple<string, string, FileInfo> result;
+ TryFindTypeFile (nsname, typename, basepath, out result);
+ reltypefile = result.Item1;
+ typefile = result.Item2;
+ file = result.Item3;
+ }
+
string output = null;
if (dest == null) {
output = typefile;
output = Path.Combine (dest, reltypefile);
}
- if (file.Exists) {
+ if (file != null && file.Exists) {
// Update
XmlDocument basefile = new XmlDocument();
try {
GetTypeFileName (basefile.SelectSingleNode("Type/@FullName").InnerText);
TypeDefinition type = assembly.GetType(typename);
if (type == null) {
- Warning ("Type no longer in assembly: " + typename);
- continue;
+ // --
+ if (!string.IsNullOrWhiteSpace (droppedNamespace)) {
+ string nameWithNs = string.Format ("{0}.{1}", droppedNamespace, typename);
+ type = assembly.GetType (nameWithNs);
+ if (type == null) {
+ Warning ("Type no longer in assembly: " + typename);
+ continue;
+ }
+ }
+ //--
}
seenTypes[type] = seenTypes;
// Add namespace and type nodes into the index file as needed
AddIndexType (type, index_types);
-
+
// Ensure the namespace index file exists
- string onsdoc = DocUtils.PathCombine (dest, type.Namespace + ".xml");
- string nsdoc = DocUtils.PathCombine (dest, "ns-" + type.Namespace + ".xml");
+ string namespaceToUse = type.Namespace;
+ if (HasDroppedNamespace(assembly)) {
+ namespaceToUse = string.Format ("{0}.{1}", droppedNamespace, namespaceToUse);
+ }
+ string onsdoc = DocUtils.PathCombine (dest, namespaceToUse + ".xml");
+ string nsdoc = DocUtils.PathCombine (dest, "ns-" + namespaceToUse + ".xml");
if (File.Exists (onsdoc)) {
File.Move (onsdoc, nsdoc);
}
if (!File.Exists (nsdoc)) {
Console.WriteLine("New Namespace File: " + type.Namespace);
- WriteNamespaceStub(type.Namespace, dest);
+ WriteNamespaceStub(namespaceToUse, dest);
}
goodfiles.Add (reltypepath);
XmlDocument doc = new XmlDocument ();
doc.Load (typefile.FullName);
XmlElement e = doc.SelectSingleNode("/Type") as XmlElement;
- if (e != null && !no_assembly_versions && UpdateAssemblyVersions(e, GetAssemblyVersions(), false)) {
+ string assemblyName = doc.SelectSingleNode ("/Type/AssemblyInfo/AssemblyName").InnerText;
+ AssemblyDefinition assembly = assemblies.FirstOrDefault (a => a.Name.Name == assemblyName);
+ if (e != null && !no_assembly_versions && assembly != null && assemblyName != null && UpdateAssemblyVersions(e, assembly, GetAssemblyVersions(assemblyName), false)) {
using (TextWriter writer = OpenWrite (typefile.FullName, FileMode.Truncate))
WriteXml(doc.DocumentElement, writer);
goodfiles.Add (relTypeFile);
continue;
}
- string newname = typefile.FullName + ".remove";
- try { System.IO.File.Delete(newname); } catch (Exception) { }
- try { typefile.MoveTo(newname); } catch (Exception) { }
- Console.WriteLine("Class no longer present; file renamed: " + Path.Combine(nsdir.Name, typefile.Name));
+
+ if (string.IsNullOrWhiteSpace (PreserveTag)) { // only do this if there was no -preserve
+ string newname = typefile.FullName + ".remove";
+ try { System.IO.File.Delete(newname); } catch (Exception) { }
+ try { typefile.MoveTo(newname); } catch (Exception) { }
+ Console.WriteLine("Class no longer present; file renamed: " + Path.Combine(nsdir.Name, typefile.Name));
+ }
}
}
}
return w;
}
- private string[] GetAssemblyVersions ()
+ private string[] GetAssemblyVersions (string assemblyName)
{
- return (from a in assemblies select GetAssemblyVersion (a)).ToArray ();
+ return (from a in assemblies
+ where a.Name.Name == assemblyName
+ select GetAssemblyVersion (a)).ToArray ();
}
private static void CleanupIndexTypes (XmlElement index_types, HashSet<string> goodfiles)
// Update existing members. Delete member nodes that no longer should be there,
// and remember what members are already documented so we don't add them again.
- if (true) {
- MyXmlNodeList todelete = new MyXmlNodeList ();
- foreach (DocsNodeInfo info in docEnum.GetDocumentationMembers (basefile, type)) {
- XmlElement oldmember = info.Node;
- MemberReference oldmember2 = info.Member;
- string sig = oldmember2 != null ? memberFormatters [0].GetDeclaration (oldmember2) : null;
-
- // Interface implementations and overrides are deleted from the docs
- // unless the overrides option is given.
- if (oldmember2 != null && sig == null)
- oldmember2 = null;
-
- // Deleted (or signature changed)
- if (oldmember2 == null) {
- if (!no_assembly_versions && UpdateAssemblyVersions (oldmember, new string[]{ GetAssemblyVersion (type.Module.Assembly) }, false))
- continue;
- DeleteMember ("Member Removed", output, oldmember, todelete);
- continue;
- }
-
- // Duplicated
- if (seenmembers.ContainsKey (sig)) {
- if (object.ReferenceEquals (oldmember, seenmembers [sig])) {
- // ignore, already seen
- }
- else if (DefaultMemberComparer.Compare (oldmember, seenmembers [sig]) == 0)
- DeleteMember ("Duplicate Member Found", output, oldmember, todelete);
- else
- Warning ("TODO: found a duplicate member '{0}', but it's not identical to the prior member found!", sig);
+
+ MyXmlNodeList todelete = new MyXmlNodeList ();
+
+ foreach (DocsNodeInfo info in docEnum.GetDocumentationMembers (basefile, type)) {
+ XmlElement oldmember = info.Node;
+ MemberReference oldmember2 = info.Member;
+ string sig = oldmember2 != null ? memberFormatters [0].GetDeclaration (oldmember2) : null;
+
+ // Interface implementations and overrides are deleted from the docs
+ // unless the overrides option is given.
+ if (oldmember2 != null && sig == null)
+ oldmember2 = null;
+
+ // Deleted (or signature changed)
+ if (oldmember2 == null) {
+ if (!no_assembly_versions && UpdateAssemblyVersions (oldmember, type.Module.Assembly, new string[]{ GetAssemblyVersion (type.Module.Assembly) }, false))
continue;
+
+ DeleteMember ("Member Removed", output, oldmember, todelete, type);
+ continue;
+ }
+
+ // Duplicated
+ if (seenmembers.ContainsKey (sig)) {
+ if (object.ReferenceEquals (oldmember, seenmembers [sig])) {
+ // ignore, already seen
}
-
- // Update signature information
- UpdateMember(info);
-
- seenmembers.Add (sig, oldmember);
+ else if (DefaultMemberComparer.Compare (oldmember, seenmembers [sig]) == 0)
+ DeleteMember ("Duplicate Member Found", output, oldmember, todelete, type);
+ else
+ Warning ("TODO: found a duplicate member '{0}', but it's not identical to the prior member found!", sig);
+ continue;
+ }
+
+ // Update signature information
+ UpdateMember(info);
+
+ // get all apistyles of sig from info.Node
+ var styles = oldmember.GetElementsByTagName ("MemberSignature").Cast<XmlElement> ()
+ .Where (x => x.GetAttribute ("Language") == "C#" && !seenmembers.ContainsKey(x.GetAttribute("Value")))
+ .Select (x => x.GetAttribute ("Value"));
+
+ foreach (var stylesig in styles) {
+ seenmembers.Add (stylesig, oldmember);
}
- foreach (XmlElement oldmember in todelete)
- oldmember.ParentNode.RemoveChild (oldmember);
}
+ foreach (XmlElement oldmember in todelete)
+ oldmember.ParentNode.RemoveChild (oldmember);
+
if (!DocUtils.IsDelegate (type)) {
XmlNode members = WriteElement (basefile.DocumentElement, "Members");
- foreach (MemberReference m in type.GetMembers()) {
- if (m is TypeDefinition) continue;
-
- string sig = memberFormatters [0].GetDeclaration (m);
- if (sig == null) continue;
- if (seenmembers.ContainsKey(sig)) continue;
-
+ var typemembers = type.GetMembers()
+ .Where(m => {
+ if (m is TypeDefinition) return false;
+ string sig = memberFormatters [0].GetDeclaration (m);
+ if (sig == null) return false;
+ if (seenmembers.ContainsKey(sig)) return false;
+ return true;
+ })
+ .ToArray();
+ foreach (MemberReference m in typemembers) {
XmlElement mm = MakeMember(basefile, new DocsNodeInfo (null, m));
if (mm == null) continue;
+
+ if (MDocUpdater.SwitchingToMagicTypes) {
+ // this is a unified style API that obviously doesn't exist in the classic API. Let's mark
+ // it with apistyle="unified", so that it's not displayed for classic style APIs
+ mm.SetAttribute ("apistyle", "unified");
+ }
+
members.AppendChild( mm );
Console.WriteLine("Member Added: " + mm.SelectSingleNode("MemberSignature/@Value").InnerText);
return null;
}
- void DeleteMember (string reason, string output, XmlNode member, MyXmlNodeList todelete)
+ void DeleteMember (string reason, string output, XmlNode member, MyXmlNodeList todelete, TypeDefinition type)
{
string format = output != null
? "{0}: File='{1}'; Signature='{4}'"
member.OwnerDocument.DocumentElement.GetAttribute ("FullName"),
member.Attributes ["MemberName"].Value,
member.SelectSingleNode ("MemberSignature[@Language='C#']/@Value").Value);
- if (!delete && MemberDocsHaveUserContent (member)) {
- Warning ("Member deletions must be enabled with the --delete option.");
- } else {
+ if (!delete && MemberDocsHaveUserContent (member)) {
+ Warning ("Member deletions must be enabled with the --delete option.");
+ } else if (HasDroppedNamespace (type)) {
+ // if we're dropping the namespace, add the "classic style"
+ var existingAttribute = member.Attributes ["apistyle"];
+ if (existingAttribute != null) {
+ existingAttribute.Value = "classic";
+ } else {
+ // add the attribute and do not remove
+ XmlAttribute apistyleAttr = member.OwnerDocument.CreateAttribute ("apistyle");
+
+ apistyleAttr.Value = "classic";
+
+ member.Attributes.Append (apistyleAttr);
+ }
+ } else if (!HasDroppedNamespace (type) && member.Attributes ["apistyle"] != null && member.Attributes ["apistyle"].Value == "unified") {
+ // do nothing if there's an apistyle=new attribute and we haven't dropped the namespace
+ } else if (!string.IsNullOrWhiteSpace (PreserveTag)) {
+ // do nothing
+ } else {
todelete.Add (member);
deletions++;
}
foreach (MemberFormatter f in typeFormatters) {
string element = "TypeSignature[@Language='" + f.Language + "']";
- WriteElementAttribute (root, element, "Language", f.Language);
- WriteElementAttribute (root, element, "Value", f.GetDeclaration (type));
+ string valueToUse = f.GetDeclaration (type);
+
+ AddXmlNode (
+ root.SelectNodes (element).Cast<XmlElement> ().ToArray (),
+ x => x.GetAttribute ("Value") == valueToUse,
+ x => x.SetAttribute ("Value", valueToUse),
+ () => {
+ var node = WriteElementAttribute (root, element, "Language", f.Language, forceNewElement: true);
+ var newnode = WriteElementAttribute (root, node, "Value", valueToUse);
+ return newnode;
+ },
+ type);
}
- XmlElement ass = WriteElement(root, "AssemblyInfo");
- WriteElementText(ass, "AssemblyName", type.Module.Assembly.Name.Name);
- if (!no_assembly_versions) {
- UpdateAssemblyVersions (root, type, true);
- }
- else {
- var versions = ass.SelectNodes ("AssemblyVersion").Cast<XmlNode> ().ToList ();
- foreach (var version in versions)
- ass.RemoveChild (version);
+ string assemblyInfoNodeFilter = MDocUpdater.HasDroppedNamespace (type) ? "[@apistyle='unified']" : "[not(@apistyle) or @apistyle='classic']";
+
+ AddXmlNode(
+ root.SelectNodes ("AssemblyInfo" + assemblyInfoNodeFilter).Cast<XmlElement> ().ToArray (),
+ x => x.SelectSingleNode("AssemblyName").InnerText == type.Module.Assembly.Name.Name,
+ x => WriteElementText(x, "AssemblyName", type.Module.Assembly.Name.Name),
+ () => {
+ XmlElement ass = WriteElement(root, "AssemblyInfo", forceNewElement:true);
+
+ if (MDocUpdater.HasDroppedNamespace (type)) ass.SetAttribute ("apistyle", "unified");
+
+
+
+ return ass;
+ },
+ type);
+
+ foreach(var ass in root.SelectNodes ("AssemblyInfo" + assemblyInfoNodeFilter).Cast<XmlElement> ())
+ {
+ WriteElementText(ass, "AssemblyName", type.Module.Assembly.Name.Name);
+ if (!no_assembly_versions) {
+ UpdateAssemblyVersions (root, type, true);
+ }
+ else {
+ var versions = ass.SelectNodes ("AssemblyVersion").Cast<XmlNode> ().ToList ();
+ foreach (var version in versions)
+ ass.RemoveChild (version);
+ }
+ if (!string.IsNullOrEmpty (type.Module.Assembly.Name.Culture))
+ WriteElementText(ass, "AssemblyCulture", type.Module.Assembly.Name.Culture);
+ else
+ ClearElement(ass, "AssemblyCulture");
+
+
+ // Why-oh-why do we put assembly attributes in each type file?
+ // Neither monodoc nor monodocs2html use them, so I'm deleting them
+ // since they're outdated in current docs, and a waste of space.
+ //MakeAttributes(ass, type.Assembly, true);
+ XmlNode assattrs = ass.SelectSingleNode("Attributes");
+ if (assattrs != null)
+ ass.RemoveChild(assattrs);
+
+ NormalizeWhitespace(ass);
}
- if (!string.IsNullOrEmpty (type.Module.Assembly.Name.Culture))
- WriteElementText(ass, "AssemblyCulture", type.Module.Assembly.Name.Culture);
- else
- ClearElement(ass, "AssemblyCulture");
-
- // Why-oh-why do we put assembly attributes in each type file?
- // Neither monodoc nor monodocs2html use them, so I'm deleting them
- // since they're outdated in current docs, and a waste of space.
- //MakeAttributes(ass, type.Assembly, true);
- XmlNode assattrs = ass.SelectSingleNode("Attributes");
- if (assattrs != null)
- ass.RemoveChild(assattrs);
-
- NormalizeWhitespace(ass);
if (type.IsGenericType ()) {
- MakeTypeParameters (root, type.GenericParameters);
+ MakeTypeParameters (root, type.GenericParameters, type, MDocUpdater.HasDroppedNamespace(type));
} else {
ClearElement(root, "TypeParameters");
}
ClearElement(root, "Interfaces");
}
- MakeAttributes (root, GetCustomAttributes (type));
+ MakeAttributes (root, GetCustomAttributes (type), type);
if (DocUtils.IsDelegate (type)) {
- MakeTypeParameters (root, type.GenericParameters);
- MakeParameters(root, type.GetMethod("Invoke").Parameters);
- MakeReturnValue(root, type.GetMethod("Invoke"));
+ MakeTypeParameters (root, type.GenericParameters, type, MDocUpdater.HasDroppedNamespace(type));
+ var member = type.GetMethod ("Invoke");
+ MakeParameters(root, member, member.Parameters);
+ MakeReturnValue(root, member);
}
DocsNodeInfo typeInfo = new DocsNodeInfo (WriteElement(root, "Docs"), type);
foreach (MemberFormatter f in memberFormatters) {
string element = "MemberSignature[@Language='" + f.Language + "']";
- WriteElementAttribute (me, element, "Language", f.Language);
- WriteElementAttribute (me, element, "Value", f.GetDeclaration (mi));
+
+ var valueToUse = f.GetDeclaration (mi);
+
+ AddXmlNode (
+ me.SelectNodes (element).Cast<XmlElement> ().ToArray(),
+ x => x.GetAttribute("Value") == valueToUse,
+ x => x.SetAttribute ("Value", valueToUse),
+ () => {
+ var node = WriteElementAttribute (me, element, "Language", f.Language, forceNewElement:true);
+ var newNode = WriteElementAttribute (me, node, "Value", valueToUse);
+ return newNode;
+ },
+ mi);
+
}
WriteElementText(me, "MemberType", GetMemberType(mi));
-
+
if (!no_assembly_versions) {
UpdateAssemblyVersions (me, mi, true);
}
ClearElement (me, "AssemblyInfo");
}
- MakeAttributes (me, GetCustomAttributes (mi));
+ MakeAttributes (me, GetCustomAttributes (mi), mi.DeclaringType);
- MakeReturnValue(me, mi);
+ MakeReturnValue(me, mi, MDocUpdater.HasDroppedNamespace(mi));
if (mi is MethodReference) {
MethodReference mb = (MethodReference) mi;
if (mb.IsGenericMethod ())
- MakeTypeParameters (me, mb.GenericParameters);
+ MakeTypeParameters (me, mb.GenericParameters, mi, MDocUpdater.HasDroppedNamespace(mi));
}
- MakeParameters(me, mi);
+ MakeParameters(me, mi, MDocUpdater.HasDroppedNamespace(mi));
string fieldValue;
if (mi is FieldDefinition && GetFieldConstValue ((FieldDefinition)mi, out fieldValue))
UpdateExtensionMethods (me, info);
}
+ static void AddXmlNode (XmlElement[] relevant, Func<XmlElement, bool> valueMatches, Action<XmlElement> setValue, Func<XmlElement> makeNewNode, MemberReference member) {
+ AddXmlNode (relevant, valueMatches, setValue, makeNewNode, member.Module);
+ }
+
+ static void AddXmlNode (XmlElement[] relevant, Func<XmlElement, bool> valueMatches, Action<XmlElement> setValue, Func<XmlElement> makeNewNode, TypeDefinition type) {
+ AddXmlNode (relevant, valueMatches, setValue, makeNewNode, type.Module);
+ }
+
+ /// <summary>Adds an xml node, reusing the node if it's available</summary>
+ /// <param name="relevant">The existing set of nodes</param>
+ /// <param name="valueMatches">Checks to see if the node's value matches what you're trying to write.</param>
+ /// <param name="setValue">Sets the node's value</param>
+ /// <param name="makeNewNode">Creates a new node, if valueMatches returns false.</param>
+ static void AddXmlNode (XmlElement[] relevant, Func<XmlElement, bool> valueMatches, Action<XmlElement> setValue, Func<XmlElement> makeNewNode, ModuleDefinition module)
+ {
+ bool shouldDuplicate = MDocUpdater.HasDroppedNamespace (module);
+ var styleToUse = shouldDuplicate ? ApiStyle.Unified : ApiStyle.Classic;
+ var existing = relevant;
+ bool done = false;
+ bool addedOldApiStyle = false;
+
+ if (shouldDuplicate) {
+ existing = existing.Where (n => n.HasApiStyle (styleToUse)).ToArray ();
+ foreach (var n in relevant.Where (n => n.DoesNotHaveApiStyle (styleToUse))) {
+ if (valueMatches (n)) {
+ done = true;
+ }
+ else {
+ n.AddApiStyle (ApiStyle.Classic);
+ addedOldApiStyle = true;
+ }
+ }
+ }
+ if (!done) {
+ if (!existing.Any ()) {
+ var newNode = makeNewNode ();
+ if (shouldDuplicate && addedOldApiStyle) {
+ newNode.AddApiStyle (ApiStyle.Unified);
+ }
+ }
+ else {
+ var itemToReuse = existing.First ();
+ setValue (itemToReuse);
+
+ if (shouldDuplicate && addedOldApiStyle) {
+ itemToReuse.AddApiStyle (styleToUse);
+ }
+ }
+ }
+ }
+
static readonly string[] MemberNodeOrder = {
"MemberSignature",
"MemberType",
// XML HELPER FUNCTIONS
- internal static XmlElement WriteElement(XmlNode parent, string element) {
+ internal static XmlElement WriteElement(XmlNode parent, string element, bool forceNewElement = false) {
XmlElement ret = (XmlElement)parent.SelectSingleNode(element);
- if (ret == null) {
+ if (ret == null || forceNewElement) {
string[] path = element.Split('/');
foreach (string p in path) {
ret = (XmlElement)parent.SelectSingleNode(p);
- if (ret == null) {
+ if (ret == null || forceNewElement) {
string ename = p;
if (ename.IndexOf('[') >= 0) // strip off XPath predicate
ename = ename.Substring(0, ename.IndexOf('['));
}
return ret;
}
- private static void WriteElementText(XmlNode parent, string element, string value) {
- XmlElement node = WriteElement(parent, element);
+ private static XmlElement WriteElementText(XmlNode parent, string element, string value, bool forceNewElement = false) {
+ XmlElement node = WriteElement(parent, element, forceNewElement: forceNewElement);
node.InnerText = value;
+ return node;
}
static XmlElement AppendElementText (XmlNode parent, string element, string value)
node = WriteElement(parent, element);
node.InnerText = value;
}
- private static void WriteElementAttribute(XmlElement parent, string element, string attribute, string value) {
- XmlElement node = WriteElement(parent, element);
- if (node.GetAttribute(attribute) == value) return;
- node.SetAttribute(attribute, value);
+ private static XmlElement WriteElementAttribute(XmlElement parent, string element, string attribute, string value, bool forceNewElement = false) {
+ XmlElement node = WriteElement(parent, element, forceNewElement:forceNewElement);
+ return WriteElementAttribute (parent, node, attribute, value);
+ }
+ private static XmlElement WriteElementAttribute(XmlElement parent, XmlElement node, string attribute, string value) {
+ if (node.GetAttribute (attribute) != value) {
+ node.SetAttribute (attribute, value);
+ }
+ return node;
}
internal static void ClearElement(XmlElement parent, string name) {
XmlElement node = (XmlElement)parent.SelectSingleNode(name);
TypeDefinition type = member as TypeDefinition;
if (type == null)
type = member.DeclaringType as TypeDefinition;
- return UpdateAssemblyVersions(root, new string[]{ GetAssemblyVersion (type.Module.Assembly) }, add);
+ return UpdateAssemblyVersions(root, type.Module.Assembly, new string[]{ GetAssemblyVersion (type.Module.Assembly) }, add);
}
private static string GetAssemblyVersion (AssemblyDefinition assembly)
return assembly.Name.Version.ToString();
}
- private static bool UpdateAssemblyVersions(XmlElement root, string[] assemblyVersions, bool add)
+ private static bool UpdateAssemblyVersions(XmlElement root, AssemblyDefinition assembly, string[] assemblyVersions, bool add)
{
XmlElement av = (XmlElement) root.SelectSingleNode ("AssemblyVersions");
if (av != null) {
root.RemoveChild (av);
}
- XmlElement e = (XmlElement) root.SelectSingleNode ("AssemblyInfo");
+ string oldNodeFilter = "AssemblyInfo[not(@apistyle) or @apistyle='classic']";
+ string newNodeFilter = "AssemblyInfo[@apistyle='unified']";
+ string thisNodeFilter = MDocUpdater.HasDroppedNamespace (assembly) ? newNodeFilter : oldNodeFilter;
+ string thatNodeFilter = MDocUpdater.HasDroppedNamespace (assembly) ? oldNodeFilter : newNodeFilter;
+
+ XmlElement e = (XmlElement) root.SelectSingleNode (thisNodeFilter);
if (e == null) {
e = root.OwnerDocument.CreateElement("AssemblyInfo");
+
+ if (MDocUpdater.HasDroppedNamespace (assembly)) {
+ e.SetAttribute ("apistyle", "unified");
+ }
+
root.AppendChild(e);
}
+
+ var thatNode = (XmlElement) root.SelectSingleNode (thatNodeFilter);
+ if (MDocUpdater.HasDroppedNamespace (assembly) && thatNode != null) {
+ // there's a classic node, we should add apistyles
+ e.SetAttribute ("apistyle", "unified");
+ thatNode.SetAttribute ("apistyle", "classic");
+ }
+
List<XmlNode> matches = e.SelectNodes ("AssemblyVersion").Cast<XmlNode>()
.Where(v => Array.IndexOf (assemblyVersions, v.InnerText) >= 0)
.ToList ();
e.AppendChild(c);
}
}
- // matches.Count == 0 && !add: ignore -- already not present
+ // matches.Count == 0 && !add: ignore -- already not present
XmlNodeList avs = e.SelectNodes ("AssemblyVersion");
SortXmlNodes (e, avs, new VersionComparer ());
- return avs.Count != 0;
+ bool anyNodesLeft = avs.Count != 0;
+ if (!anyNodesLeft) {
+ e.ParentNode.RemoveChild (e);
+ }
+ return anyNodesLeft;
}
// FIXME: get TypeReferences instead of string comparison?
"System.Runtime.CompilerServices.DynamicAttribute",
};
- private void MakeAttributes (XmlElement root, IEnumerable<string> attributes)
+ private void MakeAttributes (XmlElement root, IEnumerable<string> attributes, TypeReference t=null)
{
if (!attributes.Any ()) {
ClearElement (root, "Attributes");
{
if (v == null)
return "null";
- if (valueType.FullName == "System.Type")
- return "typeof(" + v.ToString () + ")";
+ if (valueType.FullName == "System.Type") {
+ var vTypeRef = v as TypeReference;
+ if (vTypeRef != null)
+ return "typeof(" + NativeTypeManager.GetTranslatedName (vTypeRef) + ")"; // TODO: drop NS handling
+ else
+ return "typeof(" + v.ToString () + ")";
+ }
if (valueType.FullName == "System.String")
return "\"" + v.ToString () + "\"";
if (valueType.FullName == "System.Char")
return Convert.ToInt64 (value);
}
- private void MakeParameters (XmlElement root, IList<ParameterDefinition> parameters)
+ private void MakeParameters (XmlElement root, MemberReference member, IList<ParameterDefinition> parameters, bool shouldDuplicateWithNew=false)
{
XmlElement e = WriteElement(root, "Parameters");
- e.RemoveAll();
+
+ int i = 0;
foreach (ParameterDefinition p in parameters) {
- XmlElement pe = root.OwnerDocument.CreateElement("Parameter");
- e.AppendChild(pe);
- pe.SetAttribute("Name", p.Name);
- pe.SetAttribute("Type", GetDocParameterType (p.ParameterType));
- if (p.ParameterType is ByReferenceType) {
- if (p.IsOut) pe.SetAttribute("RefType", "out");
- else pe.SetAttribute("RefType", "ref");
+ XmlElement pe;
+
+ // param info
+ var ptype = GetDocParameterType (p.ParameterType);
+ var newPType = ptype;
+
+ if (MDocUpdater.SwitchingToMagicTypes) {
+ newPType = NativeTypeManager.ConvertFromNativeType (ptype);
+ }
+
+ // now find the existing node, if it's there so we can reuse it.
+ var nodes = root.SelectSingleNode ("Parameters").SelectNodes ("Parameter")
+ .Cast<XmlElement> ().Where (x => x.GetAttribute ("Name") == p.Name)
+ .ToArray();
+
+ if (nodes.Count () == 0) {
+ // wasn't found, let's make sure it wasn't just cause the param name was changed
+ nodes = root.SelectSingleNode ("Parameters").SelectNodes ("Parameter")
+ .Cast<XmlElement> ()
+ .Skip (i) // this makes sure we don't inadvertently "reuse" nodes when adding new ones
+ .Where (x => x.GetAttribute ("Name") != p.Name && (x.GetAttribute ("Type") == ptype || x.GetAttribute ("Type") == newPType))
+ .Take(1) // there might be more than one that meets this parameter ... only take the first.
+ .ToArray();
}
- MakeAttributes (pe, GetCustomAttributes (p.CustomAttributes, ""));
+
+ AddXmlNode (nodes,
+ x => x.GetAttribute ("Type") == ptype,
+ x => x.SetAttribute ("Type", ptype),
+ () => {
+ pe = root.OwnerDocument.CreateElement ("Parameter");
+ e.AppendChild (pe);
+
+ pe.SetAttribute ("Name", p.Name);
+ pe.SetAttribute ("Type", ptype);
+ if (p.ParameterType is ByReferenceType) {
+ if (p.IsOut)
+ pe.SetAttribute ("RefType", "out");
+ else
+ pe.SetAttribute ("RefType", "ref");
+ }
+
+ MakeAttributes (pe, GetCustomAttributes (p.CustomAttributes, ""));
+ return pe;
+ },
+ member);
+
+ i++;
}
}
- private void MakeTypeParameters (XmlElement root, IList<GenericParameter> typeParams)
+ private void MakeTypeParameters (XmlElement root, IList<GenericParameter> typeParams, MemberReference member, bool shouldDuplicateWithNew)
{
if (typeParams == null || typeParams.Count == 0) {
XmlElement f = (XmlElement) root.SelectSingleNode ("TypeParameters");
return;
}
XmlElement e = WriteElement(root, "TypeParameters");
- e.RemoveAll();
+
+ var nodes = e.SelectNodes ("TypeParameter").Cast<XmlElement> ().ToArray ();
+
foreach (GenericParameter t in typeParams) {
- XmlElement pe = root.OwnerDocument.CreateElement("TypeParameter");
- e.AppendChild(pe);
- pe.SetAttribute("Name", t.Name);
- MakeAttributes (pe, GetCustomAttributes (t.CustomAttributes, ""));
- XmlElement ce = (XmlElement) e.SelectSingleNode ("Constraints");
- IList<TypeReference> constraints = t.Constraints;
- GenericParameterAttributes attrs = t.Attributes;
- if (attrs == GenericParameterAttributes.NonVariant && constraints.Count == 0) {
- if (ce != null)
- e.RemoveChild (ce);
- continue;
- }
- if (ce != null)
- ce.RemoveAll();
- else {
- ce = root.OwnerDocument.CreateElement ("Constraints");
- }
- pe.AppendChild (ce);
- if ((attrs & GenericParameterAttributes.Contravariant) != 0)
- AppendElementText (ce, "ParameterAttribute", "Contravariant");
- if ((attrs & GenericParameterAttributes.Covariant) != 0)
- AppendElementText (ce, "ParameterAttribute", "Covariant");
- if ((attrs & GenericParameterAttributes.DefaultConstructorConstraint) != 0)
- AppendElementText (ce, "ParameterAttribute", "DefaultConstructorConstraint");
- if ((attrs & GenericParameterAttributes.NotNullableValueTypeConstraint) != 0)
- AppendElementText (ce, "ParameterAttribute", "NotNullableValueTypeConstraint");
- if ((attrs & GenericParameterAttributes.ReferenceTypeConstraint) != 0)
- AppendElementText (ce, "ParameterAttribute", "ReferenceTypeConstraint");
- foreach (TypeReference c in constraints) {
- TypeDefinition cd = c.Resolve ();
- AppendElementText (ce,
- (cd != null && cd.IsInterface) ? "InterfaceName" : "BaseTypeName",
- GetDocTypeFullName (c));
- }
+
+ IList<TypeReference> constraints = t.Constraints;
+ GenericParameterAttributes attrs = t.Attributes;
+
+
+ AddXmlNode (
+ nodes,
+ x => {
+ var baseType = e.SelectSingleNode("BaseTypeName");
+ // TODO: should this comparison take into account BaseTypeName?
+ return x.GetAttribute("Name") == t.Name;
+ },
+ x => {}, // no additional action required
+ () => {
+
+ XmlElement pe = root.OwnerDocument.CreateElement("TypeParameter");
+ e.AppendChild(pe);
+ pe.SetAttribute("Name", t.Name);
+ MakeAttributes (pe, GetCustomAttributes (t.CustomAttributes, ""), t.DeclaringType);
+ XmlElement ce = (XmlElement) e.SelectSingleNode ("Constraints");
+ if (attrs == GenericParameterAttributes.NonVariant && constraints.Count == 0) {
+ if (ce != null)
+ e.RemoveChild (ce);
+ return pe;
+ }
+ if (ce != null)
+ ce.RemoveAll();
+ else {
+ ce = root.OwnerDocument.CreateElement ("Constraints");
+ }
+ pe.AppendChild (ce);
+ if ((attrs & GenericParameterAttributes.Contravariant) != 0)
+ AppendElementText (ce, "ParameterAttribute", "Contravariant");
+ if ((attrs & GenericParameterAttributes.Covariant) != 0)
+ AppendElementText (ce, "ParameterAttribute", "Covariant");
+ if ((attrs & GenericParameterAttributes.DefaultConstructorConstraint) != 0)
+ AppendElementText (ce, "ParameterAttribute", "DefaultConstructorConstraint");
+ if ((attrs & GenericParameterAttributes.NotNullableValueTypeConstraint) != 0)
+ AppendElementText (ce, "ParameterAttribute", "NotNullableValueTypeConstraint");
+ if ((attrs & GenericParameterAttributes.ReferenceTypeConstraint) != 0)
+ AppendElementText (ce, "ParameterAttribute", "ReferenceTypeConstraint");
+ foreach (TypeReference c in constraints) {
+ TypeDefinition cd = c.Resolve ();
+ AppendElementText (ce,
+ (cd != null && cd.IsInterface) ? "InterfaceName" : "BaseTypeName",
+ GetDocTypeFullName (c));
+ }
+
+ return pe;
+ },
+ member);
}
}
- private void MakeParameters (XmlElement root, MemberReference mi)
+ private void MakeParameters (XmlElement root, MemberReference mi, bool shouldDuplicateWithNew)
{
if (mi is MethodDefinition && ((MethodDefinition) mi).IsConstructor)
- MakeParameters (root, ((MethodDefinition)mi).Parameters);
+ MakeParameters (root, mi, ((MethodDefinition)mi).Parameters, shouldDuplicateWithNew);
else if (mi is MethodDefinition) {
MethodDefinition mb = (MethodDefinition) mi;
IList<ParameterDefinition> parameters = mb.Parameters;
- MakeParameters(root, parameters);
+ MakeParameters(root, mi, parameters, shouldDuplicateWithNew);
if (parameters.Count > 0 && DocUtils.IsExtensionMethod (mb)) {
XmlElement p = (XmlElement) root.SelectSingleNode ("Parameters/Parameter[position()=1]");
p.SetAttribute ("RefType", "this");
else if (mi is PropertyDefinition) {
IList<ParameterDefinition> parameters = ((PropertyDefinition)mi).Parameters;
if (parameters.Count > 0)
- MakeParameters(root, parameters);
+ MakeParameters(root, mi, parameters, shouldDuplicateWithNew);
else
return;
}
return GetDocTypeFullName (type).Replace ("@", "&");
}
- private void MakeReturnValue (XmlElement root, TypeReference type, IList<CustomAttribute> attributes)
- {
- XmlElement e = WriteElement(root, "ReturnValue");
- e.RemoveAll();
- WriteElementText(e, "ReturnType", GetDocTypeFullName (type));
- if (attributes != null)
- MakeAttributes(e, GetCustomAttributes (attributes, ""));
+ private void MakeReturnValue (XmlElement root, TypeReference type, IList<CustomAttribute> attributes, bool shouldDuplicateWithNew=false)
+ {
+ XmlElement e = WriteElement(root, "ReturnValue");
+ var valueToUse = GetDocTypeFullName (type);
+
+ AddXmlNode (e.SelectNodes("ReturnType").Cast<XmlElement> ().ToArray (),
+ x => x.InnerText == valueToUse,
+ x => x.InnerText = valueToUse,
+ () => {
+ var newNode = WriteElementText(e, "ReturnType", valueToUse, forceNewElement: true);
+ if (attributes != null)
+ MakeAttributes(e, GetCustomAttributes (attributes, ""), type);
+
+ return newNode;
+ },
+ type);
}
- private void MakeReturnValue (XmlElement root, MemberReference mi)
+ private void MakeReturnValue (XmlElement root, MemberReference mi, bool shouldDuplicateWithNew=false)
{
if (mi is MethodDefinition && ((MethodDefinition) mi).IsConstructor)
return;
else if (mi is MethodDefinition)
- MakeReturnValue (root, ((MethodDefinition)mi).ReturnType, ((MethodDefinition)mi).MethodReturnType.CustomAttributes);
+ MakeReturnValue (root, ((MethodDefinition)mi).ReturnType, ((MethodDefinition)mi).MethodReturnType.CustomAttributes, shouldDuplicateWithNew);
else if (mi is PropertyDefinition)
- MakeReturnValue (root, ((PropertyDefinition)mi).PropertyType, null);
+ MakeReturnValue (root, ((PropertyDefinition)mi).PropertyType, null, shouldDuplicateWithNew);
else if (mi is FieldDefinition)
- MakeReturnValue (root, ((FieldDefinition)mi).FieldType, null);
+ MakeReturnValue (root, ((FieldDefinition)mi).FieldType, null, shouldDuplicateWithNew);
else if (mi is EventDefinition)
- MakeReturnValue (root, ((EventDefinition)mi).EventType, null);
+ MakeReturnValue (root, ((EventDefinition)mi).EventType, null, shouldDuplicateWithNew);
else
throw new ArgumentException(mi + " is a " + mi.GetType().FullName);
}
XmlElement me = doc.CreateElement("Member");
me.SetAttribute("MemberName", GetMemberName (mi));
-
+
info.Node = me;
UpdateMember(info);
if (exceptions.HasValue &&
static class CecilExtensions {
public static string GetDeclaringType(this CustomAttribute attribute)
{
- return attribute.Constructor.DeclaringType.FullName;
+ var type = attribute.Constructor.DeclaringType;
+ var typeName = type.FullName;
+
+ string translatedType = NativeTypeManager.GetTranslatedName (type);
+ return translatedType;
}
public static IEnumerable<MemberReference> GetMembers (this TypeDefinition type)
}
}
+enum ApiStyle {
+ Classic,
+ Unified
+}
+
static class DocUtils {
+
+ public static bool DoesNotHaveApiStyle(this XmlElement element, ApiStyle style) {
+ string styleString = style.ToString ().ToLower ();
+ string apistylevalue = element.GetAttribute ("apistyle");
+ return apistylevalue != styleString || string.IsNullOrWhiteSpace(apistylevalue);
+ }
+ public static bool HasApiStyle(this XmlElement element, ApiStyle style) {
+ string styleString = style.ToString ().ToLower ();
+ return element.GetAttribute ("apistyle") == styleString;
+ }
+ public static void AddApiStyle(this XmlElement element, ApiStyle style) {
+ string styleString = style.ToString ().ToLower ();
+ var existingValue = element.GetAttribute ("apistyle");
+ if (string.IsNullOrWhiteSpace (existingValue) || existingValue != styleString) {
+ element.SetAttribute ("apistyle", styleString);
+ }
+ }
+
public static bool IsExplicitlyImplemented (MethodDefinition method)
{
return method.IsPrivate && method.IsFinal && method.IsVirtual;
type = type.DeclaringType;
if (type == null)
return string.Empty;
- return type.Namespace;
+
+ string typeNS = type.Namespace;
+
+ // first, make sure this isn't a type reference to another assembly/module
+
+ bool isInAssembly = MDocUpdater.IsInAssemblies(type.Module.Name);
+ if (isInAssembly && !typeNS.StartsWith ("System") && MDocUpdater.HasDroppedNamespace (type)) {
+ typeNS = string.Format ("{0}.{1}", MDocUpdater.droppedNamespace, typeNS);
+ }
+ return typeNS;
}
public static string PathCombine (string dir, string path)
public bool AddRemarks = true;
public MemberReference Member;
public TypeDefinition Type;
+
+ public override string ToString ()
+ {
+ return string.Format ("{0} - {1} - {2}", Type, Member, Node == null ? "no xml" : "with xml");
+ }
}
class DocumentationEnumerator {
-
+
public virtual IEnumerable<TypeDefinition> GetDocumentationTypes (AssemblyDefinition assembly, List<string> forTypes)
{
return GetDocumentationTypes (assembly, forTypes, null);
string returntype = member.ReturnType;
string docName = member.MemberName;
+
string[] docTypeParams = GetTypeParameters (docName);
+ // If we're using 'magic types', then we might get false positives ... in those cases, we keep searching
+ MemberReference likelyCandidate = null;
+
// Loop through all members in this type with the same name
- foreach (MemberReference mi in GetReflectionMembers (type, docName)) {
+ var reflectedMembers = GetReflectionMembers (type, docName).ToArray ();
+ foreach (MemberReference mi in reflectedMembers) {
+ bool matchedMagicType = false;
if (mi is TypeDefinition) continue;
if (MDocUpdater.GetMemberType(mi) != membertype) continue;
MethodDefinition mDef = mi as MethodDefinition;
if (mDef != null && !mDef.IsConstructor) {
// Casting operators can overload based on return type.
- if (returntype != GetReplacedString (
- MDocUpdater.GetDocTypeFullName (((MethodDefinition)mi).ReturnType),
- typeParams, docTypeParams)) {
+ string rtype = GetReplacedString (
+ MDocUpdater.GetDocTypeFullName (((MethodDefinition)mi).ReturnType),
+ typeParams, docTypeParams);
+ string originalRType = rtype;
+ if (MDocUpdater.SwitchingToMagicTypes) {
+ rtype = NativeTypeManager.ConvertFromNativeType (rtype);
+
+ }
+ if ((returntype != rtype && originalRType == rtype) ||
+ (MDocUpdater.SwitchingToMagicTypes && returntype != originalRType && returntype != rtype && originalRType != rtype)) {
continue;
}
+
+ if (originalRType != rtype)
+ matchedMagicType = true;
}
if (pcount == 0)
string paramType = GetReplacedString (
MDocUpdater.GetDocParameterType (pis [i].ParameterType),
typeParams, docTypeParams);
- if (paramType != (string) member.Parameters [i]) {
- good = false;
- break;
+
+ // if magictypes, replace paramType to "classic value" ... so the comparison works
+ string originalParamType = paramType;
+ if (MDocUpdater.SwitchingToMagicTypes) {
+ paramType = NativeTypeManager.ConvertFromNativeType (paramType);
}
+
+ string xmlMemberType = member.Parameters [i];
+ if ((!paramType.Equals(xmlMemberType) && paramType.Equals(originalParamType)) ||
+ (MDocUpdater.SwitchingToMagicTypes && !originalParamType.Equals(xmlMemberType) && !paramType.Equals(xmlMemberType) && !paramType.Equals(originalParamType))) {
+
+ // did not match ... if we're dropping the namespace, and the paramType has the dropped
+ // namespace, we should see if it matches when added
+ bool stillDoesntMatch = true;
+ if (MDocUpdater.HasDroppedNamespace(type) && paramType.StartsWith (MDocUpdater.droppedNamespace)) {
+ string withDroppedNs = string.Format ("{0}.{1}", MDocUpdater.droppedNamespace, xmlMemberType);
+
+ stillDoesntMatch = withDroppedNs != paramType;
+ }
+
+ if (stillDoesntMatch) {
+ good = false;
+ break;
+ }
+ }
+
+ if (originalParamType != paramType)
+ matchedMagicType = true;
}
if (!good) continue;
+ if (MDocUpdater.SwitchingToMagicTypes && likelyCandidate == null && matchedMagicType) {
+ // we matched this on a magic type conversion ... let's keep going to see if there's another one we should look at that matches more closely
+ likelyCandidate = mi;
+ continue;
+ }
+
return mi;
}
- return null;
+ return likelyCandidate;
}
static string[] GetTypeParameters (string docName)
protected static IEnumerable<MemberReference> GetReflectionMembers (TypeDefinition type, string docName)
{
+ // In case of dropping the namespace, we have to remove the dropped NS
+ // so that docName will match what's in the assembly/type
+ if (MDocUpdater.HasDroppedNamespace (type) && docName.StartsWith(MDocUpdater.droppedNamespace + ".")) {
+ int droppedNsLength = MDocUpdater.droppedNamespace.Length;
+ docName = docName.Substring (droppedNsLength + 1, docName.Length - droppedNsLength - 1);
+ }
+
// need to worry about 4 forms of //@MemberName values:
// 1. "Normal" (non-generic) member names: GetEnumerator
// - Lookup as-is.
if (membersDepth != ecmadocs.Depth - 1 || ecmadocs.NodeType != XmlNodeType.Element)
continue;
DocumentationMember dm = new DocumentationMember (ecmadocs);
+
string xp = MDocUpdater.GetXPathForMember (dm);
XmlElement oldmember = (XmlElement) basefile.SelectSingleNode (xp);
MemberReference m;
do {
if (reader.NodeType != XmlNodeType.Element)
continue;
+
+ bool shouldUse = true;
+ try {
+ string apistyle = reader.GetAttribute ("apistyle");
+ shouldUse = string.IsNullOrWhiteSpace(apistyle) || apistyle == "classic"; // only use this tag if it's an 'classic' style node
+ }
+ catch (Exception ex) {}
switch (reader.Name) {
case "MemberSignature":
- MemberSignatures [reader.GetAttribute ("Language")] = reader.GetAttribute ("Value");
+ if (shouldUse) {
+ MemberSignatures [reader.GetAttribute ("Language")] = reader.GetAttribute ("Value");
+ }
break;
case "MemberType":
MemberType = reader.ReadElementString ();
break;
case "ReturnType":
- if (reader.Depth == depth + 2)
+ if (reader.Depth == depth + 2 && shouldUse)
ReturnType = reader.ReadElementString ();
break;
case "Parameter":
- if (reader.Depth == depth + 2)
+ if (reader.Depth == depth + 2 && shouldUse)
p.Add (reader.GetAttribute ("Type"));
break;
case "Docs":
foreach (XmlNode n in node.SelectNodes ("MemberSignature")) {
XmlAttribute l = n.Attributes ["Language"];
XmlAttribute v = n.Attributes ["Value"];
- if (l != null && v != null)
+ XmlAttribute apistyle = n.Attributes ["apistyle"];
+ bool shouldUse = apistyle == null || apistyle.Value == "classic";
+ if (l != null && v != null && shouldUse)
MemberSignatures [l.Value] = v.Value;
}
MemberType = node.SelectSingleNode ("MemberType").InnerText;
- XmlNode rt = node.SelectSingleNode ("ReturnValue/ReturnType");
+ XmlNode rt = node.SelectSingleNode ("ReturnValue/ReturnType[not(@apistyle) or @apistyle='classic']");
if (rt != null)
ReturnType = rt.InnerText;
- XmlNodeList p = node.SelectNodes ("Parameters/Parameter");
+ XmlNodeList p = node.SelectNodes ("Parameters/Parameter[not(@apistyle) or @apistyle='classic']");
if (p.Count > 0) {
Parameters = new StringList (p.Count);
for (int i = 0; i < p.Count; ++i)
return buf;
}
- private static string GetBuiltinType (string t)
+ protected static string GetBuiltinType (string t)
{
switch (t) {
case "System.Byte": return "unsigned int8";
}
}
+ class ILNativeTypeMemberFormatter : ILFullMemberFormatter {
+ protected static string _GetBuiltinType (string t)
+ {
+ //string moddedType = base.GetBuiltinType (t);
+ return null;
+ //return moddedType;
+ }
+ }
+
+ class CSharpNativeTypeMemberFormatter : CSharpFullMemberFormatter {
+ protected override string GetCSharpType (string t) {
+ string moddedType = base.GetCSharpType (t);
+
+ switch (moddedType) {
+ case "int": return "nint";
+ case "uint":
+ return "nuint";
+ case "float":
+ return "nfloat";
+ case "System.Drawing.SizeF":
+ return "CoreGraphics.CGSize";
+ case "System.Drawing.PointF":
+ return "CoreGraphics.CGPoint";
+ case "System.Drawing.RectangleF":
+ return "CoreGraphics.CGPoint";
+ }
+ return null;
+ }
+ }
+
class CSharpFullMemberFormatter : MemberFormatter {
public override string Language {
protected override StringBuilder AppendNamespace (StringBuilder buf, TypeReference type)
{
+
string ns = DocUtils.GetNamespace (type);
if (GetCSharpType (type.FullName) == null && ns != null && ns.Length > 0 && ns != "System")
buf.Append (ns).Append ('.');
return buf;
}
- private string GetCSharpType (string t)
+ protected virtual string GetCSharpType (string t)
{
switch (t) {
case "System.Byte": return "byte";
--- /dev/null
+// Command to preserve member documentation for types that are changing in a subsequent version
+// By Joel Martinez <joel.martinez@xamarin.com
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Mono.Options;
+
+namespace Mono.Documentation
+{
+ public class MDocPreserve : MDocCommand
+ {
+ MDocUpdater updater;
+
+ public MDocPreserve ()
+ {
+ updater = new MDocUpdater ();
+ }
+
+ public override void Run (IEnumerable<string> args)
+ {
+ string preserveName = string.Empty;
+ var p = new OptionSet () { { "name=",
+ "Root {DIRECTORY} to generate/update documentation.",
+ v => preserveName = v
+ }
+ };
+
+ updater.PreserveTag = preserveName;
+
+ updater.Run (args);
+ }
+ }
+}
+
--- /dev/null
+namespace MyFramework.MyOtherNamespace {
+ ///<summary>Make sure the namespace in this assembly doesn't get 'dropped'</summary>
+ public class MyOtherClass {
+ public string MyProperty {get;set;}
+ public float Hello(int value) {
+ return 0.0f;
+ }
+ }
+}
--- /dev/null
+namespace MyFramework.MyNamespace {
+ public class MyClass {
+ public string MyProperty {get;set;}
+ public float Hello(int value) {
+ return 0.0f;
+ }
+ }
+}
--- /dev/null
+namespace MyNamespace {
+ public class MyClass {
+ public string MyProperty {get;set;}
+ public float Hello(int value) {
+ return 0.0f;
+ }
+ }
+}
--- /dev/null
+<Type Name="MyClass" FullName="MyFramework.MyNamespace.MyClass">
+ <TypeSignature Language="C#" Value="public class MyClass" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MyClass extends System.Object" />
+ <AssemblyInfo>
+ <AssemblyName>DocTest-DropNS-classic</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Base>
+ <BaseTypeName>System.Object</BaseTypeName>
+ </Base>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName=".ctor">
+ <MemberSignature Language="C#" Value="public MyClass ();" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
+ <MemberType>Constructor</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Hello">
+ <MemberSignature Language="C#" Value="public float Hello (int value);" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig instance float32 Hello(int32 value) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Single</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="value" Type="System.Int32" />
+ </Parameters>
+ <Docs>
+ <param name="value">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="MyProperty">
+ <MemberSignature Language="C#" Value="public string MyProperty { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance string MyProperty" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.String</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
--- /dev/null
+<Overview>
+ <Assemblies>
+ <Assembly Name="DocTest-DropNS-classic" Version="0.0.0.0">
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
+ </Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
+ </Attribute>
+ </Attributes>
+ </Assembly>
+ </Assemblies>
+ <Remarks>To be added.</Remarks>
+ <Copyright>To be added.</Copyright>
+ <Types>
+ <Namespace Name="MyFramework.MyNamespace">
+ <Type Name="MyClass" Kind="Class" />
+ </Namespace>
+ </Types>
+ <Title>DocTest-DropNS-classic</Title>
+</Overview>
--- /dev/null
+<Namespace Name="MyFramework.MyNamespace">
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+</Namespace>
--- /dev/null
+<Type Name="MyClass" FullName="MyFramework.MyNamespace.MyClass">
+ <TypeSignature Language="C#" Value="public class MyClass" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MyClass extends System.Object" />
+ <AssemblyInfo apistyle="classic">
+ <AssemblyName>DocTest-DropNS-classic</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyName>DocTest-DropNS-unified</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Base>
+ <BaseTypeName>System.Object</BaseTypeName>
+ </Base>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName=".ctor">
+ <MemberSignature Language="C#" Value="public MyClass ();" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
+ <MemberType>Constructor</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Hello">
+ <MemberSignature Language="C#" Value="public float Hello (int value);" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig instance float32 Hello(int32 value) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Single</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="value" Type="System.Int32" />
+ </Parameters>
+ <Docs>
+ <param name="value">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="MyProperty">
+ <MemberSignature Language="C#" Value="public string MyProperty { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance string MyProperty" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.String</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
--- /dev/null
+<Overview>
+ <Assemblies>
+ <Assembly Name="DocTest-DropNS-unified" Version="0.0.0.0">
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
+ </Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
+ </Attribute>
+ </Attributes>
+ </Assembly>
+ </Assemblies>
+ <Remarks>To be added.</Remarks>
+ <Copyright>To be added.</Copyright>
+ <Types>
+ <Namespace Name="MyFramework.MyNamespace">
+ <Type Name="MyClass" Kind="Class" />
+ </Namespace>
+ </Types>
+ <Title>DocTest-DropNS-classic</Title>
+</Overview>
--- /dev/null
+<Namespace Name="MyFramework.MyNamespace">
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+</Namespace>
--- /dev/null
+<Type Name="MyClass" FullName="MyFramework.MyNamespace.MyClass">
+ <TypeSignature Language="C#" Value="public class MyClass" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MyClass extends System.Object" />
+ <AssemblyInfo apistyle="classic">
+ <AssemblyName>DocTest-DropNS-classic</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyName>DocTest-DropNS-unified</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Base>
+ <BaseTypeName>System.Object</BaseTypeName>
+ </Base>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName=".ctor">
+ <MemberSignature Language="C#" Value="public MyClass ();" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
+ <MemberType>Constructor</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Hello">
+ <MemberSignature Language="C#" Value="public float Hello (int value);" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig instance float32 Hello(int32 value) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Single</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="value" Type="System.Int32" />
+ </Parameters>
+ <Docs>
+ <param name="value">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="MyProperty">
+ <MemberSignature Language="C#" Value="public string MyProperty { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance string MyProperty" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo apistyle="classic">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <AssemblyInfo apistyle="unified">
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.String</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
--- /dev/null
+<Type Name="MyOtherClass" FullName="MyFramework.MyOtherNamespace.MyOtherClass">
+ <TypeSignature Language="C#" Value="public class MyOtherClass" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MyOtherClass extends System.Object" />
+ <AssemblyInfo>
+ <AssemblyName>DocTest-DropNS-classic-secondary</AssemblyName>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Base>
+ <BaseTypeName>System.Object</BaseTypeName>
+ </Base>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName=".ctor">
+ <MemberSignature Language="C#" Value="public MyOtherClass ();" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
+ <MemberType>Constructor</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Parameters />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="Hello">
+ <MemberSignature Language="C#" Value="public float Hello (int value);" />
+ <MemberSignature Language="ILAsm" Value=".method public hidebysig instance float32 Hello(int32 value) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Single</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="value" Type="System.Int32" />
+ </Parameters>
+ <Docs>
+ <param name="value">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="MyProperty">
+ <MemberSignature Language="C#" Value="public string MyProperty { get; set; }" />
+ <MemberSignature Language="ILAsm" Value=".property instance string MyProperty" />
+ <MemberType>Property</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>0.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.String</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <value>To be added.</value>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>
--- /dev/null
+<Overview>
+ <Assemblies>
+ <Assembly Name="DocTest-DropNS-unified" Version="0.0.0.0">
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
+ </Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
+ </Attribute>
+ </Attributes>
+ </Assembly>
+ <Assembly Name="DocTest-DropNS-classic-secondary" Version="0.0.0.0">
+ <Attributes>
+ <Attribute>
+ <AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
+ </Attribute>
+ <Attribute>
+ <AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
+ </Attribute>
+ </Attributes>
+ </Assembly>
+ </Assemblies>
+ <Remarks>To be added.</Remarks>
+ <Copyright>To be added.</Copyright>
+ <Types>
+ <Namespace Name="MyFramework.MyNamespace">
+ <Type Name="MyClass" Kind="Class" />
+ </Namespace>
+ <Namespace Name="MyFramework.MyOtherNamespace">
+ <Type Name="MyOtherClass" Kind="Class" />
+ </Namespace>
+ </Types>
+ <Title>Untitled</Title>
+</Overview>
--- /dev/null
+<Namespace Name="MyFramework.MyNamespace">
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+</Namespace>
--- /dev/null
+<Namespace Name="MyFramework.MyOtherNamespace">
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+</Namespace>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>9.0.21022</ProductVersion>
+ <ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7DA7CD97-614F-4BCD-A2FA-B379590CEA48}</ProjectGuid>
<OutputType>Exe</OutputType>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="ICSharpCode.SharpZipLib" />
- <Reference Include="monodoc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\class\lib\net_2_0\monodoc.dll</HintPath>
- </Reference>
<Reference Include="System.Xml" />
<Reference Include="Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
+ <Reference Include="monodoc">
+ <HintPath>..\..\class\lib\net_4_0\monodoc.dll</HintPath>
+ </Reference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Include="Mono.Documentation\XhtmlWriter.cs" />
<Compile Include="Mono.Documentation\exceptions.cs" />
<Compile Include="Mono.Documentation\index.cs" />
+ <Compile Include="Mono.Documentation\preserver.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\defaulttemplate.xsl">
Mono.Documentation/validate.cs
Mono.Documentation/webdoc.cs
Mono.Documentation/XhtmlWriter.cs
+Mono.Documentation/preserver.cs
Mono.Rocks/ObjectRocks.cs
Mono.Rocks/StreamRocks.cs
if (use_dos2unix == null) {
use_dos2unix = false;
try {
- var dos2unix = Process.Start ("dos2unix");
+ var info = new ProcessStartInfo ("dos2unix");
+ info.CreateNoWindow = true;
+ info.RedirectStandardInput = true;
+ info.UseShellExecute = false;
+ var dos2unix = Process.Start (info);
dos2unix.StandardInput.WriteLine ("aaa");
dos2unix.StandardInput.WriteLine ("\u0004");
+ dos2unix.StandardInput.Close ();
dos2unix.WaitForExit ();
if (dos2unix.ExitCode == 0)
use_dos2unix = true;
[assembly: AssemblyProduct("MONO CLI")]
[assembly: AssemblyCopyright("(c) 2003 Various Authors")]
[assembly: AssemblyTrademark("")]
-#if TARGET_JVM
-[assembly: CLSCompliant(false)]
-#else
[assembly: CLSCompliant(true)]
-#endif
[assembly: ComVisible(false)]
[assembly: AssemblyDefaultAlias("mono-service.exe")]
[assembly: AssemblyInformationalVersion("0.0.0.1")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AllowPartiallyTrustedCallers()]
-#if !TARGET_JVM
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../../class/mono.snk")]
-#endif
using System.Xml.Schema;
using System.Xml.Xsl;
using System.Xml.XPath;
-#if !TARGET_JVM && !MSNET
+#if !MSNET
using Commons.Xml.Nvdl;
using Commons.Xml.Relaxng;
using Commons.Xml.Relaxng.Rnc;
case "--help":
Usage ();
return;
-#if !TARGET_JVM && !MSNET
+#if !MSNET
case "--validate":
ValidateAuto (args);
return;
}
}
-#if !TARGET_JVM && !MSNET
+#if !MSNET
static void ValidateAuto (string [] args)
{
if (args.Length < 1) {
LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib/$(PROFILE) -r:Mono.Security.dll
SECURITY_PROGRAMS = secutil.exe cert2spc.exe sn.exe makecert.exe chktrust.exe crlupdate.exe \
- signcode.exe setreg.exe certmgr.exe caspol.exe permview.exe mozroots.exe
+ signcode.exe setreg.exe certmgr.exe caspol.exe permview.exe mozroots.exe cert-sync.exe
SECURITY_PROGRAMS_2_0 = httpcfg.exe
HELPER_SOURCES = AssemblyInfo.cs $(topdir)/build/common/Consts.cs
--- /dev/null
+//
+// cert-sync.cs: Import the root certificates from Linux SSL store into Mono
+//
+// Authors:
+// Sebastien Pouliot <sebastien@ximian.com>
+// Jo Shields <jo.shields@xamarin.com>
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2014 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;
+using System.Collections;
+using System.IO;
+using System.Net;
+using System.Reflection;
+using System.Security.Cryptography;
+using System.Text;
+
+using Mono.Security.X509;
+
+[assembly: AssemblyTitle ("Linux Cert Store Sync")]
+[assembly: AssemblyDescription ("Synchronize local certs with certs from local Linux trust store.")]
+
+namespace Mono.Tools
+{
+
+ class CertSync
+ {
+
+ static string inputFile;
+ static bool quiet;
+
+ static X509Certificate DecodeCertificate (string s)
+ {
+ byte[] rawdata = Convert.FromBase64String (s);
+ return new X509Certificate (rawdata);
+ }
+
+ static Stream GetFile ()
+ {
+ try {
+ if (inputFile != null) {
+ return File.OpenRead (inputFile);
+ } else {
+ return null;
+ }
+ } catch {
+ return null;
+ }
+ }
+
+ static X509CertificateCollection DecodeCollection ()
+ {
+ X509CertificateCollection roots = new X509CertificateCollection ();
+ StringBuilder sb = new StringBuilder ();
+ bool processing = false;
+
+ using (Stream s = GetFile ()) {
+ if (s == null) {
+ WriteLine ("Couldn't retrieve the file using the supplied information.");
+ return null;
+ }
+
+ StreamReader sr = new StreamReader (s);
+ while (true) {
+ string line = sr.ReadLine ();
+ if (line == null)
+ break;
+
+ if (processing) {
+ if (line.StartsWith ("-----END CERTIFICATE-----")) {
+ processing = false;
+ X509Certificate root = DecodeCertificate (sb.ToString ());
+ roots.Add (root);
+
+ sb = new StringBuilder ();
+ continue;
+ }
+ sb.Append (line);
+ } else {
+ processing = line.StartsWith ("-----BEGIN CERTIFICATE-----");
+ }
+ }
+ return roots;
+ }
+ }
+
+ static int Process ()
+ {
+ X509CertificateCollection roots = DecodeCollection ();
+ if (roots == null) {
+ return 1;
+ } else if (roots.Count == 0) {
+ WriteLine ("No certificates were found.");
+ return 0;
+ }
+
+ X509Stores stores = (X509StoreManager.LocalMachine);
+ X509CertificateCollection trusted = stores.TrustedRoot.Certificates;
+ int additions = 0;
+ WriteLine ("I already trust {0}, your new list has {1}", trusted.Count, roots.Count);
+ foreach (X509Certificate root in roots) {
+ if (!trusted.Contains (root)) {
+ try {
+ stores.TrustedRoot.Import (root);
+ WriteLine ("Certificate added: {0}", root.SubjectName);
+ } catch {
+ WriteLine ("Warning: Could not import {0}");
+ }
+ additions++;
+ }
+ }
+ if (additions > 0)
+ WriteLine ("{0} new root certificates were added to your trust store.", additions);
+
+ X509CertificateCollection removed = new X509CertificateCollection ();
+ foreach (X509Certificate trust in trusted) {
+ if (!roots.Contains (trust)) {
+ removed.Add (trust);
+ }
+ }
+ if (removed.Count > 0) {
+ WriteLine ("{0} previously trusted certificates were removed.", removed.Count);
+
+ foreach (X509Certificate old in removed) {
+ stores.TrustedRoot.Remove (old);
+ WriteLine ("Certificate removed: {0}", old.SubjectName);
+ }
+ }
+ WriteLine ("Import process completed.");
+ return 0;
+ }
+
+ static string Thumbprint (string algorithm, X509Certificate certificate)
+ {
+ HashAlgorithm hash = HashAlgorithm.Create (algorithm);
+ byte[] digest = hash.ComputeHash (certificate.RawData);
+ return BitConverter.ToString (digest);
+ }
+
+ static bool ParseOptions (string[] args)
+ {
+ if (args.Length < 1)
+ return false;
+
+ for (int i = 0; i < args.Length - 1; i++) {
+ switch (args [i]) {
+ case "--quiet":
+ quiet = true;
+ break;
+ default:
+ WriteLine ("Unknown option '{0}'.");
+ return false;
+ }
+ }
+ inputFile = args [args.Length - 1];
+ if (!File.Exists (inputFile)) {
+ WriteLine ("Unknown option or file not found '{0}'.");
+ return false;
+ }
+ return true;
+ }
+
+ static void Header ()
+ {
+ Console.WriteLine (new AssemblyInfo ().ToString ());
+ }
+
+ static void Help ()
+ {
+ Console.WriteLine ("Usage: cert-sync [--quiet] system-ca-bundle.crt");
+ Console.WriteLine ("Where system-ca-bundle.crt is in PEM format");
+ }
+
+ static void WriteLine (string str)
+ {
+ if (!quiet)
+ Console.WriteLine (str);
+ }
+
+ static void WriteLine (string format, params object[] args)
+ {
+ if (!quiet)
+ Console.WriteLine (format, args);
+ }
+
+ static int Main (string[] args)
+ {
+ try {
+ if (!ParseOptions (args)) {
+ Header ();
+ Help ();
+ return 1;
+ }
+ if (!quiet) {
+ Header ();
+ }
+ return Process ();
+ } catch (Exception e) {
+ // ignore quiet on exception
+ Console.WriteLine ("Error: {0}", e);
+ return 1;
+ }
+ }
+ }
+}
\ No newline at end of file
if CROSS_COMPILING
-SUBDIRS = arch utils io-layer cil metadata $(interpreter_dir) mini dis profiler
+SUBDIRS = arch utils io-layer cil metadata mini dis profiler
else
if INSTALL_MONOTOUCH
SUBDIRS = utils io-layer metadata arch mini profiler
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
done;
else
-SUBDIRS = arch utils io-layer cil metadata $(interpreter_dir) mini dis monograph tests unit-tests benchmark profiler
+SUBDIRS = arch utils io-layer cil metadata mini dis monograph tests unit-tests benchmark profiler
endif
endif
-DIST_SUBDIRS = arch utils io-layer cil metadata interpreter mini dis monograph tests unit-tests benchmark profiler
+DIST_SUBDIRS = arch utils io-layer cil metadata mini dis monograph tests unit-tests benchmark profiler
AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
-if INTERP_SUPPORTED
-SUBDIRS = $(arch_target)
-else
if ARM
# arm needs to build some stuff even in JIT mode
SUBDIRS = $(arch_target)
-endif
-endif
-
-if INTERP_SUPPORTED
-
-noinst_LTLIBRARIES = libmonoarch.la
-
-libmonoarch_la_SOURCES = unknown.c
-
-libmonoarch_la_LIBADD = $(arch_target)/libmonoarch-$(arch_target).la
-
endif
EXTRA_DIST = ChangeLog
-
-AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
-
-noinst_LTLIBRARIES = libmonoarch-amd64.la
-
-libmonoarch_amd64_la_SOURCES = tramp.c amd64-codegen.h
+EXTRA_DIST = amd64-codegen.h
+++ /dev/null
-/*
- * Create trampolines to invoke arbitrary functions.
- *
- * Copyright (C) Ximian Inc.
- *
- * Author:
- * Zalman Stern
- * Based on code by:
- * Paolo Molaro (lupus@ximian.com)
- * Dietmar Maurer (dietmar@ximian.com)
- *
- * To understand this code, one will want to the calling convention section of the ABI sepc at:
- * http://x86-64.org/abi.pdf
- * and the AMD64 architecture docs found at amd.com .
- */
-
-#include "config.h"
-#include <stdlib.h>
-#include <string.h>
-#include "amd64-codegen.h"
-#include "mono/metadata/class.h"
-#include "mono/metadata/tabledefs.h"
-#include "mono/interpreter/interp.h"
-#include "mono/metadata/appdomain.h"
-#include "mono/metadata/marshal.h"
-
-/*
- * The resulting function takes the form:
- * void func (void (*callme)(), void *retval, void *this_obj, stackval *arguments);
- */
-#define FUNC_ADDR_POS 8
-#define RETVAL_POS 12
-#define THIS_POS 16
-#define ARGP_POS 20
-#define LOC_POS -4
-
-#define ARG_SIZE sizeof (stackval)
-
-#define MAX_INT_ARG_REGS 6
-#define MAX_FLOAT_ARG_REGS 8
-
-// TODO get these right. They are upper bounds anyway, so it doesn't much matter.
-#define PUSH_INT_STACK_ARG_SIZE 16
-#define MOVE_INT_REG_ARG_SIZE 16
-#define PUSH_FLOAT_STACK_ARG_SIZE 16
-#define MOVE_FLOAT_REG_ARG_SIZE 16
-#define COPY_STRUCT_STACK_ARG_SIZE 16
-
-/* Maps an argument number (starting at 0) to the register it is passed in (if it fits).
- * E.g. int foo(int bar, int quux) has the foo arg in RDI and the quux arg in RSI
- * There is no such map for floating point args as they go in XMM0-XMM7 in order and thus the
- * index is the register number.
- */
-static int int_arg_regs[] = { AMD64_RDI, AMD64_RSI, AMD64_RDX, AMD64_RCX, AMD64_R8, AMD64_R9 };
-
-/* This next block of code resolves the ABI rules for passing structures in the argument registers.
- * These basically amount to "Use up to two registers if they are all integer or all floating point.
- * If the structure is bigger than two registers or would be in one integer register and one floating point,
- * it is passed in memory instead.
- *
- * It is possible this code needs to be recursive to be correct in the case when one of the structure members
- * is itself a structure.
- *
- * The 80-bit floating point stuff is ignored.
- */
-typedef enum {
- ARG_IN_MEMORY,
- ARG_IN_INT_REGS,
- ARG_IN_FLOAT_REGS
-} struct_arg_type;
-
-static struct_arg_type compute_arg_type(MonoType *type)
-{
- guint32 simpletype = type->type;
-
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_I8:
- return ARG_IN_INT_REGS;
- break;
- case MONO_TYPE_VALUETYPE: {
- if (type->data.klass->enumtype)
- return ARG_IN_INT_REGS;
- return ARG_IN_MEMORY;
- break;
- }
- case MONO_TYPE_R4:
- case MONO_TYPE_R8:
- return ARG_IN_FLOAT_REGS;
- break;
- default:
- g_error ("Can't trampoline 0x%x", type->type);
- }
-
- return ARG_IN_MEMORY;
-}
-
-static struct_arg_type value_type_info(MonoClass *klass, int *native_size, int *regs_used, int *offset1, int *size1, int *offset2, int *size2)
-{
- MonoMarshalType *info = mono_marshal_load_type_info (klass);
-
- *native_size = info->native_size;
-
- if (info->native_size > 8 || info->num_fields > 2)
- {
- *regs_used = 0;
- *offset1 = -1;
- *offset2 = -1;
- return ARG_IN_MEMORY;
- }
-
- if (info->num_fields == 1)
- {
- struct_arg_type result = compute_arg_type(info->fields[0].field->type);
- if (result != ARG_IN_MEMORY)
- {
- *regs_used = 1;
- *offset1 = info->fields[0].offset;
- *size1 = mono_marshal_type_size (info->fields[0].field->type, info->fields[0].mspec, NULL, 1, 1);
- }
- else
- {
- *regs_used = 0;
- *offset1 = -1;
- }
-
- *offset2 = -1;
- return result;
- }
-
- struct_arg_type result1 = compute_arg_type(info->fields[0].field->type);
- struct_arg_type result2 = compute_arg_type(info->fields[0].field->type);
-
- if (result1 == result2 && result1 != ARG_IN_MEMORY)
- {
- *regs_used = 2;
- *offset1 = info->fields[0].offset;
- *size1 = mono_marshal_type_size (info->fields[0].field->type, info->fields[0].mspec, NULL, 1, 1);
- *offset2 = info->fields[1].offset;
- *size2 = mono_marshal_type_size (info->fields[1].field->type, info->fields[1].mspec, NULL, 1, 1);
- return result1;
- }
-
- return ARG_IN_MEMORY;
-}
-
-MonoPIFunc
-mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
-{
- unsigned char *p, *code_buffer;
- guint32 stack_size = 0, code_size = 50;
- guint32 arg_pos, simpletype;
- int i;
- static GHashTable *cache = NULL;
- MonoPIFunc res;
-
- guint32 int_arg_regs_used = 0;
- guint32 float_arg_regs_used = 0;
- guint32 next_int_arg_reg = 0;
- guint32 next_float_arg_reg = 0;
- /* Indicates that the return value is filled in inside the called function. */
- int retval_implicit = 0;
- char *arg_in_reg_bitvector; /* A set index by argument number saying if it is in a register
- (integer or floating point according to type) */
-
- if (!cache)
- cache = g_hash_table_new ((GHashFunc)mono_signature_hash,
- (GCompareFunc)mono_metadata_signature_equal);
-
- if ((res = (MonoPIFunc)g_hash_table_lookup (cache, sig)))
- return res;
-
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref && !sig->ret->data.klass->enumtype) {
- int_arg_regs_used++;
- code_size += MOVE_INT_REG_ARG_SIZE;
- }
-
- if (sig->hasthis) {
- int_arg_regs_used++;
- code_size += MOVE_INT_REG_ARG_SIZE;
- }
-
- /* Run through stuff to calculate code size and argument bytes that will be pushed on stack (stack_size). */
- for (i = 0; i < sig->param_count; ++i) {
- if (sig->params [i]->byref)
- simpletype = MONO_TYPE_PTR;
- else
- simpletype = sig->params [i]->type;
-enum_calc_size:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_I8:
- if (int_arg_regs_used++ > MAX_INT_ARG_REGS) {
- stack_size += 8;
- code_size += PUSH_INT_STACK_ARG_SIZE;
- }
- else
- code_size += MOVE_INT_REG_ARG_SIZE;
- break;
- case MONO_TYPE_VALUETYPE: {
- int size;
- int arg_type;
- int regs_used;
- int offset1;
- int size1;
- int offset2;
- int size2;
-
- if (sig->params [i]->data.klass->enumtype) {
- simpletype = sig->params [i]->data.klass->enum_basetype->type;
- goto enum_calc_size;
- }
-
- arg_type = value_type_info(sig->params [i]->data.klass, &size, ®s_used, &offset1, &size1, &offset2, &size2);
- if (arg_type == ARG_IN_INT_REGS &&
- (int_arg_regs_used + regs_used) <= MAX_INT_ARG_REGS)
- {
- code_size += MOVE_INT_REG_ARG_SIZE;
- int_arg_regs_used += regs_used;
- break;
- }
-
- if (arg_type == ARG_IN_FLOAT_REGS &&
- (float_arg_regs_used + regs_used) <= MAX_FLOAT_ARG_REGS)
- {
- code_size += MOVE_FLOAT_REG_ARG_SIZE;
- float_arg_regs_used += regs_used;
- break;
- }
-
- /* Else item is in memory. */
-
- stack_size += size + 7;
- stack_size &= ~7;
- code_size += COPY_STRUCT_STACK_ARG_SIZE;
-
- break;
- }
- case MONO_TYPE_R4:
- case MONO_TYPE_R8:
- if (float_arg_regs_used++ > MAX_FLOAT_ARG_REGS) {
- stack_size += 8;
- code_size += PUSH_FLOAT_STACK_ARG_SIZE;
- }
- else
- code_size += MOVE_FLOAT_REG_ARG_SIZE;
- break;
- default:
- g_error ("Can't trampoline 0x%x", sig->params [i]->type);
- }
- }
- /*
- * FIXME: take into account large return values.
- * (Comment carried over from IA32 code. Not sure what it means :-)
- */
-
- code_buffer = p = alloca (code_size);
-
- /*
- * Standard function prolog.
- */
- amd64_push_reg (p, AMD64_RBP);
- amd64_mov_reg_reg (p, AMD64_RBP, AMD64_RSP, 8);
- /*
- * and align to 16 byte boundary...
- */
-
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
- MonoClass *klass = sig->ret->data.klass;
- if (!klass->enumtype) {
- retval_implicit = 1;
- }
- }
-
- if (sig->ret->byref || string_ctor || !(retval_implicit || sig->ret->type == MONO_TYPE_VOID)) {
- /* Push the retval register so it is saved across the call. It will be addressed via RBP later. */
- amd64_push_reg (p, AMD64_RSI);
- stack_size += 8;
- }
-
- /* Ensure stack is 16 byte aligned when entering called function as required by calling convention.
- * Getting this wrong results in a general protection fault on an SSE load or store somewhere in the
- * code called under the trampoline.
- */
- if ((stack_size & 15) != 0)
- amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, 16 - (stack_size & 15));
-
- /*
- * On entry to generated function:
- * RDI has target function address
- * RSI has return value location address
- * RDX has this pointer address
- * RCX has the pointer to the args array.
- *
- * Inside the stub function:
- * R10 holds the pointer to the args
- * R11 holds the target function address.
- * The return value address is pushed on the stack.
- * The this pointer is moved into the first arg register at the start.
- *
- * Optimization note: we could keep the args pointer in RCX and then
- * load over itself at the end. Ditto the callee addres could be left in RDI in some cases.
- */
-
- /* Move args pointer to temp register. */
- amd64_mov_reg_reg (p, AMD64_R10, AMD64_RCX, 8);
- amd64_mov_reg_reg (p, AMD64_R11, AMD64_RDI, 8);
-
- /* First args register gets return value pointer, if need be.
- * Note that "byref" equal true means the called function returns a pointer.
- */
- if (retval_implicit) {
- amd64_mov_reg_reg (p, int_arg_regs[next_int_arg_reg], AMD64_RSI, 8);
- next_int_arg_reg++;
- }
-
- /* this pointer goes in next args register. */
- if (sig->hasthis) {
- amd64_mov_reg_reg (p, int_arg_regs[next_int_arg_reg], AMD64_RDX, 8);
- next_int_arg_reg++;
- }
-
- /*
- * Generate code to handle arguments in registers. Stack arguments will happen in a loop after this.
- */
- arg_in_reg_bitvector = (char *)alloca((sig->param_count + 7) / 8);
- memset(arg_in_reg_bitvector, 0, (sig->param_count + 7) / 8);
-
- /* First, load all the arguments that are passed in registers into the appropriate registers.
- * Below there is another loop to handle arguments passed on the stack.
- */
- for (i = 0; i < sig->param_count; i++) {
- arg_pos = ARG_SIZE * i;
-
- if (sig->params [i]->byref)
- simpletype = MONO_TYPE_PTR;
- else
- simpletype = sig->params [i]->type;
-enum_marshal:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_I8:
- case MONO_TYPE_U8:
- case MONO_TYPE_CLASS:
- if (next_int_arg_reg < MAX_INT_ARG_REGS) {
- amd64_mov_reg_membase (p, int_arg_regs[next_int_arg_reg], AMD64_R10, arg_pos, 8);
- next_int_arg_reg++;
- arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
- }
- break;
- case MONO_TYPE_R4:
- if (next_float_arg_reg < MAX_FLOAT_ARG_REGS) {
- amd64_movss_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos);
- next_float_arg_reg++;
- arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
- }
- break;
- case MONO_TYPE_R8:
- if (next_float_arg_reg < MAX_FLOAT_ARG_REGS) {
- amd64_movsd_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos);
- next_float_arg_reg++;
- arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
- }
- break;
- case MONO_TYPE_VALUETYPE: {
- if (!sig->params [i]->data.klass->enumtype) {
- int size;
- int arg_type;
- int regs_used;
- int offset1;
- int size1;
- int offset2;
- int size2;
-
- arg_type = value_type_info(sig->params [i]->data.klass, &size, ®s_used, &offset1, &size1, &offset2, &size2);
-
- if (arg_type == ARG_IN_INT_REGS &&
- (next_int_arg_reg + regs_used) <= MAX_INT_ARG_REGS)
- {
- amd64_mov_reg_membase (p, int_arg_regs[next_int_arg_reg], AMD64_R10, arg_pos + offset1, size1);
- next_int_arg_reg++;
- if (regs_used > 1)
- {
- amd64_mov_reg_membase (p, int_arg_regs[next_int_arg_reg], AMD64_R10, arg_pos + offset2, size2);
- next_int_arg_reg++;
- }
- arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
- break;
- }
-
- if (arg_type == ARG_IN_FLOAT_REGS &&
- (next_float_arg_reg + regs_used) <= MAX_FLOAT_ARG_REGS)
- {
- if (size1 == 4)
- amd64_movss_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos + offset1);
- else
- amd64_movsd_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos + offset1);
- next_float_arg_reg++;
-
- if (regs_used > 1)
- {
- if (size2 == 4)
- amd64_movss_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos + offset2);
- else
- amd64_movsd_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos + offset2);
- next_float_arg_reg++;
- }
- arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
- break;
- }
-
- /* Structs in memory are handled in the next loop. */
- } else {
- /* it's an enum value */
- simpletype = sig->params [i]->data.klass->enum_basetype->type;
- goto enum_marshal;
- }
- break;
- }
- default:
- g_error ("Can't trampoline 0x%x", sig->params [i]->type);
- }
- }
-
- /* Handle stack arguments, pushing the rightmost argument first. */
- for (i = sig->param_count; i > 0; --i) {
- arg_pos = ARG_SIZE * (i - 1);
- if (sig->params [i - 1]->byref)
- simpletype = MONO_TYPE_PTR;
- else
- simpletype = sig->params [i - 1]->type;
-enum_marshal2:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_I8:
- case MONO_TYPE_U8:
- case MONO_TYPE_CLASS:
- if ((arg_in_reg_bitvector[(i - 1) >> 3] & (1 << ((i - 1) & 7))) == 0) {
- amd64_push_membase (p, AMD64_R10, arg_pos);
- }
- break;
- case MONO_TYPE_R4:
- if ((arg_in_reg_bitvector[(i - 1) >> 3] & (1 << ((i - 1) & 7))) == 0) {
- amd64_push_membase (p, AMD64_R10, arg_pos);
- }
- break;
- case MONO_TYPE_R8:
- if ((arg_in_reg_bitvector[(i - 1) >> 3] & (1 << ((i - 1) & 7))) == 0) {
- amd64_push_membase (p, AMD64_R10, arg_pos);
- }
- break;
- case MONO_TYPE_VALUETYPE:
- if (!sig->params [i - 1]->data.klass->enumtype) {
- if ((arg_in_reg_bitvector[(i - 1) >> 3] & (1 << ((i - 1) & 7))) == 0)
- {
- int ss = mono_class_native_size (sig->params [i - 1]->data.klass, NULL);
- ss += 7;
- ss &= ~7;
-
- amd64_alu_reg_imm(p, X86_SUB, AMD64_RSP, ss);
- /* Count register */
- amd64_mov_reg_imm(p, AMD64_RCX, ss);
- /* Source register */
- amd64_lea_membase(p, AMD64_RSI, AMD64_R10, arg_pos);
- /* Dest register */
- amd64_mov_reg_reg(p, AMD64_RDI, AMD64_RSP, 8);
-
- /* AMD64 calling convention guarantees direction flag is clear at call boundary. */
- x86_prefix(p, AMD64_REX(AMD64_REX_W));
- x86_prefix(p, X86_REP_PREFIX);
- x86_movsb(p);
- }
- } else {
- /* it's an enum value */
- simpletype = sig->params [i - 1]->data.klass->enum_basetype->type;
- goto enum_marshal2;
- }
- break;
- default:
- g_error ("Can't trampoline 0x%x", sig->params [i - 1]->type);
- }
- }
-
- /* TODO: Set RAL to number of XMM registers used in case this is a varags function? */
-
- /*
- * Insert call to function
- */
- amd64_call_reg (p, AMD64_R11);
-
- if (sig->ret->byref || string_ctor || !(retval_implicit || sig->ret->type == MONO_TYPE_VOID)) {
- amd64_mov_reg_membase(p, AMD64_RSI, AMD64_RBP, -8, SIZEOF_VOID_P);
- }
- /*
- * Handle retval.
- * Small integer and pointer values are in EAX.
- * Long integers are in EAX:EDX.
- * FP values are on the FP stack.
- */
-
- if (sig->ret->byref || string_ctor) {
- simpletype = MONO_TYPE_PTR;
- } else {
- simpletype = sig->ret->type;
- }
- enum_retvalue:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- amd64_mov_regp_reg (p, AMD64_RSI, X86_EAX, 1);
- break;
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- amd64_mov_regp_reg (p, AMD64_RSI, X86_EAX, 2);
- break;
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
- case MONO_TYPE_PTR:
- amd64_mov_regp_reg (p, AMD64_RSI, X86_EAX, 8);
- break;
- case MONO_TYPE_R4:
- amd64_movss_regp_reg (p, AMD64_RSI, AMD64_XMM0);
- break;
- case MONO_TYPE_R8:
- amd64_movsd_regp_reg (p, AMD64_RSI, AMD64_XMM0);
- break;
- case MONO_TYPE_I8:
- amd64_mov_regp_reg (p, AMD64_RSI, X86_EAX, 8);
- break;
- case MONO_TYPE_VALUETYPE: {
- int size;
- int arg_type;
- int regs_used;
- int offset1;
- int size1;
- int offset2;
- int size2;
-
- if (sig->ret->data.klass->enumtype) {
- simpletype = sig->ret->data.klass->enum_basetype->type;
- goto enum_retvalue;
- }
-
- arg_type = value_type_info(sig->params [i]->data.klass, &size, ®s_used, &offset1, &size1, &offset2, &size2);
-
- if (arg_type == ARG_IN_INT_REGS)
- {
- amd64_mov_membase_reg (p, AMD64_RSI, offset1, AMD64_RAX, size1);
- if (regs_used > 1)
- amd64_mov_membase_reg (p, AMD64_RSI, offset2, AMD64_RDX, size2);
- break;
- }
-
- if (arg_type == ARG_IN_FLOAT_REGS)
- {
- if (size1 == 4)
- amd64_movss_membase_reg (p, AMD64_RSI, offset1, AMD64_XMM0);
- else
- amd64_movsd_membase_reg (p, AMD64_RSI, offset1, AMD64_XMM0);
-
- if (regs_used > 1)
- {
- if (size2 == 4)
- amd64_movss_membase_reg (p, AMD64_RSI, offset2, AMD64_XMM1);
- else
- amd64_movsd_membase_reg (p, AMD64_RSI, offset2, AMD64_XMM1);
- }
- break;
- }
-
- /* Else result should have been stored in place already. */
- break;
- }
- case MONO_TYPE_VOID:
- break;
- default:
- g_error ("Can't handle as return value 0x%x", sig->ret->type);
- }
-
- /*
- * Standard epilog.
- */
- amd64_leave (p);
- amd64_ret (p);
-
- g_assert (p - code_buffer < code_size);
- res = (MonoPIFunc)g_memdup (code_buffer, p - code_buffer);
-
- g_hash_table_insert (cache, sig, res);
-
- return res;
-}
-
-/*
- * Returns a pointer to a native function that can be used to
- * call the specified method.
- * The function created will receive the arguments according
- * to the call convention specified in the method.
- * This function works by creating a MonoInvocation structure,
- * filling the fields in and calling ves_exec_method on it.
- * Still need to figure out how to handle the exception stuff
- * across the managed/unmanaged boundary.
- */
-void *
-mono_arch_create_method_pointer (MonoMethod *method)
-{
- MonoMethodSignature *sig;
- MonoJitInfo *ji;
- unsigned char *p, *code_buffer;
- guint32 simpletype;
- gint32 local_size;
- gint32 stackval_pos;
- gint32 mono_invocation_pos;
- int i, cpos;
- int *vtbuf;
- int *rbpoffsets;
- int int_arg_regs_used = 0;
- int float_arg_regs_used = 0;
- int stacked_args_size = 0; /* bytes of register passed arguments pushed on stack for safe keeping. Used to get alignment right. */
- int next_stack_arg_rbp_offset = 16;
- int retval_ptr_rbp_offset = 0;
- int this_reg = -1; /* Remember register this ptr is in. */
-
- /*
- * If it is a static P/Invoke method, we can just return the pointer
- * to the method implementation.
- */
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && ((MonoMethodPInvoke*) method)->addr) {
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = 1;
- ji->code_start = ((MonoMethodPInvoke*) method)->addr;
-
- mono_jit_info_table_add (mono_get_root_domain (), ji);
- return ((MonoMethodPInvoke*) method)->addr;
- }
-
- sig = method->signature;
-
- code_buffer = p = alloca (512); /* FIXME: check for overflows... */
- vtbuf = alloca (sizeof(int)*sig->param_count);
- rbpoffsets = alloca (sizeof(int)*sig->param_count);
-
-
- /*
- * Standard function prolog.
- */
- amd64_push_reg (p, AMD64_RBP);
- amd64_mov_reg_reg (p, AMD64_RBP, AMD64_RSP, 8);
-
- /* If there is an implicit return value pointer in the first args reg, save it now so
- * the result can be stored through the pointer at the end.
- */
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref && !sig->ret->data.klass->enumtype)
- {
- amd64_push_reg (p, int_arg_regs[int_arg_regs_used]);
- int_arg_regs_used++;
- stacked_args_size += 8;
- retval_ptr_rbp_offset = -stacked_args_size;
- }
-
- /*
- * If there is a this pointer, remember the number of the register it is in.
- */
- if (sig->hasthis) {
- this_reg = int_arg_regs[int_arg_regs_used++];
- }
-
- /* Put all arguments passed in registers on the stack.
- * Record offsets from RBP to each argument.
- */
- cpos = 0;
-
- for (i = 0; i < sig->param_count; i++) {
- if (sig->params [i]->byref)
- simpletype = MONO_TYPE_PTR;
- else
- simpletype = sig->params [i]->type;
-enum_calc_size:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_I8:
- if (int_arg_regs_used < MAX_INT_ARG_REGS) {
- amd64_push_reg (p, int_arg_regs[int_arg_regs_used]);
- int_arg_regs_used++;
- stacked_args_size += 8;
- rbpoffsets[i] = -stacked_args_size;
- }
- else
- {
- rbpoffsets[i] = next_stack_arg_rbp_offset;
- next_stack_arg_rbp_offset += 8;
- }
- break;
- case MONO_TYPE_VALUETYPE: {
- if (sig->params [i]->data.klass->enumtype) {
- simpletype = sig->params [i]->data.klass->enum_basetype->type;
- goto enum_calc_size;
- }
- else
- {
- int size;
- int arg_type;
- int regs_used;
- int offset1;
- int size1;
- int offset2;
- int size2;
-
- arg_type = value_type_info(sig->params [i]->data.klass, &size, ®s_used, &offset1, &size1, &offset2, &size2);
-
- if (arg_type == ARG_IN_INT_REGS &&
- (int_arg_regs_used + regs_used) <= MAX_INT_ARG_REGS)
- {
- amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, size);
- stacked_args_size += size;
- rbpoffsets[i] = stacked_args_size;
-
- amd64_mov_reg_membase (p, int_arg_regs[int_arg_regs_used], AMD64_RSP, offset1, size1);
- int_arg_regs_used++;
- if (regs_used > 1)
- {
- amd64_mov_reg_membase (p, int_arg_regs[int_arg_regs_used], AMD64_RSP, offset2, size2);
- int_arg_regs_used++;
- }
- break;
- }
-
- if (arg_type == ARG_IN_FLOAT_REGS &&
- (float_arg_regs_used + regs_used) <= MAX_FLOAT_ARG_REGS)
- {
- amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, size);
- stacked_args_size += size;
- rbpoffsets[i] = stacked_args_size;
-
- if (size1 == 4)
- amd64_movss_reg_membase (p, float_arg_regs_used, AMD64_RSP, offset1);
- else
- amd64_movsd_reg_membase (p, float_arg_regs_used, AMD64_RSP, offset1);
- float_arg_regs_used++;
-
- if (regs_used > 1)
- {
- if (size2 == 4)
- amd64_movss_reg_membase (p, float_arg_regs_used, AMD64_RSP, offset2);
- else
- amd64_movsd_reg_membase (p, float_arg_regs_used, AMD64_RSP, offset2);
- float_arg_regs_used++;
- }
- break;
- }
-
- rbpoffsets[i] = next_stack_arg_rbp_offset;
- next_stack_arg_rbp_offset += size;
- }
- break;
- }
- case MONO_TYPE_R4:
- if (float_arg_regs_used < MAX_FLOAT_ARG_REGS) {
- amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, 8);
- amd64_movss_regp_reg (p, AMD64_RSP, float_arg_regs_used);
- float_arg_regs_used++;
- stacked_args_size += 8;
- rbpoffsets[i] = -stacked_args_size;
- }
- else
- {
- rbpoffsets[i] = next_stack_arg_rbp_offset;
- next_stack_arg_rbp_offset += 8;
- }
- break;
- case MONO_TYPE_R8:
- stacked_args_size += 8;
- if (float_arg_regs_used < MAX_FLOAT_ARG_REGS) {
- amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, 8);
- amd64_movsd_regp_reg (p, AMD64_RSP, float_arg_regs_used);
- float_arg_regs_used++;
- stacked_args_size += 8;
- rbpoffsets[i] = -stacked_args_size;
- }
- else
- {
- rbpoffsets[i] = next_stack_arg_rbp_offset;
- next_stack_arg_rbp_offset += 8;
- }
- break;
- default:
- g_error ("Can't trampoline 0x%x", sig->params [i]->type);
- }
- }
-
- local_size = sizeof (MonoInvocation) + sizeof (stackval) * (sig->param_count + 1) + stacked_args_size;
-
- local_size += 15;
- local_size &= ~15;
-
- stackval_pos = -local_size;
- mono_invocation_pos = stackval_pos + sizeof (stackval) * (sig->param_count + 1);
-
- /* stacked_args_size has already been pushed onto the stack. Make room for the rest of it. */
- amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, local_size - stacked_args_size);
-
- /* Be careful not to trash any arg regs before saving this_reg to MonoInvocation structure below. */
-
- /*
- * Initialize MonoInvocation fields, first the ones known now.
- */
- amd64_alu_reg_reg (p, X86_XOR, AMD64_RAX, AMD64_RAX);
- amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, ex)), AMD64_RAX, SIZEOF_VOID_P);
- amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, ex_handler)), AMD64_RAX, SIZEOF_VOID_P);
- amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, parent)), AMD64_RAX, SIZEOF_VOID_P);
- /*
- * Set the method pointer.
- */
- amd64_mov_membase_imm (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, method)), (long)method, SIZEOF_VOID_P);
-
- /*
- * Handle this.
- */
- if (sig->hasthis)
- amd64_mov_membase_reg(p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, obj)), this_reg, SIZEOF_VOID_P);
-
- /*
- * Handle the arguments. stackval_pos is the offset from RBP of the stackval in the MonoInvocation args array .
- * arg_pos is the offset from RBP to the incoming arg on the stack.
- * We just call stackval_from_data to handle all the (nasty) issues....
- */
- amd64_lea_membase (p, AMD64_RAX, AMD64_RBP, stackval_pos);
- amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, stack_args)), AMD64_RAX, SIZEOF_VOID_P);
- for (i = 0; i < sig->param_count; ++i) {
-/* Need to call stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke); */
- amd64_mov_reg_imm (p, AMD64_R11, stackval_from_data);
- amd64_mov_reg_imm (p, int_arg_regs[0], sig->params[i]);
- amd64_lea_membase (p, int_arg_regs[1], AMD64_RBP, stackval_pos);
- amd64_lea_membase (p, int_arg_regs[2], AMD64_RBP, rbpoffsets[i]);
- amd64_mov_reg_imm (p, int_arg_regs[3], sig->pinvoke);
- amd64_call_reg (p, AMD64_R11);
- stackval_pos += sizeof (stackval);
-#if 0
- /* fixme: alignment */
- if (sig->pinvoke)
- arg_pos += mono_type_native_stack_size (sig->params [i], &align);
- else
- arg_pos += mono_type_stack_size (sig->params [i], &align);
-#endif
- }
-
- /*
- * Handle the return value storage area.
- */
- amd64_lea_membase (p, AMD64_RAX, AMD64_RBP, stackval_pos);
- amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, retval)), AMD64_RAX, SIZEOF_VOID_P);
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
- MonoClass *klass = sig->ret->data.klass;
- if (!klass->enumtype) {
- amd64_mov_reg_membase (p, AMD64_RCX, AMD64_RBP, retval_ptr_rbp_offset, SIZEOF_VOID_P);
- amd64_mov_membase_reg (p, AMD64_RBP, stackval_pos, AMD64_RCX, SIZEOF_VOID_P);
- }
- }
-
- /*
- * Call the method.
- */
- amd64_lea_membase (p, int_arg_regs[0], AMD64_RBP, mono_invocation_pos);
- amd64_mov_reg_imm (p, AMD64_R11, ves_exec_method);
- amd64_call_reg (p, AMD64_R11);
-
- /*
- * Move the return value to the proper place.
- */
- amd64_lea_membase (p, AMD64_RAX, AMD64_RBP, stackval_pos);
- if (sig->ret->byref) {
- amd64_mov_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, SIZEOF_VOID_P);
- } else {
- int simpletype = sig->ret->type;
- enum_retvalue:
- switch (sig->ret->type) {
- case MONO_TYPE_VOID:
- break;
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- amd64_movzx_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 1);
- break;
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- amd64_movzx_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 2);
- break;
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- amd64_movzx_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 4);
- break;
- case MONO_TYPE_I8:
- amd64_movzx_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 8);
- break;
- case MONO_TYPE_R4:
- amd64_movss_regp_reg (p, AMD64_RAX, AMD64_XMM0);
- break;
- case MONO_TYPE_R8:
- amd64_movsd_regp_reg (p, AMD64_RAX, AMD64_XMM0);
- break;
- case MONO_TYPE_VALUETYPE: {
- int size;
- int arg_type;
- int regs_used;
- int offset1;
- int size1;
- int offset2;
- int size2;
-
- if (sig->ret->data.klass->enumtype) {
- simpletype = sig->ret->data.klass->enum_basetype->type;
- goto enum_retvalue;
- }
-
- arg_type = value_type_info(sig->params [i]->data.klass, &size, ®s_used, &offset1, &size1, &offset2, &size2);
-
- if (arg_type == ARG_IN_INT_REGS)
- {
- if (regs_used > 1)
- amd64_mov_membase_reg (p, AMD64_RAX, offset2, AMD64_RDX, size2);
- amd64_mov_membase_reg (p, AMD64_RAX, offset1, AMD64_RAX, size1);
- break;
- }
-
- if (arg_type == ARG_IN_FLOAT_REGS)
- {
- if (size1 == 4)
- amd64_movss_membase_reg (p, AMD64_RAX, offset1, AMD64_XMM0);
- else
- amd64_movsd_membase_reg (p, AMD64_RAX, offset1, AMD64_XMM0);
-
- if (regs_used > 1)
- {
- if (size2 == 4)
- amd64_movss_membase_reg (p, AMD64_RAX, offset2, AMD64_XMM1);
- else
- amd64_movsd_membase_reg (p, AMD64_RAX, offset2, AMD64_XMM1);
- }
- break;
- }
-
- /* Else result should have been stored in place already. IA32 code has a stackval_to_data call here, which
- * looks wrong to me as the pointer in the stack val being converted is setup to point to the output area anyway.
- * It all looks a bit suspect anyway.
- */
- break;
- }
- default:
- g_error ("Type 0x%x not handled yet in thunk creation", sig->ret->type);
- break;
- }
- }
-
- /*
- * Standard epilog.
- */
- amd64_leave (p);
- amd64_ret (p);
-
- g_assert (p - code_buffer < 512);
-
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = p - code_buffer;
- ji->code_start = g_memdup (code_buffer, p - code_buffer);
-
- mono_jit_info_table_add (mono_get_root_domain (), ji);
-
- return ji->code_start;
-}
-if INTERP_SUPPORTED
-
-AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
-
-noinst_LTLIBRARIES = libmonoarch-ppc.la
-
-libmonoarch_ppc_la_SOURCES = tramp.c ppc-codegen.h
-
-noinst_PROGRAMS = test
-
-endif
+EXTRA_DIST = ppc-codegen.h
\ No newline at end of file
+++ /dev/null
-#include "ppc-codegen.h"
-#include <stdio.h>
-
-/* don't run the resulting program, it will destroy your computer,
- * just objdump -d it to inspect we generated the correct assembler.
- * On Mac OS X use otool[64] -v -t
- */
-
-int main() {
- guint8 code [16000];
- guint8 *p = code;
- guint8 *cp;
-
- printf (".text\n.align 4\n.globl main\n");
-#ifndef __APPLE__
- printf (".type main,@function\n");
-#endif
- printf ("main:\n");
-
- ppc_stwu (p, ppc_r1, -32, ppc_r1);
- ppc_mflr (p, ppc_r0);
- ppc_stw (p, ppc_r31, 28, ppc_r1);
- ppc_or (p, ppc_r1, ppc_r2, ppc_r3);
- ppc_mr (p, ppc_r31, ppc_r1);
- ppc_lwz (p, ppc_r11, 0, ppc_r1);
- ppc_mtlr (p, ppc_r0);
- ppc_blr (p);
- ppc_addi (p, ppc_r6, ppc_r6, 16);
-
- for (cp = code; cp < p; cp++) {
- printf (".byte 0x%x\n", *cp);
- }
-
- return 0;
-}
+++ /dev/null
-/*
- * Create trampolines to invoke arbitrary functions.
- *
- * Copyright (C) Radek Doulik
- *
- */
-
-#include "config.h"
-#include <stdlib.h>
-#include <string.h>
-#include "ppc-codegen.h"
-#include "mono/metadata/class.h"
-#include "mono/metadata/tabledefs.h"
-#include "mono/interpreter/interp.h"
-#include "mono/metadata/appdomain.h"
-
-#ifdef NEED_MPROTECT
-#include <sys/mman.h>
-#include <limits.h> /* for PAGESIZE */
-#ifndef PAGESIZE
-#define PAGESIZE 4096
-#endif
-#endif
-
-#define DEBUG(x)
-
-/* gpointer
-fake_func (gpointer (*callme)(gpointer), stackval *retval, void *this_obj, stackval *arguments)
-{
- guint32 i = 0xc002becd;
-
- callme = (gpointer) 0x100fabcd;
-
- *(gpointer*)retval = (gpointer)(*callme) (arguments [0].data.p, arguments [1].data.p, arguments [2].data.p);
- *(gdouble*) retval = (gdouble)(*callme) (arguments [0].data.f);
-
- return (gpointer) (*callme) (((MonoType *)arguments [0]. data.p)->data.klass);
-} */
-
-#define MIN_CACHE_LINE 8
-
-static void inline
-flush_icache (guint8 *code, guint size)
-{
- guint i;
- guint8 *p;
-
- p = code;
- for (i = 0; i < size; i += MIN_CACHE_LINE, p += MIN_CACHE_LINE) {
- asm ("dcbst 0,%0;" : : "r"(p) : "memory");
- }
- asm ("sync");
- p = code;
- for (i = 0; i < size; i += MIN_CACHE_LINE, p += MIN_CACHE_LINE) {
- asm ("icbi 0,%0; sync;" : : "r"(p) : "memory");
- }
- asm ("sync");
- asm ("isync");
-}
-
-static void
-disassemble (guint8 *code, int size)
-{
- int i;
- FILE *ofd;
- const char *tmp = g_getenv("TMP");
- char *as_file;
- char *o_file;
- char *cmd;
-
- if (tmp == NULL)
- tmp = "/tmp";
- as_file = g_strdup_printf ("%s/test.s", tmp);
-
- if (!(ofd = fopen (as_file, "w")))
- g_assert_not_reached ();
-
- fprintf (ofd, "tmp:\n");
-
- for (i = 0; i < size; ++i)
- fprintf (ofd, ".byte %d\n", (unsigned int) code [i]);
-
- fclose (ofd);
-#ifdef __APPLE__
-#define DIS_CMD "otool -V -v -t"
-#else
-#define DIS_CMD "objdump -d"
-#endif
- o_file = g_strdup_printf ("%s/test.o", tmp);
- cmd = g_strdup_printf ("as %s -o %s", as_file, o_file);
- system (cmd);
- g_free (cmd);
- cmd = g_strdup_printf (DIS_CMD " %s", o_file);
- system (cmd);
- g_free (cmd);
- g_free (o_file);
- g_free (as_file);
-}
-
-
-#define NOT_IMPLEMENTED(x) \
- g_error ("FIXME: %s is not yet implemented. (trampoline)", x);
-
-#define PROLOG_INS 8
-#define CALL_INS 2
-#define EPILOG_INS 6
-#define FLOAT_REGS 8
-#define GENERAL_REGS 8
-#ifdef __APPLE__
-#define MINIMAL_STACK_SIZE 10
-#define ALWAYS_ON_STACK(s) s
-#define FP_ALSO_IN_REG(s) s
-#define RET_ADDR_OFFSET 8
-#define STACK_PARAM_OFFSET 24
-#else
-#define MINIMAL_STACK_SIZE 5
-#define ALWAYS_ON_STACK(s)
-#define FP_ALSO_IN_REG(s) s
-#define ALIGN_DOUBLES
-#define RET_ADDR_OFFSET 4
-#define STACK_PARAM_OFFSET 8
-#endif
-
-static void inline
-add_general (guint *gr, guint *stack_size, guint *code_size, gboolean simple)
-{
- if (simple) {
- if (*gr >= GENERAL_REGS) {
- *stack_size += 4;
- *code_size += 8; /* load from stack, save on stack */
- } else {
- ALWAYS_ON_STACK (*stack_size += 4);
- *code_size += 4; /* load from stack */
- }
- } else {
- if (*gr >= GENERAL_REGS - 1) {
- *stack_size += 8;
-#ifdef ALIGN_DOUBLES
- *stack_size += (*stack_size % 8);
-#endif
- *code_size += 16; /* 2x load from stack, 2x save to stack */
- } else {
- ALWAYS_ON_STACK (*stack_size += 8);
- *code_size += 8; /* 2x load from stack */
- }
-#ifdef ALIGN_DOUBLES
- if ((*gr) & 1)
- (*gr) ++;
-#endif
- (*gr) ++;
- }
- (*gr) ++;
-}
-
-static void inline
-calculate_sizes (MonoMethodSignature *sig, guint *stack_size, guint *code_size, gboolean string_ctor, gboolean *use_memcpy)
-{
- guint i, fr, gr;
- guint32 simpletype;
-
- fr = gr = 0;
- *stack_size = MINIMAL_STACK_SIZE*4;
- *code_size = (PROLOG_INS + CALL_INS + EPILOG_INS)*4;
-
- if (sig->hasthis) {
- add_general (&gr, stack_size, code_size, TRUE);
- }
- DEBUG(printf("params: %d\n", sig->param_count));
- for (i = 0; i < sig->param_count; ++i) {
- DEBUG(printf("param %d: ", i));
- if (sig->params [i]->byref) {
- DEBUG(printf("byref\n"));
- add_general (&gr, stack_size, code_size, TRUE);
- continue;
- }
- simpletype = sig->params [i]->type;
- enum_calc_size:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- add_general (&gr, stack_size, code_size, TRUE);
- break;
- case MONO_TYPE_SZARRAY:
- add_general (&gr, stack_size, code_size, TRUE);
- *code_size += 4;
- break;
- case MONO_TYPE_VALUETYPE: {
- gint size;
- if (sig->params [i]->data.klass->enumtype) {
- simpletype = sig->params [i]->data.klass->enum_basetype->type;
- goto enum_calc_size;
- }
- size = mono_class_value_size (sig->params [i]->data.klass, NULL);
- if (size != 4) {
- DEBUG(printf ("copy %d bytes struct on stack\n",
- mono_class_value_size (sig->params [i]->data.klass, NULL)));
- *use_memcpy = TRUE;
- *code_size += 8*4;
- *stack_size += (size + 3) & (~3);
- if (gr > GENERAL_REGS) {
- *code_size += 4;
- *stack_size += 4;
- }
- } else {
- DEBUG(printf ("load %d bytes struct\n",
- mono_class_value_size (sig->params [i]->data.klass, NULL)));
- add_general (&gr, stack_size, code_size, TRUE);
- *code_size += 4;
- }
- break;
- }
- case MONO_TYPE_I8:
- add_general (&gr, stack_size, code_size, FALSE);
- break;
- case MONO_TYPE_R4:
- if (fr < 7) {
- *code_size += 4;
- fr ++;
- FP_ALSO_IN_REG (gr ++);
- ALWAYS_ON_STACK (*stack_size += 4);
- } else {
- NOT_IMPLEMENTED ("R4 arg");
- }
- break;
- case MONO_TYPE_R8:
- if (fr < 7) {
- *code_size += 4;
- fr ++;
- FP_ALSO_IN_REG (gr += 2);
- ALWAYS_ON_STACK (*stack_size += 8);
- } else {
- NOT_IMPLEMENTED ("R8 arg");
- }
- break;
- default:
- g_error ("Can't trampoline 0x%x", sig->params [i]->type);
- }
- }
-
- if (sig->ret->byref || string_ctor) {
- *code_size += 8;
- } else {
- simpletype = sig->ret->type;
-enum_retvalue:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_R4:
- case MONO_TYPE_R8:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
- *code_size += 8;
- break;
- case MONO_TYPE_I8:
- *code_size += 12;
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->ret->data.klass->enumtype) {
- simpletype = sig->ret->data.klass->enum_basetype->type;
- goto enum_retvalue;
- }
- *code_size += 2*4;
- break;
- case MONO_TYPE_VOID:
- break;
- default:
- g_error ("Can't handle as return value 0x%x", sig->ret->type);
- }
- }
-
- if (*use_memcpy) {
- *stack_size += 2*4; /* for r14, r15 */
- *code_size += 6*4;
- if (sig->hasthis) {
- *stack_size += 4; /* for r16 */
- *code_size += 4;
- }
- }
-
- /* align stack size to 16 */
- DEBUG (printf (" stack size: %d (%d)\n code size: %d\n", (*stack_size + 15) & ~15, *stack_size, *code_size));
- *stack_size = (*stack_size + 15) & ~15;
-}
-
-static inline guint8 *
-emit_prolog (guint8 *p, MonoMethodSignature *sig, guint stack_size)
-{
- /* function prolog */
- ppc_stwu (p, ppc_r1, -stack_size, ppc_r1); /* sp <--- sp - stack_size, sp[0] <---- sp save sp, alloc stack */
- ppc_mflr (p, ppc_r0); /* r0 <--- LR */
- ppc_stw (p, ppc_r31, stack_size - 4, ppc_r1); /* sp[+4] <--- r31 save r31 */
- ppc_stw (p, ppc_r0, stack_size + RET_ADDR_OFFSET, ppc_r1); /* sp[-4] <--- LR save return address for "callme" */
- ppc_mr (p, ppc_r31, ppc_r1); /* r31 <--- sp */
-
- return p;
-}
-
-#define ARG_BASE ppc_r12
-#define ARG_SIZE sizeof (stackval)
-#define SAVE_4_IN_GENERIC_REGISTER \
- if (gr < GENERAL_REGS) { \
- ppc_lwz (p, ppc_r3 + gr, i*ARG_SIZE, ARG_BASE); \
- gr ++; \
- ALWAYS_ON_STACK (stack_par_pos += 4); \
- } else { \
- ppc_lwz (p, ppc_r11, i*ARG_SIZE, ARG_BASE); \
- ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1); \
- stack_par_pos += 4; \
- }
-#define SAVE_4_VAL_IN_GENERIC_REGISTER \
- if (gr < GENERAL_REGS) { \
- ppc_lwz (p, ppc_r3 + gr, i*ARG_SIZE, ARG_BASE); \
- ppc_lwz (p, ppc_r3 + gr, 0, ppc_r3 + gr); \
- gr ++; \
- ALWAYS_ON_STACK (stack_par_pos += 4); \
- } else { \
- ppc_lwz (p, ppc_r11, i*ARG_SIZE, ARG_BASE); \
- ppc_lwz (p, ppc_r11, 0, ppc_r11); \
- ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1); \
- stack_par_pos += 4; \
- }
-
-inline static guint8*
-emit_save_parameters (guint8 *p, MonoMethodSignature *sig, guint stack_size, gboolean use_memcpy)
-{
- guint i, fr, gr, stack_par_pos, struct_pos, cur_struct_pos;
- guint32 simpletype;
-
- fr = gr = 0;
- stack_par_pos = STACK_PARAM_OFFSET;
-
- ppc_stw (p, ppc_r4, stack_size - 12, ppc_r31); /* preserve "retval", sp[+8] */
-
- if (use_memcpy) {
- ppc_stw (p, ppc_r14, stack_size - 16, ppc_r31); /* save r14 */
- ppc_stw (p, ppc_r15, stack_size - 20, ppc_r31); /* save r15 */
- ppc_mr (p, ppc_r14, ppc_r3); /* keep "callme" in register */
- ppc_mr (p, ppc_r15, ppc_r6); /* keep "arguments" in register */
- } else {
- ppc_mr (p, ppc_r12, ppc_r6); /* keep "arguments" in register */
- ppc_mr (p, ppc_r0, ppc_r3); /* keep "callme" in register */
- }
-
- if (sig->hasthis) {
- if (use_memcpy) {
- ppc_stw (p, ppc_r16, stack_size - 24, ppc_r31); /* save r16 */
- ppc_mr (p, ppc_r16, ppc_r5);
- } else
- ppc_mr (p, ppc_r3, ppc_r5);
- gr ++;
- ALWAYS_ON_STACK (stack_par_pos += 4);
- }
-
- if (use_memcpy) {
- cur_struct_pos = struct_pos = stack_par_pos;
- for (i = 0; i < sig->param_count; ++i) {
- if (sig->params [i]->byref)
- continue;
- if (sig->params [i]->type == MONO_TYPE_VALUETYPE && !sig->params [i]->data.klass->enumtype) {
- gint size;
-
- size = mono_class_value_size (sig->params [i]->data.klass, NULL);
- if (size != 4) {
- /* call memcpy */
- ppc_addi (p, ppc_r3, ppc_r1, stack_par_pos);
- ppc_lwz (p, ppc_r4, i*16, ppc_r15);
- /* FIXME check if size > 0xffff */
- ppc_li (p, ppc_r5, size & 0xffff);
- ppc_lis (p, ppc_r0, (guint32) memcpy >> 16);
- ppc_ori (p, ppc_r0, ppc_r0, (guint32) memcpy & 0xffff);
- ppc_mtlr (p, ppc_r0);
- ppc_blrl (p);
- stack_par_pos += (size + 3) & (~3);
- }
- }
- }
-
- if (sig->hasthis) {
- ppc_mr (p, ppc_r3, ppc_r16);
- ppc_lwz (p, ppc_r16, stack_size - 24, ppc_r31); /* restore r16 */
- }
- ppc_mr (p, ppc_r0, ppc_r14);
- ppc_mr (p, ppc_r12, ppc_r15);
- ppc_lwz (p, ppc_r14, stack_size - 16, ppc_r31); /* restore r14 */
- ppc_lwz (p, ppc_r15, stack_size - 20, ppc_r31); /* restore r15 */
- }
-
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
- MonoClass *klass = sig->ret->data.klass;
- if (!klass->enumtype) {
- gint size = mono_class_native_size (klass, NULL);
-
- DEBUG(printf ("retval value type size: %d\n", size));
- if (size > 8) {
- ppc_lwz (p, ppc_r3, stack_size - 12, ppc_r31);
- ppc_lwz (p, ppc_r3, 0, ppc_r3);
- gr ++;
- ALWAYS_ON_STACK (stack_par_pos += 4);
- } else {
- NOT_IMPLEMENTED ("retval valuetype <= 8 bytes");
- }
- }
- }
-
- for (i = 0; i < sig->param_count; ++i) {
- if (sig->params [i]->byref) {
- SAVE_4_IN_GENERIC_REGISTER;
- continue;
- }
- simpletype = sig->params [i]->type;
- enum_calc_size:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- SAVE_4_IN_GENERIC_REGISTER;
- break;
- case MONO_TYPE_VALUETYPE: {
- gint size;
- if (sig->params [i]->data.klass->enumtype) {
- simpletype = sig->params [i]->data.klass->enum_basetype->type;
- goto enum_calc_size;
- }
- size = mono_class_value_size (sig->params [i]->data.klass, NULL);
- if (size == 4) {
- SAVE_4_VAL_IN_GENERIC_REGISTER;
- } else {
- if (gr < GENERAL_REGS) {
- ppc_addi (p, ppc_r3 + gr, ppc_r1, cur_struct_pos);
- gr ++;
- } else {
- ppc_lwz (p, ppc_r11, cur_struct_pos, ppc_r1);
- ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1);
- stack_par_pos += 4;
- }
- cur_struct_pos += (size + 3) & (~3);
- }
- break;
- }
- case MONO_TYPE_I8:
-DEBUG(printf("Mono_Type_i8. gr = %d, arg_base = %d\n", gr, ARG_BASE));
-#ifdef ALIGN_DOUBLES
- if (gr & 1)
- gr++;
-#endif
- if (gr < 7) {
- ppc_lwz (p, ppc_r3 + gr, i*ARG_SIZE, ARG_BASE);
- ppc_lwz (p, ppc_r3 + gr + 1, i*ARG_SIZE + 4, ARG_BASE);
- ALWAYS_ON_STACK (stack_par_pos += 8);
- } else if (gr == 7) {
- ppc_lwz (p, ppc_r3 + gr, i*ARG_SIZE, ARG_BASE);
- ppc_lwz (p, ppc_r11, i*ARG_SIZE + 4, ARG_BASE);
- ppc_stw (p, ppc_r11, stack_par_pos + 4, ppc_r1);
- stack_par_pos += 8;
- } else {
- ppc_lwz (p, ppc_r11, i*ARG_SIZE, ARG_BASE);
- ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1);
- ppc_lwz (p, ppc_r11, i*ARG_SIZE + 4, ARG_BASE);
- ppc_stw (p, ppc_r11, stack_par_pos + 4, ppc_r1);
- stack_par_pos += 8;
- }
- gr += 2;
- break;
- case MONO_TYPE_R4:
- if (fr < 7) {
- ppc_lfs (p, ppc_f1 + fr, i*ARG_SIZE, ARG_BASE);
- fr ++;
- FP_ALSO_IN_REG (gr ++);
- ALWAYS_ON_STACK (stack_par_pos += 4);
- } else {
- NOT_IMPLEMENTED ("r4 on stack");
- }
- break;
- case MONO_TYPE_R8:
- if (fr < 7) {
- ppc_lfd (p, ppc_f1 + fr, i*ARG_SIZE, ARG_BASE);
- fr ++;
- FP_ALSO_IN_REG (gr += 2);
- ALWAYS_ON_STACK (stack_par_pos += 8);
- } else {
- NOT_IMPLEMENTED ("r8 on stack");
- }
- break;
- default:
- g_error ("Can't trampoline 0x%x", sig->params [i]->type);
- }
- }
-
- return p;
-}
-
-static inline guint8 *
-alloc_code_memory (guint code_size)
-{
- guint8 *p;
-
-#ifdef NEED_MPROTECT
- p = g_malloc (code_size + PAGESIZE - 1);
-
- /* Align to a multiple of PAGESIZE, assumed to be a power of two */
- p = (char *)(((int) p + PAGESIZE-1) & ~(PAGESIZE-1));
-#else
- p = g_malloc (code_size);
-#endif
- DEBUG (printf (" align: %p (%d)\n", p, (guint)p % 4));
-
- return p;
-}
-
-/* static MonoString*
-mono_string_new_wrapper (const char *text)
-{
- return text ? mono_string_new (mono_domain_get (), text) : NULL;
-} */
-
-static inline guint8 *
-emit_call_and_store_retval (guint8 *p, MonoMethodSignature *sig, guint stack_size, gboolean string_ctor)
-{
- guint32 simpletype;
-
- /* call "callme" */
- ppc_mtlr (p, ppc_r0);
- ppc_blrl (p);
-
- /* get return value */
- if (sig->ret->byref || string_ctor) {
- ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
- ppc_stw (p, ppc_r3, 0, ppc_r9); /* save return value (r3) to "retval" */
- } else {
- simpletype = sig->ret->type;
-enum_retvalue:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
- ppc_stb (p, ppc_r3, 0, ppc_r9); /* save return value (r3) to "retval" */
- break;
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
- ppc_sth (p, ppc_r3, 0, ppc_r9); /* save return value (r3) to "retval" */
- break;
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_STRING:
- ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
- ppc_stw (p, ppc_r3, 0, ppc_r9); /* save return value (r3) to "retval" */
- break;
- case MONO_TYPE_R4:
- ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
- ppc_stfs (p, ppc_f1, 0, ppc_r9); /* save return value (f1) to "retval" */
- break;
- case MONO_TYPE_R8:
- ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
- ppc_stfd (p, ppc_f1, 0, ppc_r9); /* save return value (f1) to "retval" */
- break;
- case MONO_TYPE_I8:
- ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
- ppc_stw (p, ppc_r3, 0, ppc_r9); /* save return value (r3) to "retval" */
- ppc_stw (p, ppc_r4, 4, ppc_r9); /* save return value (r3) to "retval" */
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->ret->data.klass->enumtype) {
- simpletype = sig->ret->data.klass->enum_basetype->type;
- goto enum_retvalue;
- }
- break;
- case MONO_TYPE_VOID:
- break;
- default:
- g_error ("Can't handle as return value 0x%x", sig->ret->type);
- }
- }
-
- return p;
-}
-
-static inline guint8 *
-emit_epilog (guint8 *p, MonoMethodSignature *sig, guint stack_size)
-{
- /* function epilog */
- ppc_lwz (p, ppc_r11, 0, ppc_r1); /* r11 <--- sp[0] load backchain from caller's function */
- ppc_lwz (p, ppc_r0, RET_ADDR_OFFSET, ppc_r11); /* r0 <--- r11[4] load return address */
- ppc_mtlr (p, ppc_r0); /* LR <--- r0 set return address */
- ppc_lwz (p, ppc_r31, -4, ppc_r11); /* r31 <--- r11[-4] restore r31 */
- ppc_mr (p, ppc_r1, ppc_r11); /* sp <--- r11 restore stack */
- ppc_blr (p); /* return */
-
- return p;
-}
-
-MonoPIFunc
-mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
-{
- guint8 *p, *code_buffer;
- guint stack_size, code_size;
- gboolean use_memcpy = FALSE;
-
- DEBUG (printf ("\nPInvoke [start emiting]\n"));
- calculate_sizes (sig, &stack_size, &code_size, string_ctor, &use_memcpy);
-
- p = code_buffer = alloc_code_memory (code_size);
- p = emit_prolog (p, sig, stack_size);
- p = emit_save_parameters (p, sig, stack_size, use_memcpy);
- p = emit_call_and_store_retval (p, sig, stack_size, string_ctor);
- p = emit_epilog (p, sig, stack_size);
-
- /* {
- guchar *cp;
- printf (".text\n.align 4\n.globl main\n.type main,@function\nmain:\n");
- for (cp = code_buffer; cp < p; cp++) {
- printf (".byte 0x%x\n", *cp);
- }
- } */
-
-#ifdef NEED_MPROTECT
- if (mprotect (code_buffer, 1024, PROT_READ | PROT_WRITE | PROT_EXEC)) {
- g_error ("Cannot mprotect trampoline\n");
- }
-#endif
-
- DEBUG (printf ("emited code size: %d\n", p - code_buffer));
- flush_icache (code_buffer, p - code_buffer);
-
- DEBUG (printf ("PInvoke [end emiting]\n"));
-
- return (MonoPIFunc) code_buffer;
- /* return fake_func; */
-}
-
-
-#ifdef __APPLE__
-#define MINV_POS 40 /* MonoInvocation structure offset on stack - STACK_PARAM_OFFSET + 4 pointer args for stackval_from_data */
-#else
-#define MINV_POS 8 /* MonoInvocation structure offset on stack */
-#endif
-#define STACK_POS (MINV_POS - sizeof (stackval) * sig->param_count)
-#define OBJ_POS 8
-#define TYPE_OFFSET (G_STRUCT_OFFSET (stackval, type))
-
-/*
- * Returns a pointer to a native function that can be used to
- * call the specified method.
- * The function created will receive the arguments according
- * to the call convention specified in the method.
- * This function works by creating a MonoInvocation structure,
- * filling the fields in and calling ves_exec_method on it.
- * Still need to figure out how to handle the exception stuff
- * across the managed/unmanaged boundary.
- */
-void *
-mono_arch_create_method_pointer (MonoMethod *method)
-{
- MonoMethodSignature *sig;
- MonoJitInfo *ji;
- guint8 *p, *code_buffer;
- guint i, align = 0, code_size, stack_size, stackval_arg_pos, local_pos, local_start, reg_param = 0, stack_param,
- cpos, vt_cur;
- gint *vtbuf;
- guint32 simpletype;
-
- code_size = 1024;
- stack_size = 1024;
- stack_param = 0;
-
- sig = mono_method_signature (method);
-
- p = code_buffer = g_malloc (code_size);
-
- DEBUG (printf ("\nDelegate [start emiting] %s\n", mono_method_get_name (method)));
-
- /* prolog */
- ppc_stwu (p, ppc_r1, -stack_size, ppc_r1); /* sp <--- sp - stack_size, sp[0] <---- sp save sp, alloc stack */
- ppc_mflr (p, ppc_r0); /* r0 <--- LR */
- ppc_stw (p, ppc_r31, stack_size - 4, ppc_r1); /* sp[+4] <--- r31 save r31 */
- ppc_stw (p, ppc_r0, stack_size + RET_ADDR_OFFSET, ppc_r1); /* sp[-4] <--- LR save return address for "callme" */
- ppc_mr (p, ppc_r31, ppc_r1); /* r31 <--- sp */
-
- /* let's fill MonoInvocation */
- /* first zero some fields */
- ppc_li (p, ppc_r0, 0);
- ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex)), ppc_r31);
- ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler)), ppc_r31);
- ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, parent)), ppc_r31);
-
- /* set method pointer */
- ppc_lis (p, ppc_r0, (guint32) method >> 16);
- ppc_ori (p, ppc_r0, ppc_r0, (guint32) method & 0xffff);
- ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, method)), ppc_r31);
-
- local_start = local_pos = MINV_POS + sizeof (MonoInvocation) + (sig->param_count + 1) * sizeof (stackval);
-
- if (sig->hasthis) {
- ppc_stw (p, ppc_r3, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)), ppc_r31);
- reg_param = 1;
- }
-
- if (sig->param_count) {
- gint save_count = MIN (8, sig->param_count + sig->hasthis);
- for (i = reg_param; i < save_count; i ++) {
- ppc_stw (p, ppc_r3 + i, local_pos, ppc_r31);
- local_pos += 4;
- DEBUG (printf ("save r%d\n", 4 + i));
- }
- }
-
- /* prepare space for valuetypes */
- vt_cur = local_pos;
- vtbuf = alloca (sizeof(int)*sig->param_count);
- cpos = 0;
- for (i = 0; i < sig->param_count; i++) {
- MonoType *type = sig->params [i];
- vtbuf [i] = -1;
- if (type->type == MONO_TYPE_VALUETYPE) {
- MonoClass *klass = type->data.klass;
- gint size;
-
- if (klass->enumtype)
- continue;
- size = mono_class_native_size (klass, &align);
- cpos += align - 1;
- cpos &= ~(align - 1);
- vtbuf [i] = cpos;
- cpos += size;
- }
- }
- cpos += 3;
- cpos &= ~3;
-
- local_pos += cpos;
-
- /* set MonoInvocation::stack_args */
- stackval_arg_pos = MINV_POS + sizeof (MonoInvocation);
- ppc_addi (p, ppc_r0, ppc_r31, stackval_arg_pos);
- ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, stack_args)), ppc_r31);
-
- /* add stackval arguments */
- for (i = 0; i < sig->param_count; ++i) {
- if (reg_param < 8) {
- ppc_addi (p, ppc_r5, ppc_r31, local_start + i*4);
- reg_param ++;
- } else {
- ppc_addi (p, ppc_r5, stack_size + 8 + stack_param, ppc_r31);
- stack_param ++;
- }
- ppc_lis (p, ppc_r3, (guint32) sig->params [i] >> 16);
-
- if (vtbuf [i] >= 0) {
- ppc_addi (p, ppc_r4, ppc_r31, vt_cur);
- ppc_stw (p, ppc_r4, stackval_arg_pos, ppc_r31);
- ppc_addi (p, ppc_r4, ppc_r31, stackval_arg_pos);
- ppc_lwz (p, ppc_r5, 0, ppc_r5);
- vt_cur += vtbuf [i];
- } else {
- ppc_addi (p, ppc_r4, ppc_r31, stackval_arg_pos);
- }
- ppc_ori (p, ppc_r3, ppc_r3, (guint32) sig->params [i] & 0xffff);
- ppc_lis (p, ppc_r0, (guint32) stackval_from_data >> 16);
- ppc_li (p, ppc_r6, sig->pinvoke);
- ppc_ori (p, ppc_r0, ppc_r0, (guint32) stackval_from_data & 0xffff);
- ppc_mtlr (p, ppc_r0);
- ppc_blrl (p);
-
- stackval_arg_pos += sizeof (stackval);
- }
-
- /* return value storage */
- if (sig->param_count) {
- ppc_addi (p, ppc_r0, ppc_r31, stackval_arg_pos);
- }
- ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)), ppc_r31);
-
- /* call ves_exec_method */
- ppc_lis (p, ppc_r0, (guint32) ves_exec_method >> 16);
- ppc_addi (p, ppc_r3, ppc_r31, MINV_POS);
- ppc_ori (p, ppc_r0, ppc_r0, (guint32) ves_exec_method & 0xffff);
- ppc_mtlr (p, ppc_r0);
- ppc_blrl (p);
-
- /* move retval from stackval to proper place (r3/r4/...) */
- if (sig->ret->byref) {
- DEBUG (printf ("ret by ref\n"));
- ppc_lwz (p, ppc_r3, stackval_arg_pos, ppc_r31);
- } else {
- enum_retvalue:
- switch (sig->ret->type) {
- case MONO_TYPE_VOID:
- break;
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- ppc_lbz (p, ppc_r3, stackval_arg_pos, ppc_r31);
- break;
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- ppc_lhz (p, ppc_r3, stackval_arg_pos, ppc_r31);
- break;
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- ppc_lwz (p, ppc_r3, stackval_arg_pos, ppc_r31);
- break;
- case MONO_TYPE_I8:
- ppc_lwz (p, ppc_r3, stackval_arg_pos, ppc_r31);
- ppc_lwz (p, ppc_r4, stackval_arg_pos + 4, ppc_r31);
- break;
- case MONO_TYPE_R4:
- ppc_lfs (p, ppc_f1, stackval_arg_pos, ppc_r31);
- break;
- case MONO_TYPE_R8:
- ppc_lfd (p, ppc_f1, stackval_arg_pos, ppc_r31);
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->ret->data.klass->enumtype) {
- simpletype = sig->ret->data.klass->enum_basetype->type;
- goto enum_retvalue;
- }
- NOT_IMPLEMENTED ("value type as ret val from delegate");
- break;
- default:
- g_error ("Type 0x%x not handled yet in thunk creation", sig->ret->type);
- break;
- }
- }
-
- /* epilog */
- ppc_lwz (p, ppc_r11, 0, ppc_r1); /* r11 <--- sp[0] load backchain from caller's function */
- ppc_lwz (p, ppc_r0, RET_ADDR_OFFSET, ppc_r11); /* r0 <--- r11[4] load return address */
- ppc_mtlr (p, ppc_r0); /* LR <--- r0 set return address */
- ppc_lwz (p, ppc_r31, -4, ppc_r11); /* r31 <--- r11[-4] restore r31 */
- ppc_mr (p, ppc_r1, ppc_r11); /* sp <--- r11 restore stack */
- ppc_blr (p); /* return */
-
- DEBUG (printf ("emited code size: %d\n", p - code_buffer));
- DEBUG (disassemble (code_buffer, p - code_buffer));
- flush_icache (code_buffer, p - code_buffer);
-
- DEBUG (printf ("Delegate [end emiting]\n"));
-
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = p - code_buffer;
- ji->code_start = code_buffer;
-
- mono_jit_info_table_add (mono_get_root_domain (), ji);
-
- return ji->code_start;
-}
+++ /dev/null
-#include "mono/interpreter/interp.h"
-#ifdef NO_PORT
-MonoPIFunc
-mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
-{
- g_error ("Unsupported arch");
- return NULL;
-}
-
-void *
-mono_create_method_pointer (MonoMethod *method)
-{
- g_error ("Unsupported arch");
- return NULL;
-}
-
-#endif
-
-if INTERP_SUPPORTED
-
-AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)
-
-noinst_LTLIBRARIES = libmonoarch-x86.la
-
-libmonoarch_x86_la_SOURCES = tramp.c x86-codegen.h
-
-endif
+EXTRA_DIST = x86-codegen.h
\ No newline at end of file
+++ /dev/null
-#include "x86-codegen.h"
-#include <stdio.h>
-
-/* don't run the resulting program, it will destroy your computer,
- * just objdump -d it to inspect we generated the correct assembler.
- */
-
-int main() {
- unsigned char code [16000];
- unsigned char *p = code;
- unsigned char *target, *start, *end;
- unsigned long mem_addr = 0xdeadbeef;
- int size, i;
-
- printf (".text\n.align 4\n.globl main\n.type main,@function\nmain:\n");
-
- x86_prolog (p, 16, X86_CALLER_REGS);
-
- x86_cmpxchg_reg_reg (p, X86_EAX, X86_EBP);
- x86_cmpxchg_membase_reg (p, X86_EAX, 12, X86_EBP);
-
- x86_xchg_reg_reg (p, X86_EAX, X86_EBP, 4);
- x86_xchg_reg_reg (p, X86_EAX, X86_EBP, 1); // FIXME?
- x86_xchg_membase_reg (p, X86_EAX, 12, X86_EBP, 4);
- x86_xchg_membase_reg (p, X86_EAX, 12, X86_EBP, 2);
- x86_xchg_membase_reg (p, X86_EAX, 12, X86_EBX, 1); // FIXME?
-
- x86_inc_reg (p, X86_EAX);
- x86_inc_mem (p, mem_addr);
- x86_inc_membase (p, X86_ESP, 4);
-
- x86_nop (p);
- x86_nop (p);
-
- x86_dec_reg (p, X86_EAX);
- x86_dec_reg (p, X86_ECX);
- x86_dec_mem (p, mem_addr);
- x86_dec_membase (p, X86_ESP, 4);
-
- x86_not_reg (p, X86_EDX);
- x86_not_reg (p, X86_ECX);
- x86_not_mem (p, mem_addr);
- x86_not_membase (p, X86_ESP, 4);
- x86_not_membase (p, X86_ESP, 0x4444444);
- x86_not_membase (p, X86_EBP, 0x4444444);
- x86_not_membase (p, X86_ECX, 0x4444444);
- x86_not_membase (p, X86_EDX, 0);
- x86_not_membase (p, X86_EBP, 0);
-
- x86_neg_reg (p, X86_EAX);
- x86_neg_reg (p, X86_ECX);
- x86_neg_mem (p, mem_addr);
- x86_neg_membase (p, X86_ESP, 8);
-
- x86_alu_reg_imm (p, X86_ADD, X86_EAX, 5);
- x86_alu_reg_imm (p, X86_ADD, X86_EBX, -10);
- x86_alu_reg_imm (p, X86_SUB, X86_EDX, 7);
- x86_alu_reg_imm (p, X86_OR, X86_ESP, 0xffffedaf);
- x86_alu_reg_imm (p, X86_CMP, X86_ECX, 1);
- x86_alu_mem_imm (p, X86_ADC, mem_addr, 2);
- x86_alu_membase_imm (p, X86_ADC, X86_ESP, -4, 4);
- x86_alu_membase_imm (p, X86_ADC, X86_ESP, -12, 0xffffedaf);
-
- x86_alu_mem_reg (p, X86_SUB, mem_addr, X86_EDX);
- x86_alu_reg_reg (p, X86_ADD, X86_EAX, X86_EBX);
- x86_alu_reg_mem (p, X86_ADD, X86_EAX, mem_addr);
- x86_alu_reg_imm (p, X86_ADD, X86_EAX, 0xdeadbeef);
- x86_alu_reg_membase (p, X86_XOR, X86_EDX, X86_ESP, 4);
- x86_alu_membase_reg (p, X86_XOR, X86_EBP, 8, X86_ESI);
-
- x86_test_reg_imm (p, X86_EAX, 16);
- x86_test_reg_imm (p, X86_EDX, -16);
- x86_test_mem_imm (p, mem_addr, 1);
- x86_test_membase_imm (p, X86_EBP, 8, 1);
-
- x86_test_reg_reg (p, X86_EAX, X86_EDX);
- x86_test_mem_reg (p, mem_addr, X86_EDX);
- x86_test_membase_reg (p, X86_ESI, 4, X86_EDX);
-
- x86_shift_reg_imm (p, X86_SHL, X86_EAX, 1);
- x86_shift_reg_imm (p, X86_SHL, X86_EDX, 2);
-
- x86_shift_mem_imm (p, X86_SHL, mem_addr, 2);
- x86_shift_membase_imm (p, X86_SHLR, X86_EBP, 8, 4);
-
- /*
- * Shift by CL
- */
- x86_shift_reg (p, X86_SHL, X86_EAX);
- x86_shift_mem (p, X86_SHL, mem_addr);
-
- x86_mul_reg (p, X86_EAX, 0);
- x86_mul_reg (p, X86_EAX, 1);
- x86_mul_membase (p, X86_EBP, 8, 1);
-
- x86_imul_reg_reg (p, X86_EBX, X86_EDX);
- x86_imul_reg_membase (p, X86_EBX, X86_EBP, 12);
-
- x86_imul_reg_reg_imm (p, X86_EBX, X86_EDX, 10);
- x86_imul_reg_mem_imm (p, X86_EBX, mem_addr, 20);
- x86_imul_reg_membase_imm (p, X86_EBX, X86_EBP, 16, 300);
-
- x86_div_reg (p, X86_EDX, 0);
- x86_div_reg (p, X86_EDX, 1);
- x86_div_mem (p, mem_addr, 1);
- x86_div_membase (p, X86_ESI, 4, 1);
-
- x86_mov_mem_reg (p, mem_addr, X86_EAX, 4);
- x86_mov_mem_reg (p, mem_addr, X86_EAX, 2);
- x86_mov_mem_reg (p, mem_addr, X86_EAX, 1);
- x86_mov_membase_reg (p, X86_EBP, 4, X86_EAX, 1);
-
- x86_mov_regp_reg (p, X86_EAX, X86_EAX, 4);
- x86_mov_membase_reg (p, X86_EAX, 0, X86_EAX, 4);
- x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 4);
- x86_mov_reg_memindex (p, X86_ECX, X86_EAX, 34, X86_EDX, 2, 4);
- x86_mov_reg_memindex (p, X86_ECX, X86_NOBASEREG, 34, X86_EDX, 2, 4);
- x86_mov_memindex_reg (p, X86_EAX, X86_EAX, 0, X86_EDX, 2, 4);
- x86_mov_reg_reg (p, X86_EAX, X86_EAX, 1);
- x86_mov_reg_reg (p, X86_EAX, X86_EAX, 4);
- x86_mov_reg_mem (p, X86_EAX, mem_addr, 4);
-
- x86_mov_reg_imm (p, X86_EAX, 10);
- x86_mov_mem_imm (p, mem_addr, 54, 4);
- x86_mov_mem_imm (p, mem_addr, 54, 1);
-
- x86_lea_mem (p, X86_EDX, mem_addr);
- /* test widen */
- x86_widen_memindex (p, X86_EDX, X86_ECX, 0, X86_EBX, 2, 1, 0);
-
- x86_cdq (p);
- x86_wait (p);
-
- x86_fp_op_mem (p, X86_FADD, mem_addr, 1);
- x86_fp_op_mem (p, X86_FSUB, mem_addr, 0);
- x86_fp_op (p, X86_FSUB, 2);
- x86_fp_op_reg (p, X86_FMUL, 1, 0);
- x86_fstp (p, 2);
- x86_fcompp (p);
- x86_fnstsw (p);
- x86_fnstcw (p, mem_addr);
- x86_fnstcw_membase (p, X86_ESP, -8);
-
- x86_fldcw_membase (p, X86_ESP, -8);
- x86_fchs (p);
- x86_frem (p);
- x86_fxch (p, 3);
- x86_fcomip (p, 3);
- x86_fld_membase (p, X86_ESP, -8, 1);
- x86_fld_membase (p, X86_ESP, -8, 0);
- x86_fld80_membase (p, X86_ESP, -8);
- x86_fild_membase (p, X86_ESP, -8, 1);
- x86_fild_membase (p, X86_ESP, -8, 0);
- x86_fld_reg (p, 4);
- x86_fldz (p);
- x86_fld1 (p);
-
- x86_fst (p, mem_addr, 1, 0);
- x86_fst (p, mem_addr, 1, 1);
- x86_fst (p, mem_addr, 0, 1);
-
- x86_fist_pop_membase (p, X86_EDX, 4, 1);
- x86_fist_pop_membase (p, X86_EDX, 4, 0);
-
- x86_push_reg (p, X86_EBX);
- x86_push_membase (p, X86_EBP, 8);
- x86_push_imm (p, -1);
- x86_pop_reg (p, X86_EBX);
-
- x86_pushad (p);
- x86_pushfd (p);
- x86_popfd (p);
- x86_popad (p);
-
- target = p;
-
- start = p;
- x86_jump32 (p, mem_addr);
- x86_patch (start, target);
- start = p;
- x86_jump8 (p, 12);
- x86_patch (start, target);
- x86_jump_reg (p, X86_EAX);
- x86_jump_membase (p, X86_EDX, 16);
-
- x86_jump_code (p, target);
-
- x86_branch8 (p, X86_CC_EQ, 54, 1);
- x86_branch32 (p, X86_CC_LT, 54, 0);
- x86_branch (p, X86_CC_GT, target, 0);
- x86_branch_disp (p, X86_CC_NE, -4, 0);
-
- x86_set_reg (p, X86_CC_EQ, X86_EAX, 0);
- x86_set_membase (p, X86_CC_LE, X86_EBP, -8, 0);
-
- x86_call_code (p, printf);
- x86_call_reg (p, X86_ECX);
-
- x86_sahf (p);
-
- x86_fsin (p);
- x86_fcos (p);
- x86_fabs (p);
- x86_fpatan (p);
- x86_fprem (p);
- x86_fprem1 (p);
- x86_frndint (p);
- x86_fsqrt (p);
- x86_fptan (p);
-
- x86_leave (p);
- x86_ret (p);
- x86_ret_imm (p, 24);
-
- x86_cmov_reg (p, X86_CC_GT, 1, X86_EAX, X86_EDX);
- x86_cmov_membase (p, X86_CC_GT, 0, X86_EAX, X86_EDX, -4);
-
- x86_nop (p);
- x86_epilog (p, X86_CALLER_REGS);
-
- size = p-code;
- for (i = 0; i < size; ++i)
- printf (".byte %d\n", (unsigned int) code [i]);
- return 0;
-}
+++ /dev/null
-/*
- * Create trampolines to invoke arbitrary functions.
- *
- * Copyright (C) Ximian Inc.
- *
- * Authors:
- * Paolo Molaro (lupus@ximian.com)
- * Dietmar Maurer (dietmar@ximian.com)
- *
- */
-
-#include "config.h"
-#include <stdlib.h>
-#include <string.h>
-#include "x86-codegen.h"
-#include "mono/metadata/class.h"
-#include "mono/metadata/tabledefs.h"
-#include "mono/interpreter/interp.h"
-#include "mono/metadata/appdomain.h"
-#include "mono/metadata/marshal.h"
-
-/*
- * The resulting function takes the form:
- * void func (void (*callme)(), void *retval, void *this_obj, stackval *arguments);
- */
-#define FUNC_ADDR_POS 8
-#define RETVAL_POS 12
-#define THIS_POS 16
-#define ARGP_POS 20
-#define LOC_POS -4
-
-#define ARG_SIZE sizeof (stackval)
-
-MonoPIFunc
-mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
-{
- unsigned char *p, *code_buffer;
- guint32 stack_size = 0, code_size = 50;
- guint32 arg_pos, simpletype;
- int i, stringp;
- static GHashTable *cache = NULL;
- MonoPIFunc res;
-
- if (!cache)
- cache = g_hash_table_new ((GHashFunc)mono_signature_hash,
- (GCompareFunc)mono_metadata_signature_equal);
-
- if ((res = (MonoPIFunc)g_hash_table_lookup (cache, sig)))
- return res;
-
- if (sig->hasthis) {
- stack_size += sizeof (gpointer);
- code_size += 10;
- }
-
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref && !sig->ret->data.klass->enumtype) {
- stack_size += sizeof (gpointer);
- code_size += 5;
- }
-
- for (i = 0; i < sig->param_count; ++i) {
- if (sig->params [i]->byref) {
- stack_size += sizeof (gpointer);
- code_size += 20;
- continue;
- }
- simpletype = sig->params [i]->type;
-enum_calc_size:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- stack_size += 4;
- code_size += i < 10 ? 5 : 8;
- break;
- case MONO_TYPE_VALUETYPE: {
- int size;
- if (sig->params [i]->data.klass->enumtype) {
- simpletype = sig->params [i]->data.klass->enum_basetype->type;
- goto enum_calc_size;
- }
- if ((size = mono_class_native_size (sig->params [i]->data.klass, NULL)) != 4) {
- stack_size += size + 3;
- stack_size &= ~3;
- code_size += 32;
- } else {
- stack_size += 4;
- code_size += i < 10 ? 5 : 8;
- }
- break;
- }
- case MONO_TYPE_I8:
- stack_size += 8;
- code_size += i < 10 ? 5 : 8;
- break;
- case MONO_TYPE_R4:
- stack_size += 4;
- code_size += i < 10 ? 10 : 13;
- break;
- case MONO_TYPE_R8:
- stack_size += 8;
- code_size += i < 10 ? 7 : 10;
- break;
- default:
- g_error ("Can't trampoline 0x%x", sig->params [i]->type);
- }
- }
- /*
- * FIXME: take into account large return values.
- */
-
- code_buffer = p = alloca (code_size);
-
- /*
- * Standard function prolog.
- */
- x86_push_reg (p, X86_EBP);
- x86_mov_reg_reg (p, X86_EBP, X86_ESP, 4);
- /*
- * and align to 16 byte boundary...
- */
- stack_size += 15;
- stack_size &= ~15;
-
- if (stack_size)
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, stack_size);
-
- /*
- * EDX has the pointer to the args.
- */
- x86_mov_reg_membase (p, X86_EDX, X86_EBP, ARGP_POS, 4);
-
- /*
- * Push arguments in reverse order.
- */
- stringp = 0;
- for (i = sig->param_count; i; --i) {
- arg_pos = ARG_SIZE * (i - 1);
- if (sig->params [i - 1]->byref) {
- x86_push_membase (p, X86_EDX, arg_pos);
- continue;
- }
- simpletype = sig->params [i - 1]->type;
-enum_marshal:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- x86_push_membase (p, X86_EDX, arg_pos);
- break;
- case MONO_TYPE_R4:
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, 4);
- x86_fld_membase (p, X86_EDX, arg_pos, TRUE);
- x86_fst_membase (p, X86_ESP, 0, FALSE, TRUE);
- break;
- case MONO_TYPE_CLASS:
- x86_push_membase (p, X86_EDX, arg_pos);
- break;
- case MONO_TYPE_SZARRAY:
- x86_push_membase (p, X86_EDX, arg_pos);
- break;
- case MONO_TYPE_VALUETYPE:
- if (!sig->params [i - 1]->data.klass->enumtype) {
- int size = mono_class_native_size (sig->params [i - 1]->data.klass, NULL);
- if (size == 4) {
- /* it's a structure that fits in 4 bytes, need to push the value pointed to */
- x86_mov_reg_membase (p, X86_EAX, X86_EDX, arg_pos, 4);
- x86_push_regp (p, X86_EAX);
- } else {
- int ss = size;
- ss += 3;
- ss &= ~3;
-
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, ss);
- x86_push_imm (p, size);
- x86_push_membase (p, X86_EDX, arg_pos);
- x86_lea_membase (p, X86_EAX, X86_ESP, 2*4);
- x86_push_reg (p, X86_EAX);
- x86_mov_reg_imm (p, X86_EAX, memcpy);
- x86_call_reg (p, X86_EAX);
- x86_alu_reg_imm (p, X86_ADD, X86_ESP, 12);
- /* memcpy might clobber EDX so restore it */
- x86_mov_reg_membase (p, X86_EDX, X86_EBP, ARGP_POS, 4);
- }
- } else {
- /* it's an enum value */
- simpletype = sig->params [i - 1]->data.klass->enum_basetype->type;
- goto enum_marshal;
- }
- break;
- case MONO_TYPE_I8:
- case MONO_TYPE_U8:
- case MONO_TYPE_R8:
- x86_push_membase (p, X86_EDX, arg_pos + 4);
- x86_push_membase (p, X86_EDX, arg_pos);
- break;
- default:
- g_error ("Can't trampoline 0x%x", sig->params [i - 1]->type);
- }
- }
-
- if (sig->hasthis) {
- if (sig->call_convention != MONO_CALL_THISCALL) {
- x86_mov_reg_membase (p, X86_EDX, X86_EBP, THIS_POS, 4);
- x86_push_reg (p, X86_EDX);
- } else {
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, THIS_POS, 4);
- }
- }
-
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
- MonoClass *klass = sig->ret->data.klass;
- if (!klass->enumtype) {
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_push_membase (p, X86_ECX, 0);
- }
- }
-
- /*
- * Insert call to function
- */
- x86_mov_reg_membase (p, X86_EDX, X86_EBP, FUNC_ADDR_POS, 4);
- x86_call_reg (p, X86_EDX);
-
- /*
- * Handle retval.
- * Small integer and pointer values are in EAX.
- * Long integers are in EAX:EDX.
- * FP values are on the FP stack.
- */
-
- if (sig->ret->byref || string_ctor) {
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- } else {
- simpletype = sig->ret->type;
- enum_retvalue:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 1);
- break;
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 2);
- break;
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- break;
- case MONO_TYPE_STRING:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- break;
- case MONO_TYPE_R4:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_fst_membase (p, X86_ECX, 0, FALSE, TRUE);
- break;
- case MONO_TYPE_R8:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_fst_membase (p, X86_ECX, 0, TRUE, TRUE);
- break;
- case MONO_TYPE_I8:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- x86_mov_membase_reg (p, X86_ECX, 4, X86_EDX, 4);
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->ret->data.klass->enumtype) {
- simpletype = sig->ret->data.klass->enum_basetype->type;
- goto enum_retvalue;
- }
- case MONO_TYPE_VOID:
- break;
- default:
- g_error ("Can't handle as return value 0x%x", sig->ret->type);
- }
- }
-
- /*
- * Standard epilog.
- */
- x86_leave (p);
- x86_ret (p);
-
- g_assert (p - code_buffer < code_size);
- res = (MonoPIFunc)g_memdup (code_buffer, p - code_buffer);
-
- g_hash_table_insert (cache, sig, res);
-
- return res;
-}
-
-#define MINV_POS (- sizeof (MonoInvocation))
-#define STACK_POS (MINV_POS - sizeof (stackval) * sig->param_count)
-#define TYPE_OFFSET (G_STRUCT_OFFSET (stackval, type))
-
-/*
- * Returns a pointer to a native function that can be used to
- * call the specified method.
- * The function created will receive the arguments according
- * to the call convention specified in the method.
- * This function works by creating a MonoInvocation structure,
- * filling the fields in and calling ves_exec_method on it.
- * Still need to figure out how to handle the exception stuff
- * across the managed/unmanaged boundary.
- */
-void *
-mono_arch_create_method_pointer (MonoMethod *method)
-{
- MonoMethodSignature *sig;
- MonoJitInfo *ji;
- unsigned char *p, *code_buffer;
- gint32 local_size;
- gint32 stackval_pos, arg_pos = 8;
- int i, size, align, cpos;
- int *vtbuf;
-
- sig = method->signature;
-
- code_buffer = p = alloca (512); /* FIXME: check for overflows... */
- vtbuf = alloca (sizeof(int)*sig->param_count);
-
- local_size = sizeof (MonoInvocation) + sizeof (stackval) * (sig->param_count + 1);
-
- local_size += 7;
- local_size &= ~7;
-
- stackval_pos = -local_size;
-
- cpos = 0;
- for (i = 0; i < sig->param_count; i++) {
- MonoType *type = sig->params [i];
- vtbuf [i] = -1;
- if (type->type == MONO_TYPE_VALUETYPE) {
- MonoClass *klass = type->data.klass;
- if (klass->enumtype)
- continue;
- size = mono_class_native_size (klass, &align);
- cpos += align - 1;
- cpos &= ~(align - 1);
- vtbuf [i] = cpos;
- cpos += size;
- }
- }
-
- cpos += 7;
- cpos &= ~7;
-
- local_size += cpos;
-
- /*
- * Standard function prolog.
- */
- x86_push_reg (p, X86_EBP);
- x86_mov_reg_reg (p, X86_EBP, X86_ESP, 4);
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, local_size);
-
- /*
- * Initialize MonoInvocation fields, first the ones known now.
- */
- x86_mov_reg_imm (p, X86_EAX, 0);
- x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex)), X86_EAX, 4);
- x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler)), X86_EAX, 4);
- x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, parent)), X86_EAX, 4);
- /*
- * Set the method pointer.
- */
- x86_mov_membase_imm (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, method)), (int)method, 4);
-
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref && !sig->ret->data.klass->enumtype)
- arg_pos += 4;
-
- /*
- * Handle this.
- */
- if (sig->hasthis) {
- if (sig->call_convention != MONO_CALL_THISCALL) {
- /*
- * Grab it from the stack, otherwise it's already in ECX.
- */
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, arg_pos, 4);
- arg_pos += 4;
- }
- x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)), X86_ECX, 4);
- }
- /*
- * Handle the arguments. stackval_pos is the posset of the stackval array from EBP.
- * arg_pos is the offset from EBP to the incoming arg on the stack.
- * We just call stackval_from_data to handle all the (nasty) issues....
- */
- x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
- x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, stack_args)), X86_EAX, 4);
- for (i = 0; i < sig->param_count; ++i) {
- if (vtbuf [i] >= 0) {
- x86_lea_membase (p, X86_EAX, X86_EBP, - local_size + vtbuf [i]);
- x86_mov_membase_reg (p, X86_EBP, stackval_pos, X86_EAX, 4);
- }
- x86_mov_reg_imm (p, X86_ECX, stackval_from_data);
- x86_lea_membase (p, X86_EDX, X86_EBP, arg_pos);
- x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
- x86_push_imm (p, sig->pinvoke);
- x86_push_reg (p, X86_EDX);
- x86_push_reg (p, X86_EAX);
- x86_push_imm (p, sig->params [i]);
- x86_call_reg (p, X86_ECX);
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, 16);
- stackval_pos += sizeof (stackval);
- /* fixme: alignment */
- if (sig->pinvoke)
- arg_pos += mono_type_native_stack_size (sig->params [i], &align);
- else
- arg_pos += mono_type_stack_size (sig->params [i], &align);
- }
-
- /*
- * Handle the return value storage area.
- */
- x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
- x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)), X86_EAX, 4);
- if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
- MonoClass *klass = sig->ret->data.klass;
- if (!klass->enumtype) {
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, 8, 4);
- x86_mov_membase_reg (p, X86_EBP, stackval_pos, X86_ECX, 4);
- }
- }
-
- /*
- * Call the method.
- */
- x86_lea_membase (p, X86_EAX, X86_EBP, MINV_POS);
- x86_push_reg (p, X86_EAX);
- x86_mov_reg_imm (p, X86_EDX, ves_exec_method);
- x86_call_reg (p, X86_EDX);
-
- /*
- * Move the return value to the proper place.
- */
- x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
- if (sig->ret->byref) {
- x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 4);
- } else {
- int simpletype = sig->ret->type;
- enum_retvalue:
- switch (sig->ret->type) {
- case MONO_TYPE_VOID:
- break;
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 1);
- break;
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 2);
- break;
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 4);
- break;
- case MONO_TYPE_I8:
- x86_mov_reg_membase (p, X86_EDX, X86_EAX, 4, 4);
- x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 4);
- break;
- case MONO_TYPE_R8:
- x86_fld_membase (p, X86_EAX, 0, TRUE);
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->ret->data.klass->enumtype) {
- simpletype = sig->ret->data.klass->enum_basetype->type;
- goto enum_retvalue;
- }
-
- x86_push_imm (p, sig->pinvoke);
- x86_push_membase (p, X86_EBP, stackval_pos);
- x86_push_reg (p, X86_EAX);
- x86_push_imm (p, sig->ret);
- x86_mov_reg_imm (p, X86_ECX, stackval_to_data);
- x86_call_reg (p, X86_ECX);
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, 16);
-
- break;
- default:
- g_error ("Type 0x%x not handled yet in thunk creation", sig->ret->type);
- break;
- }
- }
-
- /*
- * Standard epilog.
- */
- x86_leave (p);
- x86_ret (p);
-
- g_assert (p - code_buffer < 512);
-
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = p - code_buffer;
- ji->code_start = g_memdup (code_buffer, p - code_buffer);
-
- mono_jit_info_table_add (mono_get_root_domain (), ji);
-
- return ji->code_start;
-}
current_type = 1;
last_m = first_m = 1;
for (i = 1; i <= t->rows; i++){
+ MonoError error;
guint32 cols [MONO_METHOD_SIZE];
char *sig, *impl_flags;
const char *sigblob;
mono_metadata_string_heap (m, mono_metadata_decode_row_col (td, current_type - 2, MONO_TYPEDEF_NAME)));
first_m = last_m;
type_container = mono_metadata_load_generic_params (m, MONO_TOKEN_TYPE_DEF | (current_type - 1), NULL);
- if (type_container)
- mono_metadata_load_generic_param_constraints (m, MONO_TOKEN_TYPE_DEF | (current_type - 1), type_container);
+ if (type_container) {
+ mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_TYPE_DEF | (current_type - 1), type_container, &error);
+ g_assert (mono_error_ok (&error)); /*FIXME don't swallow the error message*/
+ }
}
method_container = mono_metadata_load_generic_params (m, MONO_TOKEN_METHOD_DEF | i, type_container);
- if (method_container)
- mono_metadata_load_generic_param_constraints (m, MONO_TOKEN_METHOD_DEF | i, method_container);
+ if (method_container) {
+ mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_METHOD_DEF | i, method_container, &error);
+ g_assert (mono_error_ok (&error)); /*FIXME don't swallow the error message*/
+ }
mono_metadata_decode_table_row (m, MONO_TABLE_METHOD, i - 1, cols, MONO_METHOD_SIZE);
sigblob = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]);
mono_metadata_decode_blob_size (sigblob, &sigblob);
method_name = mono_metadata_string_heap (m, cols [MONO_METHOD_NAME]);
param_index = cols [MONO_METHOD_PARAMLIST];
if (!method) {
+ MonoError error;
const char *sig = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]);
container = mono_metadata_load_generic_params (m, MONO_TOKEN_METHOD_DEF | methoddef_row, container);
- if (container)
- mono_metadata_load_generic_param_constraints (m, MONO_TOKEN_METHOD_DEF | methoddef_row, container);
+ if (container) {
+ mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_METHOD_DEF | methoddef_row, container, &error);
+ g_assert (mono_error_ok (&error)); /*FIXME don't swallow the error message*/
+ }
mono_metadata_decode_blob_size (sig, &sig);
method = mono_metadata_parse_method_signature_full (m, container, methoddef_row, sig, &sig);
mono_metadata_decode_blob_size (sig, &sig);
container = mono_metadata_load_generic_params (m, MONO_TOKEN_METHOD_DEF | (i + 1), type_container);
- if (container)
- mono_metadata_load_generic_param_constraints (m, MONO_TOKEN_METHOD_DEF | (i + 1), container);
- else
+ if (container) {
+ MonoError error;
+ mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_METHOD_DEF | (i + 1), container, &error);
+ g_assert (mono_error_ok (&error)); /*FIXME don't swallow the error message*/
+ } else {
container = type_container;
+ }
ms = mono_metadata_parse_method_signature_full (m, container, i + 1, sig, &sig);
if (ms != NULL){
}
container = mono_metadata_load_generic_params (m, MONO_TOKEN_TYPE_DEF | (n + 1), NULL);
- if (container)
- mono_metadata_load_generic_param_constraints (m, MONO_TOKEN_TYPE_DEF | (n + 1), container);
+ if (container) {
+ MonoError error;
+ mono_metadata_load_generic_param_constraints_checked (m, MONO_TOKEN_TYPE_DEF | (n + 1), container, &error);
+ g_assert (mono_error_ok (&error)); /*FIXME don't swallow the error message*/
+ }
esname = get_escaped_name (name);
if ((cols [MONO_TYPEDEF_FLAGS] & TYPE_ATTRIBUTE_CLASS_SEMANTIC_MASK) == TYPE_ATTRIBUTE_CLASS){
+++ /dev/null
-/Makefile
-/Makefile.in
-/mint
-/*.o
-/.libs
-/.deps
-/interp.lo
-/libmint.la
-/*.lo
-/semantic.cache
-/TAGS
+++ /dev/null
-2009-11-10 Andrew Jorgensen <ajorgensen@novell.com>
-
- * Makefile.am: mint man page should be conditional also
-
-2009-03-20 Zoltan Varga <vargaz@gmail.com>
-
- * interp.c: Change location of gc_wrapper.h.
-
-2007-06-04 Mark Probst <mark.probst@gmail.com>
-
- * interp.c, interp.h (RuntimeMethod): Due to the jit_code_hash
- change in MonoDomain this had to be changed slightly, too.
-
-2006-05-09 Miguel de Icaza <miguel@novell.com>
-
- * interp.c (ves_exec_method_with_context): Pass a temporary to the
- mono_load_remote_field routine, instead of passing a NULL.
-
-Thu Aug 4 20:09:40 BST 2005 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: a real zombie is supposed to at least walk.
- Compilation fix.
-
-2005-03-07 Zoltan Varga <vargaz@freemail.hu>
-
- * transform.c (generate): Add CEE_MONO_NOT_TAKEN.
-
-2005-01-31 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c: fix typo
-
-2005-01-29 Ben Maurer <bmaurer@ximian.com>
-
- * *: MonoMethod->signature might be NULL now. You *MUST* use
- mono_method_signature.
-
-2005-01-20 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c: mono_init_icall got renamed
-
-2005-01-03 Zoltan Varga <vargaz@freemail.hu>
-
- * transform.c (generate): Handle MONO_CLASSCONST.
-
-2004-12-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * interp.c: fix the build. Dunno if it's correct.
-
-2004-12-02 Bernie Solomon <bernard@ugsolutions.com>
-
- * mintops.def:
- * transform.c:
- * interp.c: cope with new thread interruption icall
-
-2004-11-12 Ben Maurer <bmaurer@ximian.com>
-
- * transform.c: Fix bug with delegates in interp.
-
-2004-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * interp.c: Added MonoRemotingTarget parameter to signature
- interp_create_remoting_trampoline.
-
-Tue Nov 9 17:28:48 CET 2004 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: update to exception clause structure changes.
-
-2004-11-08 Ben Maurer <bmaurer@ximian.com>
-
- * interp.c: warning free
-
-2004-10-29 Zoltan Varga <vargaz@freemail.hu>
-
- * Makefile.am (libgc_libs): Do some automake magic so libmono/mono
- depends on libmonogc.
-
-Wed Sep 22 19:06:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: updates for stack walk interface.
-
-2004-09-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * interp.c: In interp_walk_stack, don't crash if the context is not set
- (this may happen if the method is called by unmanaged code).
-
-2004-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * interp.c: thread local alloc
-
-2004-08-05 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c: (mono_interp_init) use g_thread_supported
- to stop multiple g_thread_init calls.
- Also attach domain to thread like mono_jit_init
-
-2004-07-31 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.h: add mono_interp_ftnptr_to_delegate
-
- * transform.c (generate): use mono_interp_ftnptr_to_delegate
- as ical function.
-
- * interp.c: add mono_interp_ftnptr_to_delegate to create
- interpreter style delegate. fixes pinvoke3
-
-2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * interp.c: Use mono_init_from_assembly instead of mono_init.
-
-2004-07-27 Bernie Solomon <bernard@ugsolutions.com>
-
- * transform.c (mono_interp_transform_method):
- quick fix to cope with the fake ptr classes
-
-2004-07-26 Bernie Solomon <bernard@ugsolutions.com>
-
- * mintops.def: more options on ICALL op code
-
- * interp.c: cope with exception in ICALL ops, more of them
-
- * transforms.c: more ICALL opcodes
-
-2004-07-21 Bernie Solomon <bernard@ugsolutions.com>
-
- * mintops.def: rename the ICALL op codes to give a better
- clue about their signature.
-
- * transform.c (generate): use new ICALL types and add
- a case for two args + a result
-
- * interp.c (ves_exec_method_with_context): new ICALL
- op codes.
-
-2004-07-21 Bernie Solomon <bernard@ugsolutions.com>
-
- * mintops.def: add MINT_DUP_VT
-
- * transform.c (generate): cope with CEE_DUP on value type
-
- * interp.c (ves_exec_method_with_context): implement MINT_DUP_VT
- (interp_mono_runtime_invoke): don't unbox this for valuetypes
- here as it is now done in the callers.
-
-2004-07-09 Ben Maurer <bmaurer@ximian.com>
-
- * interp.c: register gc roots
-
-2004-07-08 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c mintops.def transform.c: Replace CEE_MONO_PROC<x> with
- CEE_MONO_ICALL.
-
-2004-07-05 Zoltan Varga <vargaz@freemail.hu>
-
- * mintops.h: Applied patch from Marcin Krzyzanowski (krzak@pld-linux.org). Add support for unaligned access on little endian machines.
-
- * interp.c:Applied patch from Marcin Krzyzanowski (krzak@pld-linux.org). Fix crash seen on amd64.
-
-2004-06-24 David Waite <mass@akuma.org>
-
- * interp.c: change to C90-style comments from C99/C++-style
-
-Mon Jun 21 14:06:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * interp.h: API updates.
-
-2004-05-21 Bernie Solomon <bernard@ugsolutions.com>
-
- * transform.c: ignore new LMF opcodes
-
-2004-05-20 Lluis Sanchez Gual <lluis@ximian.com>
-
- * interp.c, interp.h: Use the new methods for handling thread.abort.
-
-2004-05-04 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_exec_method_with_context): Disable explicit assignment
- of 'esi' to the ip variable, since it causes register allocation errors
- on some versions of gcc. Fixes #58010.
-
-2004-04-29 Bernie Solomon <bernard@ugsolutions.com>
-
- * transform.c (generate): missed a couple
- of places that should use ADD_CODE so buffer
- gets grown properly.
-
- * interp.c (interp_mono_runtime_invoke):
- restore state better on catching exception
- via longjmp here
-
-2004-04-29 Bernie Solomon <bernard@ugsolutions.com>
-
- * transform.c:
- * interp.c:
- Implement STARG for valuetypes as mcs needs it.
-
-2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
-
- * transform.c: Make sure ENSURE_I4 is called on
- 32 bit machines too.
- (mono_interp_transform_method): allow some stack
- space for tracing to work.
-
-2004-04-26 David Waite <mass@akuma.org>
-
- * interp.h: remove comma from end of enumeration constants
- declarations
-
-2004-04-21 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.h: put in space for old type field
- for PPC as tramp.c assumes it. Quick fix until that's fixed.
-
- * interp.c: reenable instruction tracing for DEBUG_INTERP
-
-2004-04-19 Bernie Solomon <bernard@ugsolutions.com>
-
- * Makefile.am:
- * interp.h:
- * interp.c: now interprets different VM code
- * mintops.h:
- * mintops.def:
- * mintops.c: definition of new VM code
- * transform.c: convert CIL to new VM code
-
-2004-04-14 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_exec_method_with_context): Add support for STRWLPARRAY
- marshalling convention.
-
-2004-03-29 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c interp.h: remove child from MonoInvocation
- as it isn't used.
-
-2004-03-25 Martin Baulig <martin@ximian.com>
-
- * interp.c (stackval_from_data): Added MONO_TYPE_GENERICINST.
- (stackval_to_data): Added MONO_TYPE_GENERICINST.
- (calc_offsets): Use mono_class_get_full() and mono_get_method_full().
- (ves_exec_method_with_context): Likewise.
-
-2004-03-04 Lluis Sanchez Gual <lluis@ximian.com>
-
- * interp.c: Get the type of transparent proxies from its remote_class.
-
-2004-02-02 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_exec_method_with_context): Add new marshalling
- conventions.
-
-2004-01-22 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (mono_main): Remove call to mono_verify_corlib (), since
- the verification code is not up-to-date.
-
-2004-01-19 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c (ves_exec_method_with_context):
- get_native_wrapper removed and call
- mono_marshal_get_native_wrapper directly
- with new DllNotFoundException handling
-
-Mon Jan 19 17:52:33 CET 2004 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: eliminate CSIZE macro.
-
-2004-01-15 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_array_set): Check for ArrayTypeMismatchException.
-
-2004-01-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * interp.c: call setlocale (). Fixes bug #52100.
-
-2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
-
- * embed.h, main.c: new files to enable embedding
- the interpreter
-
- * interp.c: make main callable from main.c
- rearrange main for embedding
-
- * Makefile.am: changes now most code is in a library
-
-2003-11-21 Lluis Sanchez Gual <lluis@ximian.com>
-
- * interp.c: Added support for context static fields.
-
-2003-10-31 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (mono_create_method_pointer): New function which contains
- the arch independent part of method wrapper creation. Add a cache
- for the wrapper code, since Delegate::Equals depends on the wrapper
- address being constant for a method. Fixes #50366.
-
-2003-10-30 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c: (ves_exec_method_with_context)
- we need to lookup internal calls now.
- don't free type in CEE_SIZEOF.
- fix CEE_NEWOBJ inside wrapper methods
-
-2003-10-24 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c: Update after appdomain changes.
-
-2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c - set large stack size on HP 64bit
-
-2003-10-02 Bernie Solomon <bernard@ugsolutions.com>
-
- * hacks.h - work round HP 64 bit problem with isunordered
-
-2003-10-03 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (dump_frame): Avoid crash on frames without a method. Patch
- sam@superduper.net (sam clegg). Fixes #46197.
- (ves_exec_method_with_context): Fix unbox casting.
-
-2003-09-25 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c - reinstate use of mono_marshal_get_delegate_invoke
- for ordering and fix CALLI to handle wrapper. More wrapper handling
- in CALL and LDSTR. Add another string conversion case.
-
-2003-09-25 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_exec_method): Fix warning.
- (ves_exec_method_with_context): Fix CGT_UN and CLT_UN. Patch by
- David Waite (mass@akuma.org).
-
-2003-9-24 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c: I broke calling native delegates reinstate
- old code for the moment.
-
-2003-9-22 Bernie Solomon <bernard@ugsolutions.com>
-
- * interp.c: use mono_marshal_get_delegate_invoke to get delegate
- invocation order consistent. Fix THROW_EX, fix ip in overflow
- exceptions.
-
-Fri Sep 12 10:42:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * interp.c, interp.h: patch from Bernie Solomon <bernard@ugsolutions.com>:
- 64 bit/opcodes/exception handling fixes.
-
-2003-08-30 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c: Use mono_field_from_token () in the appropriate places.
- This simplifies the code and also fixes #48051.
-
-2003-08-27 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (main): Fix the order of initialization calls so it maches
- the order in the JIT.Patch by Bernie Solomon (bernard@ugsolutions.com).
- Also remove the unused ms mutex.
-
- * interp.c: Get rid of metadata_section.
-
-2003-08-22 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (main): Call g_thread_init () to make glib thread-safe.
- Fixes #47682. Thanks to Laurent Morichetti (l_m@pacbell.net) for
- reporting this.
-
-2003-08-18 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c: Get rid of duplicate definition of CHECK_MUL_OVERFLOW.
- * interp.h interp.c: Get rid of VAL_VALUETA, use VAL_MP instead. Fix
- the INITOBJ opcode which was the only user of VALUETA.
-
-2003-08-16 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_exec_method): Implemented mul.ovf correctly for int32
- and int64. Implement the conv.ovf opcodes for all argument types.
-
-2003-08-15 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c (ves_exec_method): Handle non-valuetypes in CEE_STOBJ.
- Fixes #46781.
- (ves_exec_method): Added support for the synchronized flag to the
- interpreter. Also fixed the CALLI opcode, and made exception handling
- work though the managed-unmanaged barrier.
-
-Fri Jul 25 19:06:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: updates for new instructions.
-
-2003-07-22 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c: Use the new metadata_section lock instead of metadata_lock.
- Patch by Bernie Solomon (bernard@ugsolutions.com).
-
-Fri Jul 18 15:11:44 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: 64 bit fixes from Laurent Morichetti <l_m@pacbell.net>.
- Install cleanup function.
-
-2003-07-13 Zoltan Varga <vargaz@freemail.hu>
-
- * interp.c: Keep alloca()-d data on a free list to prevent stack
- overflow errors when valuetypes are allocated in a loop. Fixes
- #27420. Is the new code still faster than using malloc/free ?
-
- * interp.c (ves_array_get): Add index checking to ves_array_get/set.
- Fixes decimal-array.exe.
-
- * interp.c (interp_mono_runtime_invoke): Unbox value type instances
- before calling the method. Fixes appdomain2.exe.
-
- * interp.c: Fix warnings.
-
- * interp.c: Report unhandled exceptions correctly.
-
- * interp.c: Implement CEE_ISINST and CEE_CASTCLASS using
- mono_object_isinst. Fixes bug #45539 and reflection-enum.exe.
-
-Tue May 27 16:36:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: don't use relative numbering stuff.
-
-Tue May 27 12:18:44 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: update for mono_class_vtable() changes.
-
-Tue May 13 16:43:18 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: handle thread static fields.
-
-Sun Apr 27 13:27:59 CEST 2003 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: check for arraytypemismatch.
-
-2003-04-23 Martin Baulig <martin@ximian.com>
-
- * interp.c: When running with --dieonex, use the debugging code to
- print source lines in the backtrace.
-
-2003-02-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * interp.c: added a dummy mono_runtime_install_handlers function to
- avoid crashing when ves_pinvoke_method tries to call it.
-
-2003-02-06 Piers Haken <piersh@friskit.com>
-
- * interp.c: warning cleanups
-
-2002-11-15 Dick Porter <dick@ximian.com>
-
- * interp.c: mono_runtime_init() now has an extra parameter for
- thread attaching.
-
-2002-10-31 Dick Porter <dick@ximian.com>
-
- * Makefile.am: The previous automake-1.6 fix broke automake-1.4 on
- cygwin. Try again.
-
-2002-09-27 Dick Porter <dick@ximian.com>
-
- * interp.c: Tell glib what the program name is, by passing it the
- name of the managed file we're executing
-
-2002-08-28 Dick Porter <dick@ximian.com>
-
- * interp.c: mono_set_rootdir() doesnt take any args now
-
- * Makefile.am: Export HOST_CC and turn on optimisation for w32 builds
-
-2002-08-28 Nick Drochak <ndrochak@gol.com>
-
- * interp.c: check and throw exception if needed for overflow on
- multiplication of integer types.
-
-2002-08-07 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (interp_walk_stack): removed the createdelegate icall
-
-2002-08-02 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (get_virtual_method): support proxies
- (ves_exec_method): impl. LDFLD/STFLD for proxies.
-
-Fri Aug 2 13:00:41 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c, interp.h: implemented exception trap for runtime_invoke
- and handle exceptions across managed/unmanaged boundaries.
-
-2002-08-01 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (stackval_from_data): add pinvoke argument
- (stackval_to_data): add pinvoke argument. We need consider the
- fact that unmanages structures may have different sizes.
- (ves_pinvoke_method): do not call stackval_from_data if the result
- is a value type.
-
-Wed Jul 31 17:47:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: simplified some more branch code.
-
-Wed Jul 31 16:50:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fixed indentation, simplified some code.
-
-Wed Jul 31 14:29:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix so that mint can at least get to executing Main().
-
-2002-07-31 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c: use the new marshaling code. better delegate/remoting
- support.
- (ves_exec_method): bug fix - directly jump to handle_exception.
-
-2002-07-29 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (main): install compile_method handler
-
-Wed Jul 24 13:02:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: implemented stack walking function.
-
-Fri Jul 19 14:21:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix float boxing on LE systems.
-
-Sat Jul 13 19:54:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: advance ip in conv.r.un.
-
-2002-07-01 Dick Porter <dick@ximian.com>
-
- * interp.c (ves_exec): Removed unneeded argument to
- mono_runtime_run_main()
-
-2002-06-25 Dick Porter <dick@ximian.com>
-
- * interp.c (ves_exec): Pass the assembly to mono_runtime_run_main
-
-Wed Jun 19 17:01:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: un-broke after stack trace changes.
-
-Fri May 31 16:17:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c, hacks.h: compiler compatibility fixes.
-
-Fri May 31 13:25:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c, mint.1: added --config command line option.
-
-Thu May 30 14:14:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: lookup P/Invoke method addr only when needed.
-
-2002-05-29 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): free type in CEE_SIZEOF
-
-Tue May 28 16:10:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fixed SIZEOF to work with typedef/typeref.
-
-Fri May 24 15:33:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: added partial async delegate and remoting support.
-
-Thu May 23 18:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: special case string ctors in invoke.
- Handle null object in throw. Misc integer type mismatch fixes.
-
-2002-05-23 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_runtime_method): share more code with the jit.
-
-Wed May 22 12:31:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fixed finally handling. In trace mode show
- exception handling operations and the contents of the stack in the same
- line as the executing instruction.
-
-2002-05-20 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c: Updated help display.
-
-2002-05-20 Radek Doulik <rodo@ximian.com>
-
- * interp.c (dump_stack): print boxed values for --noptr
- (ves_exec_method): use stackval_to_data as pointed out by lupus
-
-2002-05-17 Radek Doulik <rodo@ximian.com>
-
- * interp.c (dump_stack): if --noptr then print content of strings
- in form [str:<printed string>]
-
-2002-05-16 Radek Doulik <rodo@ximian.com>
-
- * interp.c (ves_exec_method): use data.i instead of data.l in i32
- case
- (ves_exec_method): set type in I64 <--> I32 conversions
-
-2002-05-15 Radek Doulik <rodo@ximian.com>
-
- * interp.c (ves_runtime_method): moved stackval_from_data call
- inside #else branch, consulted on irc with lupus
-
-2002-05-15 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): use new mono_unhandled_exception()
-
-2002-05-14 Radek Doulik <rodo@ximian.com>
-
- * interp.c: introduced new --noptr option to suppres pointer
- address printing. I find this useful for comparing trace outputs
- while porting to ppc
-
-Tue May 14 16:37:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: some finally handling fixes and compilation fixes for
- changes in the runtime lib.
-
-2002-04-30 Dick Porter <dick@ximian.com>
-
- * interp.c: Tell glib to not abort when g_log() etc print
- recursively
-
-Mon Apr 22 16:52:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: handle muslticast delegates. Implement a couple more
- convert opcodes. Pretend we spend some time jitting...
-
-2002-04-20 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): support internalcall String constructors
-
-2002-04-19 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * interp.c: support for new szarray format.
-
-Tue Apr 16 20:12:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: removed profiling code (moved to common library).
- Implemented inlining for some special methods.
-
-2002-04-15 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * interp.c: Using fullnames when adding icall's (array)
-
-Wed Apr 10 16:07:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: quick implementation for opcodes needed by the new parse
- routines in corlib.
-
-Tue Apr 9 13:08:26 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: make the interp thread-safe wrt the metadata lib.
-
-Mon Apr 8 17:15:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: display return value with --trace.
- Call mono_runtime_init ().
-
-2002-04-06 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (interp_mono_runtime_invoke): handle more types,
- removed runtime_exec_main
-
-Thu Apr 4 11:36:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: don't try to get an IL opcode for runtime and internal
- call methods.
-
-Thu Mar 28 16:54:51 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: spring warning cleanup.
-
-Thu Mar 28 12:03:28 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: check obj address in stfld.
-
-2002-03-27 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): CASTCLASS: fix for transparent proxy
-
-Tue Mar 26 20:09:10 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: set frame->ip before dumping the stack trace.
-
-Tue Mar 26 19:54:45 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: remove glib mem vtable code.
-
-2002-03-26 Dick Porter <dick@ximian.com>
-
- * interp.c: Show thread ID's in trace output.
-
- New option "--traceclassinit" to put debug output around
- runtime_class_init().
-
- Make sure all options are displayed in usage().
-
-Tue Mar 26 17:03:14 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: support fieldrefs when accessing instance fields.
-
-Mon Mar 25 12:59:52 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: allow tracing to be done on a per-method basis.
- Fix interp_mono_runtime_invoke() to deal correcttly with the return
- value. Disable glib mem vtable setting.
-
-Thu Mar 21 18:08:37 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: set stack trace info when throwing an exception.
-
-Thu Mar 21 17:32:46 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: intern strings before executing a method (and don't
- intern command line arguments anymore). Add sanity checks in alloca
- use.
-
-Sat Mar 16 19:15:18 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: restore frame on return from unmanaged calls.
- Add support for continuing execution up to x IL insn.
- Fix exception handling when an exception is raised in the catch
- handler of the same method that issued the first one.
-
-2002-03-11 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_runtime_method): set method_info field
-
-Mon Mar 11 14:48:07 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: corlib consistency checls moved to libmetadata.
-
-Mon Mar 11 11:27:27 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: use the new facilities in debug-helpers to
- disassemble CIL code and match method names to MonoMethods.
-
-Thu Mar 7 17:20:59 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: Boehm-GC enable. Fix some overflow opcodes.
-
-Tue Mar 5 18:12:40 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix non-debug build and some more opcode work.
-
-Mon Mar 4 11:21:44 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: print the address of 'this' in tracing mode.
-
-Thu Feb 28 19:18:59 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: add checks for more binary consistency.
-
-2002-02-27 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (interp_mono_runtime_invoke): use alloca instead of g_new0
-
-Tue Feb 26 11:43:34 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: added profiling for object creation.
-
-Mon Feb 25 17:37:07 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: use correct value for guint64 max.
-
-2002-02-22 Radek Doulik <rodo@ximian.com>
-
- * interp.c: s/gulong/guint64 as it differs on ppc
-
-Wed Feb 20 22:18:40 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: more complete runtime_invoke () implementation.
- Fixed castclass/isinst to work correctly with arrays.
-
-Tue Feb 19 20:21:14 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: implement the runtime_invoke function.
-
-Mon Feb 18 15:49:20 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix alignment code. Make sure to init classes
- in more cases. Command-line arguments are interned.
-
-2002-02-16 Radek Doulik <rodo@ximian.com>
-
- * interp.c (ves_exec_method): test type of sp [-1] instead of sp
- [0], because sp [-1] is the value going to be shifted, fixed in
- CEE_SHL, CEE_SHR, CEE_UN opcodes)
-
-Sat Feb 16 12:00:24 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fixed cut&paste error for ldind.r4 and ldind.r8.
-
-Fri Feb 15 15:07:27 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: use strrchr instead of rindex. use _isnan and _finite on
- win32 systems.
-
-2002-02-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * interp.c (ves_exec_method): replace
- 'g_assert (sp->type = VAL_VALUETA)' with
- 'g_assert (sp->type == VAL_VALUETA)' otherwise
- the assert always passes. FIXME: should the test have been !=?
-
-2002-02-14 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (stackval_from_data): fix for MONO_TYPE_PTR
-
-Wed Feb 13 16:17:38 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fixed newobj implementation for valuetypes bug found by
- dietmar. sub.ovf dummy code.
-
-Tue Feb 12 14:08:47 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * hacks.h: check against redefining preprocessor symbol.
- * interp.c: fix profile info to return more sensible results.
-
-Mon Feb 11 13:05:29 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: added "die on exception" command line argument.
- When we segfault, set the message in the exception to "Segmentation
- fault" so people can recognise what's going on.
-
-2002-02-10 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c (ves_exec_method): Compare the element_class type token
- in the class we got as well, instead of the element class vs the
- toplevel class.
-
- This fixes the invalid cast exceptions during unboxing
-
-Fri Feb 8 13:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: use opcode information from libmetadata.
-
-2002-02-05 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): CEE_UNBOX: use element_class for
- type check.
-
-2002-02-04 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (main): impl. __array_Address icall
-
-Fri Feb 1 16:03:53 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: exception fixes. Use mono_method_pointer_get ()
- to easy porting to other archs. Some support for overflow detection.
-
-2002-01-25 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c, jit.c (main): install runtime_exec_main handler
- (main): bug fix - call TlsAlloc () before we execute code
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * interp.c: Added some kludges to cope with CONV_OVF_I2,
- CONV_OVF_I4 and ADD_OVF so that number formatting works. Also
- initialise and cleanup the network support.
-
-Thu Jan 10 20:59:59 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c, interp.h: add a flag to mono_create_trampoline ()
- to handle runtime methods.
-
-Sat Jan 5 15:45:14 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: allow classname:method name in --debug argument.
- Fix box opcode for valuetypes. Fix a few opcode to take a 16 bit
- index instead of 32 (stloc, ldloc, starg, etc.).
-
-Thu Jan 3 23:19:27 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: temporary mul.ovf, mul.ovf.un, add.ovf.un implementations
- to get the compiler going.
-
-Mon Dec 24 17:23:45 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix ldc.i8.
-
-Thu Dec 20 20:09:48 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix delegate method invocation to handle both
- static and instance methods.
-
-Tue Dec 18 18:48:50 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: make segv_handler static, handle runtime methods in stack
- trace.
-
-Thu Dec 13 20:24:28 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: correctly handle exceptions generated in C code.
- Install an handler for SIGSEGV. Bare-bones profiler and hook for the
- verifier.
-
-Mon Dec 3 17:15:44 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: call mono_init() after registering internal calls.
-
-2001-11-30 Dick Porter <dick@ximian.com>
-
- * interp.c: Replace get_named_exception() with
- mono_exception_from_name()
-
-Fri Nov 30 12:05:21 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: calculate locals and args offsets only once
- per method call. Cache trampoline code as well.
-
-2001-11-23 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): bug fix for exception5.cs
-
-Mon Nov 19 11:33:00 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: start adding support for handling exceptions across
- managed/unmanaged boundaries. Cleanup Delegate method invocation.
- Pass the correct target object in Delegate::Invoke and use the correct
- 'this' pointer in ldvirtftn (bugs pointed out by Dietmar).
-
-Thu Nov 15 17:40:24 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: handle enums with underlying type different from int32.
- More checks for C structs <-> C# objects consistency.
-
-Wed Nov 14 19:23:00 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: move the stack frame dumping code to a function so it can
- be called from the debugger. Fix virtual method lookup for interfaces.
- Throw exceptions instead of aborting in more places.
- Print also the message in an exception. Updates for field renames in
- corlib.
-
-2001-11-09 Dick Porter <dick@ximian.com>
-
- * Makefile.am (mint_LDADD): Don't need THREAD_LIBS any more
-
-2001-11-07 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c: Include stdlib to kill warning.
- (check_corlib): Adjust format encodings to remove warnings.
-
-Wed Nov 7 15:47:36 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: updates for changes in array code.
-
-Fri Nov 2 19:06:54 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: hanlde field refs. Throw an exception on NULL references.
- Check consistency of corlib types with the C struct representation.
-
-2001-10-25 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): use relative numbering for runtime
- type checks (and make it work with interfaces)
-
-2001-10-15 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c: removed newobj()
-
-2001-10-10 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (get_virtual_method): use the vtable
- (arch_compile_method): added to compute vtable entry
-
-Mon Oct 8 16:14:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: use the accessors provided in object.h to deal with
- MonoArrays. Updates for API renames in metadata. Throw exception
- in ldelema if index is out of bounds.
-
-Mon Oct 8 10:44:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fixes for changes in metadata.
-
-2001-10-04 Dick Porter <dick@ximian.com>
-
- * interp.c (ves_runtime_method): init_class() the
- mono_defaults.delegate_class
- Include mono-endian.h not endian.h
-
-Tue Oct 2 18:51:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: set frame->ip in the leave opcode. Make db_methods static.
-
-Sun Sep 30 11:57:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: compiler and ANSI C portability fixes.
-
-Fri Sep 28 19:37:46 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: Implemented ldtoken, conv.ovf.i. Use MonoClass->byval_arg
- (and remove related kludges). Don't choke on access to arrays of
- references. Throw an exception when an internalcall or P/Invoke
- function don't have an implementation. Throw and EngineException
- for unimplemented opcodes.
-
-Tue Sep 25 11:12:35 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fixed get_virtual_method () to deal with interface
- methods better.
-
-Mon Sep 24 18:50:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: catch a few more error conditions with exceptions instead of
- erroring out.
- Don't use g_print() in stack traces because it doesn't work with
- some float values.
- When we call an instance method of a valuetype class, unbox the 'this'
- argument if it is an object.
- Use mono_ldstr () to implement the ldstr opcode: it takes care of
- interning the string if necessary.
- Implemented new opcodes: ckfinite, cgt.un, clt.un, ldvirtftn, ldarga.
- Fixes to handle NaNs when comparing doubles.
- Make sure the loaded assembly has an entry point defined.
- Fixed portability bugs in neg and not opcodes.
-
-2001-09-24 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): LDC_I4: 8bit constants are signed
- (ves_exec_method): bug fix for NOT/NEG
- (main): fix bug in parameter parsing
-
-2001-09-23 Dick Porter <dick@ximian.com>
-
- * Makefile.am (mint_LDADD): rename PTHREAD_LIBS to THREAD_LIBS
-
-2001-09-23 Dick Porter <dick@ximian.com>
-
- * interp.c (main): Do some thread setup and cleanup around the
- call to ves_exec()
-
-2001-09-21 Dick Porter <dick@ximian.com>
-
- * Makefile.am (mint_LDADD): Added PTHREAD_LIBS to the link line
-
-Thu Sep 20 16:32:42 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: implemented some more opcodes: calli, rem.un,
- shr.un, conv.u, cpobj, stobj, conv.r.un, conv.ovf.i1.un,
- conv.ovf.i2.un, conv.ovf.i4.un, conv.ovf.i8.un, conv.ovf.i.un,
- conv.ovf.u1.un, conv.ovf.u2.un, conv.ovf.u4.un, conv.ovf.u8.un,
- conv.ovf.u.un.
- Fix some 64 bit issues in the array element access code and a small bug.
- Throw an exception on index out of range instead of asserting.
- Throw an exception on a NULL array instead of dying.
- Stomped a memory corruption bug (.cctor methods were freed after
- executing them, but they are stores in MonoClass now...).
- Added a simple facility to invoke the debugger when a named
- function is entered (use the cmdline option --debug method_name).
- * interp.h: fix 64 bit issue.
-
-Tue Sep 18 13:21:33 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix some 64 bit issues. Safer support for delegates.
-
-2001-09-12 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c (ves_exec_method): implement conv.u8 opcode.
-
-Mon Sep 10 20:20:36 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: endian fixes, comments.
-
-Fri Sep 7 18:45:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c, interp.h: make ves_exec_method () and stackval_from_data ()
- non static. Implement a couple of runtime methods needed to
- use delegates (ves_runtime_method ()).
- Implemented ldftn opcode.
-
-Thu Sep 6 15:41:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * Makefile.am: link to libmonoarch.
- * interp.h, interp.c: use mono_create_trampoline ().
- Pass the command line arguments to Main (String[]) methods.
-
-2001-08-30 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_pinvoke_method): removed the libffi dependency
-
-2001-08-29 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_array_set): moved from icall.c
- (ves_array_get): moved from icall.c
-
- * icall.c: moved to metadata/icall.c
-
-Wed Aug 29 12:46:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: some small optimizations. Fixes to do signed
- compares when needed. Change C++ comments into C.
- Implemented cgt, clt. Added --opcode-count cmdline switch.
-
-2001-08-28 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): better check for value types (get
- the class to detect if we have a value type), implemented CEE_CONV_U1,
- CEE_CONV_U2, CEE_CEQ
-
-
-Mon Aug 27 21:30:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: warn and exit when Main () expects the cmdline arguments
- instead of creashing.
-
-Mon Aug 27 20:16:37 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: merge isinst/castclass handling. Hopefully implement
- the right semantics for handling callvirt correctly (changes
- here and there to support it). Integrate bugfix from Dietmar quickly
- so he needs to handle the cvs conflict:-)
-
-Mon Aug 27 12:20:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix compilation and updates for changes in metadata/.
-
-2001-08-26 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c (main): Add option handling for the interpreter,
- support the `--trace' option.
-
-Sun Aug 26 23:04:46 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: get in a dummy virtual method dispatch.
- Added support for int64, native int and native uint as arguments.
- Added debug enter/leave for icall and pinvoke methods, too.
- Implement opcodes conv.i, conv.i8, ldelema.
-
-Sun Aug 26 11:37:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.h, interp.c: load also a MonoClass pointer when we load
- an address on the stack. Implemented conv.i1, conv.i2, con.i4,
- conv.u4, conv.r4, conv.r8. Print the arguments in the stack trace
- and the name of the exception.
-
-Sat Aug 25 15:56:03 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: Implemented some opcodes: starg.s, ldobj, isinst,
- ldarg, starg, ldloc, ldloca, stloc, initobj, cpblk, sizeof.
-
-Sat Aug 25 12:57:36 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: handle enumerations specially (not as valuetypes).
-
-Fri Aug 24 19:34:04 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.h, interp.c: add support for valuetypes.
-
-Fri Aug 24 16:09:20 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: updates for merge of MonoParam in MonoType.
-
-Thu Aug 23 12:04:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: removed beforefieldinit check, it's a useless flag.
- Added a couple more test cases to tests/ dir.
-
-2001-08-22 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c (usage): Add version information
- (ves_pinvoke_method): Typo fix.
-
-Wed Aug 22 20:37:51 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: simplified init_class (). Make sure a class
- is fully initialized before executing a method in the class.
- Search for the class constructor only on beforefieldinit classes.
- Implement a bunch of opcodes: br, brfalse, brtrue, beq, bge,
- bgt, blt, ble, bne.un, bge.un, bgt.un, ble.un, blt.un, stind.i,
- ldflda, ldsflda, ldelem.i8, stelem.i8, leave.
-
-Wed Aug 22 16:34:03 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: Updates for changes in metadata/. Better output in debug mode
- and in the stack trace. Completed rethrow handling
-
-Tue Aug 21 18:56:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: new macro INIT_FRAME() to properly
- initialize a MonoInvocation. Fixed a couple of buglets in exception code:
- increase stack pointer when pushing the exception for catch blocks,
- initialize frame->ex_handler to NULL, correctly try all the
- catch blocks (don't incorrectly fallback on filter handling).
- Added a couple more checks where we may need to throw an
- exception. Added more exception creation functions.
- Changed stackval_from_data() to take the target stackval as
- argument. Implemented a couple more opcodes.
- * interp.h: prepare stackval for value type code.
-
-2001-08-21 Miguel de Icaza <miguel@ximian.com>
-
- * Makefile.am (mint_LDADD): Renamed interpreter to mint.
-
-2001-08-21 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (get_named_exception): use the right constructor.
-
-Mon Aug 20 18:58:36 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix buglet with the leave.s opcode.
-
-2001-08-20 Dietmar Maurer <dietmar@ximian.com>
-
- * icall.c: changed everything to support the new calling convention
-
- * hacks.h: added some macros for FreeBSD
-
- * interp.c (get_named_exception): use mono_object_new instead of
- newobj, initialize the stack before we call the constructor.
-
-Sat Aug 18 12:43:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c, interp.h: added support code to create exceptions.
- Changed interncal calling convnetion over to MonoInvocation, to support
- exceptions, walking the stack back and forward and passing the 'this'
- pointer separately (remove the cludges required before to pass this on the
- stack). Use alloca heavily for both local vars and a copy of the incoming
- arguments. Init local vars to zero.
- Simplify stackval_from_data() and stackval_to_data() to only take a pointer
- instead of pointer + offset.
- Implement a few exceptions-related opcodes and the code to run finally, fault and
- catch blocks as well as a stack trace if no handler is found.
-
-2001-08-16 Alex Graveley <alex@ximian.com>
-
- * Makefile.am (mono_int_LDADD): Link with ../../libffi/libffi.a
- instead of ../../libffi/.libs/libffi.a.
-
-2001-08-10 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): impl CASTCLASS
-
- * icall.c: moved the internal call stuff to this file
-
- * interp.c (ves_exec_method): impl. BOX/UNBOX
- (ves_icall_System_Array_GetValue): impl.
- (ves_icall_System_Array_SetValue): impl.
- added myself to Authors
-
-2001-08-09 Dietmar Maurer <dietmar@ximian.com>
-
- * implemented arrays, but you will need a modified version of
- Array.cs to get arrays working (will commit soon)
-
- * interp.c (ves_icall_array_Set): impl.
- (ves_icall_array_Get): impl.
- (ves_icall_array_ctor): impl.
- (ves_icall_System_Array_GetRank): impl.
- (ves_icall_System_Array_GetLength): impl.
- (ves_icall_System_Array_GetLowerBound): impl.
- (mono_lookup_internal_call): impl.
-
-2001-08-06 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): impl. NEWARR
- (ves_exec_method): impl. most LDELEM/STELEM opcodes, LDLEN
- (newarr): impl.
- (mono_get_ansi_string): impl.
- (mono_lookup_internal_call): impl.
- (ves_exec_method): implemented internal calls
-
-2001-08-05 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_pinvoke_method): removed all static vars.
-
-2001-08-02 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): found a way to do unordered
- compares, implemented CEE_BNE_UN_S, CEE_BGE_UN_S, CEE_BGT_UN_S,
- CEE_BLE_UN_S, CEE_BLT_UN_S
-
-Wed Aug 1 22:51:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: handle also MONO_TYPE_CLASS to/from the stack.
- Change locals to be a memory blob, instead of the structured
- (but wrong) stackval. Implement bne.un.s opcode. Make the program
- exit with the error code from Main().
-
-2001-08-01 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_exec_method): implemented LDSTR
-
-2001-07-31 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c (GET_NATI): Switched from using nati_t to cli/types.h
- m_i type. Maybe we should rename the types to be m_i_t instead of
- m_i alone.
-
- Make the code compile after I broke it.
-
-Tue Jul 31 23:46:33 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: fix cleanup.
- * Makefile.am: don't link with disassembler library.
-
-2001-07-31 Miguel de Icaza <miguel@ximian.com>
-
- (ves_exec_method): Cleanup of the source code.
-
-Tue Jul 31 20:13:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: implement stind.*, ldind.*, ldloca.s opcodes.
- Provide better tracing with DEBUG_INTERP.
-
-Tue Jul 31 17:52:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: massive namespace cleanup.
-
-Mon Jul 30 20:09:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: update to use mono_method->name.
-
-Fri Jul 27 20:54:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: start implementing callvirt. Classes with
- class constructors are properly initialized when needed.
- Fix error introduced in version 1.17.
-
-Fri Jul 27 14:03:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: implement static field loading and storing.
-
-2001-07-27 Dietmar Maurer <dietmar@ximian.com>
-
- * interp.c (ves_pinvoke_method): impl.
-
-Fri Jul 27 11:49:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: Removed some debugging printouts. Made stackval_to_data
- static. Handle also instance methods in CALL opcode. Fix ret to properly
- deal with void functions. Fixed constructor to leave the object on
- the stack.
-
-Thu Jul 26 13:24:51 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c: ves_exec_method () doesn't take a MonoImage arg
- anymore. Use the method cache in MonoImage. Updates to
- mache recent changes in metadata.
- Fix newobj code to use new metadata features. Call the class
- constructor after allocationg the object. Implemented load field
- and store field opcodes (the support functions need to be finished).
-
-Tue Jul 24 16:51:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * interp.c, hacks.h: moved a few ugly macros out of the code.
- Implemented switch opcode.
-
-2001-07-23 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c (newobj): Added function to handle newobj opcode.
-
-2001-07-18 Miguel de Icaza <miguel@ximian.com>
-
- * interp.c (ves_exec_method): Make the interpreter abort with more
- information than it currently does.
-
- Enable the slow processor, as it is easier to debug.
-
-Sun Jul 15 17:50:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * Started changelog.
- * interp.c: use new mono_get_method () function to get the complete
- info on a method invocation: we support now method invocation with
- multiple (or zero) simple arguments and with or without a return value.
- Implement also a couple more opcodes.
+++ /dev/null
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- $(LIBGC_CPPFLAGS) \
- $(GLIB_CFLAGS)
-
-if HOST_WIN32
-export HOST_CC
-# The mingw math.h has "extern inline" functions that dont appear in libs, so
-# optimisation is required to actually inline them
-AM_CFLAGS = -O
-endif
-
-if INTERP_SUPPORTED
-bin_PROGRAMS = mint
-
-lib_LTLIBRARIES = libmint.la
-
-man_MANS = mint.1
-endif
-
-mint_SOURCES = \
- main.c
-
-mint_LDADD = \
- libmint.la
-
-libmint_la_SOURCES = \
- hacks.h \
- interp.h \
- interp.c \
- mintops.h \
- mintops.def \
- mintops.c \
- transform.c
-
-libmintincludedir = $(includedir)/mono-$(API_VER)/mono/interpreter
-
-libmintinclude_HEADERS = \
- embed.h
-
-# This is needed for automake dependency generation
-if INCLUDED_LIBGC
-libgc_libs=../../libgc/libmonogc.la
-else
-libgc_libs=$(LIBGC_LIBS)
-endif
-
-libmint_la_LIBADD = \
- ../arch/libmonoarch.la \
- ../metadata/libmonoruntime.la \
- ../io-layer/libwapi.la \
- ../utils/libmonoutils.la \
- $(libgc_libs) \
- $(GLIB_LIBS) \
- $(LIBICONV) \
- $(ICU_LIBS) \
- -lm
-
-EXTRA_DIST = $(man_MANS)
+++ /dev/null
-#include <mono/metadata/object.h>
-#include <mono/metadata/appdomain.h>
-
-int
-mono_main (int argc, char* argv[]);
-
-MonoDomain *
-mono_interp_init(const char *file);
-
-int
-mono_interp_exec(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]);
-
-void
-mono_interp_cleanup(MonoDomain *domain);
-
+++ /dev/null
-/* we need some special math function */
-#ifndef _ISOC99_SOURCE
-#define _ISOC99_SOURCE
-#endif
-#include <math.h>
-
-/* which are not defined on FreeBSD */
-#ifdef __GNUC__
-
-#ifndef isunordered
-# define isunordered(u, v) \
- (__extension__ \
- ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
- isnan(__u) || isnan(__v); }))
-#endif
-
-#ifndef islessgreater
-# define islessgreater(x, u) \
- (__extension__ \
- ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered (__x, __y) && (__x < __y) || (__y < __x); }))
-#endif
-
-#ifndef islessequal
-# define islessequal(x, y) \
- (__extension__ \
- ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered(__x, __y) && __x <= __y; }))
-#endif
-
-#ifndef isless
-# define isless(x, y) \
- (__extension__ \
- ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered(__x, __y) && __x < __y; }))
-#endif
-
-#ifndef isgreater
-# define isgreater(x, y) \
- (__extension__ \
- ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered(__x, __y) && __x > __y; }))
-#endif
-
-#else
-
-/* isunordered seems to crash on HPUX when built 64 bits
- so use generic implementation.
-*/
-#if defined(__hpux) && SIZEOF_VOID_P == 8
-#undef isunordered
-#undef islessgreater
-#undef islessequal
-#undef isless
-#undef isgreater
-#endif
-
-#ifndef isunordered
-# define isunordered(u, v) (isnan(u) || isnan(v))
-#endif
-
-#ifndef islessgreater
-# define islessgreater(x, u) (!isunordered (x, y) && (x < y) || (y < x))
-#endif
-
-#ifndef islessequal
-# define islessequal(x, y) (!isunordered(x, y) && x <= y)
-#endif
-
-#ifndef isless
-# define isless(x, y) (!isunordered(x, y) && x < y)
-#endif
-
-#ifndef isgreater
-# define isgreater(x, y) (!isunordered(x, y) && x > y)
-#endif
-
-#endif
-
-/*
- * Attempt at using the goto label construct of GNU GCC:
- * it turns out this does give some benefit: 5-15% speedup.
- * Don't look at these macros, it hurts...
- */
-#define GOTO_LABEL
-#undef GOTO_LABEL
-#ifdef GOTO_LABEL
-
-#define SWITCH(a) goto *goto_map [(a)];
-#define BREAK SWITCH(*ip)
-#define CASE(l) l ## _LABEL:
-#define DEFAULT \
- CEE_ILLEGAL_LABEL: \
- CEE_ENDMAC_LABEL:
-#define SUB_SWITCH \
- CEE_PREFIX1_LABEL: \
- CEE_ARGLIST_LABEL: \
- CEE_CEQ_LABEL: \
- CEE_CGT_LABEL: \
- CEE_CGT_UN_LABEL: \
- CEE_CLT_LABEL: \
- CEE_CLT_UN_LABEL: \
- CEE_LDFTN_LABEL: \
- CEE_LDVIRTFTN_LABEL: \
- CEE_UNUSED56_LABEL: \
- CEE_LDARG_LABEL: \
- CEE_LDARGA_LABEL: \
- CEE_STARG_LABEL: \
- CEE_LDLOC_LABEL: \
- CEE_LDLOCA_LABEL: \
- CEE_STLOC_LABEL: \
- CEE_LOCALLOC_LABEL: \
- CEE_UNUSED57_LABEL: \
- CEE_ENDFILTER_LABEL: \
- CEE_UNALIGNED__LABEL: \
- CEE_VOLATILE__LABEL: \
- CEE_TAIL__LABEL: \
- CEE_INITOBJ_LABEL: \
- CEE_UNUSED68_LABEL: \
- CEE_CPBLK_LABEL: \
- CEE_INITBLK_LABEL: \
- CEE_UNUSED69_LABEL: \
- CEE_RETHROW_LABEL: \
- CEE_UNUSED_LABEL: \
- CEE_SIZEOF_LABEL: \
- CEE_REFANYTYPE_LABEL: \
- CEE_UNUSED52_LABEL: \
- CEE_UNUSED53_LABEL: \
- CEE_UNUSED54_LABEL: \
- CEE_UNUSED55_LABEL: \
- CEE_UNUSED70_LABEL:
-#define GOTO_LABEL_VARS \
- const static void * const goto_map [] = {\
-#define OPDEF(a,b,c,d,e,f,g,h,i,j) \ \
- && a ## _LABEL, \
-#include "mono/cil/opcode.def" \
-#undef OPDEF \
- &&DUMMY_LABEL \
- }; \
- DUMMY_LABEL:
-
-#else
-
-#define SWITCH(a) switch(a)
-#define BREAK break
-#define CASE(l) case l:
-#define DEFAULT \
- default: \
- g_error ("Unimplemented opcode: %x at 0x%x\n", *ip, ip-header->code);
-#define SUB_SWITCH case 0xFE:
-#define GOTO_LABEL_VARS
-
-#endif
+++ /dev/null
-/*
- * PLEASE NOTE: This is a research prototype.
- *
- *
- * interp.c: Interpreter for CIL byte codes
- *
- * Authors:
- * Paolo Molaro (lupus@ximian.com)
- * Miguel de Icaza (miguel@ximian.com)
- * Dietmar Maurer (dietmar@ximian.com)
- *
- * (C) 2001, 2002 Ximian, Inc.
- */
-#ifndef __USE_ISOC99
-#define __USE_ISOC99
-#endif
-#include "config.h"
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <math.h>
-#include <locale.h>
-
-#include <mono/utils/gc_wrapper.h>
-
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#else
-# ifdef __CYGWIN__
-# define alloca __builtin_alloca
-# endif
-#endif
-
-/* trim excessive headers */
-#include <mono/metadata/image.h>
-#include <mono/metadata/assembly.h>
-#include <mono/metadata/cil-coff.h>
-#include <mono/metadata/mono-endian.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/metadata/loader.h>
-#include <mono/metadata/threads.h>
-#include <mono/metadata/threadpool.h>
-#include <mono/metadata/profiler-private.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/reflection.h>
-#include <mono/metadata/exception.h>
-#include <mono/metadata/verify.h>
-#include <mono/metadata/opcodes.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/mono-config.h>
-#include <mono/metadata/marshal.h>
-#include <mono/metadata/environment.h>
-#include <mono/metadata/mono-debug.h>
-#include <mono/os/util.h>
-
-#include "interp.h"
-#include "mintops.h"
-#include "embed.h"
-#include "hacks.h"
-
-#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
- a = i,
-
-enum {
-#include "mono/cil/opcode.def"
- CEE_LASTOP
-};
-#undef OPDEF
-
-/* Mingw 2.1 doesnt need this any more, but leave it in for now for older versions */
-#ifdef _WIN32
-#define isnan _isnan
-#define finite _finite
-#endif
-#ifndef HAVE_FINITE
-#ifdef HAVE_ISFINITE
-#define finite isfinite
-#endif
-#endif
-
-static gint *abort_requested;
-
-/* If true, then we output the opcodes as we interpret them */
-static int global_tracing = 0;
-static int global_no_pointers = 0;
-
-int mono_interp_traceopt = 0;
-
-static int debug_indent_level = 0;
-
-#define INIT_FRAME(frame,parent_frame,obj_this,method_args,method_retval,mono_method) \
- do { \
- (frame)->parent = (parent_frame); \
- (frame)->obj = (obj_this); \
- (frame)->stack_args = (method_args); \
- (frame)->retval = (method_retval); \
- (frame)->runtime_method = mono_interp_get_runtime_method (mono_method); \
- (frame)->ex = NULL; \
- (frame)->ip = NULL; \
- (frame)->invoke_trap = 0; \
- } while (0)
-
-void ves_exec_method (MonoInvocation *frame);
-
-static char* dump_stack (stackval *stack, stackval *sp);
-static char* dump_frame (MonoInvocation *inv);
-static MonoArray *get_trace_ips (MonoDomain *domain, MonoInvocation *top);
-static void ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context);
-
-typedef void (*ICallMethod) (MonoInvocation *frame);
-
-static guint32 die_on_exception = 0;
-static guint32 thread_context_id = 0;
-
-#define DEBUG_INTERP 1
-#define COUNT_OPS 0
-#if DEBUG_INTERP
-
-static int break_on_method = 0;
-static int nested_trace = 0;
-static GList *db_methods = NULL;
-
-static void
-output_indent (void)
-{
- int h;
-
- for (h = 0; h < debug_indent_level; h++)
- g_print (" ");
-}
-
-static void
-db_match_method (gpointer data, gpointer user_data)
-{
- MonoMethod *m = (MonoMethod*)user_data;
- MonoMethodDesc *desc = data;
-
- if (mono_method_desc_full_match (desc, m))
- break_on_method = 1;
-}
-
-#define DEBUG_ENTER() \
- if (db_methods) { \
- g_list_foreach (db_methods, db_match_method, (gpointer)frame->runtime_method->method); \
- if (break_on_method) tracing=nested_trace ? (global_tracing = 2, 3) : 2; \
- break_on_method = 0; \
- } \
- if (tracing) { \
- MonoMethod *method = frame->runtime_method->method ;\
- char *mn, *args = dump_args (frame); \
- debug_indent_level++; \
- output_indent (); \
- mn = mono_method_full_name (method, FALSE); \
- g_print ("(%u) Entering %s (", GetCurrentThreadId(), mn); \
- g_free (mn); \
- g_print ("%s)\n", args); \
- g_free (args); \
- } \
- if (mono_profiler_events & MONO_PROFILE_ENTER_LEAVE) \
- mono_profiler_method_enter (frame->runtime_method->method);
-
-#define DEBUG_LEAVE() \
- if (tracing) { \
- char *mn, *args; \
- args = dump_retval (frame); \
- output_indent (); \
- mn = mono_method_full_name (frame->runtime_method->method, FALSE); \
- g_print ("(%u) Leaving %s", GetCurrentThreadId(), mn); \
- g_free (mn); \
- g_print (" => %s\n", args); \
- g_free (args); \
- debug_indent_level--; \
- if (tracing == 3) global_tracing = 0; \
- } \
- if (mono_profiler_events & MONO_PROFILE_ENTER_LEAVE) \
- mono_profiler_method_leave (frame->runtime_method->method);
-
-#else
-
-#define DEBUG_ENTER()
-#define DEBUG_LEAVE()
-
-#endif
-
-static void
-interp_ex_handler (MonoException *ex) {
- ThreadContext *context = TlsGetValue (thread_context_id);
- char *stack_trace;
- if (context == NULL)
- return;
- stack_trace = dump_frame (context->current_frame);
- ex->stack_trace = mono_string_new (mono_domain_get(), stack_trace);
- g_free (stack_trace);
- if (context->current_env == NULL || strcmp(ex->object.vtable->klass->name, "ExecutionEngineException") == 0) {
- char *strace = mono_string_to_utf8 (ex->stack_trace);
- fprintf(stderr, "Nothing can catch this exception: ");
- fprintf(stderr, "%s", ex->object.vtable->klass->name);
- if (ex->message != NULL) {
- char *m = mono_string_to_utf8 (ex->message);
- fprintf(stderr, ": %s", m);
- g_free(m);
- }
- fprintf(stderr, "\n");
- fprintf(stderr, "%s\n", strace);
- g_free (strace);
- if (ex->inner_ex != NULL) {
- ex = (MonoException *)ex->inner_ex;
- fprintf(stderr, "Inner exception: %s", ex->object.vtable->klass->name);
- if (ex->message != NULL) {
- char *m = mono_string_to_utf8 (ex->message);
- fprintf(stderr, ": %s", m);
- g_free(m);
- }
- strace = mono_string_to_utf8 (ex->stack_trace);
- fprintf(stderr, "\n");
- fprintf(stderr, "%s\n", strace);
- g_free (strace);
- }
- /* wait for other threads to also collapse */
- Sleep(1000);
- exit(1);
- }
- context->env_frame->ex = ex;
- context->search_for_handler = 1;
- longjmp (*context->current_env, 1);
-}
-
-static void
-ves_real_abort (int line, MonoMethod *mh,
- const unsigned short *ip, stackval *stack, stackval *sp)
-{
- fprintf (stderr, "Execution aborted in method: %s::%s\n", mh->klass->name, mh->name);
- fprintf (stderr, "Line=%d IP=0x%04x, Aborted execution\n", line,
- ip-(const unsigned short *)mono_method_get_header (mh)->code);
- g_print ("0x%04x %02x\n",
- ip-(const unsigned short *)mono_method_get_header (mh)->code, *ip);
- if (sp > stack)
- printf ("\t[%d] 0x%08x %0.5f\n", sp-stack, sp[-1].data.i, sp[-1].data.f);
-}
-
-#define ves_abort() \
- do {\
- ves_real_abort(__LINE__, frame->runtime_method->method, ip, frame->stack, sp); \
- THROW_EX (mono_get_exception_execution_engine (NULL), ip); \
- } while (0);
-
-static gpointer
-interp_create_remoting_trampoline (MonoMethod *method, MonoRemotingTarget target)
-{
- return mono_interp_get_runtime_method (mono_marshal_get_remoting_invoke_for_target (method, target));
-}
-
-static CRITICAL_SECTION runtime_method_lookup_section;
-
-RuntimeMethod*
-mono_interp_get_runtime_method (MonoMethod *method)
-{
- MonoDomain *domain = mono_domain_get ();
- RuntimeMethod *rtm;
-
- EnterCriticalSection (&runtime_method_lookup_section);
- if ((rtm = mono_internal_hash_table_lookup (&domain->jit_code_hash, method))) {
- LeaveCriticalSection (&runtime_method_lookup_section);
- return rtm;
- }
- rtm = mono_mempool_alloc (domain->mp, sizeof (RuntimeMethod));
- memset (rtm, 0, sizeof (*rtm));
- rtm->method = method;
- rtm->param_count = mono_method_signature (method)->param_count;
- rtm->hasthis = mono_method_signature (method)->hasthis;
- rtm->valuetype = method->klass->valuetype;
- mono_internal_hash_table_insert (&domain->jit_code_hash, method, rtm);
- LeaveCriticalSection (&runtime_method_lookup_section);
-
- return rtm;
-}
-
-static gpointer
-interp_create_trampoline (MonoMethod *method)
-{
- if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
- method = mono_marshal_get_synchronized_wrapper (method);
- return mono_interp_get_runtime_method (method);
-}
-
-static inline RuntimeMethod*
-get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
-{
- MonoMethod *m = runtime_method->method;
-
- if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
- if (obj->vtable->klass == mono_defaults.transparent_proxy_class)
- return mono_interp_get_runtime_method (mono_marshal_get_remoting_invoke (m));
- else if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
- return mono_interp_get_runtime_method (mono_marshal_get_synchronized_wrapper (m));
- else
- return runtime_method;
- }
-
- if (m->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
- return ((RuntimeMethod **)obj->vtable->interface_offsets [m->klass->interface_id]) [m->slot];
- } else {
- return ((RuntimeMethod **)obj->vtable->vtable) [m->slot];
- }
-}
-
-void inline
-stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke)
-{
- if (type->byref) {
- switch (type->type) {
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_STRING:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
- break;
- default:
- break;
- }
- result->data.p = *(gpointer*)data;
- return;
- }
- switch (type->type) {
- case MONO_TYPE_VOID:
- return;
- case MONO_TYPE_I1:
- result->data.i = *(gint8*)data;
- return;
- case MONO_TYPE_U1:
- case MONO_TYPE_BOOLEAN:
- result->data.i = *(guint8*)data;
- return;
- case MONO_TYPE_I2:
- result->data.i = *(gint16*)data;
- return;
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- result->data.i = *(guint16*)data;
- return;
- case MONO_TYPE_I4:
- result->data.i = *(gint32*)data;
- return;
- case MONO_TYPE_U:
- case MONO_TYPE_I:
- result->data.nati = *(mono_i*)data;
- return;
- case MONO_TYPE_PTR:
- result->data.p = *(gpointer*)data;
- return;
- case MONO_TYPE_U4:
- result->data.i = *(guint32*)data;
- return;
- case MONO_TYPE_R4:
- result->data.f = *(float*)data;
- return;
- case MONO_TYPE_I8:
- case MONO_TYPE_U8:
- result->data.l = *(gint64*)data;
- return;
- case MONO_TYPE_R8:
- result->data.f = *(double*)data;
- return;
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_ARRAY:
- result->data.p = *(gpointer*)data;
- return;
- case MONO_TYPE_VALUETYPE:
- if (type->data.klass->enumtype) {
- stackval_from_data (type->data.klass->enum_basetype, result, data, pinvoke);
- return;
- } else {
- int size;
-
- if (pinvoke)
- size = mono_class_native_size (type->data.klass, NULL);
- else
- size = mono_class_value_size (type->data.klass, NULL);
- memcpy (result->data.vt, data, size);
- }
- return;
- default:
- g_warning ("got type 0x%02x", type->type);
- g_assert_not_reached ();
- }
-}
-
-void inline
-stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke)
-{
- if (type->byref) {
- gpointer *p = (gpointer*)data;
- *p = val->data.p;
- return;
- }
- /* printf ("TODAT0 %p\n", data); */
- switch (type->type) {
- case MONO_TYPE_I1:
- case MONO_TYPE_U1: {
- guint8 *p = (guint8*)data;
- *p = val->data.i;
- return;
- }
- case MONO_TYPE_BOOLEAN: {
- guint8 *p = (guint8*)data;
- *p = (val->data.i != 0);
- return;
- }
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR: {
- guint16 *p = (guint16*)data;
- *p = val->data.i;
- return;
- }
- case MONO_TYPE_I: {
- mono_i *p = (mono_i*)data;
- /* In theory the value used by stloc should match the local var type
- but in practice it sometimes doesn't (a int32 gets dup'd and stloc'd into
- a native int - both by csc and mcs). Not sure what to do about sign extension
- as it is outside the spec... doing the obvious */
- *p = (mono_i)val->data.nati;
- return;
- }
- case MONO_TYPE_U: {
- mono_u *p = (mono_u*)data;
- /* see above. */
- *p = (mono_u)val->data.nati;
- return;
- }
- case MONO_TYPE_I4:
- case MONO_TYPE_U4: {
- gint32 *p = (gint32*)data;
- *p = val->data.i;
- return;
- }
- case MONO_TYPE_I8:
- case MONO_TYPE_U8: {
- gint64 *p = (gint64*)data;
- *p = val->data.l;
- return;
- }
- case MONO_TYPE_R4: {
- float *p = (float*)data;
- *p = val->data.f;
- return;
- }
- case MONO_TYPE_R8: {
- double *p = (double*)data;
- *p = val->data.f;
- return;
- }
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_PTR: {
- gpointer *p = (gpointer*)data;
- *p = val->data.p;
- return;
- }
- case MONO_TYPE_VALUETYPE:
- if (type->data.klass->enumtype) {
- stackval_to_data (type->data.klass->enum_basetype, val, data, pinvoke);
- return;
- } else {
- int size;
-
- if (pinvoke)
- size = mono_class_native_size (type->data.klass, NULL);
- else
- size = mono_class_value_size (type->data.klass, NULL);
-
- memcpy (data, val->data.p, size);
- }
- return;
- default:
- g_warning ("got type %x", type->type);
- g_assert_not_reached ();
- }
-}
-
-static void
-fill_in_trace (MonoException *exception, MonoInvocation *frame)
-{
- char *stack_trace = dump_frame (frame);
- MonoDomain *domain = mono_domain_get();
- (exception)->stack_trace = mono_string_new (domain, stack_trace);
- (exception)->trace_ips = get_trace_ips (domain, frame);
- g_free (stack_trace);
-}
-
-#define FILL_IN_TRACE(exception, frame) fill_in_trace(exception, frame)
-
-#define THROW_EX(exception,ex_ip) \
- do {\
- frame->ip = (ex_ip); \
- frame->ex = (MonoException*)(exception); \
- FILL_IN_TRACE(frame->ex, frame); \
- goto handle_exception; \
- } while (0)
-
-static MonoObject*
-ves_array_create (MonoDomain *domain, MonoClass *klass, MonoMethodSignature *sig, stackval *values)
-{
- guint32 *lengths;
- guint32 *lower_bounds;
- int i;
-
- lengths = alloca (sizeof (guint32) * klass->rank * 2);
- for (i = 0; i < sig->param_count; ++i) {
- lengths [i] = values->data.i;
- values ++;
- }
- if (klass->rank == sig->param_count) {
- /* Only lengths provided. */
- lower_bounds = NULL;
- } else {
- /* lower bounds are first. */
- lower_bounds = lengths;
- lengths += klass->rank;
- }
- return (MonoObject*)mono_array_new_full (domain, klass, lengths, lower_bounds);
-}
-
-static void
-ves_array_set (MonoInvocation *frame)
-{
- stackval *sp = frame->stack_args;
- MonoObject *o;
- MonoArray *ao;
- MonoClass *ac;
- gint32 i, t, pos, esize;
- gpointer ea;
- MonoType *mt;
-
- o = frame->obj;
- ao = (MonoArray *)o;
- ac = o->vtable->klass;
-
- g_assert (ac->rank >= 1);
-
- pos = sp [0].data.i;
- if (ao->bounds != NULL) {
- pos -= ao->bounds [0].lower_bound;
- for (i = 1; i < ac->rank; i++) {
- if ((t = sp [i].data.i - ao->bounds [i].lower_bound) >=
- ao->bounds [i].length) {
- frame->ex = mono_get_exception_index_out_of_range ();
- FILL_IN_TRACE(frame->ex, frame);
- return;
- }
- pos = pos*ao->bounds [i].length + sp [i].data.i -
- ao->bounds [i].lower_bound;
- }
- } else if (pos >= ao->max_length) {
- frame->ex = mono_get_exception_index_out_of_range ();
- FILL_IN_TRACE(frame->ex, frame);
- return;
- }
-
-#if 0 /* FIX */
- if (sp [ac->rank].data.p && !mono_object_isinst (sp [ac->rank].data.p, mono_object_class (o)->element_class)) {
- frame->ex = mono_get_exception_array_type_mismatch ();
- FILL_IN_TRACE (frame->ex, frame);
- return;
- }
-#endif
-
- esize = mono_array_element_size (ac);
- ea = mono_array_addr_with_size (ao, esize, pos);
-
- mt = mono_method_signature (frame->runtime_method->method)->params [ac->rank];
- stackval_to_data (mt, &sp [ac->rank], ea, FALSE);
-}
-
-static void
-ves_array_get (MonoInvocation *frame)
-{
- stackval *sp = frame->stack_args;
- MonoObject *o;
- MonoArray *ao;
- MonoClass *ac;
- gint32 i, t, pos, esize;
- gpointer ea;
- MonoType *mt;
-
- o = frame->obj;
- ao = (MonoArray *)o;
- ac = o->vtable->klass;
-
- g_assert (ac->rank >= 1);
-
- pos = sp [0].data.i;
- if (ao->bounds != NULL) {
- pos -= ao->bounds [0].lower_bound;
- for (i = 1; i < ac->rank; i++) {
- if ((t = sp [i].data.i - ao->bounds [i].lower_bound) >=
- ao->bounds [i].length) {
- frame->ex = mono_get_exception_index_out_of_range ();
- FILL_IN_TRACE(frame->ex, frame);
- return;
- }
-
- pos = pos*ao->bounds [i].length + sp [i].data.i -
- ao->bounds [i].lower_bound;
- }
- } else if (pos >= ao->max_length) {
- frame->ex = mono_get_exception_index_out_of_range ();
- FILL_IN_TRACE(frame->ex, frame);
- return;
- }
-
- esize = mono_array_element_size (ac);
- ea = mono_array_addr_with_size (ao, esize, pos);
-
- mt = mono_method_signature (frame->runtime_method->method)->ret;
- stackval_from_data (mt, frame->retval, ea, FALSE);
-}
-
-static void
-ves_array_element_address (MonoInvocation *frame)
-{
- stackval *sp = frame->stack_args;
- MonoObject *o;
- MonoArray *ao;
- MonoClass *ac;
- gint32 i, t, pos, esize;
- gpointer ea;
-
- o = frame->obj;
- ao = (MonoArray *)o;
- ac = o->vtable->klass;
-
- g_assert (ac->rank >= 1);
-
- pos = sp [0].data.i;
- if (ao->bounds != NULL) {
- pos -= ao->bounds [0].lower_bound;
- for (i = 1; i < ac->rank; i++) {
- if ((t = sp [i].data.i - ao->bounds [i].lower_bound) >=
- ao->bounds [i].length) {
- frame->ex = mono_get_exception_index_out_of_range ();
- FILL_IN_TRACE(frame->ex, frame);
- return;
- }
- pos = pos*ao->bounds [i].length + sp [i].data.i -
- ao->bounds [i].lower_bound;
- }
- } else if (pos >= ao->max_length) {
- frame->ex = mono_get_exception_index_out_of_range ();
- FILL_IN_TRACE(frame->ex, frame);
- return;
- }
-
- esize = mono_array_element_size (ac);
- ea = mono_array_addr_with_size (ao, esize, pos);
-
- frame->retval->data.p = ea;
-}
-
-static void
-interp_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data)
-{
- ThreadContext *context = TlsGetValue (thread_context_id);
- MonoInvocation *frame;
- int il_offset;
- MonoMethodHeader *hd;
-
- if (!context) return;
-
- frame = context->current_frame;
-
- while (frame) {
- gboolean managed = FALSE;
- MonoMethod *method = frame->runtime_method->method;
- if (!method || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
- (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)))
- il_offset = -1;
- else {
- hd = mono_method_get_header (method);
- il_offset = frame->ip - (const unsigned short *)hd->code;
- if (!method->wrapper_type)
- managed = TRUE;
- }
- if (func (method, -1, il_offset, managed, user_data))
- return;
- frame = frame->parent;
- }
-}
-
-static void
-ves_pinvoke_method (MonoInvocation *frame, MonoMethodSignature *sig, MonoFunc addr, gboolean string_ctor, ThreadContext *context)
-{
- jmp_buf env;
- MonoPIFunc func;
- MonoInvocation *old_frame = context->current_frame;
- MonoInvocation *old_env_frame = context->env_frame;
- jmp_buf *old_env = context->current_env;
-
- if (setjmp (env)) {
- context->current_frame = old_frame;
- context->env_frame = old_env_frame;
- context->current_env = old_env;
- context->managed_code = 1;
- return;
- }
-
- frame->ex = NULL;
- context->env_frame = frame;
- context->current_env = &env;
-
- if (frame->runtime_method) {
- func = frame->runtime_method->func;
- } else {
- func = mono_arch_create_trampoline (sig, string_ctor);
- }
-
- context->current_frame = frame;
- context->managed_code = 0;
-
- func (addr, &frame->retval->data.p, frame->obj, frame->stack_args);
-
- context->managed_code = 1;
- /* domain can only be changed by native code */
- context->domain = mono_domain_get ();
-
- if (*abort_requested)
- mono_thread_interruption_checkpoint ();
-
- if (string_ctor) {
- stackval_from_data (&mono_defaults.string_class->byval_arg,
- frame->retval, (char*)&frame->retval->data.p, sig->pinvoke);
- } else if (!MONO_TYPE_ISSTRUCT (sig->ret))
- stackval_from_data (sig->ret, frame->retval, (char*)&frame->retval->data.p, sig->pinvoke);
-
- context->current_frame = old_frame;
- context->env_frame = old_env_frame;
- context->current_env = old_env;
-}
-
-static void
-interp_delegate_ctor (MonoDomain *domain, MonoObject *this, MonoObject *target, RuntimeMethod *runtime_method)
-{
- MonoDelegate *delegate = (MonoDelegate *)this;
-
- delegate->method_info = mono_method_get_object (domain, runtime_method->method, NULL);
- delegate->target = target;
-
- if (target && target->vtable->klass == mono_defaults.transparent_proxy_class) {
- MonoMethod *method = mono_marshal_get_remoting_invoke (runtime_method->method);
- delegate->method_ptr = mono_interp_get_runtime_method (method);
- } else {
- delegate->method_ptr = runtime_method;
- }
-}
-
-MonoDelegate*
-mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
-{
- MonoDelegate *d;
- MonoJitInfo *ji;
- MonoDomain *domain = mono_domain_get ();
-
- d = (MonoDelegate*)mono_object_new (domain, klass);
-
- ji = mono_jit_info_table_find (domain, ftn);
- if (ji == NULL)
- mono_raise_exception (mono_get_exception_argument ("", "Function pointer was not created by a Delegate."));
-
- /* FIXME: discard the wrapper and call the original method */
- interp_delegate_ctor (domain, (MonoObject*)d, NULL, mono_interp_get_runtime_method (ji->method));
-
- return d;
-}
-
-/*
- * From the spec:
- * runtime specifies that the implementation of the method is automatically
- * provided by the runtime and is primarily used for the methods of delegates.
- */
-static void
-ves_runtime_method (MonoInvocation *frame, ThreadContext *context)
-{
- MonoMethod *method = frame->runtime_method->method;
- const char *name = method->name;
- MonoObject *obj = (MonoObject*)frame->obj;
-
- mono_class_init (method->klass);
-
- if (obj && mono_object_isinst (obj, mono_defaults.multicastdelegate_class)) {
- if (*name == '.' && (strcmp (name, ".ctor") == 0)) {
- interp_delegate_ctor (context->domain, obj, frame->stack_args[0].data.p, frame->stack_args[1].data.p);
- return;
- }
- }
-
- if (obj && mono_object_isinst (obj, mono_defaults.array_class)) {
- if (*name == 'S' && (strcmp (name, "Set") == 0)) {
- ves_array_set (frame);
- return;
- }
- if (*name == 'G' && (strcmp (name, "Get") == 0)) {
- ves_array_get (frame);
- return;
- }
- if (*name == 'A' && (strcmp (name, "Address") == 0)) {
- ves_array_element_address (frame);
- return;
- }
- }
-
- g_error ("Don't know how to exec runtime method %s.%s::%s",
- method->klass->name_space, method->klass->name,
- method->name);
-}
-
-static char*
-dump_stack (stackval *stack, stackval *sp)
-{
- stackval *s = stack;
- GString *str = g_string_new ("");
-
- if (sp == stack)
- return g_string_free (str, FALSE);
-
- while (s < sp) {
- g_string_append_printf (str, "[%lld/0x%0llx] ", s->data.l, s->data.l);
- ++s;
- }
- return g_string_free (str, FALSE);
-}
-
-static void
-dump_stackval (GString *str, stackval *s, MonoType *type)
-{
- switch (type->type) {
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_BOOLEAN:
- g_string_append_printf (str, "[%d] ", s->data.i);
- break;
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_PTR:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- g_string_append_printf (str, "[%p] ", s->data.p);
- break;
- case MONO_TYPE_VALUETYPE:
- if (type->data.klass->enumtype)
- g_string_append_printf (str, "[%d] ", s->data.i);
- else
- g_string_append_printf (str, "[vt:%p] ", s->data.p);
- break;
- case MONO_TYPE_R4:
- case MONO_TYPE_R8:
- g_string_append_printf (str, "[%g] ", s->data.f);
- break;
- case MONO_TYPE_I8:
- case MONO_TYPE_U8:
- default:
- g_string_append_printf (str, "[%lld/0x%0llx] ", s->data.l, s->data.l);
- break;
- }
-}
-
-static char*
-dump_args (MonoInvocation *inv)
-{
- GString *str = g_string_new ("");
- int i;
- MonoMethodSignature *signature = mono_method_signature (inv->runtime_method->method);
-
- if (signature->param_count == 0)
- return g_string_free (str, FALSE);
-
- if (signature->hasthis)
- g_string_append_printf (str, "%p ", inv->obj);
-
- for (i = 0; i < signature->param_count; ++i)
- dump_stackval (str, inv->stack_args + i, signature->params [i]);
-
- return g_string_free (str, FALSE);
-}
-
-static char*
-dump_retval (MonoInvocation *inv)
-{
- GString *str = g_string_new ("");
- MonoType *ret = mono_method_signature (inv->runtime_method->method)->ret;
-
- if (ret->type != MONO_TYPE_VOID)
- dump_stackval (str, inv->retval, ret);
-
- return g_string_free (str, FALSE);
-}
-
-static char*
-dump_frame (MonoInvocation *inv)
-{
- GString *str = g_string_new ("");
- int i;
- char *args;
- for (i = 0; inv; inv = inv->parent) {
- if (inv->runtime_method != NULL) {
- MonoMethod *method = inv->runtime_method->method;
- MonoClass *k;
-
- int codep = 0;
- const char * opname = "";
- char *name;
- gchar *source = NULL;
-
- k = method->klass;
-
- if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 &&
- (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) == 0) {
- MonoMethodHeader *hd = mono_method_get_header (method);
-
- if (hd != NULL) {
- if (inv->ip) {
- opname = mono_interp_opname [*inv->ip];
- codep = inv->ip - inv->runtime_method->code;
- } else
- opname = "";
-
- source = mono_debug_source_location_from_il_offset (method, codep, NULL);
- }
- }
- args = dump_args (inv);
- name = mono_method_full_name (method, TRUE);
- if (source)
- g_string_append_printf (str, "#%d: 0x%05x %-10s in %s (%s) at %s\n", i, codep, opname,
- name, args, source);
- else
- g_string_append_printf (str, "#%d: 0x%05x %-10s in %s (%s)\n", i, codep, opname,
- name, args);
- g_free (name);
- g_free (args);
- g_free (source);
- ++i;
- }
- }
- return g_string_free (str, FALSE);
-}
-
-static MonoArray *
-get_trace_ips (MonoDomain *domain, MonoInvocation *top)
-{
- int i;
- MonoArray *res;
- MonoInvocation *inv;
-
- for (i = 0, inv = top; inv; inv = inv->parent)
- if (inv->runtime_method != NULL)
- ++i;
-
- res = mono_array_new (domain, mono_defaults.int_class, 2 * i);
-
- for (i = 0, inv = top; inv; inv = inv->parent)
- if (inv->runtime_method != NULL) {
- mono_array_set (res, gpointer, i, inv->runtime_method);
- ++i;
- mono_array_set (res, gpointer, i, (gpointer)inv->ip);
- ++i;
- }
-
- return res;
-}
-
-
-#define MYGUINT64_MAX 18446744073709551615ULL
-#define MYGINT64_MAX 9223372036854775807LL
-#define MYGINT64_MIN (-MYGINT64_MAX -1LL)
-
-#define MYGUINT32_MAX 4294967295U
-#define MYGINT32_MAX 2147483647
-#define MYGINT32_MIN (-MYGINT32_MAX -1)
-
-#define CHECK_ADD_OVERFLOW(a,b) \
- (gint32)(b) >= 0 ? (gint32)(MYGINT32_MAX) - (gint32)(b) < (gint32)(a) ? -1 : 0 \
- : (gint32)(MYGINT32_MIN) - (gint32)(b) > (gint32)(a) ? +1 : 0
-
-#define CHECK_SUB_OVERFLOW(a,b) \
- (gint32)(b) < 0 ? (gint32)(MYGINT32_MAX) + (gint32)(b) < (gint32)(a) ? -1 : 0 \
- : (gint32)(MYGINT32_MIN) + (gint32)(b) > (gint32)(a) ? +1 : 0
-
-#define CHECK_ADD_OVERFLOW_UN(a,b) \
- (guint32)(MYGUINT32_MAX) - (guint32)(b) < (guint32)(a) ? -1 : 0
-
-#define CHECK_SUB_OVERFLOW_UN(a,b) \
- (guint32)(a) < (guint32)(b) ? -1 : 0
-
-#define CHECK_ADD_OVERFLOW64(a,b) \
- (gint64)(b) >= 0 ? (gint64)(MYGINT64_MAX) - (gint64)(b) < (gint64)(a) ? -1 : 0 \
- : (gint64)(MYGINT64_MIN) - (gint64)(b) > (gint64)(a) ? +1 : 0
-
-#define CHECK_SUB_OVERFLOW64(a,b) \
- (gint64)(b) < 0 ? (gint64)(MYGINT64_MAX) + (gint64)(b) < (gint64)(a) ? -1 : 0 \
- : (gint64)(MYGINT64_MIN) + (gint64)(b) > (gint64)(a) ? +1 : 0
-
-#define CHECK_ADD_OVERFLOW64_UN(a,b) \
- (guint64)(MYGUINT64_MAX) - (guint64)(b) < (guint64)(a) ? -1 : 0
-
-#define CHECK_SUB_OVERFLOW64_UN(a,b) \
- (guint64)(a) < (guint64)(b) ? -1 : 0
-
-#if SIZEOF_VOID_P == 4
-#define CHECK_ADD_OVERFLOW_NAT(a,b) CHECK_ADD_OVERFLOW(a,b)
-#define CHECK_ADD_OVERFLOW_NAT_UN(a,b) CHECK_ADD_OVERFLOW_UN(a,b)
-#else
-#define CHECK_ADD_OVERFLOW_NAT(a,b) CHECK_ADD_OVERFLOW64(a,b)
-#define CHECK_ADD_OVERFLOW_NAT_UN(a,b) CHECK_ADD_OVERFLOW64_UN(a,b)
-#endif
-
-/* Resolves to TRUE if the operands would overflow */
-#define CHECK_MUL_OVERFLOW(a,b) \
- ((gint32)(a) == 0) || ((gint32)(b) == 0) ? 0 : \
- (((gint32)(a) > 0) && ((gint32)(b) == -1)) ? FALSE : \
- (((gint32)(a) < 0) && ((gint32)(b) == -1)) ? (a == - MYGINT32_MAX) : \
- (((gint32)(a) > 0) && ((gint32)(b) > 0)) ? (gint32)(a) > ((MYGINT32_MAX) / (gint32)(b)) : \
- (((gint32)(a) > 0) && ((gint32)(b) < 0)) ? (gint32)(a) > ((MYGINT32_MIN) / (gint32)(b)) : \
- (((gint32)(a) < 0) && ((gint32)(b) > 0)) ? (gint32)(a) < ((MYGINT32_MIN) / (gint32)(b)) : \
- (gint32)(a) < ((MYGINT32_MAX) / (gint32)(b))
-
-#define CHECK_MUL_OVERFLOW_UN(a,b) \
- ((guint32)(a) == 0) || ((guint32)(b) == 0) ? 0 : \
- (guint32)(b) > ((MYGUINT32_MAX) / (guint32)(a))
-
-#define CHECK_MUL_OVERFLOW64(a,b) \
- ((gint64)(a) == 0) || ((gint64)(b) == 0) ? 0 : \
- (((gint64)(a) > 0) && ((gint64)(b) == -1)) ? FALSE : \
- (((gint64)(a) < 0) && ((gint64)(b) == -1)) ? (a == - MYGINT64_MAX) : \
- (((gint64)(a) > 0) && ((gint64)(b) > 0)) ? (gint64)(a) > ((MYGINT64_MAX) / (gint64)(b)) : \
- (((gint64)(a) > 0) && ((gint64)(b) < 0)) ? (gint64)(a) > ((MYGINT64_MIN) / (gint64)(b)) : \
- (((gint64)(a) < 0) && ((gint64)(b) > 0)) ? (gint64)(a) < ((MYGINT64_MIN) / (gint64)(b)) : \
- (gint64)(a) < ((MYGINT64_MAX) / (gint64)(b))
-
-#define CHECK_MUL_OVERFLOW64_UN(a,b) \
- ((guint64)(a) == 0) || ((guint64)(b) == 0) ? 0 : \
- (guint64)(b) > ((MYGUINT64_MAX) / (guint64)(a))
-
-#if SIZEOF_VOID_P == 4
-#define CHECK_MUL_OVERFLOW_NAT(a,b) CHECK_MUL_OVERFLOW(a,b)
-#define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW_UN(a,b)
-#else
-#define CHECK_MUL_OVERFLOW_NAT(a,b) CHECK_MUL_OVERFLOW64(a,b)
-#define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW64_UN(a,b)
-#endif
-
-static MonoObject*
-interp_mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
-{
- MonoInvocation frame;
- ThreadContext * volatile context = TlsGetValue (thread_context_id);
- MonoObject *retval = NULL;
- MonoMethodSignature *sig = mono_method_signature (method);
- MonoClass *klass = mono_class_from_mono_type (sig->ret);
- int i, type, isobject = 0;
- void *ret = NULL;
- stackval result;
- stackval *args = alloca (sizeof (stackval) * sig->param_count);
- ThreadContext context_struct;
- MonoInvocation *old_frame = NULL;
- jmp_buf env;
-
- frame.ex = NULL;
-
- if (setjmp(env)) {
- if (context != &context_struct) {
- context->domain = mono_domain_get ();
- context->current_frame = old_frame;
- context->managed_code = 0;
- } else
- TlsSetValue (thread_context_id, NULL);
- if (exc != NULL)
- *exc = (MonoObject *)frame.ex;
- return retval;
- }
-
- if (context == NULL) {
- context = &context_struct;
- context_struct.base_frame = &frame;
- context_struct.current_frame = NULL;
- context_struct.env_frame = &frame;
- context_struct.current_env = &env;
- context_struct.search_for_handler = 0;
- context_struct.managed_code = 0;
- TlsSetValue (thread_context_id, context);
- }
- else
- old_frame = context->current_frame;
-
- context->domain = mono_domain_get ();
-
- switch (sig->ret->type) {
- case MONO_TYPE_VOID:
- break;
- case MONO_TYPE_STRING:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
- isobject = 1;
- break;
- case MONO_TYPE_VALUETYPE:
- retval = mono_object_new (context->domain, klass);
- ret = ((char*)retval) + sizeof (MonoObject);
- if (!sig->ret->data.klass->enumtype)
- result.data.vt = ret;
- break;
- default:
- retval = mono_object_new (context->domain, klass);
- ret = ((char*)retval) + sizeof (MonoObject);
- break;
- }
-
- for (i = 0; i < sig->param_count; ++i) {
- if (sig->params [i]->byref) {
- args [i].data.p = params [i];
- continue;
- }
- type = sig->params [i]->type;
-handle_enum:
- switch (type) {
- case MONO_TYPE_U1:
- case MONO_TYPE_I1:
- case MONO_TYPE_BOOLEAN:
- args [i].data.i = *(MonoBoolean*)params [i];
- break;
- case MONO_TYPE_U2:
- case MONO_TYPE_I2:
- case MONO_TYPE_CHAR:
- args [i].data.i = *(gint16*)params [i];
- break;
-#if SIZEOF_VOID_P == 4
- case MONO_TYPE_U: /* use VAL_POINTER? */
- case MONO_TYPE_I:
-#endif
- case MONO_TYPE_U4:
- case MONO_TYPE_I4:
- args [i].data.i = *(gint32*)params [i];
- break;
-#if SIZEOF_VOID_P == 8
- case MONO_TYPE_U:
- case MONO_TYPE_I:
-#endif
- case MONO_TYPE_U8:
- case MONO_TYPE_I8:
- args [i].data.l = *(gint64*)params [i];
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->params [i]->data.klass->enumtype) {
- type = sig->params [i]->data.klass->enum_basetype->type;
- goto handle_enum;
- } else {
- args [i].data.p = params [i];
- }
- break;
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_OBJECT:
- args [i].data.p = params [i];
- break;
- default:
- g_error ("type 0x%x not handled in runtime invoke", sig->params [i]->type);
- }
- }
-
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
- method = mono_marshal_get_native_wrapper (method);
- INIT_FRAME(&frame,context->current_frame,obj,args,&result,method);
- if (exc)
- frame.invoke_trap = 1;
- context->managed_code = 1;
- ves_exec_method_with_context (&frame, context);
- context->managed_code = 0;
- if (context == &context_struct)
- TlsSetValue (thread_context_id, NULL);
- else
- context->current_frame = old_frame;
- if (frame.ex != NULL) {
- if (exc != NULL) {
- *exc = (MonoObject*) frame.ex;
- return NULL;
- }
- if (context->current_env != NULL) {
- context->env_frame->ex = frame.ex;
- longjmp(*context->current_env, 1);
- }
- else
- printf("dropped exception...\n");
- }
- if (sig->ret->type == MONO_TYPE_VOID && !method->string_ctor)
- return NULL;
- if (isobject || method->string_ctor)
- return result.data.p;
- stackval_to_data (sig->ret, &result, ret, sig->pinvoke);
- return retval;
-}
-
-static stackval *
-do_icall (ThreadContext *context, int op, stackval *sp, gpointer ptr)
-{
- MonoInvocation *old_frame = context->current_frame;
- MonoInvocation *old_env_frame = context->env_frame;
- jmp_buf *old_env = context->current_env;
- jmp_buf env;
-
- if (setjmp (env)) {
- context->current_frame = old_frame;
- context->env_frame = old_env_frame;
- context->current_env = old_env;
- context->managed_code = 1;
- return sp;
- }
-
- context->env_frame = context->current_frame;
- context->current_env = &env;
- context->managed_code = 0;
-
- switch (op) {
- case MINT_ICALL_V_V: {
- void (*func)() = ptr;
- func ();
- break;
- }
- case MINT_ICALL_P_V: {
- void (*func)(gpointer) = ptr;
- func (sp [-1].data.p);
- sp --;
- break;
- }
- case MINT_ICALL_P_P: {
- gpointer (*func)(gpointer) = ptr;
- sp [-1].data.p = func (sp [-1].data.p);
- break;
- }
- case MINT_ICALL_PP_V: {
- void (*func)(gpointer,gpointer) = ptr;
- sp -= 2;
- func (sp [0].data.p, sp [1].data.p);
- break;
- }
- case MINT_ICALL_PI_V: {
- void (*func)(gpointer,int) = ptr;
- sp -= 2;
- func (sp [0].data.p, sp [1].data.i);
- break;
- }
- case MINT_ICALL_PP_P: {
- gpointer (*func)(gpointer,gpointer) = ptr;
- --sp;
- sp [-1].data.p = func (sp [-1].data.p, sp [0].data.p);
- break;
- }
- case MINT_ICALL_PI_P: {
- gpointer (*func)(gpointer,int) = ptr;
- --sp;
- sp [-1].data.p = func (sp [-1].data.p, sp [0].data.i);
- break;
- }
- case MINT_ICALL_PPP_V: {
- void (*func)(gpointer,gpointer,gpointer) = ptr;
- sp -= 3;
- func (sp [0].data.p, sp [1].data.p, sp [2].data.p);
- break;
- }
- case MINT_ICALL_PPI_V: {
- void (*func)(gpointer,gpointer,int) = ptr;
- sp -= 3;
- func (sp [0].data.p, sp [1].data.p, sp [2].data.i);
- break;
- }
- default:
- g_assert_not_reached ();
- }
-
- context->env_frame = old_env_frame;
- context->current_env = old_env;
-
- return sp;
-}
-
-static CRITICAL_SECTION create_method_pointer_mutex;
-
-static MonoGHashTable *method_pointer_hash = NULL;
-
-static void *
-mono_create_method_pointer (MonoMethod *method)
-{
- gpointer addr;
- MonoJitInfo *ji;
-
- EnterCriticalSection (&create_method_pointer_mutex);
- if (!method_pointer_hash) {
- MONO_GC_REGISTER_ROOT (method_pointer_hash);
- method_pointer_hash = mono_g_hash_table_new (NULL, NULL);
- }
- addr = mono_g_hash_table_lookup (method_pointer_hash, method);
- if (addr) {
- LeaveCriticalSection (&create_method_pointer_mutex);
- return addr;
- }
-
- /*
- * If it is a static P/Invoke method, we can just return the pointer
- * to the method implementation.
- */
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && ((MonoMethodPInvoke*) method)->addr) {
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = 1;
- ji->code_start = addr = ((MonoMethodPInvoke*) method)->addr;
-
- mono_jit_info_table_add (mono_get_root_domain (), ji);
- }
- else
- addr = mono_arch_create_method_pointer (method);
-
- mono_g_hash_table_insert (method_pointer_hash, method, addr);
- LeaveCriticalSection (&create_method_pointer_mutex);
-
- return addr;
-}
-
-#if COUNT_OPS
-static int opcode_counts[512];
-
-#define COUNT_OP(op) opcode_counts[op]++
-#else
-#define COUNT_OP(op)
-#endif
-
-#if DEBUG_INTERP
-#define DUMP_INSTR() \
- if (tracing > 1) { \
- char *ins; \
- if (sp > frame->stack) { \
- ins = dump_stack (frame->stack, sp); \
- } else { \
- ins = g_strdup (""); \
- } \
- sp->data.l = 0; \
- output_indent (); \
- g_print ("(%u) ", GetCurrentThreadId()); \
- mono_interp_dis_mintop(rtm->code, ip); \
- g_print ("\t%d:%s\n", vt_sp - vtalloc, ins); \
- g_free (ins); \
- }
-#else
-#define DUMP_INSTR()
-#endif
-
-#ifdef __GNUC__
-#define USE_COMPUTED_GOTO 1
-#endif
-#if USE_COMPUTED_GOTO
-#define MINT_IN_SWITCH(op) COUNT_OP(op); goto *in_labels[op];
-#define MINT_IN_CASE(x) LAB_ ## x:
-#if DEBUG_INTERP
-#define MINT_IN_BREAK if (tracing > 1) goto main_loop; else { COUNT_OP(*ip); goto *in_labels[*ip]; }
-#else
-#define MINT_IN_BREAK { COUNT_OP(*ip); goto *in_labels[*ip]; }
-#endif
-#define MINT_IN_DEFAULT mint_default: if (0) goto mint_default; /* make gcc shut up */
-#else
-#define MINT_IN_SWITCH(op) switch (op)
-#define MINT_IN_CASE(x) case x:
-#define MINT_IN_BREAK break
-#define MINT_IN_DEFAULT default:
-#endif
-
-/*
- * Defining this causes register allocation errors in some versions of gcc:
- * error: unable to find a register to spill in class `SIREG'
- */
-/* #define MINT_USE_DEDICATED_IP_REG */
-
-static void
-ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
-{
- MonoInvocation child_frame;
- GSList *finally_ips = NULL;
- const unsigned short *endfinally_ip = NULL;
-#if defined(__GNUC__) && defined (i386) && defined (MINT_USE_DEDICATED_IP_REG)
- register const unsigned short *ip asm ("%esi");
-#else
- register const unsigned short *ip;
-#endif
- register stackval *sp;
- RuntimeMethod *rtm;
-#if DEBUG_INTERP
- gint tracing = global_tracing;
- unsigned char *vtalloc;
-#endif
- int i32;
- unsigned char *vt_sp;
- char *locals;
- MonoObject *o = NULL;
- MonoClass *c;
-#if USE_COMPUTED_GOTO
- static void *in_labels[] = {
-#define OPDEF(a,b,c,d) \
- &&LAB_ ## a,
-#include "mintops.def"
- 0 };
-#endif
-
- frame->ex = NULL;
- frame->ex_handler = NULL;
- frame->ip = NULL;
- context->current_frame = frame;
-
- DEBUG_ENTER ();
-
- if (!frame->runtime_method->transformed) {
- context->managed_code = 0;
- frame->ex = mono_interp_transform_method (frame->runtime_method, context);
- context->managed_code = 1;
- if (frame->ex) {
- rtm = NULL;
- ip = NULL;
- goto exit_frame;
- }
- }
-
- rtm = frame->runtime_method;
- frame->args = alloca (rtm->alloca_size);
- sp = frame->stack = (stackval *)((char *)frame->args + rtm->args_size);
-#if DEBUG_INTERP
- if (tracing > 1)
- memset(sp, 0, rtm->stack_size);
-#endif
- vt_sp = (char *)sp + rtm->stack_size;
-#if DEBUG_INTERP
- vtalloc = vt_sp;
-#endif
- locals = vt_sp + rtm->vt_stack_size;
-
- child_frame.parent = frame;
-
- /* ready to go */
- ip = rtm->code;
-
- /*
- * using while (ip < end) may result in a 15% performance drop,
- * but it may be useful for debug
- */
- while (1) {
- main_loop:
- /* g_assert (sp >= frame->stack); */
- /* g_assert(vt_sp - vtalloc <= rtm->vt_stack_size); */
- DUMP_INSTR();
- MINT_IN_SWITCH (*ip) {
- MINT_IN_CASE(MINT_INITLOCALS)
- memset (locals, 0, rtm->locals_size);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_NOP)
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BREAK)
- ++ip;
- G_BREAKPOINT (); /* this is not portable... */
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDNULL)
- sp->data.p = NULL;
- ++ip;
- ++sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_VTRESULT) {
- int ret_size = * (guint16 *)(ip + 1);
- char *ret_vt_sp = vt_sp;
- vt_sp -= READ32(ip + 2);
- if (ret_size > 0) {
- memmove (vt_sp, ret_vt_sp, ret_size);
- vt_sp += (ret_size + 7) & ~7;
- }
- ip += 4;
- MINT_IN_BREAK;
- }
-#define LDC(n) do { sp->data.i = (n); ++ip; ++sp; } while (0)
- MINT_IN_CASE(MINT_LDC_I4_M1)
- LDC(-1);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_0)
- LDC(0);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_1)
- LDC(1);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_2)
- LDC(2);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_3)
- LDC(3);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_4)
- LDC(4);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_5)
- LDC(5);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_6)
- LDC(6);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_7)
- LDC(7);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_8)
- LDC(8);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4_S)
- sp->data.i = *(const short *)(ip + 1);
- ip += 2;
- ++sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I4)
- ++ip;
- sp->data.i = READ32 (ip);
- ip += 2;
- ++sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_I8)
- ++ip;
- sp->data.l = READ64 (ip);
- ip += 4;
- ++sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDC_R4) {
- guint32 val;
- ++ip;
- val = READ32(ip);
- sp->data.f = * (float *)&val;
- ip += 2;
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDC_R8)
- sp->data.l = READ64 (ip + 1); /* note union usage */
- ip += 5;
- ++sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_DUP)
- sp [0] = sp[-1];
- ++sp;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_DUP_VT)
- i32 = READ32 (ip + 1);
- sp->data.p = vt_sp;
- memcpy(sp->data.p, sp [-1].data.p, i32);
- vt_sp += (i32 + 7) & ~7;
- ++sp;
- ip += 3;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_POP)
- ++ip;
- --sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_JMP) {
- RuntimeMethod *new_method = rtm->data_items [* (guint16 *)(ip + 1)];
- if (!new_method->transformed) {
- frame->ip = ip;
- frame->ex = mono_interp_transform_method (new_method, context);
- if (frame->ex)
- goto exit_frame;
- }
- ip += 2;
- if (new_method->alloca_size > rtm->alloca_size)
- g_error ("MINT_JMP to method which needs more stack space (%d > %d)", new_method->alloca_size, rtm->alloca_size);
- rtm = frame->runtime_method = new_method;
- vt_sp = (char *)sp + rtm->stack_size;
-#if DEBUG_INTERP
- vtalloc = vt_sp;
-#endif
- locals = vt_sp + rtm->vt_stack_size;
- ip = rtm->new_body_start; /* bypass storing input args from callers frame */
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_CALLI) {
- MonoMethodSignature *csignature;
- stackval *endsp = sp;
-
- frame->ip = ip;
-
- csignature = rtm->data_items [* (guint16 *)(ip + 1)];
- ip += 2;
- --sp;
- --endsp;
- child_frame.runtime_method = sp->data.p;
-
- sp->data.p = vt_sp;
- child_frame.retval = sp;
- /* decrement by the actual number of args */
- sp -= csignature->param_count;
- child_frame.stack_args = sp;
- if (csignature->hasthis) {
- --sp;
- child_frame.obj = sp->data.p;
- } else {
- child_frame.obj = NULL;
- }
- if (csignature->hasthis &&
- ((MonoObject *)child_frame.obj)->vtable->klass == mono_defaults.transparent_proxy_class) {
- child_frame.runtime_method = mono_interp_get_runtime_method (
- mono_marshal_get_remoting_invoke (child_frame.runtime_method->method));
- } else if (child_frame.runtime_method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
- child_frame.runtime_method = mono_interp_get_runtime_method (
- mono_marshal_get_native_wrapper (child_frame.runtime_method->method));
-
- ves_exec_method_with_context (&child_frame, context);
-
- context->current_frame = frame;
-
- if (child_frame.ex) {
- /*
- * An exception occurred, need to run finally, fault and catch handlers..
- */
- frame->ex = child_frame.ex;
- goto handle_finally;
- }
-
- /* need to handle typedbyref ... */
- if (csignature->ret->type != MONO_TYPE_VOID) {
- *sp = *endsp;
- sp++;
- }
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_CALLI_NAT) {
- MonoMethodSignature *csignature;
- stackval *endsp = sp;
- unsigned char *code = NULL;
-
- frame->ip = ip;
-
- csignature = rtm->data_items [* (guint16 *)(ip + 1)];
- ip += 2;
- --sp;
- --endsp;
- code = sp->data.p;
- child_frame.runtime_method = NULL;
-
- sp->data.p = vt_sp;
- child_frame.retval = sp;
- /* decrement by the actual number of args */
- sp -= csignature->param_count;
- child_frame.stack_args = sp;
- if (csignature->hasthis) {
- --sp;
- child_frame.obj = sp->data.p;
- } else {
- child_frame.obj = NULL;
- }
- ves_pinvoke_method (&child_frame, csignature, (MonoFunc) code, FALSE, context);
-
- context->current_frame = frame;
-
- if (child_frame.ex) {
- /*
- * An exception occurred, need to run finally, fault and catch handlers..
- */
- frame->ex = child_frame.ex;
- if (context->search_for_handler) {
- context->search_for_handler = 0;
- goto handle_exception;
- }
- goto handle_finally;
- }
-
- /* need to handle typedbyref ... */
- if (csignature->ret->type != MONO_TYPE_VOID) {
- *sp = *endsp;
- sp++;
- }
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_CALL) {
- stackval *endsp = sp;
-
- frame->ip = ip;
-
- child_frame.runtime_method = rtm->data_items [* (guint16 *)(ip + 1)];
- ip += 2;
- sp->data.p = vt_sp;
- child_frame.retval = sp;
- /* decrement by the actual number of args */
- sp -= child_frame.runtime_method->param_count;
- child_frame.stack_args = sp;
- if (child_frame.runtime_method->hasthis) {
- --sp;
- child_frame.obj = sp->data.p;
- } else {
- child_frame.obj = NULL;
- }
- if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->valuetype &&
- ((MonoObject *)child_frame.obj)->vtable->klass == mono_defaults.transparent_proxy_class) {
- child_frame.runtime_method = mono_interp_get_runtime_method (
- mono_marshal_get_remoting_invoke (child_frame.runtime_method->method));
- }
- ves_exec_method_with_context (&child_frame, context);
-
- context->current_frame = frame;
-
- if (child_frame.ex) {
- /*
- * An exception occurred, need to run finally, fault and catch handlers..
- */
- frame->ex = child_frame.ex;
- goto handle_finally;
- }
-
- /* need to handle typedbyref ... */
- *sp = *endsp;
- sp++;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_VCALL) {
- frame->ip = ip;
-
- child_frame.runtime_method = rtm->data_items [* (guint16 *)(ip + 1)];
- ip += 2;
-
- sp->data.p = vt_sp;
- child_frame.retval = sp;
- /* decrement by the actual number of args */
- sp -= child_frame.runtime_method->param_count;
- child_frame.stack_args = sp;
- if (child_frame.runtime_method->hasthis) {
- --sp;
- child_frame.obj = sp->data.p;
- } else {
- child_frame.obj = NULL;
- }
-
- if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->valuetype &&
- ((MonoObject *)child_frame.obj)->vtable->klass == mono_defaults.transparent_proxy_class) {
- child_frame.runtime_method = mono_interp_get_runtime_method (
- mono_marshal_get_remoting_invoke (child_frame.runtime_method->method));
- }
-
- ves_exec_method_with_context (&child_frame, context);
-
- context->current_frame = frame;
-
- if (child_frame.ex) {
- /*
- * An exception occurred, need to run finally, fault and catch handlers..
- */
- frame->ex = child_frame.ex;
- goto handle_finally;
- }
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_CALLVIRT) {
- stackval *endsp = sp;
- MonoObject *this_arg;
- guint32 token;
-
- frame->ip = ip;
-
- token = * (unsigned short *)(ip + 1);
- ip += 2;
- child_frame.runtime_method = rtm->data_items [token];
- sp->data.p = vt_sp;
- child_frame.retval = sp;
-
- /* decrement by the actual number of args */
- sp -= child_frame.runtime_method->param_count;
- child_frame.stack_args = sp;
- --sp;
- child_frame.obj = this_arg = sp->data.p;
- if (!this_arg)
- THROW_EX (mono_get_exception_null_reference(), ip - 2);
- child_frame.runtime_method = get_virtual_method (child_frame.runtime_method, this_arg);
-
- if (this_arg->vtable->klass->valuetype && child_frame.runtime_method->valuetype) {
- child_frame.obj = (char *)this_arg + sizeof(MonoObject);
- }
-
- ves_exec_method_with_context (&child_frame, context);
-
- context->current_frame = frame;
-
- if (child_frame.ex) {
- /*
- * An exception occurred, need to run finally, fault and catch handlers..
- */
- frame->ex = child_frame.ex;
- if (context->search_for_handler) {
- context->search_for_handler = 0;
- goto handle_exception;
- }
- goto handle_finally;
- }
-
- /* need to handle typedbyref ... */
- *sp = *endsp;
- sp++;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_VCALLVIRT) {
- MonoObject *this_arg;
- guint32 token;
-
- frame->ip = ip;
-
- token = * (unsigned short *)(ip + 1);
- ip += 2;
- child_frame.runtime_method = rtm->data_items [token];
- sp->data.p = vt_sp;
- child_frame.retval = sp;
-
- /* decrement by the actual number of args */
- sp -= child_frame.runtime_method->param_count;
- child_frame.stack_args = sp;
- --sp;
- child_frame.obj = this_arg = sp->data.p;
- if (!this_arg)
- THROW_EX (mono_get_exception_null_reference(), ip - 2);
- child_frame.runtime_method = get_virtual_method (child_frame.runtime_method, this_arg);
-
- if (this_arg->vtable->klass->valuetype && child_frame.runtime_method->valuetype) {
- child_frame.obj = (char *)this_arg + sizeof(MonoObject);
- }
-
- ves_exec_method_with_context (&child_frame, context);
-
- context->current_frame = frame;
-
- if (child_frame.ex) {
- /*
- * An exception occurred, need to run finally, fault and catch handlers..
- */
- frame->ex = child_frame.ex;
- if (context->search_for_handler) {
- context->search_for_handler = 0;
- goto handle_exception;
- }
- goto handle_finally;
- }
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_CALLINT)
- ves_pinvoke_method (frame, mono_method_signature (frame->runtime_method->method), ((MonoMethodPInvoke*) frame->runtime_method->method)->addr,
- frame->runtime_method->method->string_ctor, context);
- if (frame->ex) {
- rtm = NULL;
- goto handle_exception;
- }
- goto exit_frame;
- MINT_IN_CASE(MINT_CALLRUN)
- ves_runtime_method (frame, context);
- if (frame->ex) {
- rtm = NULL;
- goto handle_exception;
- }
- goto exit_frame;
- MINT_IN_CASE(MINT_RET)
- --sp;
- *frame->retval = *sp;
- if (sp > frame->stack)
- g_warning ("ret: more values on stack: %d", sp-frame->stack);
- goto exit_frame;
- MINT_IN_CASE(MINT_RET_VOID)
- if (sp > frame->stack)
- g_warning ("ret.void: more values on stack: %d", sp-frame->stack);
- goto exit_frame;
- MINT_IN_CASE(MINT_RET_VT)
- i32 = READ32(ip + 1);
- --sp;
- memcpy(frame->retval->data.p, sp->data.p, i32);
- if (sp > frame->stack)
- g_warning ("ret.vt: more values on stack: %d", sp-frame->stack);
- goto exit_frame;
- MINT_IN_CASE(MINT_BR_S)
- ip += (short) *(ip + 1);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BR)
- ip += (gint32) READ32(ip + 1);
- MINT_IN_BREAK;
-#define ZEROP_S(datamem, op) \
- --sp; \
- if (sp->data.datamem op 0) \
- ip += * (gint16 *)(ip + 1); \
- else \
- ip += 2;
-
-#define ZEROP(datamem, op) \
- --sp; \
- if (sp->data.datamem op 0) \
- ip += READ32(ip + 1); \
- else \
- ip += 3;
-
- MINT_IN_CASE(MINT_BRFALSE_I4_S)
- ZEROP_S(i, ==);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRFALSE_I8_S)
- ZEROP_S(l, ==);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRFALSE_R8_S)
- ZEROP_S(f, ==);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRFALSE_I4)
- ZEROP(i, ==);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRFALSE_I8)
- ZEROP(l, ==);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRFALSE_R8)
- ZEROP_S(f, ==);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRTRUE_I4_S)
- ZEROP_S(i, !=);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRTRUE_I8_S)
- ZEROP_S(l, !=);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRTRUE_R8_S)
- ZEROP_S(f, !=);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRTRUE_I4)
- ZEROP(i, !=);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRTRUE_I8)
- ZEROP(l, !=);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BRTRUE_R8)
- ZEROP(f, !=);
- MINT_IN_BREAK;
-#define CONDBR_S(cond) \
- sp -= 2; \
- if (cond) \
- ip += * (gint16 *)(ip + 1); \
- else \
- ip += 2;
-#define BRELOP_S(datamem, op) \
- CONDBR_S(sp[0].data.datamem op sp[1].data.datamem)
-
-#define CONDBR(cond) \
- sp -= 2; \
- if (cond) \
- ip += READ32(ip + 1); \
- else \
- ip += 3;
-
-#define BRELOP(datamem, op) \
- CONDBR(sp[0].data.datamem op sp[1].data.datamem)
-
- MINT_IN_CASE(MINT_BEQ_I4_S)
- BRELOP_S(i, ==)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BEQ_I8_S)
- BRELOP_S(l, ==)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BEQ_R8_S)
- CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f == sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BEQ_I4)
- BRELOP(i, ==)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BEQ_I8)
- BRELOP(l, ==)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BEQ_R8)
- CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f == sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_I4_S)
- BRELOP_S(i, >=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_I8_S)
- BRELOP_S(l, >=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_R8_S)
- CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f >= sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_I4)
- BRELOP(i, >=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_I8)
- BRELOP(l, >=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_R8)
- CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f >= sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_I4_S)
- BRELOP_S(i, >)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_I8_S)
- BRELOP_S(l, >)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_R8_S)
- CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f > sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_I4)
- BRELOP(i, >)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_I8)
- BRELOP(l, >)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_R8)
- CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f > sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_I4_S)
- BRELOP_S(i, <)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_I8_S)
- BRELOP_S(l, <)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_R8_S)
- CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f < sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_I4)
- BRELOP(i, <)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_I8)
- BRELOP(l, <)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_R8)
- CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f < sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_I4_S)
- BRELOP_S(i, <=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_I8_S)
- BRELOP_S(l, <=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_R8_S)
- CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f <= sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_I4)
- BRELOP(i, <=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_I8)
- BRELOP(l, <=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_R8)
- CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f <= sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BNE_UN_I4_S)
- BRELOP_S(i, !=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BNE_UN_I8_S)
- BRELOP_S(l, !=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BNE_UN_R8_S)
- CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f != sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BNE_UN_I4)
- BRELOP(i, !=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BNE_UN_I8)
- BRELOP(l, !=)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BNE_UN_R8)
- CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f != sp[1].data.f)
- MINT_IN_BREAK;
-
-#define BRELOP_S_CAST(datamem, op, type) \
- sp -= 2; \
- if ((type) sp[0].data.datamem op (type) sp[1].data.datamem) \
- ip += * (gint16 *)(ip + 1); \
- else \
- ip += 2;
-
-#define BRELOP_CAST(datamem, op, type) \
- sp -= 2; \
- if ((type) sp[0].data.datamem op (type) sp[1].data.datamem) \
- ip += READ32(ip + 1); \
- else \
- ip += 3;
-
- MINT_IN_CASE(MINT_BGE_UN_I4_S)
- BRELOP_S_CAST(i, >=, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_UN_I8_S)
- BRELOP_S_CAST(l, >=, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_UN_R8_S)
- CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f >= sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_UN_I4)
- BRELOP_CAST(i, >=, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_UN_I8)
- BRELOP_CAST(l, >=, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGE_UN_R8)
- CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f >= sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_UN_I4_S)
- BRELOP_S_CAST(i, >, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_UN_I8_S)
- BRELOP_S_CAST(l, >, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_UN_R8_S)
- CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f > sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_UN_I4)
- BRELOP_CAST(i, >, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_UN_I8)
- BRELOP_CAST(l, >, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BGT_UN_R8)
- CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f > sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_UN_I4_S)
- BRELOP_S_CAST(i, <=, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_UN_I8_S)
- BRELOP_S_CAST(l, <=, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_UN_R8_S)
- CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f <= sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_UN_I4)
- BRELOP_CAST(i, <=, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_UN_I8)
- BRELOP_CAST(l, <=, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLE_UN_R8)
- CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f <= sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_UN_I4_S)
- BRELOP_S_CAST(i, <, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_UN_I8_S)
- BRELOP_S_CAST(l, <, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_UN_R8_S)
- CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f < sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_UN_I4)
- BRELOP_CAST(i, <, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_UN_I8)
- BRELOP_CAST(l, <, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BLT_UN_R8)
- CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f < sp[1].data.f)
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SWITCH) {
- guint32 n;
- const unsigned short *st;
- ++ip;
- n = READ32 (ip);
- ip += 2;
- st = ip + 2 * n;
- --sp;
- if ((guint32)sp->data.i < n) {
- gint offset;
- ip += 2 * (guint32)sp->data.i;
- offset = READ32 (ip);
- ip = st + offset;
- } else {
- ip = st;
- }
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDIND_I1)
- ++ip;
- sp[-1].data.i = *(gint8*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_U1)
- ++ip;
- sp[-1].data.i = *(guint8*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_I2)
- ++ip;
- sp[-1].data.i = *(gint16*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_U2)
- ++ip;
- sp[-1].data.i = *(guint16*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_I4) /* Fall through */
- MINT_IN_CASE(MINT_LDIND_U4)
- ++ip;
- sp[-1].data.i = *(gint32*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_I8)
- ++ip;
- sp[-1].data.l = *(gint64*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_I)
- ++ip;
- sp[-1].data.p = *(gpointer*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_R4)
- ++ip;
- sp[-1].data.f = *(gfloat*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_R8)
- ++ip;
- sp[-1].data.f = *(gdouble*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDIND_REF)
- ++ip;
- sp[-1].data.p = *(gpointer*)sp[-1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STIND_REF)
- ++ip;
- sp -= 2;
- * (gpointer *) sp->data.p = sp[1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STIND_I1)
- ++ip;
- sp -= 2;
- * (gint8 *) sp->data.p = (gint8)sp[1].data.i;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STIND_I2)
- ++ip;
- sp -= 2;
- * (gint16 *) sp->data.p = (gint16)sp[1].data.i;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STIND_I4)
- ++ip;
- sp -= 2;
- * (gint32 *) sp->data.p = sp[1].data.i;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STIND_I)
- ++ip;
- sp -= 2;
- * (mono_i *) sp->data.p = (mono_i)sp[1].data.p;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STIND_I8)
- ++ip;
- sp -= 2;
- * (gint64 *) sp->data.p = sp[1].data.l;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STIND_R4)
- ++ip;
- sp -= 2;
- * (float *) sp->data.p = (gfloat)sp[1].data.f;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STIND_R8)
- ++ip;
- sp -= 2;
- * (double *) sp->data.p = sp[1].data.f;
- MINT_IN_BREAK;
-#define BINOP(datamem, op) \
- --sp; \
- sp [-1].data.datamem = sp [-1].data.datamem op sp [0].data.datamem; \
- ++ip;
- MINT_IN_CASE(MINT_ADD_I4)
- BINOP(i, +);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ADD_I8)
- BINOP(l, +);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ADD_R8)
- BINOP(f, +);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ADD1_I4)
- ++sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SUB_I4)
- BINOP(i, -);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SUB_I8)
- BINOP(l, -);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SUB_R8)
- BINOP(f, -);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SUB1_I4)
- --sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MUL_I4)
- BINOP(i, *);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MUL_I8)
- BINOP(l, *);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MUL_R8)
- BINOP(f, *);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_DIV_I4)
- if (sp [-1].data.i == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip);
- BINOP(i, /);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_DIV_I8)
- if (sp [-1].data.l == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip);
- BINOP(l, /);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_DIV_R8)
- BINOP(f, /);
- MINT_IN_BREAK;
-
-#define BINOP_CAST(datamem, op, type) \
- --sp; \
- sp [-1].data.datamem = (type)sp [-1].data.datamem op (type)sp [0].data.datamem; \
- ++ip;
- MINT_IN_CASE(MINT_DIV_UN_I4)
- if (sp [-1].data.i == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip);
- BINOP_CAST(i, /, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_DIV_UN_I8)
- if (sp [-1].data.l == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip);
- BINOP_CAST(l, /, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_REM_I4)
- if (sp [-1].data.i == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip);
- BINOP(i, %);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_REM_I8)
- if (sp [-1].data.l == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip);
- BINOP(l, %);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_REM_R8)
- /* FIXME: what do we actually do here? */
- --sp;
- sp [-1].data.f = fmod (sp [-1].data.f, sp [0].data.f);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_REM_UN_I4)
- if (sp [-1].data.i == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip);
- BINOP_CAST(i, %, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_REM_UN_I8)
- if (sp [-1].data.l == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip);
- BINOP_CAST(l, %, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_AND_I4)
- BINOP(i, &);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_AND_I8)
- BINOP(l, &);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_OR_I4)
- BINOP(i, |);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_OR_I8)
- BINOP(l, |);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_XOR_I4)
- BINOP(i, ^);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_XOR_I8)
- BINOP(l, ^);
- MINT_IN_BREAK;
-
-#define SHIFTOP(datamem, op) \
- --sp; \
- sp [-1].data.datamem = sp [-1].data.datamem op sp [0].data.i; \
- ++ip;
-
- MINT_IN_CASE(MINT_SHL_I4)
- SHIFTOP(i, <<);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SHL_I8)
- SHIFTOP(l, <<);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SHR_I4)
- SHIFTOP(i, >>);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SHR_I8)
- SHIFTOP(l, >>);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SHR_UN_I4)
- --sp;
- sp [-1].data.i = (guint32)sp [-1].data.i >> sp [0].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SHR_UN_I8)
- --sp;
- sp [-1].data.l = (guint64)sp [-1].data.l >> sp [0].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_NEG_I4)
- sp [-1].data.i = - sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_NEG_I8)
- sp [-1].data.l = - sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_NEG_R8)
- sp [-1].data.f = - sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_NOT_I4)
- sp [-1].data.i = ~ sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_NOT_I8)
- sp [-1].data.l = ~ sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I1_I4)
- sp [-1].data.i = (gint8)sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I1_I8)
- sp [-1].data.i = (gint8)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I1_R8)
- sp [-1].data.i = (gint8)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U1_I4)
- sp [-1].data.i = (guint8)sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U1_I8)
- sp [-1].data.i = (guint8)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U1_R8)
- sp [-1].data.i = (guint8)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I2_I4)
- sp [-1].data.i = (gint16)sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I2_I8)
- sp [-1].data.i = (gint16)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I2_R8)
- sp [-1].data.i = (gint16)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U2_I4)
- sp [-1].data.i = (guint16)sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U2_I8)
- sp [-1].data.i = (guint16)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U2_R8)
- sp [-1].data.i = (guint16)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I4_R8)
- sp [-1].data.i = (gint32)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U4_I8)
- MINT_IN_CASE(MINT_CONV_I4_I8)
- sp [-1].data.i = (gint32)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I4_I8_SP)
- sp [-2].data.i = (gint32)sp [-2].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U4_R8)
- sp [-1].data.i = (guint32)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I8_I4)
- sp [-1].data.l = sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I8_I4_SP)
- sp [-2].data.l = sp [-2].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I8_U4)
- sp [-1].data.l = (guint32)sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_I8_R8)
- sp [-1].data.l = (gint64)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_R4_I4)
- sp [-1].data.f = (float)sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_R4_I8)
- sp [-1].data.f = (float)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_R4_R8)
- sp [-1].data.f = (float)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_R8_I4)
- sp [-1].data.f = (double)sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_R8_I8)
- sp [-1].data.f = (double)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U8_I4)
- sp [-1].data.l = sp [-1].data.i & 0xffffffff;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_U8_R8)
- sp [-1].data.l = (guint64)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
-#if 0
- MINT_IN_CASE(MINT_CPOBJ) {
- MonoClass *vtklass;
- ++ip;
- vtklass = rtm->data_items[READ32 (ip)];
- ip += 2;
- sp -= 2;
- memcpy (sp [0].data.p, sp [1].data.p, mono_class_value_size (vtklass, NULL));
- MINT_IN_BREAK;
- }
-#endif
- MINT_IN_CASE(MINT_LDOBJ) {
- int size;
- void *p;
- c = rtm->data_items[* (guint16 *)(ip + 1)];
- ip += 2;
- if (c->byval_arg.type != MONO_TYPE_VALUETYPE || c->byval_arg.data.klass->enumtype) {
- p = sp [-1].data.p;
- stackval_from_data (&c->byval_arg, &sp [-1], p, FALSE);
- } else {
- size = mono_class_value_size (c, NULL);
- p = sp [-1].data.p;
- sp [-1].data.p = vt_sp;
- memcpy(vt_sp, p, size);
- vt_sp += (size + 7) & ~7;
- }
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDSTR)
- sp->data.p = rtm->data_items [* (guint16 *)(ip + 1)];
- ++sp;
- ip += 2;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_NEWOBJ) {
- MonoClass *newobj_class;
- MonoMethodSignature *csig;
- stackval valuetype_this;
- guint32 token;
- stackval retval;
-
- frame->ip = ip;
-
- token = * (guint16 *)(ip + 1);
- ip += 2;
-
- child_frame.runtime_method = rtm->data_items [token];
- csig = mono_method_signature (child_frame.runtime_method->method);
- newobj_class = child_frame.runtime_method->method->klass;
- /*if (profiling_classes) {
- guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, newobj_class));
- count++;
- g_hash_table_insert (profiling_classes, newobj_class, GUINT_TO_POINTER (count));
- }*/
-
-
- if (newobj_class->parent == mono_defaults.array_class) {
- sp -= csig->param_count;
- o = ves_array_create (context->domain, newobj_class, csig, sp);
- goto array_constructed;
- }
-
- /*
- * First arg is the object.
- */
- if (newobj_class->valuetype) {
- if (!newobj_class->enumtype && (newobj_class->byval_arg.type == MONO_TYPE_VALUETYPE)) {
- child_frame.obj = vt_sp;
- valuetype_this.data.p = vt_sp;
- } else {
- memset (&valuetype_this, 0, sizeof (stackval));
- child_frame.obj = &valuetype_this;
- }
- } else {
- if (newobj_class != mono_defaults.string_class) {
- context->managed_code = 0;
- o = mono_object_new (context->domain, newobj_class);
- context->managed_code = 1;
- if (*abort_requested)
- mono_thread_interruption_checkpoint ();
- child_frame.obj = o;
- } else {
- child_frame.retval = &retval;
- }
- }
-
- if (csig->param_count) {
- sp -= csig->param_count;
- child_frame.stack_args = sp;
- } else {
- child_frame.stack_args = NULL;
- }
-
- g_assert (csig->call_convention == MONO_CALL_DEFAULT);
-
- child_frame.ip = NULL;
- child_frame.ex = NULL;
-
- ves_exec_method_with_context (&child_frame, context);
-
- context->current_frame = frame;
-
- if (child_frame.ex) {
- /*
- * An exception occurred, need to run finally, fault and catch handlers..
- */
- frame->ex = child_frame.ex;
- goto handle_finally;
- }
- /*
- * a constructor returns void, but we need to return the object we created
- */
-array_constructed:
- if (newobj_class->valuetype && !newobj_class->enumtype) {
- *sp = valuetype_this;
- } else if (newobj_class == mono_defaults.string_class) {
- *sp = retval;
- } else {
- sp->data.p = o;
- }
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_CASTCLASS)
- c = rtm->data_items [*(guint16 *)(ip + 1)];
- if ((o = sp [-1].data.p)) {
- if (c->marshalbyref) {
- if (!mono_object_isinst_mbyref (o, c))
- THROW_EX (mono_get_exception_invalid_cast (), ip);
- } else {
- MonoVTable *vt = o->vtable;
- MonoClass *oklass = vt->klass;
- if (c->flags & TYPE_ATTRIBUTE_INTERFACE) {
- if (c->interface_id > vt->max_interface_id ||
- vt->interface_offsets [c->interface_id] == 0) {
- THROW_EX (mono_get_exception_invalid_cast (), ip);
- }
- } else if (c->rank) {
- if (!mono_object_isinst (o, c))
- THROW_EX (mono_get_exception_invalid_cast (), ip);
- } else if (!mono_class_has_parent (oklass, c)) {
- THROW_EX (mono_get_exception_invalid_cast (), ip);
- }
- }
- }
- ip += 2;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ISINST)
- c = rtm->data_items [*(guint16 *)(ip + 1)];
- if ((o = sp [-1].data.p)) {
- if (c->marshalbyref) {
- if (!mono_object_isinst_mbyref (o, c))
- sp [-1].data.p = NULL;
- } else {
- MonoVTable *vt = o->vtable;
- MonoClass *oklass = vt->klass;
- if (c->flags & TYPE_ATTRIBUTE_INTERFACE) {
- if (c->interface_id > vt->max_interface_id ||
- vt->interface_offsets [c->interface_id] == 0) {
- sp [-1].data.p = NULL;
- }
- } else if (c->rank) {
- if (!mono_object_isinst (o, c))
- sp [-1].data.p = NULL;
- } else if (!mono_class_has_parent (oklass, c)) {
- sp [-1].data.p = NULL;
- }
- }
- }
- ip += 2;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_R_UN_I4)
- sp [-1].data.f = (double)(guint32)sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_R_UN_I8)
- sp [-1].data.f = (double)(guint64)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_UNBOX)
- c = rtm->data_items[*(guint16 *)(ip + 1)];
-
- o = sp [-1].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference(), ip);
-
- if (!(mono_object_isinst (o, c) ||
- ((o->vtable->klass->rank == 0) &&
- (o->vtable->klass->element_class == c->element_class))))
- THROW_EX (mono_get_exception_invalid_cast (), ip);
-
- sp [-1].data.p = (char *)o + sizeof (MonoObject);
- ip += 2;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_THROW)
- --sp;
- frame->ex_handler = NULL;
- if (!sp->data.p)
- sp->data.p = mono_get_exception_null_reference ();
- THROW_EX ((MonoException *)sp->data.p, ip);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLDA)
- o = sp [-1].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- sp[-1].data.p = (char *)o + * (guint16 *)(ip + 1);
- ip += 2;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CKNULL)
- o = sp [-1].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- ++ip;
- MINT_IN_BREAK;
-
-#define LDFLD(datamem, fieldtype) \
- o = sp [-1].data.p; \
- if (!o) \
- THROW_EX (mono_get_exception_null_reference (), ip); \
- sp[-1].data.datamem = * (fieldtype *)((char *)o + * (guint16 *)(ip + 1)) ; \
- ip += 2;
-
- MINT_IN_CASE(MINT_LDFLD_I1) LDFLD(i, gint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_U1) LDFLD(i, guint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_I2) LDFLD(i, gint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_U2) LDFLD(i, guint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_I4) LDFLD(i, gint32); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_I8) LDFLD(l, gint64); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_R4) LDFLD(f, float); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_R8) LDFLD(f, double); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_O) LDFLD(p, gpointer); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFLD_P) LDFLD(p, gpointer); MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_LDFLD_VT)
- o = sp [-1].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- i32 = READ32(ip + 2);
- sp [-1].data.p = vt_sp;
- memcpy(sp [-1].data.p, (char *)o + * (guint16 *)(ip + 1), i32);
- vt_sp += (i32 + 7) & ~7;
- ip += 4;
- MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_LDRMFLD) {
- gpointer tmp;
- MonoClassField *field;
- char *addr;
-
- o = sp [-1].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- field = rtm->data_items[* (guint16 *)(ip + 1)];
- ip += 2;
- if (o->vtable->klass == mono_defaults.transparent_proxy_class) {
- MonoClass *klass = ((MonoTransparentProxy*)o)->remote_class->proxy_class;
-
- addr = mono_load_remote_field (o, klass, field, &tmp);
- } else {
- addr = (char*)o + field->offset;
- }
-
- stackval_from_data (field->type, &sp [-1], addr, FALSE);
- MINT_IN_BREAK;
- }
-
- MINT_IN_CASE(MINT_LDRMFLD_VT) {
- MonoClassField *field;
- char *addr;
- gpointer tmp;
-
- o = sp [-1].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- field = rtm->data_items[* (guint16 *)(ip + 1)];
- i32 = READ32(ip + 2);
- ip += 4;
- if (o->vtable->klass == mono_defaults.transparent_proxy_class) {
- MonoClass *klass = ((MonoTransparentProxy*)o)->remote_class->proxy_class;
- addr = mono_load_remote_field (o, klass, field, &tmp);
- } else {
- addr = (char*)o + field->offset;
- }
-
- sp [-1].data.p = vt_sp;
- memcpy(sp [-1].data.p, (char *)o + * (guint16 *)(ip + 1), i32);
- vt_sp += (i32 + 7) & ~7;
- memcpy(sp [-1].data.p, addr, i32);
- MINT_IN_BREAK;
- }
-
-#define STFLD(datamem, fieldtype) \
- o = sp [-2].data.p; \
- if (!o) \
- THROW_EX (mono_get_exception_null_reference (), ip); \
- sp -= 2; \
- * (fieldtype *)((char *)o + * (guint16 *)(ip + 1)) = sp[1].data.datamem; \
- ip += 2;
-
- MINT_IN_CASE(MINT_STFLD_I1) STFLD(i, gint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_U1) STFLD(i, guint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_I2) STFLD(i, gint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_U2) STFLD(i, guint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_I4) STFLD(i, gint32); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_I8) STFLD(l, gint64); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_R4) STFLD(f, float); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_R8) STFLD(f, double); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_O) STFLD(p, gpointer); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STFLD_P) STFLD(p, gpointer); MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_STFLD_VT)
- o = sp [-2].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- i32 = READ32(ip + 2);
- sp -= 2;
- memcpy((char *)o + * (guint16 *)(ip + 1), sp [1].data.p, i32);
- vt_sp -= (i32 + 7) & ~7;
- ip += 4;
- MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_STRMFLD) {
- MonoClassField *field;
-
- o = sp [-2].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
-
- field = rtm->data_items[* (guint16 *)(ip + 1)];
- ip += 2;
-
- if (o->vtable->klass == mono_defaults.transparent_proxy_class) {
- MonoClass *klass = ((MonoTransparentProxy*)o)->remote_class->proxy_class;
- mono_store_remote_field (o, klass, field, &sp [-1].data);
- } else
- stackval_to_data (field->type, &sp [-1], (char*)o + field->offset, FALSE);
-
- sp -= 2;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_STRMFLD_VT) {
- MonoClassField *field;
-
- o = sp [-2].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- field = rtm->data_items[* (guint16 *)(ip + 1)];
- i32 = READ32(ip + 2);
- ip += 4;
-
- if (o->vtable->klass == mono_defaults.transparent_proxy_class) {
- MonoClass *klass = ((MonoTransparentProxy*)o)->remote_class->proxy_class;
- mono_store_remote_field (o, klass, field, &sp [-1].data);
- } else
- memcpy((char*)o + field->offset, sp [-1].data.p, i32);
-
- sp -= 2;
- vt_sp -= (i32 + 7) & ~7;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDSFLDA) {
- MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
- MonoVTable *vt = mono_class_vtable (context->domain, field->parent);
- gpointer addr;
-
- if (!vt->initialized) {
- frame->ip = ip;
- mono_runtime_class_init (vt);
- }
- ip += 2;
-
- if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
- sp->data.p = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
- else
- sp->data.p = (char*)(vt->data) + field->offset;
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDSFLD) {
- MonoVTable *vt;
- MonoClassField *field;
- gpointer addr;
-
- field = rtm->data_items[*(guint16 *)(ip + 1)];
- vt = rtm->data_items [*(guint16 *)(ip + 2)];
- if (!vt->initialized) {
- frame->ip = ip;
- mono_runtime_class_init (vt);
- }
- ip += 3;
- if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
- addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
- else
- addr = (char*)(vt->data) + field->offset;
-
- stackval_from_data (field->type, sp, addr, FALSE);
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDSFLD_I4) {
- MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
- MonoVTable *vt = rtm->data_items [*(guint16 *)(ip + 2)];
- if (!vt->initialized) {
- frame->ip = ip;
- mono_runtime_class_init (vt);
- }
- ip += 3;
- sp->data.i = * (gint32 *)((char*)(vt->data) + field->offset);
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDSFLD_O) {
- MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
- MonoVTable *vt = rtm->data_items [*(guint16 *)(ip + 2)];
- if (!vt->initialized) {
- frame->ip = ip;
- mono_runtime_class_init (vt);
- }
- ip += 3;
- sp->data.p = * (gpointer *)((char*)(vt->data) + field->offset);
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDSFLD_VT) {
- MonoVTable *vt;
- MonoClassField *field;
- guint32 token;
- gpointer addr;
- int size;
-
- token = * (guint16 *)(ip + 1);
- size = READ32(ip + 2);
- field = rtm->data_items[token];
- ip += 4;
-
- vt = mono_class_vtable (context->domain, field->parent);
- if (!vt->initialized) {
- frame->ip = ip - 2;
- mono_runtime_class_init (vt);
- }
-
- if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
- addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
- else
- addr = (char*)(vt->data) + field->offset;
-
- sp->data.p = vt_sp;
- vt_sp += (size + 7) & ~7;
- stackval_from_data (field->type, sp, addr, FALSE);
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_STSFLD) {
- MonoVTable *vt;
- MonoClassField *field;
- guint32 token;
- gpointer addr;
-
- token = * (guint16 *)(ip + 1);
- field = rtm->data_items[token];
- ip += 2;
- --sp;
-
- vt = mono_class_vtable (context->domain, field->parent);
- if (!vt->initialized) {
- frame->ip = ip - 2;
- mono_runtime_class_init (vt);
- }
-
- if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
- addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
- else
- addr = (char*)(vt->data) + field->offset;
-
- stackval_to_data (field->type, sp, addr, FALSE);
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_STSFLD_VT) {
- MonoVTable *vt;
- MonoClassField *field;
- guint32 token;
- gpointer addr;
- int size;
-
- token = * (guint16 *)(ip + 1);
- size = READ32(ip + 2);
- field = rtm->data_items[token];
- ip += 4;
-
- vt = mono_class_vtable (context->domain, field->parent);
- if (!vt->initialized) {
- frame->ip = ip - 2;
- mono_runtime_class_init (vt);
- }
-
- if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
- addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
- else
- addr = (char*)(vt->data) + field->offset;
- --sp;
- stackval_to_data (field->type, sp, addr, FALSE);
- vt_sp -= (size + 7) & ~7;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_STOBJ_VT) {
- int size;
- c = rtm->data_items[* (guint16 *)(ip + 1)];
- ip += 2;
- size = mono_class_value_size (c, NULL);
- memcpy(sp [-2].data.p, sp [-1].data.p, size);
- vt_sp -= (size + 7) & ~7;
- sp -= 2;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_STOBJ) {
- int size;
- c = rtm->data_items[* (guint16 *)(ip + 1)];
- ip += 2;
- size = mono_class_value_size (c, NULL);
- memcpy(sp [-2].data.p, &sp [-1].data, size);
- sp -= 2;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_CONV_OVF_I4_UN_R8)
- if (sp [-1].data.f < 0 || sp [-1].data.f > MYGUINT32_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (guint32)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U8_I4)
- if (sp [-1].data.i < 0)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.l = sp [-1].data.i;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U8_R8)
- MINT_IN_CASE(MINT_CONV_OVF_I8_UN_R8)
- if (sp [-1].data.f < 0 || sp [-1].data.f > 9223372036854775807LL)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.l = (guint64)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I8_R8)
- if (sp [-1].data.f < MYGINT64_MIN || sp [-1].data.f > MYGINT64_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.l = (gint64)sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I4_UN_I8)
- if ((mono_u)sp [-1].data.l > MYGUINT32_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (mono_u)sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BOX)
- c = rtm->data_items [* (guint16 *)(ip + 1)];
-
- if (c->byval_arg.type == MONO_TYPE_VALUETYPE && !c->enumtype) {
- int size = mono_class_value_size (c, NULL);
- sp [-1].data.p = mono_value_box (context->domain, c, sp [-1].data.p);
- size = (size + 7) & ~7;
- vt_sp -= size;
- }
- else {
- stackval_to_data (&c->byval_arg, &sp [-1], (char*)&sp [-1], FALSE);
- sp [-1].data.p = mono_value_box (context->domain, c, &sp [-1]);
- }
- ip += 2;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_NEWARR)
- sp [-1].data.p = (MonoObject*) mono_array_new (context->domain, rtm->data_items[*(guint16 *)(ip + 1)], sp [-1].data.i);
- ip += 2;
- /*if (profiling_classes) {
- guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, o->vtable->klass));
- count++;
- g_hash_table_insert (profiling_classes, o->vtable->klass, GUINT_TO_POINTER (count));
- }*/
-
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLEN)
- o = sp [-1].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- sp [-1].data.nati = mono_array_length ((MonoArray *)o);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_GETCHR) {
- MonoString *s;
- s = sp [-2].data.p;
- if (!s)
- THROW_EX (mono_get_exception_null_reference (), ip);
- i32 = sp [-1].data.i;
- if (i32 < 0 || i32 >= mono_string_length (s))
- THROW_EX (mono_get_exception_index_out_of_range (), ip);
- --sp;
- sp [-1].data.i = mono_string_chars(s)[i32];
- ++ip;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_STRLEN)
- ++ip;
- sp [-1].data.i = mono_string_length ((MonoString*)sp [-1].data.p);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ARRAY_RANK)
- o = sp [-1].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
- sp [-1].data.i = mono_object_class (sp [-1].data.p)->rank;
- ip++;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDELEMA) {
- guint32 esize;
- mono_u aindex;
-
- /*token = READ32 (ip)*/;
- ip += 2;
- sp -= 2;
-
- o = sp [0].data.p;
-
- aindex = sp [1].data.i;
- if (aindex >= mono_array_length ((MonoArray *) o))
- THROW_EX (mono_get_exception_index_out_of_range (), ip - 2);
-
- /* check the array element corresponds to token */
- esize = mono_array_element_size (((MonoArray *) o)->obj.vtable->klass);
-
- sp->data.p = mono_array_addr_with_size ((MonoArray *) o, esize, aindex);
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDELEM_I1) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_U1) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_I2) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_U2) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_I4) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_U4) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_I8) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_I) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_R4) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_R8) /* fall through */
- MINT_IN_CASE(MINT_LDELEM_REF) {
- MonoArray *o;
- mono_u aindex;
-
- sp -= 2;
-
- o = sp [0].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
-
- aindex = sp [1].data.i;
- if (aindex >= mono_array_length (o))
- THROW_EX (mono_get_exception_index_out_of_range (), ip);
-
- /*
- * FIXME: throw mono_get_exception_array_type_mismatch () if needed
- */
- switch (*ip) {
- case MINT_LDELEM_I1:
- sp [0].data.i = mono_array_get (o, gint8, aindex);
- break;
- case MINT_LDELEM_U1:
- sp [0].data.i = mono_array_get (o, guint8, aindex);
- break;
- case MINT_LDELEM_I2:
- sp [0].data.i = mono_array_get (o, gint16, aindex);
- break;
- case MINT_LDELEM_U2:
- sp [0].data.i = mono_array_get (o, guint16, aindex);
- break;
- case MINT_LDELEM_I:
- sp [0].data.nati = mono_array_get (o, mono_i, aindex);
- break;
- case MINT_LDELEM_I4:
- sp [0].data.i = mono_array_get (o, gint32, aindex);
- break;
- case MINT_LDELEM_U4:
- sp [0].data.i = mono_array_get (o, guint32, aindex);
- break;
- case MINT_LDELEM_I8:
- sp [0].data.l = mono_array_get (o, guint64, aindex);
- break;
- case MINT_LDELEM_R4:
- sp [0].data.f = mono_array_get (o, float, aindex);
- break;
- case MINT_LDELEM_R8:
- sp [0].data.f = mono_array_get (o, double, aindex);
- break;
- case MINT_LDELEM_REF:
- sp [0].data.p = mono_array_get (o, gpointer, aindex);
- break;
- default:
- ves_abort();
- }
-
- ++ip;
- ++sp;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_STELEM_I) /* fall through */
- MINT_IN_CASE(MINT_STELEM_I1) /* fall through */
- MINT_IN_CASE(MINT_STELEM_I2) /* fall through */
- MINT_IN_CASE(MINT_STELEM_I4) /* fall through */
- MINT_IN_CASE(MINT_STELEM_I8) /* fall through */
- MINT_IN_CASE(MINT_STELEM_R4) /* fall through */
- MINT_IN_CASE(MINT_STELEM_R8) /* fall through */
- MINT_IN_CASE(MINT_STELEM_REF) {
- mono_u aindex;
-
- sp -= 3;
-
- o = sp [0].data.p;
- if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip);
-
- aindex = sp [1].data.i;
- if (aindex >= mono_array_length ((MonoArray *)o))
- THROW_EX (mono_get_exception_index_out_of_range (), ip);
-
- switch (*ip) {
- case MINT_STELEM_I:
- mono_array_set ((MonoArray *)o, mono_i, aindex, sp [2].data.nati);
- break;
- case MINT_STELEM_I1:
- mono_array_set ((MonoArray *)o, gint8, aindex, sp [2].data.i);
- break;
- case MINT_STELEM_I2:
- mono_array_set ((MonoArray *)o, gint16, aindex, sp [2].data.i);
- break;
- case MINT_STELEM_I4:
- mono_array_set ((MonoArray *)o, gint32, aindex, sp [2].data.i);
- break;
- case MINT_STELEM_I8:
- mono_array_set ((MonoArray *)o, gint64, aindex, sp [2].data.l);
- break;
- case MINT_STELEM_R4:
- mono_array_set ((MonoArray *)o, float, aindex, sp [2].data.f);
- break;
- case MINT_STELEM_R8:
- mono_array_set ((MonoArray *)o, double, aindex, sp [2].data.f);
- break;
- case MINT_STELEM_REF:
- if (sp [2].data.p && !mono_object_isinst (sp [2].data.p, mono_object_class (o)->element_class))
- THROW_EX (mono_get_exception_array_type_mismatch (), ip);
- mono_array_set ((MonoArray *)o, gpointer, aindex, sp [2].data.p);
- break;
- default:
- ves_abort();
- }
-
- ++ip;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_CONV_OVF_I4_U4)
- if (sp [-1].data.i < 0)
- THROW_EX (mono_get_exception_overflow (), ip);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I4_I8)
- if (sp [-1].data.l < MYGINT32_MIN || sp [-1].data.l > MYGINT32_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint32) sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I4_R8)
- if (sp [-1].data.f < MYGINT32_MIN || sp [-1].data.f > MYGINT32_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint32) sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U4_I4)
- if (sp [-1].data.i < 0)
- THROW_EX (mono_get_exception_overflow (), ip);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U4_I8)
- if (sp [-1].data.l < 0 || sp [-1].data.l > MYGUINT32_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (guint32) sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U4_R8)
- if (sp [-1].data.f < 0 || sp [-1].data.f > MYGUINT32_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (guint32) sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I2_I4)
- if (sp [-1].data.i < -32768 || sp [-1].data.i > 32767)
- THROW_EX (mono_get_exception_overflow (), ip);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I2_I8)
- if (sp [-1].data.l < -32768 || sp [-1].data.l > 32767)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint16) sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I2_R8)
- if (sp [-1].data.f < -32768 || sp [-1].data.f > 32767)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint16) sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U2_I4)
- if (sp [-1].data.i < 0 || sp [-1].data.i > 65535)
- THROW_EX (mono_get_exception_overflow (), ip);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U2_I8)
- if (sp [-1].data.l < 0 || sp [-1].data.l > 65535)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (guint16) sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U2_R8)
- if (sp [-1].data.f < 0 || sp [-1].data.f > 65535)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (guint16) sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I1_I4)
- if (sp [-1].data.i < -128 || sp [-1].data.i > 127)
- THROW_EX (mono_get_exception_overflow (), ip);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I1_I8)
- if (sp [-1].data.l < -128 || sp [-1].data.l > 127)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint8) sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_I1_R8)
- if (sp [-1].data.f < -128 || sp [-1].data.f > 127)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint8) sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U1_I4)
- if (sp [-1].data.i < 0 || sp [-1].data.i > 255)
- THROW_EX (mono_get_exception_overflow (), ip);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U1_I8)
- if (sp [-1].data.l < 0 || sp [-1].data.l > 255)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (guint8) sp [-1].data.l;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CONV_OVF_U1_R8)
- if (sp [-1].data.f < 0 || sp [-1].data.f > 255)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (guint8) sp [-1].data.f;
- ++ip;
- MINT_IN_BREAK;
-#if 0
- MINT_IN_CASE(MINT_LDELEM)
- MINT_IN_CASE(MINT_STELEM)
- MINT_IN_CASE(MINT_UNBOX_ANY)
-
- MINT_IN_CASE(MINT_REFANYVAL) ves_abort(); MINT_IN_BREAK;
-#endif
- MINT_IN_CASE(MINT_CKFINITE)
- if (!finite(sp [-1].data.f))
- THROW_EX (mono_get_exception_arithmetic (), ip);
- ++ip;
- MINT_IN_BREAK;
-#if 0
- MINT_IN_CASE(MINT_MKREFANY) ves_abort(); MINT_IN_BREAK;
-#endif
- MINT_IN_CASE(MINT_LDTOKEN)
- sp->data.p = vt_sp;
- vt_sp += 8;
- * (gpointer *)sp->data.p = rtm->data_items[*(guint16 *)(ip + 1)];
- ip += 2;
- ++sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ADD_OVF_I4)
- if (CHECK_ADD_OVERFLOW (sp [-2].data.i, sp [-1].data.i))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP(i, +);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ADD_OVF_I8)
- if (CHECK_ADD_OVERFLOW64 (sp [-2].data.l, sp [-1].data.l))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP(l, +);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ADD_OVF_UN_I4)
- if (CHECK_ADD_OVERFLOW_UN (sp [-2].data.i, sp [-1].data.i))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP_CAST(i, +, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ADD_OVF_UN_I8)
- if (CHECK_ADD_OVERFLOW64_UN (sp [-2].data.l, sp [-1].data.l))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP_CAST(l, +, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MUL_OVF_I4)
- if (CHECK_MUL_OVERFLOW (sp [-2].data.i, sp [-1].data.i))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP(i, *);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MUL_OVF_I8)
- if (CHECK_MUL_OVERFLOW64 (sp [-2].data.l, sp [-1].data.l))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP(l, *);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MUL_OVF_UN_I4)
- if (CHECK_MUL_OVERFLOW_UN (sp [-2].data.i, sp [-1].data.i))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP_CAST(i, *, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MUL_OVF_UN_I8)
- if (CHECK_MUL_OVERFLOW64_UN (sp [-2].data.l, sp [-1].data.l))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP_CAST(l, *, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SUB_OVF_I4)
- if (CHECK_SUB_OVERFLOW (sp [-2].data.i, sp [-1].data.i))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP(i, -);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SUB_OVF_I8)
- if (CHECK_SUB_OVERFLOW64 (sp [-2].data.l, sp [-1].data.l))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP(l, -);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SUB_OVF_UN_I4)
- if (CHECK_SUB_OVERFLOW_UN (sp [-2].data.i, sp [-1].data.i))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP_CAST(i, -, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_SUB_OVF_UN_I8)
- if (CHECK_SUB_OVERFLOW64_UN (sp [-2].data.l, sp [-1].data.l))
- THROW_EX (mono_get_exception_overflow (), ip);
- BINOP_CAST(l, -, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ENDFINALLY)
- if (finally_ips) {
- ip = finally_ips->data;
- finally_ips = g_slist_remove (finally_ips, ip);
- goto main_loop;
- }
- if (frame->ex)
- goto handle_fault;
- ves_abort();
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LEAVE) /* Fall through */
- MINT_IN_CASE(MINT_LEAVE_S)
- while (sp > frame->stack) {
- --sp;
- }
- frame->ip = ip;
- if (*ip == MINT_LEAVE_S) {
- ip += (short) *(ip + 1);
- } else {
- ip += (gint32) READ32 (ip + 1);
- }
- endfinally_ip = ip;
- if (frame->ex_handler != NULL && MONO_OFFSET_IN_HANDLER(frame->ex_handler, frame->ip - rtm->code)) {
- frame->ex_handler = NULL;
- frame->ex = NULL;
- }
- goto handle_finally;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_ICALL_V_V)
- MINT_IN_CASE(MINT_ICALL_P_V)
- MINT_IN_CASE(MINT_ICALL_P_P)
- MINT_IN_CASE(MINT_ICALL_PP_V)
- MINT_IN_CASE(MINT_ICALL_PI_V)
- MINT_IN_CASE(MINT_ICALL_PP_P)
- MINT_IN_CASE(MINT_ICALL_PI_P)
- MINT_IN_CASE(MINT_ICALL_PPP_V)
- MINT_IN_CASE(MINT_ICALL_PPI_V)
- sp = do_icall (context, *ip, sp, rtm->data_items [*(guint16 *)(ip + 1)]);
- if (frame->ex != NULL)
- goto handle_exception;
- ip += 2;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MONO_LDPTR)
- sp->data.p = rtm->data_items [*(guint16 *)(ip + 1)];
- ip += 2;
- ++sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MONO_NEWOBJ)
- sp->data.p = mono_object_new (context->domain, rtm->data_items [*(guint16 *)(ip + 1)]);
- ip += 2;
- sp++;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MONO_FREE)
- ++ip;
- --sp;
- g_free (sp->data.p);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MONO_RETOBJ)
- ++ip;
- sp--;
- stackval_from_data (mono_method_signature (frame->runtime_method->method)->ret, frame->retval, sp->data.p,
- mono_method_signature (frame->runtime_method->method)->pinvoke);
- if (sp > frame->stack)
- g_warning ("retobj: more values on stack: %d", sp-frame->stack);
- goto exit_frame;
-
-#define RELOP(datamem, op) \
- --sp; \
- sp [-1].data.i = sp [-1].data.datamem op sp [0].data.datamem; \
- ++ip;
- MINT_IN_CASE(MINT_CEQ_I4)
- RELOP(i, ==);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CEQ0_I4)
- sp [-1].data.i = (sp [-1].data.i == 0);
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CEQ_I8)
- RELOP(l, ==);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CEQ_R8)
- --sp;
- if (isunordered (sp [-1].data.f, sp [0].data.f))
- sp [-1].data.i = 0;
- else
- sp [-1].data.i = sp [-1].data.f == sp [0].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CGT_I4)
- RELOP(i, >);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CGT_I8)
- RELOP(l, >);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CGT_R8)
- --sp;
- if (isunordered (sp [-1].data.f, sp [0].data.f))
- sp [-1].data.i = 0;
- else
- sp [-1].data.i = sp [-1].data.f > sp [0].data.f;
- ++ip;
- MINT_IN_BREAK;
-
-#define RELOP_CAST(datamem, op, type) \
- --sp; \
- sp [-1].data.i = (type)sp [-1].data.datamem op (type)sp [0].data.datamem; \
- ++ip;
-
- MINT_IN_CASE(MINT_CGT_UN_I4)
- RELOP_CAST(i, >, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CGT_UN_I8)
- RELOP_CAST(l, >, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CGT_UN_R8)
- --sp;
- if (isunordered (sp [-1].data.f, sp [0].data.f))
- sp [-1].data.i = 1;
- else
- sp [-1].data.i = sp [-1].data.f > sp [0].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CLT_I4)
- RELOP(i, <);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CLT_I8)
- RELOP(l, <);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CLT_R8)
- --sp;
- if (isunordered (sp [-1].data.f, sp [0].data.f))
- sp [-1].data.i = 0;
- else
- sp [-1].data.i = sp [-1].data.f < sp [0].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CLT_UN_I4)
- RELOP_CAST(i, <, guint32);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CLT_UN_I8)
- RELOP_CAST(l, <, guint64);
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CLT_UN_R8)
- --sp;
- if (isunordered (sp [-1].data.f, sp [0].data.f))
- sp [-1].data.i = 1;
- else
- sp [-1].data.i = sp [-1].data.f < sp [0].data.f;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDFTN) {
- sp->data.p = rtm->data_items [* (guint16 *)(ip + 1)];
- ++sp;
- ip += 2;
- MINT_IN_BREAK;
- }
- MINT_IN_CASE(MINT_LDVIRTFTN) {
- RuntimeMethod *m = rtm->data_items [* (guint16 *)(ip + 1)];
- ip += 2;
- --sp;
- if (!sp->data.p)
- THROW_EX (mono_get_exception_null_reference (), ip - 2);
-
- sp->data.p = get_virtual_method (m, sp->data.p);
- ++sp;
- MINT_IN_BREAK;
- }
-
- MINT_IN_CASE(MINT_LDTHIS)
- sp->data.p = frame->obj;
- ++ip;
- ++sp;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STTHIS)
- --sp;
- frame->obj = sp->data.p;
- ++ip;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDTHISA)
- sp->data.p = &frame->obj;
- ++ip;
- ++sp;
- MINT_IN_BREAK;
-
-#define LDARG(datamem, argtype) \
- sp->data.datamem = * (argtype *)(frame->args + * (guint16 *)(ip + 1)); \
- ip += 2; \
- ++sp;
-
- MINT_IN_CASE(MINT_LDARG_I1) LDARG(i, gint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_U1) LDARG(i, guint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_I2) LDARG(i, gint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_U2) LDARG(i, guint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_I4) LDARG(i, gint32); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_I8) LDARG(l, gint64); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_R4) LDARG(f, float); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_R8) LDARG(f, double); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_O) LDARG(p, gpointer); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDARG_P) LDARG(p, gpointer); MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_LDARG_VT)
- sp->data.p = vt_sp;
- i32 = READ32(ip + 2);
- memcpy(sp->data.p, frame->args + * (guint16 *)(ip + 1), i32);
- vt_sp += (i32 + 7) & ~7;
- ip += 4;
- ++sp;
- MINT_IN_BREAK;
-
-#define STARG(datamem, argtype) \
- --sp; \
- * (argtype *)(frame->args + * (guint16 *)(ip + 1)) = sp->data.datamem; \
- ip += 2; \
-
- MINT_IN_CASE(MINT_STARG_I1) STARG(i, gint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_U1) STARG(i, guint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_I2) STARG(i, gint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_U2) STARG(i, guint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_I4) STARG(i, gint32); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_I8) STARG(l, gint64); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_R4) STARG(f, float); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_R8) STARG(f, double); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_O) STARG(p, gpointer); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STARG_P) STARG(p, gpointer); MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_STARG_VT)
- i32 = READ32(ip + 2);
- --sp;
- memcpy(frame->args + * (guint16 *)(ip + 1), sp->data.p, i32);
- vt_sp -= (i32 + 7) & ~7;
- ip += 4;
- MINT_IN_BREAK;
-
-#define STINARG(datamem, argtype) \
- do { \
- int n = * (guint16 *)(ip + 1); \
- * (argtype *)(frame->args + rtm->arg_offsets [n]) = frame->stack_args [n].data.datamem; \
- ip += 2; \
- } while (0)
-
- MINT_IN_CASE(MINT_STINARG_I1) STINARG(i, gint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_U1) STINARG(i, guint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_I2) STINARG(i, gint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_U2) STINARG(i, guint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_I4) STINARG(i, gint32); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_I8) STINARG(l, gint64); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_R4) STINARG(f, float); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_R8) STINARG(f, double); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_O) STINARG(p, gpointer); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STINARG_P) STINARG(p, gpointer); MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_STINARG_VT) {
- int n = * (guint16 *)(ip + 1);
- i32 = READ32(ip + 2);
- memcpy (frame->args + rtm->arg_offsets [n], frame->stack_args [n].data.p, i32);
- ip += 4;
- MINT_IN_BREAK;
- }
-
- MINT_IN_CASE(MINT_LDARGA)
- sp->data.p = frame->args + * (guint16 *)(ip + 1);
- ip += 2;
- ++sp;
- MINT_IN_BREAK;
-
-#define LDLOC(datamem, argtype) \
- sp->data.datamem = * (argtype *)(locals + * (guint16 *)(ip + 1)); \
- ip += 2; \
- ++sp;
-
- MINT_IN_CASE(MINT_LDLOC_I1) LDLOC(i, gint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_U1) LDLOC(i, guint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_I2) LDLOC(i, gint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_U2) LDLOC(i, guint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_I4) LDLOC(i, gint32); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_I8) LDLOC(l, gint64); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_R4) LDLOC(f, float); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_R8) LDLOC(f, double); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_O) LDLOC(p, gpointer); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_LDLOC_P) LDLOC(p, gpointer); MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_LDLOC_VT)
- sp->data.p = vt_sp;
- i32 = READ32(ip + 2);
- memcpy(sp->data.p, locals + * (guint16 *)(ip + 1), i32);
- vt_sp += (i32 + 7) & ~7;
- ip += 4;
- ++sp;
- MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_LDLOCA_S)
- sp->data.p = locals + * (guint16 *)(ip + 1);
- ip += 2;
- ++sp;
- MINT_IN_BREAK;
-
-#define STLOC(datamem, argtype) \
- --sp; \
- * (argtype *)(locals + * (guint16 *)(ip + 1)) = sp->data.datamem; \
- ip += 2;
-
- MINT_IN_CASE(MINT_STLOC_I1) STLOC(i, gint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_U1) STLOC(i, guint8); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_I2) STLOC(i, gint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_U2) STLOC(i, guint16); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_I4) STLOC(i, gint32); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_I8) STLOC(l, gint64); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_R4) STLOC(f, float); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_R8) STLOC(f, double); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_O) STLOC(p, gpointer); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_P) STLOC(p, gpointer); MINT_IN_BREAK;
-
-#define STLOC_NP(datamem, argtype) \
- * (argtype *)(locals + * (guint16 *)(ip + 1)) = sp [-1].data.datamem; \
- ip += 2;
-
- MINT_IN_CASE(MINT_STLOC_NP_I4) STLOC_NP(i, gint32); MINT_IN_BREAK;
- MINT_IN_CASE(MINT_STLOC_NP_O) STLOC_NP(p, gpointer); MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_STLOC_VT)
- i32 = READ32(ip + 2);
- --sp;
- memcpy(locals + * (guint16 *)(ip + 1), sp->data.p, i32);
- vt_sp -= (i32 + 7) & ~7;
- ip += 4;
- MINT_IN_BREAK;
-
- MINT_IN_CASE(MINT_LOCALLOC)
- if (sp != frame->stack + 1) /*FIX?*/
- THROW_EX (mono_get_exception_execution_engine (NULL), ip);
- sp [-1].data.p = alloca (sp [-1].data.i);
- ++ip;
- MINT_IN_BREAK;
-#if 0
- MINT_IN_CASE(MINT_ENDFILTER) ves_abort(); MINT_IN_BREAK;
-#endif
- MINT_IN_CASE(MINT_INITOBJ)
- --sp;
- memset (sp->data.vt, 0, READ32(ip + 1));
- ip += 3;
- MINT_IN_BREAK;
- MINT_IN_CASE(MINT_CPBLK)
- sp -= 3;
- if (!sp [0].data.p || !sp [1].data.p)
- THROW_EX (mono_get_exception_null_reference(), ip - 1);
- ++ip;
- /* FIXME: value and size may be int64... */
- memcpy (sp [0].data.p, sp [1].data.p, sp [2].data.i);
- MINT_IN_BREAK;
-#if 0
- MINT_IN_CASE(MINT_CONSTRAINED_) {
- guint32 token;
- /* FIXME: implement */
- ++ip;
- token = READ32 (ip);
- ip += 2;
- MINT_IN_BREAK;
- }
-#endif
- MINT_IN_CASE(MINT_INITBLK)
- sp -= 3;
- if (!sp [0].data.p)
- THROW_EX (mono_get_exception_null_reference(), ip - 1);
- ++ip;
- /* FIXME: value and size may be int64... */
- memset (sp [0].data.p, sp [1].data.i, sp [2].data.i);
- MINT_IN_BREAK;
-#if 0
- MINT_IN_CASE(MINT_NO_)
- /* FIXME: implement */
- ip += 2;
- MINT_IN_BREAK;
-#endif
- MINT_IN_CASE(MINT_RETHROW)
- /*
- * need to clarify what this should actually do:
- * start the search from the last found handler in
- * this method or continue in the caller or what.
- * Also, do we need to run finally/fault handlers after a retrow?
- * Well, this implementation will follow the usual search
- * for an handler, considering the current ip as throw spot.
- * We need to NULL frame->ex_handler for the later code to
- * actually run the new found handler.
- */
- frame->ex_handler = NULL;
- THROW_EX (frame->ex, ip - 1);
- MINT_IN_BREAK;
- MINT_IN_DEFAULT
- g_print ("Unimplemented opcode: %04x %s at 0x%x\n", *ip, mono_interp_opname[*ip], ip-rtm->code);
- THROW_EX (mono_get_exception_execution_engine ("Unimplemented opcode"), ip);
- }
- }
-
- g_assert_not_reached ();
- /*
- * Exception handling code.
- * The exception object is stored in frame->ex.
- */
-
- handle_exception:
- {
- int i;
- guint32 ip_offset;
- MonoInvocation *inv;
- MonoExceptionClause *clause;
- /*char *message;*/
- MonoObject *ex_obj;
-
-#if DEBUG_INTERP
- if (tracing)
- g_print ("* Handling exception '%s' at IL_%04x\n",
- frame->ex == NULL ? "** Unknown **" : mono_object_class (frame->ex)->name,
- rtm == NULL ? 0 : frame->ip - rtm->code);
-#endif
- if (die_on_exception)
- goto die_on_ex;
-
- for (inv = frame; inv; inv = inv->parent) {
- MonoMethod *method;
- if (inv->runtime_method == NULL)
- continue;
- method = inv->runtime_method->method;
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
- continue;
- if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))
- continue;
- if (inv->ip == NULL)
- continue;
- ip_offset = inv->ip - inv->runtime_method->code;
- inv->ex_handler = NULL; /* clear this in case we are trhowing an exception while handling one - this one wins */
- for (i = 0; i < inv->runtime_method->num_clauses; ++i) {
- clause = &inv->runtime_method->clauses [i];
- if (clause->flags <= 1 && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
- if (!clause->flags) {
- if (mono_object_isinst ((MonoObject*)frame->ex, clause->data.catch_class)) {
- /*
- * OK, we found an handler, now we need to execute the finally
- * and fault blocks before branching to the handler code.
- */
- inv->ex_handler = clause;
-#if DEBUG_INTERP
- if (tracing)
- g_print ("* Found handler at '%s'\n", method->name);
-#endif
- goto handle_finally;
- }
- } else {
- /* FIXME: handle filter clauses */
- g_assert (0);
- }
- }
- }
- }
- /*
- * If we get here, no handler was found: print a stack trace.
- */
- for (inv = frame; inv; inv = inv->parent) {
- if (inv->invoke_trap)
- goto handle_finally;
- }
-die_on_ex:
- ex_obj = (MonoObject*)frame->ex;
- mono_unhandled_exception (ex_obj);
- exit (1);
- }
- handle_finally:
- {
- int i;
- guint32 ip_offset;
- MonoExceptionClause *clause;
- GSList *old_list = finally_ips;
- MonoMethod *method = frame->runtime_method->method;
- MonoMethodHeader *header = mono_method_get_header (method);
-
-#if DEBUG_INTERP
- if (tracing)
- g_print ("* Handle finally IL_%04x\n", endfinally_ip == NULL ? 0 : endfinally_ip - rtm->code);
-#endif
- if (rtm == NULL || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
- || (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))) {
- goto exit_frame;
- }
- ip_offset = frame->ip - rtm->code;
-
- if (endfinally_ip != NULL)
- finally_ips = g_slist_prepend(finally_ips, (void *)endfinally_ip);
- for (i = 0; i < header->num_clauses; ++i)
- if (frame->ex_handler == &rtm->clauses [i])
- break;
- while (i > 0) {
- --i;
- clause = &rtm->clauses [i];
- if (MONO_OFFSET_IN_CLAUSE (clause, ip_offset) && (endfinally_ip == NULL || !(MONO_OFFSET_IN_CLAUSE (clause, endfinally_ip - rtm->code)))) {
- if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY) {
- ip = rtm->code + clause->handler_offset;
- finally_ips = g_slist_prepend (finally_ips, (gpointer) ip);
-#if DEBUG_INTERP
- if (tracing)
- g_print ("* Found finally at IL_%04x with exception: %s\n", clause->handler_offset, frame->ex? "yes": "no");
-#endif
- }
- }
- }
-
- endfinally_ip = NULL;
-
- if (old_list != finally_ips && finally_ips) {
- ip = finally_ips->data;
- finally_ips = g_slist_remove (finally_ips, ip);
- sp = frame->stack; /* spec says stack should be empty at endfinally so it should be at the start too */
- goto main_loop;
- }
-
- /*
- * If an exception is set, we need to execute the fault handler, too,
- * otherwise, we continue normally.
- */
- if (frame->ex)
- goto handle_fault;
- ves_abort();
- }
- handle_fault:
- {
- int i;
- guint32 ip_offset;
- MonoExceptionClause *clause;
- MonoMethodHeader *header = mono_method_get_header (frame->runtime_method->method);
-
-#if DEBUG_INTERP
- if (tracing)
- g_print ("* Handle fault\n");
-#endif
- ip_offset = frame->ip - rtm->code;
- for (i = 0; i < header->num_clauses; ++i) {
- clause = &rtm->clauses [i];
- if (clause->flags == MONO_EXCEPTION_CLAUSE_FAULT && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
- ip = rtm->code + clause->handler_offset;
-#if DEBUG_INTERP
- if (tracing)
- g_print ("* Executing handler at IL_%04x\n", clause->handler_offset);
-#endif
- goto main_loop;
- }
- }
- /*
- * If the handler for the exception was found in this method, we jump
- * to it right away, otherwise we return and let the caller run
- * the finally, fault and catch blocks.
- * This same code should be present in the endfault opcode, but it
- * is corrently not assigned in the ECMA specs: LAMESPEC.
- */
- if (frame->ex_handler) {
-#if DEBUG_INTERP
- if (tracing)
- g_print ("* Executing handler at IL_%04x\n", frame->ex_handler->handler_offset);
-#endif
- ip = rtm->code + frame->ex_handler->handler_offset;
- sp = frame->stack;
- vt_sp = (char *)sp + rtm->stack_size;
- sp->data.p = frame->ex;
- ++sp;
- goto main_loop;
- }
- goto exit_frame;
- }
-exit_frame:
- DEBUG_LEAVE ();
-}
-
-void
-ves_exec_method (MonoInvocation *frame)
-{
- ThreadContext *context = TlsGetValue (thread_context_id);
- ThreadContext context_struct;
- jmp_buf env;
-
- frame->ex = NULL;
-
- if (setjmp(env)) {
- mono_unhandled_exception ((MonoObject*)frame->ex);
- return;
- }
- if (context == NULL) {
- context = &context_struct;
- context_struct.domain = mono_domain_get ();
- context_struct.base_frame = frame;
- context_struct.current_frame = NULL;
- context_struct.env_frame = frame;
- context_struct.current_env = &env;
- context_struct.search_for_handler = 0;
- context_struct.managed_code = 0;
- TlsSetValue (thread_context_id, context);
- }
- frame->ip = NULL;
- frame->parent = context->current_frame;
- frame->runtime_method = mono_interp_get_runtime_method (frame->method);
- context->managed_code = 1;
- ves_exec_method_with_context(frame, context);
- context->managed_code = 0;
- if (frame->ex) {
- if (context != &context_struct && context->current_env) {
- context->env_frame->ex = frame->ex;
- longjmp (*context->current_env, 1);
- }
- else
- mono_unhandled_exception ((MonoObject*)frame->ex);
- }
- if (context->base_frame == frame)
- TlsSetValue (thread_context_id, NULL);
- else
- context->current_frame = frame->parent;
-}
-
-static int
-ves_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
-{
- MonoImage *image = mono_assembly_get_image (assembly);
- MonoMethod *method;
- MonoObject *exc = NULL;
- int rval;
-
- method = mono_get_method (image, mono_image_get_entry_point (image), NULL);
- if (!method)
- g_error ("No entry point method found in %s", mono_image_get_filename (image));
-
- rval = mono_runtime_run_main (method, argc, argv, &exc);
- if (exc != NULL)
- mono_unhandled_exception (exc);
-
- return rval;
-}
-
-static void
-usage (void)
-{
- fprintf (stderr,
- "mint %s, the Mono ECMA CLI interpreter, (C) 2001, 2002 Ximian, Inc.\n\n"
- "Usage is: mint [options] executable args...\n\n", VERSION);
- fprintf (stderr,
- "Runtime Debugging:\n"
-#ifdef DEBUG_INTERP
- " --debug\n"
-#endif
- " --dieonex\n"
- " --noptr\t\t\tdon't print pointer addresses in trace output\n"
- " --opcode-count\n"
- " --print-vtable\n"
- " --traceclassinit\n"
- "\n"
- "Development:\n"
- " --debug method_name\n"
- " --profile\n"
- " --trace\n"
- " --traceops\n"
- "\n"
- "Runtime:\n"
- " --config filename load the specified config file instead of the default\n"
- " --workers n maximum number of worker threads\n"
- );
- exit (1);
-}
-
-#ifdef RUN_TEST
-static void
-test_load_class (MonoImage* image)
-{
- MonoTableInfo *t = &image->tables [MONO_TABLE_TYPEDEF];
- MonoClass *klass;
- int i;
-
- for (i = 1; i <= t->rows; ++i) {
- klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | i);
- mono_class_init (klass);
- }
-}
-#endif
-
-static void
-add_signal_handler (int signo, void (*handler)(int))
-{
-#ifdef HOST_WIN32
- signal (signo, handler);
-#else
- struct sigaction sa;
-
- sa.sa_handler = handler;
- sigemptyset (&sa.sa_mask);
- sa.sa_flags = 0;
-
- g_assert (sigaction (signo, &sa, NULL) != -1);
-#endif
-}
-
-static void
-segv_handler (int signum)
-{
- ThreadContext *context = TlsGetValue (thread_context_id);
- MonoException *segv_exception;
-
- if (context == NULL)
- return;
- segv_exception = mono_get_exception_null_reference ();
- segv_exception->message = mono_string_new (mono_domain_get (), "Null Reference (SIGSEGV)");
- mono_raise_exception (segv_exception);
-}
-
-
-static void
-quit_handler (int signum)
-{
- ThreadContext *context = TlsGetValue (thread_context_id);
- MonoException *quit_exception;
-
- if (context == NULL)
- return;
- quit_exception = mono_get_exception_execution_engine ("Interrupted (SIGQUIT).");
- mono_raise_exception (quit_exception);
-}
-
-static void
-abrt_handler (int signum)
-{
- ThreadContext *context = TlsGetValue (thread_context_id);
- MonoException *abrt_exception;
-
- if (context == NULL)
- return;
- abrt_exception = mono_get_exception_execution_engine ("Abort (SIGABRT).");
- mono_raise_exception (abrt_exception);
-}
-
-static void
-thread_abort_handler (int signum)
-{
- ThreadContext *context = TlsGetValue (thread_context_id);
- MonoException *exc;
-
- if (context == NULL)
- return;
-
- exc = mono_thread_request_interruption (context->managed_code);
- if (exc) mono_raise_exception (exc);
-}
-
-static MonoBoolean
-ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
- MonoReflectionMethod **method,
- gint32 *iloffset, gint32 *native_offset,
- MonoString **file, gint32 *line, gint32 *column)
-{
- ThreadContext *context = TlsGetValue (thread_context_id);
- MonoInvocation *inv = context->current_frame;
- int i;
-
- for (i = 0; inv && i < skip; inv = inv->parent)
- if (inv->runtime_method != NULL)
- ++i;
-
- if (iloffset)
- *iloffset = 0;
- if (native_offset)
- *native_offset = 0;
- if (method)
- *method = inv == NULL ? NULL : mono_method_get_object (context->domain, inv->runtime_method->method, NULL);
- if (line)
- *line = 0;
- if (need_file_info) {
- if (column)
- *column = 0;
- if (file)
- *file = mono_string_new (mono_domain_get (), "unknown");
- }
-
- return TRUE;
-}
-
-static MonoArray *
-ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info)
-{
- MonoDomain *domain = mono_domain_get ();
- MonoArray *res;
- MonoArray *ta = exc->trace_ips;
- int i, len;
-
- if (ta == NULL) {
- /* Exception is not thrown yet */
- return mono_array_new (domain, mono_defaults.stack_frame_class, 0);
- }
-
- len = mono_array_length (ta);
-
- res = mono_array_new (domain, mono_defaults.stack_frame_class, len > skip ? len - skip : 0);
-
- for (i = skip; i < len / 2; i++) {
- MonoStackFrame *sf = (MonoStackFrame *)mono_object_new (domain, mono_defaults.stack_frame_class);
- gushort *ip = mono_array_get (ta, gpointer, 2 * i + 1);
- RuntimeMethod *rtm = mono_array_get (ta, gpointer, 2 * i);
-
- if (rtm != NULL) {
- sf->method = mono_method_get_object (domain, rtm->method, NULL);
- sf->native_offset = ip - rtm->code;
- }
-
-#if 0
- sf->il_offset = mono_debug_il_offset_from_address (ji->method, sf->native_offset, domain);
-
- if (need_file_info) {
- gchar *filename;
-
- filename = mono_debug_source_location_from_address (ji->method, sf->native_offset, &sf->line, domain);
-
- sf->filename = filename? mono_string_new (domain, filename): NULL;
- sf->column = 0;
-
- g_free (filename);
- }
-#endif
-
- mono_array_set (res, gpointer, i, sf);
- }
-
- return res;
-}
-
-static MonoObject *
-ves_icall_System_Delegate_CreateDelegate_internal (MonoReflectionType *type, MonoObject *target,
- MonoReflectionMethod *info)
-{
- MonoClass *delegate_class = mono_class_from_mono_type (type->type);
- MonoObject *delegate;
-
- mono_assert (delegate_class->parent == mono_defaults.multicastdelegate_class);
-
- delegate = mono_object_new (mono_object_domain (type), delegate_class);
-
- interp_delegate_ctor (mono_object_domain (type), delegate, target, mono_interp_get_runtime_method (info->method));
-
- return delegate;
-}
-
-
-typedef struct
-{
- MonoDomain *domain;
- int enable_debugging;
- char *file;
- int argc;
- char **argv;
-} MainThreadArgs;
-
-static void main_thread_handler (gpointer user_data)
-{
- MainThreadArgs *main_args=(MainThreadArgs *)user_data;
- MonoAssembly *assembly;
-
- if (main_args->enable_debugging) {
- mono_debug_init (MONO_DEBUG_FORMAT_MONO);
- mono_debug_init_1 (main_args->domain);
- }
-
- assembly = mono_domain_assembly_open (main_args->domain,
- main_args->file);
-
- if (!assembly){
- fprintf (stderr, "Can not open image %s\n", main_args->file);
- exit (1);
- }
-
- if (main_args->enable_debugging)
- mono_debug_init_2 (assembly);
-
-#ifdef RUN_TEST
- test_load_class (assembly->image);
-#else
-
- ves_exec (main_args->domain, assembly, main_args->argc, main_args->argv);
-#endif
-}
-
-static void
-mono_runtime_install_handlers (void)
-{
- add_signal_handler (SIGSEGV, segv_handler);
- add_signal_handler (SIGINT, quit_handler);
- add_signal_handler (SIGABRT, abrt_handler);
- add_signal_handler (mono_thread_get_abort_signal (), thread_abort_handler);
-}
-
-static void
-quit_function (MonoDomain *domain, gpointer user_data)
-{
- mono_profiler_shutdown ();
-
- mono_runtime_cleanup (domain);
- mono_domain_free (domain, TRUE);
-
-}
-
-void
-mono_interp_cleanup(MonoDomain *domain)
-{
- quit_function (domain, NULL);
-}
-
-int
-mono_interp_exec(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
-{
- return ves_exec (domain, assembly, argc, argv);
-}
-
-MonoDomain *
-mono_interp_init(const char *file)
-{
- MonoDomain *domain;
-
- g_set_prgname (file);
- mono_set_rootdir ();
-
- g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
- g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
-
- if (!g_thread_supported ())
- g_thread_init (NULL);
-
- thread_context_id = TlsAlloc ();
- TlsSetValue (thread_context_id, NULL);
- InitializeCriticalSection (&runtime_method_lookup_section);
- InitializeCriticalSection (&create_method_pointer_mutex);
-
- mono_runtime_install_handlers ();
- mono_interp_transform_init ();
- mono_install_compile_method (mono_create_method_pointer);
- mono_install_runtime_invoke (interp_mono_runtime_invoke);
- mono_install_remoting_trampoline (interp_create_remoting_trampoline);
- mono_install_trampoline (interp_create_trampoline);
-
- mono_install_handler (interp_ex_handler);
- mono_install_stack_walk (interp_walk_stack);
- mono_install_runtime_cleanup (quit_function);
- abort_requested = mono_thread_interruption_request_flag ();
-
- domain = mono_init_from_assembly (file, file);
-#ifdef __hpux /* generates very big stack frames */
- mono_threads_set_default_stacksize(32*1024*1024);
-#endif
- mono_icall_init ();
- mono_add_internal_call ("System.Diagnostics.StackFrame::get_frame_info", ves_icall_get_frame_info);
- mono_add_internal_call ("System.Diagnostics.StackTrace::get_trace", ves_icall_get_trace);
- mono_add_internal_call ("Mono.Runtime::mono_runtime_install_handlers", mono_runtime_install_handlers);
- mono_add_internal_call ("System.Delegate::CreateDelegate_internal", ves_icall_System_Delegate_CreateDelegate_internal);
-
- mono_register_jit_icall (mono_thread_interruption_checkpoint, "mono_thread_interruption_checkpoint", mono_create_icall_signature ("void"), FALSE);
-
- mono_runtime_init (domain, NULL, NULL);
-
-
- mono_thread_attach (domain);
- return domain;
-}
-
-int
-mono_main (int argc, char *argv [])
-{
- MonoDomain *domain;
- int retval = 0, i;
- char *file, *config_file = NULL;
- int enable_debugging = FALSE;
- MainThreadArgs main_args;
- const char *error;
-
- setlocale (LC_ALL, "");
- if (argc < 2)
- usage ();
-
- MONO_GC_PRE_INIT ();
-
- for (i = 1; i < argc && argv [i][0] == '-'; i++){
- if (strcmp (argv [i], "--trace") == 0)
- global_tracing = 1;
- if (strcmp (argv [i], "--noptr") == 0)
- global_no_pointers = 1;
- if (strcmp (argv [i], "--traceops") == 0)
- global_tracing = 2;
- if (strcmp (argv [i], "--traceopt") == 0)
- ++mono_interp_traceopt;
- if (strcmp (argv [i], "--dieonex") == 0) {
- die_on_exception = 1;
- enable_debugging = 1;
- }
- if (strcmp (argv [i], "--print-vtable") == 0)
- mono_print_vtable = TRUE;
- if (strcmp (argv [i], "--profile") == 0)
- mono_profiler_load (NULL);
- if (strcmp (argv [i], "--config") == 0)
- config_file = argv [++i];
- if (strcmp (argv [i], "--help") == 0)
- usage ();
-#if DEBUG_INTERP
- if (strcmp (argv [i], "--debug") == 0) {
- MonoMethodDesc *desc = mono_method_desc_new (argv [++i], FALSE);
- if (!desc)
- g_error ("Invalid method name '%s'", argv [i]);
- db_methods = g_list_append (db_methods, desc);
- }
- if (strcmp (argv [i], "--nested") == 0)
- nested_trace = 1;
-#endif
- }
-
- file = argv [i];
-
- if (!file)
- usage ();
-
- domain = mono_interp_init(file);
- mono_config_parse (config_file);
-
- error = mono_check_corlib_version ();
- if (error) {
- fprintf (stderr, "Corlib not in sync with this runtime: %s\n", error);
- fprintf (stderr, "Download a newer corlib at http://www.go-mono.com/daily.\n");
- exit (1);
- }
-
- main_args.domain=domain;
- main_args.file=file;
- main_args.argc=argc-i;
- main_args.argv=argv+i;
- main_args.enable_debugging=enable_debugging;
-
- mono_runtime_exec_managed_code (domain, main_thread_handler,
- &main_args);
-
- quit_function (domain, NULL);
-
- /* Get the return value from System.Environment.ExitCode */
- retval=mono_environment_exitcode_get ();
-
-#if COUNT_OPS
- for (i = 0; i < 512; i++)
- if (opcode_counts[i] != 0)
- printf("%s %d\n", mono_interp_opname[i], opcode_counts[i]);
-#endif
- return retval;
-}
+++ /dev/null
-#include <setjmp.h>
-#include <glib.h>
-#include <mono/metadata/loader.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/domain-internals.h>
-#include <mono/metadata/class-internals.h>
-#include "config.h"
-
-enum {
- VAL_I32 = 0,
- VAL_DOUBLE = 1,
- VAL_I64 = 2,
- VAL_VALUET = 3,
- VAL_POINTER = 4,
- VAL_NATI = 0 + VAL_POINTER,
- VAL_MP = 1 + VAL_POINTER,
- VAL_TP = 2 + VAL_POINTER,
- VAL_OBJ = 3 + VAL_POINTER
-};
-
-#if SIZEOF_VOID_P == 4
-typedef guint32 mono_u;
-typedef gint32 mono_i;
-#elif SIZEOF_VOID_P == 8
-typedef guint64 mono_u;
-typedef gint64 mono_i;
-#endif
-
-/*
- * Value types are represented on the eval stack as pointers to the
- * actual storage. The size field tells how much storage is allocated.
- * A value type can't be larger than 16 MB.
- */
-typedef struct {
- union {
- gint32 i;
- gint64 l;
- double f;
- /* native size integer and pointer types */
- gpointer p;
- mono_u nati;
- gpointer vt;
- } data;
-#if defined(__ppc__) || defined(__powerpc__)
- int pad;
-#endif
-} stackval;
-
-typedef struct _MonoInvocation MonoInvocation;
-
-typedef void (*MonoFunc) (void);
-typedef void (*MonoPIFunc) (MonoFunc callme, void *retval, void *obj_this, stackval *arguments);
-
-/*
- * Structure representing a method transformed for the interpreter
- * This is domain specific
- */
-typedef struct _RuntimeMethod
-{
- /* NOTE: These first two elements (method and
- next_jit_code_hash) must be in the same order and at the
- same offset as in MonoJitInfo, because of the jit_code_hash
- internal hash table in MonoDomain. */
- MonoMethod *method;
- struct _RuntimeMethod *next_jit_code_hash;
- guint32 locals_size;
- guint32 args_size;
- guint32 stack_size;
- guint32 vt_stack_size;
- guint32 alloca_size;
- unsigned short *code;
- unsigned short *new_body_start; /* after all STINARG instrs */
- MonoPIFunc func;
- int num_clauses;
- MonoExceptionClause *clauses;
- void **data_items;
- int transformed;
- guint32 *arg_offsets;
- guint32 *local_offsets;
- unsigned int param_count;
- unsigned int hasthis;
- unsigned int valuetype;
-} RuntimeMethod;
-
-struct _MonoInvocation {
- MonoInvocation *parent; /* parent */
- RuntimeMethod *runtime_method; /* parent */
- MonoMethod *method; /* parent */
- stackval *retval; /* parent */
- void *obj; /* this - parent */
- char *args;
- stackval *stack_args; /* parent */
- stackval *stack;
- stackval *sp; /* For GC stack marking */
- /* exception info */
- unsigned char invoke_trap;
- const unsigned short *ip;
- MonoException *ex;
- MonoExceptionClause *ex_handler;
-};
-
-typedef struct {
- MonoDomain *domain;
- MonoInvocation *base_frame;
- MonoInvocation *current_frame;
- MonoInvocation *env_frame;
- jmp_buf *current_env;
- unsigned char search_for_handler;
- unsigned char managed_code;
-} ThreadContext;
-
-void mono_init_icall (void);
-
-MonoException *
-mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context);
-
-MonoDelegate*
-mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);
-
-void
-mono_interp_transform_init (void);
-
-void inline stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke);
-void inline stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke);
-void ves_exec_method (MonoInvocation *frame);
-
-/*
- * defined in an arch specific file.
- */
-MonoPIFunc
-mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor);
-
-RuntimeMethod *
-mono_interp_get_runtime_method (MonoMethod *method);
-
-void *mono_arch_create_method_pointer (MonoMethod *method);
-
-extern int mono_interp_traceopt;
+++ /dev/null
-#include "interp.h"
-#include "embed.h"
-
-int
-main (int argc, char* argv[])
-{
- return mono_main (argc, argv);
-}
-
+++ /dev/null
-.\"
-.\" mint manual page.
-.\" (C) Ximian, Inc.
-.\" Author:
-.\" Miguel de Icaza (miguel@gnu.org)
-.\"
-.TH Mono "Mono 1.0"
-.SH NAME
-mint \- Mono ECMA-CLI interpreter.
-.SH SYNOPSIS
-.PP
-.B mint
-[\-\-help] [\-\-opcode\-count] [\-\-trace] [\-\-traceops] [\-\-profile]
-[\-\-config filename] [\-\-debug method]
-program.exe [arguments...]
-.SH DESCRIPTION
-The \fImint\fP program is an interpreter for ECMA CLI byte codes. It
-executes the bytecodes contains in
-.I program.exe
-and optionally passes
-the
-.I arguments
-to it.
-.SH OPTIONS
-The following Generic options are supported:
-.TP
-.I "--help", "-h"
-Displays usage instructions.
-.TP
-.I "--config filename"
-Load the specified configuration file instead of the default one(s).
-The default files are /etc/mono/config and ~/.mono/config or the file
-specified in the MONO_CONFIG environment variable, if set.
-.TP
-.I "--trace"
-Traces execution showing when methods are entered and left.
-.I "--traceops"
-Traces execution at the instruction level and displays the stack contents.
-.I "--traceclassinit"
-Shows when classes are initialized
-.TP
-.I "--noptr"
-Suppresses printing of pointer addresses in trace output.
-.TP
-.I "--profile"
-Performs runtime profiling of the code and displays statistics at the
-end of execution.
-.TP
-.I "--opcode-count"
-Displays the number of opcodes executed.
-.TP
-.I "--dieonex"
-Aborts execution upon hitting an exception.
-.TP
-.I "--debug method"
-Debugs the method whose name is `method'. You can specify the method
-like this: `class:method' or `class::method'
-.TP
-.I "--opcode-count"
-Displays the number of opcodes executed
-.PP
-.SH ENVIRONMENT VARIABLES
-.TP
-.I "MONO_PATH"
-Provides a search path to mono and mint where to look for library files.
-Directories are separated by the platform path separator (colons on unix). Example:
-.B /home/username/lib:/usr/local/mono/lib
-.PP
-.SH FILES
-Assemblies are lodaed from the installation lib directory. If you set
-`prefix' to /usr, the assemblies will be located in /usr/lib.
-.PP
-/etc/mono/config, ~/.mono/config
-.IP
-Mono runtime configuration file. See the mono-config(5) manual page
-for more information.
-.SH MAILING LISTS
-Visit http://mail.ximian.com/mailman/mono-list for details.
-.SH WEB SITE
-Visit: http://www.go-mono.com for details
-.SH SEE ALSO
-.BR mono(1), monodis(1)
+++ /dev/null
-/*
- * Utilities for handling interpreter VM instructions
- *
- * Authors:
- * Bernie Solomon (bernard@ugsolutions.com)
- *
- */
-#include <glib.h>
-#include <stdio.h>
-#include "mintops.h"
-
-#define OPDEF(a,b,c,d) \
- b,
-const char *mono_interp_opname[] = {
-#include "mintops.def"
- ""
-};
-#undef OPDEF
-
-#define OPDEF(a,b,c,d) \
- c,
-unsigned char mono_interp_oplen[] = {
-#include "mintops.def"
- 0
-};
-#undef OPDEF
-
-
-#define OPDEF(a,b,c,d) \
- d,
-MintOpArgType mono_interp_opargtype[] = {
-#include "mintops.def"
- 0
-};
-#undef OPDEF
-
-const guint16 *
-mono_interp_dis_mintop(const guint16 *base, const guint16 *ip)
-{
- int len = mono_interp_oplen [*ip];
- guint32 token;
- int target;
- if (len < 0 || len > 10) {
- g_print ("op %d len %d\n", *ip, len);
- g_assert_not_reached ();
- } else if (len == 0) { /* SWITCH */
- int n = READ32 (ip + 1);
- len = 3 + n * 2;
- }
-
- g_print ("IL_%04x: %-10s", ip - base, mono_interp_opname [*ip]);
- switch (mono_interp_opargtype [*ip]) {
- case MintOpNoArgs:
- break;
- case MintOpUShortInt:
- g_print (" %u", * (guint16 *)(ip + 1));
- break;
- case MintOpTwoShorts:
- g_print (" %u,%u", * (guint16 *)(ip + 1), * (guint16 *)(ip + 2));
- break;
- case MintOpShortAndInt:
- g_print (" %u,%u", * (guint16 *)(ip + 1), (guint32)READ32(ip + 2));
- break;
- case MintOpShortInt:
- g_print (" %d", * (short *)(ip + 1));
- break;
- case MintOpClassToken:
- case MintOpMethodToken:
- case MintOpFieldToken:
- token = * (guint16 *)(ip + 1);
- g_print (" %u", token);
- break;
- case MintOpInt:
- g_print (" %d", (gint32)READ32 (ip + 1));
- break;
- case MintOpLongInt:
- g_print (" %lld", (gint64)READ64 (ip + 1));
- break;
- case MintOpFloat: {
- gint32 tmp = READ32 (ip + 1);
- g_print (" %g", * (float *)&tmp);
- break;
- }
- case MintOpDouble: {
- gint64 tmp = READ64 (ip + 1);
- g_print (" %g", * (double *)&tmp);
- break;
- }
- case MintOpShortBranch:
- target = ip + * (short *)(ip + 1) - base;
- g_print (" IL_%04x", target);
- break;
- case MintOpBranch:
- target = ip + (gint32)READ32 (ip + 1) - base;
- g_print (" IL_%04x", target);
- break;
- case MintOpSwitch: {
- const guint16 *p = ip + 1;
- int sval = (gint32)READ32 (p);
- int i;
- p += 2;
- g_print ("(");
- for (i = 0; i < sval; ++i) {
- int offset;
- if (i > 0)
- g_print (", ");
- offset = (gint32)READ32 (p);
- g_print ("IL_%04x", ip - base + 3 + 2 * sval + offset);
- p += 2;
- }
- g_print (")");
- break;
- }
- default:
- g_print("unknown arg type\n");
- }
-
- return ip + len;
-}
-
+++ /dev/null
-/*
- * Definitions of VM instructions executed by interp.c
- *
- * Authors:
- * Bernie Solomon (bernard@ugsolutions.com)
- *
- */
-
-/* OPDEF (opsymbol, opstring, oplength, optype) */
-
-OPDEF(MINT_NOP, "nop", 1, MintOpNoArgs)
-OPDEF(MINT_BREAK, "break", 1, MintOpNoArgs)
-OPDEF(MINT_LDNULL, "ldnull", 1, MintOpNoArgs)
-OPDEF(MINT_DUP, "dup", 1, MintOpNoArgs)
-OPDEF(MINT_DUP_VT, "dup.vt", 3, MintOpInt)
-OPDEF(MINT_POP, "pop", 1, MintOpNoArgs)
-
-OPDEF(MINT_RET, "ret", 1, MintOpNoArgs)
-OPDEF(MINT_RET_VOID, "ret.void", 1, MintOpNoArgs)
-OPDEF(MINT_RET_VT, "ret.vt", 3, MintOpInt)
-
-OPDEF(MINT_VTRESULT, "vtresult", 4, MintOpShortAndInt) /*FIX should be unsigned*/
-
-OPDEF(MINT_LDC_I4_M1, "ldc.i4.m1", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_0, "ldc.i4.0", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_1, "ldc.i4.1", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_2, "ldc.i4.2", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_3, "ldc.i4.3", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_4, "ldc.i4.4", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_5, "ldc.i4.5", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_6, "ldc.i4.6", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_7, "ldc.i4.7", 1, MintOpNoArgs)
-OPDEF(MINT_LDC_I4_8, "ldc.i4.8", 1, MintOpNoArgs)
-
-OPDEF(MINT_LDC_I4_S, "ldc.i4.s", 2, MintOpShortInt)
-OPDEF(MINT_LDC_I4, "ldc.i4", 3, MintOpInt)
-OPDEF(MINT_LDC_I8, "ldc.i8", 5, MintOpLongInt)
-
-OPDEF(MINT_LDC_R4, "ldc.r4", 3, MintOpFloat)
-OPDEF(MINT_LDC_R8, "ldc.r8", 5, MintOpDouble)
-
-OPDEF(MINT_LDARG_I1, "ldarg.i1", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_U1, "ldarg.u1", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_I2, "ldarg.i2", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_U2, "ldarg.u2", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_I4, "ldarg.i4", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_I8, "ldarg.i8", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_R4, "ldarg.r4", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_R8, "ldarg.r8", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_O, "ldarg.o", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_P, "ldarg.p", 2, MintOpUShortInt)
-OPDEF(MINT_LDARG_VT, "ldarg.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_LDTHIS, "ldthis", 1, MintOpNoArgs)
-
-OPDEF(MINT_STARG_I1, "starg.i1", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_U1, "starg.u1", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_I2, "starg.i2", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_U2, "starg.u2", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_I4, "starg.i4", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_I8, "starg.i8", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_R4, "starg.r4", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_R8, "starg.r8", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_O, "starg.o", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_P, "starg.p", 2, MintOpUShortInt)
-OPDEF(MINT_STARG_VT, "starg.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_STTHIS, "stthis", 1, MintOpNoArgs)
-
-OPDEF(MINT_STINARG_I1, "stinarg.i1", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_U1, "stinarg.u1", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_I2, "stinarg.i2", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_U2, "stinarg.u2", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_I4, "stinarg.i4", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_I8, "stinarg.i8", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_R4, "stinarg.r4", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_R8, "stinarg.r8", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_O, "stinarg.o", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_P, "stinarg.p", 2, MintOpUShortInt)
-OPDEF(MINT_STINARG_VT, "stinarg.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_LDARGA, "ldarga", 2, MintOpUShortInt)
-OPDEF(MINT_LDTHISA, "ldthisa", 1, MintOpNoArgs)
-
-OPDEF(MINT_LDFLD_I1, "ldfld.i1", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_U1, "ldfld.u1", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_I2, "ldfld.i2", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_U2, "ldfld.u2", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_I4, "ldfld.i4", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_I8, "ldfld.i8", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_R4, "ldfld.r4", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_R8, "ldfld.r8", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_O, "ldfld.o", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_P, "ldfld.p", 2, MintOpUShortInt)
-OPDEF(MINT_LDFLD_VT, "ldfld.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_LDRMFLD, "ldrmfld", 2, MintOpFieldToken)
-OPDEF(MINT_LDRMFLD_VT, "ldrmfld.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_LDFLDA, "ldflda", 2, MintOpUShortInt)
-
-OPDEF(MINT_STFLD_I1, "stfld.i1", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_U1, "stfld.u1", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_I2, "stfld.i2", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_U2, "stfld.u2", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_I4, "stfld.i4", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_I8, "stfld.i8", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_R4, "stfld.r4", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_R8, "stfld.r8", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_O, "stfld.o", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_P, "stfld.p", 2, MintOpUShortInt)
-OPDEF(MINT_STFLD_VT, "stfld.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_STRMFLD, "strmfld", 2, MintOpFieldToken)
-OPDEF(MINT_STRMFLD_VT, "strmfld.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_LDSFLD, "ldsfld", 3, MintOpTwoShorts)
-OPDEF(MINT_LDSFLD_I4, "ldsfld.i4", 3, MintOpTwoShorts)
-OPDEF(MINT_LDSFLD_O, "ldsfld.o", 3, MintOpTwoShorts)
-OPDEF(MINT_LDSFLD_VT, "ldsfld.vt", 4, MintOpShortAndInt)
-OPDEF(MINT_STSFLD, "stsfld", 2, MintOpUShortInt)
-OPDEF(MINT_STSFLD_VT, "stsfld.vt", 4, MintOpShortAndInt)
-OPDEF(MINT_LDSFLDA, "ldsflda", 2, MintOpUShortInt)
-
-OPDEF(MINT_LDLOC_I1, "ldloc.i1", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_U1, "ldloc.u1", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_I2, "ldloc.i2", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_U2, "ldloc.u2", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_I4, "ldloc.i4", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_I8, "ldloc.i8", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_R4, "ldloc.r4", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_R8, "ldloc.r8", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_O, "ldloc.o", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_P, "ldloc.p", 2, MintOpUShortInt)
-OPDEF(MINT_LDLOC_VT, "ldloc.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_STLOC_I1, "stloc.i1", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_U1, "stloc.u1", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_I2, "stloc.i2", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_U2, "stloc.u2", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_I4, "stloc.i4", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_I8, "stloc.i8", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_R4, "stloc.r4", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_R8, "stloc.r8", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_O, "stloc.o", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_P, "stloc.p", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_VT, "stloc.vt", 4, MintOpShortAndInt)
-
-OPDEF(MINT_STLOC_NP_I4, "stloc.np.i4", 2, MintOpUShortInt)
-OPDEF(MINT_STLOC_NP_O, "stloc.np.o", 2, MintOpUShortInt)
-
-OPDEF(MINT_LDLOCA_S, "ldloca.s", 2, MintOpUShortInt)
-
-OPDEF(MINT_LDIND_I1, "ldind.i1", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_U1, "ldind.u1", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_I2, "ldind.i2", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_U2, "ldind.u2", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_I4, "ldind.i4", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_U4, "ldind.u4", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_I8, "ldind.i8", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_I, "ldind.i", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_R4, "ldind.r4", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_R8, "ldind.r8", 1, MintOpNoArgs)
-OPDEF(MINT_LDIND_REF, "ldind.ref", 1, MintOpNoArgs)
-OPDEF(MINT_STIND_I1, "stind.i1", 1, MintOpNoArgs)
-OPDEF(MINT_STIND_I2, "stind.i2", 1, MintOpNoArgs)
-OPDEF(MINT_STIND_I4, "stind.i4", 1, MintOpNoArgs)
-OPDEF(MINT_STIND_I8, "stind.i8", 1, MintOpNoArgs)
-OPDEF(MINT_STIND_I, "stind.i", 1, MintOpNoArgs)
-OPDEF(MINT_STIND_R4, "stind.r4", 1, MintOpNoArgs)
-OPDEF(MINT_STIND_R8, "stind.r8", 1, MintOpNoArgs)
-OPDEF(MINT_STIND_REF, "stind.ref", 1, MintOpNoArgs)
-
-OPDEF(MINT_BR, "br", 3, MintOpBranch)
-OPDEF(MINT_LEAVE, "leave", 3, MintOpBranch)
-OPDEF(MINT_BR_S, "br.s", 2, MintOpShortBranch)
-OPDEF(MINT_LEAVE_S, "leave.s", 2, MintOpShortBranch)
-
-OPDEF(MINT_THROW, "throw", 1, MintOpNoArgs)
-OPDEF(MINT_RETHROW, "rethrow", 1, MintOpNoArgs)
-OPDEF(MINT_ENDFINALLY, "endfinally", 1, MintOpNoArgs)
-
-OPDEF(MINT_BRFALSE_I4, "brfalse.i4", 3, MintOpBranch)
-OPDEF(MINT_BRFALSE_I8, "brfalse.i8", 3, MintOpBranch)
-OPDEF(MINT_BRFALSE_R8, "brfalse.r8", 3, MintOpBranch)
-OPDEF(MINT_BRTRUE_I4, "brtrue.i4", 3, MintOpBranch)
-OPDEF(MINT_BRTRUE_I8, "brtrue.i8", 3, MintOpBranch)
-OPDEF(MINT_BRTRUE_R8, "brtrue.r8", 3, MintOpBranch)
-
-OPDEF(MINT_BRFALSE_I4_S, "brfalse.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BRFALSE_I8_S, "brfalse.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BRFALSE_R8_S, "brfalse.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BRTRUE_I4_S, "brtrue.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BRTRUE_I8_S, "brtrue.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BRTRUE_R8_S, "brtrue.r8.s", 2, MintOpShortBranch)
-
-OPDEF(MINT_BEQ_I4, "beq.i4", 3, MintOpBranch)
-OPDEF(MINT_BEQ_I8, "beq.i8", 3, MintOpBranch)
-OPDEF(MINT_BEQ_R8, "beq.r8", 3, MintOpBranch)
-OPDEF(MINT_BGE_I4, "bge.i4", 3, MintOpBranch)
-OPDEF(MINT_BGE_I8, "bge.i8", 3, MintOpBranch)
-OPDEF(MINT_BGE_R8, "bge.r8", 3, MintOpBranch)
-OPDEF(MINT_BGT_I4, "bgt.i4", 3, MintOpBranch)
-OPDEF(MINT_BGT_I8, "bgt.i8", 3, MintOpBranch)
-OPDEF(MINT_BGT_R8, "bgt.r8", 3, MintOpBranch)
-OPDEF(MINT_BLT_I4, "blt.i4", 3, MintOpBranch)
-OPDEF(MINT_BLT_I8, "blt.i8", 3, MintOpBranch)
-OPDEF(MINT_BLT_R8, "blt.r8", 3, MintOpBranch)
-OPDEF(MINT_BLE_I4, "ble.i4", 3, MintOpBranch)
-OPDEF(MINT_BLE_I8, "ble.i8", 3, MintOpBranch)
-OPDEF(MINT_BLE_R8, "ble.r8", 3, MintOpBranch)
-
-OPDEF(MINT_BNE_UN_I4, "bne.un.i4", 3, MintOpBranch)
-OPDEF(MINT_BNE_UN_I8, "bne.un.i8", 3, MintOpBranch)
-OPDEF(MINT_BNE_UN_R8, "bne.un.r8", 3, MintOpBranch)
-OPDEF(MINT_BGE_UN_I4, "bge.un.i4", 3, MintOpBranch)
-OPDEF(MINT_BGE_UN_I8, "bge.un.i8", 3, MintOpBranch)
-OPDEF(MINT_BGE_UN_R8, "bge.un.r8", 3, MintOpBranch)
-OPDEF(MINT_BGT_UN_I4, "bgt.un.i4", 3, MintOpBranch)
-OPDEF(MINT_BGT_UN_I8, "bgt.un.i8", 3, MintOpBranch)
-OPDEF(MINT_BGT_UN_R8, "bgt.un.r8", 3, MintOpBranch)
-OPDEF(MINT_BLE_UN_I4, "ble.un.i4", 3, MintOpBranch)
-OPDEF(MINT_BLE_UN_I8, "ble.un.i8", 3, MintOpBranch)
-OPDEF(MINT_BLE_UN_R8, "ble.un.r8", 3, MintOpBranch)
-OPDEF(MINT_BLT_UN_I4, "blt.un.i4", 3, MintOpBranch)
-OPDEF(MINT_BLT_UN_I8, "blt.un.i8", 3, MintOpBranch)
-OPDEF(MINT_BLT_UN_R8, "blt.un.r8", 3, MintOpBranch)
-
-OPDEF(MINT_BEQ_I4_S, "beq.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BEQ_I8_S, "beq.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BEQ_R8_S, "beq.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGE_I4_S, "bge.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGE_I8_S, "bge.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGE_R8_S, "bge.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGT_I4_S, "bgt.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGT_I8_S, "bgt.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGT_R8_S, "bgt.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLT_I4_S, "blt.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLT_I8_S, "blt.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLT_R8_S, "blt.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLE_I4_S, "ble.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLE_I8_S, "ble.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLE_R8_S, "ble.r8.s", 2, MintOpShortBranch)
-
-OPDEF(MINT_BNE_UN_I4_S, "bne.un.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BNE_UN_I8_S, "bne.un.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BNE_UN_R8_S, "bne.un.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGE_UN_I4_S, "bge.un.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGE_UN_I8_S, "bge.un.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGE_UN_R8_S, "bge.un.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGT_UN_I4_S, "bgt.un.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGT_UN_I8_S, "bgt.un.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BGT_UN_R8_S, "bgt.un.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLE_UN_I4_S, "ble.un.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLE_UN_I8_S, "ble.un.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLE_UN_R8_S, "ble.un.r8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLT_UN_I4_S, "blt.un.i4.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLT_UN_I8_S, "blt.un.i8.s", 2, MintOpShortBranch)
-OPDEF(MINT_BLT_UN_R8_S, "blt.un.r8.s", 2, MintOpShortBranch)
-
-OPDEF(MINT_SWITCH, "switch", 0, MintOpSwitch)
-
-OPDEF(MINT_LDSTR, "ldstr", 2, MintOpMethodToken) /* not really */
-
-OPDEF(MINT_CALL, "call", 2, MintOpMethodToken)
-OPDEF(MINT_VCALL, "vcall", 2, MintOpMethodToken)
-OPDEF(MINT_CALLVIRT, "callvirt", 2, MintOpMethodToken)
-OPDEF(MINT_VCALLVIRT, "vcallvirt", 2, MintOpMethodToken)
-OPDEF(MINT_CALLI, "calli", 2, MintOpMethodToken)
-OPDEF(MINT_CALLI_NAT, "calli.nat", 2, MintOpMethodToken)
-OPDEF(MINT_JMP, "jmp", 2, MintOpMethodToken)
-
-OPDEF(MINT_CALLINT, "callint", 1, MintOpNoArgs)
-OPDEF(MINT_CALLRUN, "callrun", 1, MintOpNoArgs)
-
-OPDEF(MINT_NEWOBJ, "newobj", 2, MintOpMethodToken)
-OPDEF(MINT_INITOBJ, "initobj", 3, MintOpInt)
-OPDEF(MINT_CASTCLASS, "castclass", 2, MintOpClassToken)
-OPDEF(MINT_ISINST, "isinst", 2, MintOpClassToken)
-OPDEF(MINT_NEWARR, "newarr", 2, MintOpClassToken)
-OPDEF(MINT_BOX, "box", 2, MintOpClassToken)
-OPDEF(MINT_UNBOX, "unbox", 2, MintOpClassToken)
-OPDEF(MINT_LDTOKEN, "ldtoken", 2, MintOpClassToken) /* not really */
-OPDEF(MINT_LDFTN, "ldftn", 2, MintOpMethodToken)
-OPDEF(MINT_LDVIRTFTN, "ldvirtftn", 2, MintOpMethodToken)
-OPDEF(MINT_LDOBJ, "ldobj", 2, MintOpClassToken)
-OPDEF(MINT_STOBJ, "stobj", 2, MintOpClassToken)
-OPDEF(MINT_STOBJ_VT, "stobj.vt", 2, MintOpClassToken)
-OPDEF(MINT_CPBLK, "cpblk", 1, MintOpNoArgs)
-OPDEF(MINT_INITBLK, "initblk", 1, MintOpNoArgs)
-OPDEF(MINT_LOCALLOC, "localloc", 1, MintOpNoArgs)
-OPDEF(MINT_INITLOCALS, "initlocals", 1, MintOpNoArgs)
-
-OPDEF(MINT_LDELEM_I, "ldelem.i", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_I1, "ldelem.i1", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_U1, "ldelem.u1", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_I2, "ldelem.i2", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_U2, "ldelem.u2", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_I4, "ldelem.i4", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_U4, "ldelem.u4", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_I8, "ldelem.i8", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_R4, "ldelem.r4", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_R8, "ldelem.r8", 1, MintOpNoArgs)
-OPDEF(MINT_LDELEM_REF, "ldelem.ref", 1, MintOpNoArgs)
-
-OPDEF(MINT_LDELEMA, "ldelema", 2, MintOpClassToken)
-
-OPDEF(MINT_STELEM_I, "stelem.i", 1, MintOpNoArgs)
-OPDEF(MINT_STELEM_I1, "stelem.i1", 1, MintOpNoArgs)
-OPDEF(MINT_STELEM_I2, "stelem.i2", 1, MintOpNoArgs)
-OPDEF(MINT_STELEM_I4, "stelem.i4", 1, MintOpNoArgs)
-OPDEF(MINT_STELEM_I8, "stelem.i8", 1, MintOpNoArgs)
-OPDEF(MINT_STELEM_R4, "stelem.r4", 1, MintOpNoArgs)
-OPDEF(MINT_STELEM_R8, "stelem.r8", 1, MintOpNoArgs)
-OPDEF(MINT_STELEM_REF, "stelem.ref", 1, MintOpNoArgs)
-
-OPDEF(MINT_LDLEN, "ldlen", 1, MintOpNoArgs)
-
-OPDEF(MINT_ADD_I4, "add.i4", 1, MintOpNoArgs)
-OPDEF(MINT_ADD_I8, "add.i8", 1, MintOpNoArgs)
-OPDEF(MINT_ADD_R8, "add.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_ADD1_I4, "add1.i4", 1, MintOpNoArgs)
-
-OPDEF(MINT_SUB_I4, "sub.i4", 1, MintOpNoArgs)
-OPDEF(MINT_SUB_I8, "sub.i8", 1, MintOpNoArgs)
-OPDEF(MINT_SUB_R8, "sub.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_SUB1_I4, "sub1.i4", 1, MintOpNoArgs)
-
-OPDEF(MINT_MUL_I4, "mul.i4", 1, MintOpNoArgs)
-OPDEF(MINT_MUL_I8, "mul.i8", 1, MintOpNoArgs)
-OPDEF(MINT_MUL_R8, "mul.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_DIV_I4, "div.i4", 1, MintOpNoArgs)
-OPDEF(MINT_DIV_I8, "div.i8", 1, MintOpNoArgs)
-OPDEF(MINT_DIV_R8, "div.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_DIV_UN_I4, "div.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_DIV_UN_I8, "div.un.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_ADD_OVF_I4, "add.ovf.i4", 1, MintOpNoArgs)
-OPDEF(MINT_ADD_OVF_I8, "add.ovf.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_ADD_OVF_UN_I4, "add.ovf.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_ADD_OVF_UN_I8, "add.ovf.un.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_MUL_OVF_I4, "mul.ovf.i4", 1, MintOpNoArgs)
-OPDEF(MINT_MUL_OVF_I8, "mul.ovf.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_MUL_OVF_UN_I4, "mul.ovf.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_MUL_OVF_UN_I8, "mul.ovf.un.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_SUB_OVF_I4, "sub.ovf.i4", 1, MintOpNoArgs)
-OPDEF(MINT_SUB_OVF_I8, "sub.ovf.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_SUB_OVF_UN_I4, "sub.ovf.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_SUB_OVF_UN_I8, "sub.ovf.un.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_NEG_I4, "neg.i4", 1, MintOpNoArgs)
-OPDEF(MINT_NEG_I8, "neg.i8", 1, MintOpNoArgs)
-OPDEF(MINT_NEG_R8, "neg.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_NOT_I4, "not.i4", 1, MintOpNoArgs)
-OPDEF(MINT_NOT_I8, "not.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_AND_I4, "and.i4", 1, MintOpNoArgs)
-OPDEF(MINT_AND_I8, "and.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_OR_I4, "or.i4", 1, MintOpNoArgs)
-OPDEF(MINT_OR_I8, "or.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_XOR_I4, "xor.i4", 1, MintOpNoArgs)
-OPDEF(MINT_XOR_I8, "xor.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_REM_I4, "rem.i4", 1, MintOpNoArgs)
-OPDEF(MINT_REM_I8, "rem.i8", 1, MintOpNoArgs)
-OPDEF(MINT_REM_R8, "rem.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_REM_UN_I4, "rem.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_REM_UN_I8, "rem.un.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_SHR_UN_I4, "shr.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_SHR_UN_I8, "shr.un.i8", 1, MintOpNoArgs)
-OPDEF(MINT_SHL_I4, "shl.i4", 1, MintOpNoArgs)
-OPDEF(MINT_SHL_I8, "shl.i8", 1, MintOpNoArgs)
-OPDEF(MINT_SHR_I4, "shr.i4", 1, MintOpNoArgs)
-OPDEF(MINT_SHR_I8, "shr.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_R_UN_I4, "conv.r.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_R_UN_I8, "conv.r.un.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_I1_I4, "conv.i1.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_I1_I8, "conv.i1.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_I1_R8, "conv.i1.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_U1_I4, "conv.u1.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_U1_I8, "conv.u1.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_U1_R8, "conv.u1.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_I2_I4, "conv.i2.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_I2_I8, "conv.i2.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_I2_R8, "conv.i2.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_U2_I4, "conv.u2.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_U2_I8, "conv.u2.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_U2_R8, "conv.u2.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_I4_I8, "conv.i4.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_I4_R8, "conv.i4.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_U4_I8, "conv.u4.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_U4_R8, "conv.u4.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_I8_I4, "conv.i8.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_I8_U4, "conv.i8.u4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_I8_R8, "conv.i8.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_R4_I4, "conv.r4.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_R4_I8, "conv.r4.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_R4_R8, "conv.r4.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_R8_I4, "conv.r8.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_R8_I8, "conv.r8.i8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_I4_I8_SP, "conv.i4.i8.sp", 1, MintOpNoArgs) /* special for narrowing sp[-2] on 64 bits */
-OPDEF(MINT_CONV_I8_I4_SP, "conv.i8.i4.sp", 1, MintOpNoArgs) /* special for widening sp[-2] on 64 bits */
-
-OPDEF(MINT_CONV_U8_I4, "conv.u8.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_U8_R8, "conv.u8.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_I1_I4, "conv.ovf.i1.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_I1_I8, "conv.ovf.i1.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_I1_R8, "conv.ovf.i1.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_U1_I4, "conv.ovf.u1.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_U1_I8, "conv.ovf.u1.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_U1_R8, "conv.ovf.u1.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_I2_I4, "conv.ovf.i2.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_I2_I8, "conv.ovf.i2.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_I2_R8, "conv.ovf.i2.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_U2_I4, "conv.ovf.u2.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_U2_I8, "conv.ovf.u2.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_U2_R8, "conv.ovf.u2.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_I4_U4, "conv.ovf.i4.u4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_I4_I8, "conv.ovf.i4.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_I4_R8, "conv.ovf.i4.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_I4_UN_I8, "conv.ovf.i4.un.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_I4_UN_R8, "conv.ovf.i4.un.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_U4_I4, "conv.ovf.u4.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_U4_I8, "conv.ovf.u4.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_U4_R8, "conv.ovf.u4.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_I8_R8, "conv.ovf.i8.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_I8_UN_R8, "conv.ovf.i8.un.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CONV_OVF_U8_I4, "conv.ovf.u8.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CONV_OVF_U8_R8, "conv.ovf.u8.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CEQ_I4, "ceq.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CEQ_I8, "ceq.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CEQ_R8, "ceq.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CEQ0_I4, "ceq0.i4", 1, MintOpNoArgs)
-
-OPDEF(MINT_CGT_I4, "cgt.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CGT_I8, "cgt.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CGT_R8, "cgt.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CGT_UN_I4, "cgt.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CGT_UN_I8, "cgt.un.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CGT_UN_R8, "cgt.un.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CLT_I4, "clt.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CLT_I8, "clt.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CLT_R8, "clt.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CLT_UN_I4, "clt.un.i4", 1, MintOpNoArgs)
-OPDEF(MINT_CLT_UN_I8, "clt.un.i8", 1, MintOpNoArgs)
-OPDEF(MINT_CLT_UN_R8, "clt.un.r8", 1, MintOpNoArgs)
-
-OPDEF(MINT_CKFINITE, "ckfinite", 1, MintOpNoArgs)
-
-OPDEF(MINT_CKNULL, "cknull", 1, MintOpNoArgs)
-
-OPDEF(MINT_GETCHR, "getchr", 1, MintOpNoArgs)
-OPDEF(MINT_STRLEN, "strlen", 1, MintOpNoArgs)
-OPDEF(MINT_ARRAY_RANK, "array_rank", 1, MintOpNoArgs)
-
-OPDEF(MINT_ICALL_V_V, "mono_icall_v_v", 2, MintOpClassToken) /* not really */
-OPDEF(MINT_ICALL_P_V, "mono_icall_p_v", 2, MintOpClassToken)
-OPDEF(MINT_ICALL_P_P, "mono_icall_p_p", 2, MintOpClassToken)
-OPDEF(MINT_ICALL_PP_V, "mono_icall_pp_v", 2, MintOpClassToken)
-OPDEF(MINT_ICALL_PI_V, "mono_icall_pi_v", 2, MintOpClassToken)
-OPDEF(MINT_ICALL_PP_P, "mono_icall_pp_p", 2, MintOpClassToken)
-OPDEF(MINT_ICALL_PI_P, "mono_icall_pi_p", 2, MintOpClassToken)
-OPDEF(MINT_ICALL_PPP_V, "mono_icall_ppp_v", 2, MintOpClassToken)
-OPDEF(MINT_ICALL_PPI_V, "mono_icall_ppi_v", 2, MintOpClassToken)
-OPDEF(MINT_MONO_LDPTR, "mono_ldptr", 2, MintOpClassToken)
-OPDEF(MINT_MONO_NEWOBJ, "mono_newobj", 2, MintOpClassToken)
-OPDEF(MINT_MONO_RETOBJ, "mono_retobj", 1, MintOpNoArgs)
-OPDEF(MINT_MONO_FREE, "mono_free", 1, MintOpNoArgs)
-
-
+++ /dev/null
-#ifndef __INTERPRETER_MINTOPS_H
-#define __INTERPRETER_MINTOPS_H
-
-#include <glib.h>
-
-typedef enum
-{
- MintOpNoArgs,
- MintOpShortInt,
- MintOpUShortInt,
- MintOpInt,
- MintOpLongInt,
- MintOpFloat,
- MintOpDouble,
- MintOpBranch,
- MintOpShortBranch,
- MintOpSwitch,
- MintOpMethodToken,
- MintOpFieldToken,
- MintOpClassToken,
- MintOpTwoShorts,
- MintOpShortAndInt
-} MintOpArgType;
-
-#define OPDEF(a,b,c,d) \
- a,
-enum {
-#include "mintops.def"
- MINT_LASTOP
-};
-#undef OPDEF
-
-#if NO_UNALIGNED_ACCESS
-# if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define READ32(x) (((guint16 *)(x)) [0] | ((guint16 *)(x)) [1] << 16)
-#define READ64(x) ((guint64)((guint16 *)(x)) [0] | \
- (guint64)((guint16 *)(x)) [1] << 16 | \
- (guint64)((guint16 *)(x)) [2] << 32 | \
- (guint64)((guint16 *)(x)) [3] << 48)
-# else
-#define READ32(x) (((guint16 *)(x)) [0] << 16 | ((guint16 *)(x)) [1])
-#define READ64(x) ((guint64)((guint16 *)(x)) [0] << 48 | \
- (guint64)((guint16 *)(x)) [1] << 32 | \
- (guint64)((guint16 *)(x)) [2] << 16 | \
- (guint64)((guint16 *)(x)) [3])
-# endif
-#else /* unaligned access OK */
-#define READ32(x) (*(guint32 *)(x))
-#define READ64(x) (*(guint64 *)(x))
-#endif
-
-extern const char *mono_interp_opname[];
-extern unsigned char mono_interp_oplen[];
-extern MintOpArgType mono_interp_opargtype[];
-extern const guint16 *mono_interp_dis_mintop(const unsigned short *base, const guint16 *ip);
-
-#endif
-
+++ /dev/null
-/*
- * transform CIL into different opcodes for more
- * efficient interpretation
- *
- * Written by Bernie Solomon (bernard@ugsolutions.com)
- * Copyright (c) 2004.
- */
-
-#include <string.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/debug-helpers.h>
-#include <mono/metadata/exception.h>
-#include <mono/metadata/mono-endian.h>
-#include <mono/metadata/marshal.h>
-#include <mono/metadata/profiler-private.h>
-#include <mono/metadata/tabledefs.h>
-
-#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
- a = i,
-
-enum {
-#include "mono/cil/opcode.def"
- CEE_LASTOP
-};
-#undef OPDEF
-
-#include "mintops.h"
-#include "interp.h"
-
-#define DEBUG 0
-
-typedef struct
-{
- MonoClass *klass;
- unsigned char type;
- unsigned char flags;
-} StackInfo;
-
-typedef struct
-{
- MonoMethod *method;
- MonoMethodHeader *header;
- RuntimeMethod *rtm;
- const unsigned char *il_code;
- const unsigned char *ip;
- const unsigned char *last_ip;
- const unsigned char *in_start;
- int code_size;
- int *in_offsets;
- int *forward_refs;
- StackInfo **stack_state;
- int *stack_height;
- int *vt_stack_size;
- unsigned char *is_bb_start;
- unsigned short *new_code;
- unsigned short *new_code_end;
- unsigned short *new_ip;
- unsigned short *last_new_ip;
- unsigned int max_code_size;
- StackInfo *stack;
- StackInfo *sp;
- unsigned int max_stack_height;
- unsigned int vt_sp;
- unsigned int max_vt_sp;
- int n_data_items;
- int max_data_items;
- void **data_items;
- GHashTable *data_hash;
-} TransformData;
-
-#define MINT_TYPE_I1 0
-#define MINT_TYPE_U1 1
-#define MINT_TYPE_I2 2
-#define MINT_TYPE_U2 3
-#define MINT_TYPE_I4 4
-#define MINT_TYPE_I8 5
-#define MINT_TYPE_R4 6
-#define MINT_TYPE_R8 7
-#define MINT_TYPE_O 8
-#define MINT_TYPE_P 9
-#define MINT_TYPE_VT 10
-
-#define STACK_TYPE_I4 0
-#define STACK_TYPE_I8 1
-#define STACK_TYPE_R8 2
-#define STACK_TYPE_O 3
-#define STACK_TYPE_VT 4
-#define STACK_TYPE_MP 5
-#define STACK_TYPE_F 6
-
-static const char *stack_type_string [] = { "I4", "I8", "R8", "O ", "VT", "MP", "F " };
-
-#if SIZEOF_VOID_P == 8
-#define STACK_TYPE_I STACK_TYPE_I8
-#else
-#define STACK_TYPE_I STACK_TYPE_I4
-#endif
-
-static int stack_type [] = {
- STACK_TYPE_I4, /*I1*/
- STACK_TYPE_I4, /*U1*/
- STACK_TYPE_I4, /*I2*/
- STACK_TYPE_I4, /*U2*/
- STACK_TYPE_I4, /*I4*/
- STACK_TYPE_I8, /*I8*/
- STACK_TYPE_R8, /*R4*/
- STACK_TYPE_R8, /*R8*/
- STACK_TYPE_O, /*O*/
- STACK_TYPE_MP, /*P*/
- STACK_TYPE_VT
-};
-
-static void
-grow_code (TransformData *td)
-{
- unsigned int old_ip_offset = td->new_ip - td->new_code;
- unsigned int old_last_ip_offset = td->last_new_ip - td->new_code;
- g_assert (old_ip_offset <= td->max_code_size);
- td->new_code = g_realloc (td->new_code, (td->max_code_size *= 2) * sizeof (td->new_code [0]));
- td->new_code_end = td->new_code + td->max_code_size;
- td->new_ip = td->new_code + old_ip_offset;
- td->last_new_ip = td->new_code + old_last_ip_offset;
-}
-
-#define ENSURE_CODE(td, n) \
- do { \
- if ((td)->new_ip + (n) > (td)->new_code_end) \
- grow_code (td); \
- } while (0)
-
-#define ADD_CODE(td, n) \
- do { \
- if ((td)->new_ip == (td)->new_code_end) \
- grow_code (td); \
- *(td)->new_ip++ = (n); \
- } while (0)
-
-#define CHECK_STACK(td, n) \
- do { \
- int stack_size = (td)->sp - (td)->stack; \
- if (stack_size < (n)) \
- g_warning ("%s.%s: not enough values (%d < %d) on stack at %04x", \
- (td)->method->klass->name, (td)->method->name, \
- stack_size, n, (td)->ip - (td)->il_code); \
- } while (0)
-
-#define ENSURE_I4(td, sp_off) \
- do { \
- if ((td)->sp [-sp_off].type == STACK_TYPE_I8) \
- ADD_CODE(td, sp_off == 1 ? MINT_CONV_I4_I8 : MINT_CONV_I4_I8_SP); \
- } while (0)
-
-static void
-handle_branch(TransformData *td, int short_op, int long_op, int offset)
-{
- int shorten_branch = 0;
- int target = td->ip + offset - td->il_code;
- if (target < 0 || target >= td->code_size)
- g_assert_not_reached ();
- if (offset > 0 && td->stack_height [target] < 0) {
- td->stack_height [target] = td->sp - td->stack;
- if (td->stack_height [target] > 0)
- td->stack_state [target] = g_memdup (td->stack, td->stack_height [target] * sizeof (td->stack [0]));
- td->vt_stack_size [target] = td->vt_sp;
- }
- if (offset < 0) {
- offset = td->in_offsets [target] - (td->new_ip - td->new_code);
- if (offset >= -32768) {
- shorten_branch = 1;
- }
- } else {
- int prev = td->forward_refs [target];
- td->forward_refs [td->ip - td->il_code] = prev;
- td->forward_refs [target] = td->ip - td->il_code;
- offset = 0;
- if (td->header->code_size <= 25000) /* FIX to be precise somehow? */
- shorten_branch = 1;
- }
- if (shorten_branch) {
- ADD_CODE(td, short_op);
- ADD_CODE(td, offset);
- } else {
- ADD_CODE(td, long_op);
- ADD_CODE(td, * (unsigned short *)(&offset));
- ADD_CODE(td, * ((unsigned short *)&offset + 1));
- }
-}
-
-static void
-one_arg_branch(TransformData *td, int mint_op, int offset)
-{
- int type = td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP ? STACK_TYPE_I : td->sp [-1].type;
- int long_op = mint_op + type - STACK_TYPE_I4;
- int short_op = long_op + MINT_BRFALSE_I4_S - MINT_BRFALSE_I4;
- CHECK_STACK(td, 1);
- --td->sp;
- handle_branch (td, short_op, long_op, offset);
-}
-
-static void
-two_arg_branch(TransformData *td, int mint_op, int offset)
-{
- int type1 = td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP ? STACK_TYPE_I : td->sp [-1].type;
- int type2 = td->sp [-2].type == STACK_TYPE_O || td->sp [-2].type == STACK_TYPE_MP ? STACK_TYPE_I : td->sp [-2].type;
- int long_op = mint_op + type1 - STACK_TYPE_I4;
- int short_op = long_op + MINT_BEQ_I4_S - MINT_BEQ_I4;
- CHECK_STACK(td, 2);
- if (type1 == STACK_TYPE_I4 && type2 == STACK_TYPE_I8) {
- ADD_CODE(td, MINT_CONV_I8_I4);
- td->in_offsets [td->ip - td->il_code]++;
- } else if (type1 == STACK_TYPE_I8 && type2 == STACK_TYPE_I4) {
- ADD_CODE(td, MINT_CONV_I8_I4_SP);
- td->in_offsets [td->ip - td->il_code]++;
- } else if (type1 != type2) {
- g_warning("%s.%s: branch type mismatch %d %d",
- td->method->klass->name, td->method->name,
- td->sp [-1].type, td->sp [-2].type);
- }
- td->sp -= 2;
- handle_branch (td, short_op, long_op, offset);
-}
-
-static void
-unary_arith_op(TransformData *td, int mint_op)
-{
- int op = mint_op + td->sp [-1].type - STACK_TYPE_I4;
- CHECK_STACK(td, 1);
- ADD_CODE(td, op);
-}
-
-static void
-binary_arith_op(TransformData *td, int mint_op)
-{
- int type1 = td->sp [-2].type;
- int type2 = td->sp [-1].type;
- int op;
-#if SIZEOF_VOID_P == 8
- if ((type1 == STACK_TYPE_MP || type1 == STACK_TYPE_I8) && type2 == STACK_TYPE_I4) {
- ADD_CODE(td, MINT_CONV_I8_I4);
- type2 = STACK_TYPE_I8;
- }
- if (type1 == STACK_TYPE_I4 && (type2 == STACK_TYPE_MP || type2 == STACK_TYPE_I8)) {
- ADD_CODE(td, MINT_CONV_I8_I4_SP);
- type1 = STACK_TYPE_I8;
- td->sp [-2].type = STACK_TYPE_I8;
- }
-#endif
- if (type1 == STACK_TYPE_MP)
- type1 = STACK_TYPE_I;
- if (type2 == STACK_TYPE_MP)
- type2 = STACK_TYPE_I;
- if (type1 != type2) {
- g_warning("%s.%s: %04x arith type mismatch %s %d %d",
- td->method->klass->name, td->method->name,
- td->ip - td->il_code, mono_interp_opname[mint_op], type1, type2);
- }
- op = mint_op + type1 - STACK_TYPE_I4;
- CHECK_STACK(td, 2);
- ADD_CODE(td, op);
- --td->sp;
-}
-
-static void
-binary_int_op(TransformData *td, int mint_op)
-{
- int op = mint_op + td->sp [-1].type - STACK_TYPE_I4;
- CHECK_STACK(td, 2);
- if (td->sp [-1].type != td->sp [-2].type)
- g_warning("%s.%s: int type mismatch", td->method->klass->name, td->method->name);
- ADD_CODE(td, op);
- --td->sp;
-}
-
-static void
-shift_op(TransformData *td, int mint_op)
-{
- int op = mint_op + td->sp [-2].type - STACK_TYPE_I4;
- CHECK_STACK(td, 2);
- if (td->sp [-1].type != STACK_TYPE_I4) {
- g_warning("%s.%s: shift type mismatch %d",
- td->method->klass->name, td->method->name,
- td->sp [-2].type);
- }
- ADD_CODE(td, op);
- --td->sp;
-}
-
-static int
-mint_type(MonoType *type)
-{
- if (type->byref)
- return MINT_TYPE_P;
-enum_type:
- switch (type->type) {
- case MONO_TYPE_I1:
- return MINT_TYPE_I1;
- case MONO_TYPE_U1:
- case MONO_TYPE_BOOLEAN:
- return MINT_TYPE_U1;
- case MONO_TYPE_I2:
- return MINT_TYPE_I2;
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- return MINT_TYPE_U2;
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- return MINT_TYPE_I4;
- case MONO_TYPE_I:
- case MONO_TYPE_U:
-#if SIZEOF_VOID_P == 4
- return MINT_TYPE_I4;
-#else
- return MINT_TYPE_I8;
-#endif
- case MONO_TYPE_PTR:
- return MINT_TYPE_P;
- case MONO_TYPE_R4:
- return MINT_TYPE_R4;
- case MONO_TYPE_I8:
- case MONO_TYPE_U8:
- return MINT_TYPE_I8;
- case MONO_TYPE_R8:
- return MINT_TYPE_R8;
- case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_ARRAY:
- return MINT_TYPE_O;
- case MONO_TYPE_VALUETYPE:
- if (type->data.klass->enumtype) {
- type = type->data.klass->enum_basetype;
- goto enum_type;
- } else
- return MINT_TYPE_VT;
- default:
- g_warning ("got type 0x%02x", type->type);
- g_assert_not_reached ();
- }
- return -1;
-}
-
-static int
-can_store (int stack_type, int var_type)
-{
- if (stack_type == STACK_TYPE_O || stack_type == STACK_TYPE_MP)
- stack_type = STACK_TYPE_I;
- if (var_type == STACK_TYPE_O || var_type == STACK_TYPE_MP)
- var_type = STACK_TYPE_I;
- return stack_type == var_type;
-}
-
-#define SET_SIMPLE_TYPE(s, ty) \
- do { \
- (s)->type = (ty); \
- (s)->flags = 0; \
- (s)->klass = NULL; \
- } while (0)
-
-#define SET_TYPE(s, ty, k) \
- do { \
- (s)->type = (ty); \
- (s)->flags = 0; \
- (s)->klass = k; \
- } while (0)
-
-#define PUSH_SIMPLE_TYPE(td, ty) \
- do { \
- int sp_height; \
- (td)->sp++; \
- sp_height = (td)->sp - (td)->stack; \
- if (sp_height > (td)->max_stack_height) \
- (td)->max_stack_height = sp_height; \
- SET_SIMPLE_TYPE((td)->sp - 1, ty); \
- } while (0)
-
-#define PUSH_TYPE(td, ty, k) \
- do { \
- int sp_height; \
- (td)->sp++; \
- sp_height = (td)->sp - (td)->stack; \
- if (sp_height > (td)->max_stack_height) \
- (td)->max_stack_height = sp_height; \
- SET_TYPE((td)->sp - 1, ty, k); \
- } while (0)
-
-#define PUSH_VT(td, size) \
- do { \
- (td)->vt_sp += ((size) + 7) & ~7; \
- if ((td)->vt_sp > (td)->max_vt_sp) \
- (td)->max_vt_sp = (td)->vt_sp; \
- } while (0)
-
-#define POP_VT(td, size) \
- do { \
- (td)->vt_sp -= ((size) + 7) & ~7; \
- } while (0)
-
-#if NO_UNALIGNED_ACCESS
-#define WRITE32(td, v) \
- do { \
- ENSURE_CODE(td, 2); \
- * (guint16 *)((td)->new_ip) = * (guint16 *)(v); \
- * ((guint16 *)((td)->new_ip) + 1) = * ((guint16 *)(v) + 1); \
- (td)->new_ip += 2; \
- } while (0)
-
-#define WRITE64(td, v) \
- do { \
- ENSURE_CODE(td, 4); \
- * (guint16 *)((td)->new_ip) = * (guint16 *)(v); \
- * ((guint16 *)((td)->new_ip) + 1) = * ((guint16 *)(v) + 1); \
- * ((guint16 *)((td)->new_ip) + 2) = * ((guint16 *)(v) + 2); \
- * ((guint16 *)((td)->new_ip) + 3) = * ((guint16 *)(v) + 3); \
- (td)->new_ip += 4; \
- } while (0)
-#else
-#define WRITE32(td, v) \
- do { \
- ENSURE_CODE(td, 2); \
- * (guint32 *)((td)->new_ip) = * (guint32 *)(v); \
- (td)->new_ip += 2; \
- } while (0)
-
-#define WRITE64(td, v) \
- do { \
- ENSURE_CODE(td, 4); \
- * (guint64 *)((td)->new_ip) = * (guint64 *)(v); \
- (td)->new_ip += 4; \
- } while (0)
-
-#endif
-
-static void
-load_arg(TransformData *td, int n)
-{
- int mt;
- MonoClass *klass = NULL;
- if (n == 0 && mono_method_signature (td->method)->hasthis) {
- if (td->method->klass->valuetype)
- mt = MINT_TYPE_P;
- else {
- mt = MINT_TYPE_O;
- klass = td->method->klass;
- }
- ADD_CODE(td, MINT_LDTHIS);
- } else {
- MonoType *type;
- n -= mono_method_signature (td->method)->hasthis;
- type = mono_method_signature (td->method)->params [n];
- mt = mint_type (type);
- if (mt == MINT_TYPE_VT) {
- gint32 size;
- if (mono_method_signature (td->method)->pinvoke)
- size = mono_class_native_size (type->data.klass, NULL);
- else
- size = mono_class_value_size (type->data.klass, NULL);
- PUSH_VT(td, size);
- ADD_CODE(td, MINT_LDARG_VT);
- ADD_CODE(td, td->rtm->arg_offsets [n]); /* FIX for large offset */
- WRITE32(td, &size);
- klass = type->data.klass;
- } else {
- ADD_CODE(td, MINT_LDARG_I1 + (mt - MINT_TYPE_I1));
- ADD_CODE(td, td->rtm->arg_offsets [n]); /* FIX for large offset */
- if (mt == MINT_TYPE_O)
- klass = mono_class_from_mono_type (type);
- }
- }
- PUSH_TYPE(td, stack_type[mt], klass);
-}
-
-static void
-store_arg(TransformData *td, int n)
-{
- int mt;
- CHECK_STACK (td, 1);
- if (n == 0 && mono_method_signature (td->method)->hasthis)
- ADD_CODE(td, MINT_STTHIS);
- else {
- MonoType *type;
- n -= mono_method_signature (td->method)->hasthis;
- type = mono_method_signature (td->method)->params [n];
- mt = mint_type (type);
- if (mt == MINT_TYPE_VT) {
- gint32 size;
- if (mono_method_signature (td->method)->pinvoke)
- size = mono_class_native_size (type->data.klass, NULL);
- else
- size = mono_class_value_size (type->data.klass, NULL);
- ADD_CODE(td, MINT_STARG_VT);
- ADD_CODE(td, n);
- WRITE32(td, &size);
- if (td->sp [-1].type == STACK_TYPE_VT)
- POP_VT(td, size);
- } else {
- ADD_CODE(td, MINT_STARG_I1 + (mt - MINT_TYPE_I1));
- ADD_CODE(td, td->rtm->arg_offsets [n]);
- }
- }
- --td->sp;
-}
-
-static void
-store_inarg(TransformData *td, int n)
-{
- MonoType *type = mono_method_signature (td->method)->params [n];
- int mt = mint_type (type);
- if (mt == MINT_TYPE_VT) {
- gint32 size;
- if (mono_method_signature (td->method)->pinvoke)
- size = mono_class_native_size (type->data.klass, NULL);
- else
- size = mono_class_value_size (type->data.klass, NULL);
- ADD_CODE(td, MINT_STINARG_VT);
- ADD_CODE(td, n);
- WRITE32(td, &size);
- } else {
- ADD_CODE(td, MINT_STINARG_I1 + (mt - MINT_TYPE_I1));
- ADD_CODE(td, n);
- }
-}
-
-static void
-load_local(TransformData *td, int n)
-{
- MonoType *type = td->header->locals [n];
- int mt = mint_type (type);
- int offset = td->rtm->local_offsets [n];
- MonoClass *klass = NULL;
- if (mt == MINT_TYPE_VT) {
- gint32 size = mono_class_value_size (type->data.klass, NULL);
- PUSH_VT(td, size);
- ADD_CODE(td, MINT_LDLOC_VT);
- ADD_CODE(td, offset); /*FIX for large offset */
- WRITE32(td, &size);
- klass = type->data.klass;
- } else {
- if (mt == MINT_TYPE_I4 && !td->is_bb_start [td->in_start - td->il_code] && td->last_new_ip != NULL &&
- td->last_new_ip [0] == MINT_STLOC_I4 && td->last_new_ip [1] == offset) {
- td->last_new_ip [0] = MINT_STLOC_NP_I4;
- } else if (mt == MINT_TYPE_O && !td->is_bb_start [td->in_start - td->il_code] && td->last_new_ip != NULL &&
- td->last_new_ip [0] == MINT_STLOC_O && td->last_new_ip [1] == offset) {
- td->last_new_ip [0] = MINT_STLOC_NP_O;
- } else {
- ADD_CODE(td, MINT_LDLOC_I1 + (mt - MINT_TYPE_I1));
- ADD_CODE(td, offset); /*FIX for large offset */
- }
- if (mt == MINT_TYPE_O)
- klass = mono_class_from_mono_type (type);
- }
- PUSH_TYPE(td, stack_type[mt], klass);
-}
-
-static void
-store_local(TransformData *td, int n)
-{
- MonoType *type = td->header->locals [n];
- int mt = mint_type (type);
- int offset = td->rtm->local_offsets [n];
- CHECK_STACK (td, 1);
-#if SIZEOF_VOID_P == 8
- if (td->sp [-1].type == STACK_TYPE_I4 && stack_type [mt] == STACK_TYPE_I8) {
- ADD_CODE(td, MINT_CONV_I8_I4);
- td->sp [-1].type = STACK_TYPE_I8;
- }
-#endif
- if (!can_store(td->sp [-1].type, stack_type [mt])) {
- g_warning("%s.%s: Store local stack type mismatch %d %d",
- td->method->klass->name, td->method->name,
- stack_type [mt], td->sp [-1].type);
- }
- if (mt == MINT_TYPE_VT) {
- gint32 size = mono_class_value_size (type->data.klass, NULL);
- ADD_CODE(td, MINT_STLOC_VT);
- ADD_CODE(td, offset); /*FIX for large offset */
- WRITE32(td, &size);
- if (td->sp [-1].type == STACK_TYPE_VT)
- POP_VT(td, size);
- } else {
- ADD_CODE(td, MINT_STLOC_I1 + (mt - MINT_TYPE_I1));
- ADD_CODE(td, offset); /*FIX for large offset */
- }
- --td->sp;
-}
-
-#define SIMPLE_OP(td, op) \
- do { \
- ADD_CODE(&td, op); \
- ++td.ip; \
- } while (0)
-
-static guint16
-get_data_item_index (TransformData *td, void *ptr)
-{
- gpointer p = g_hash_table_lookup (td->data_hash, ptr);
- guint index;
- if (p != NULL)
- return GPOINTER_TO_UINT (p) - 1;
- if (td->max_data_items == td->n_data_items) {
- td->max_data_items = td->n_data_items == 0 ? 16 : 2 * td->max_data_items;
- td->data_items = g_realloc (td->data_items, td->max_data_items * sizeof(td->data_items [0]));
- }
- index = td->n_data_items;
- td->data_items [index] = ptr;
- ++td->n_data_items;
- g_hash_table_insert (td->data_hash, ptr, GUINT_TO_POINTER (index + 1));
- return index;
-}
-
-static void
-generate(MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
-{
- MonoMethodHeader *header = mono_method_get_header (method);
- MonoMethodSignature *signature = mono_method_signature (method);
- MonoImage *image = method->klass->image;
- MonoDomain *domain = mono_domain_get ();
- MonoGenericContext *generic_context = NULL;
- int offset, mt;
- int i;
- int i32;
- MonoClass *klass;
- MonoClassField *field;
- const unsigned char *end;
- int new_in_start_offset;
- int body_start_offset;
- int target;
- guint32 token;
- TransformData td;
- int generating_code = 1;
-
- if (mono_method_signature (method)->is_inflated)
- generic_context = ((MonoMethodInflated *) method)->context;
-
- memset(&td, 0, sizeof(td));
- td.method = method;
- td.rtm = rtm;
- td.is_bb_start = is_bb_start;
- td.il_code = header->code;
- td.code_size = header->code_size;
- td.header = header;
- td.max_code_size = td.code_size;
- td.new_code = (unsigned short *)g_malloc(td.max_code_size * sizeof(gushort));
- td.new_code_end = td.new_code + td.max_code_size;
- td.in_offsets = g_malloc0(header->code_size * sizeof(int));
- td.forward_refs = g_malloc(header->code_size * sizeof(int));
- td.stack_state = g_malloc0(header->code_size * sizeof(StackInfo *));
- td.stack_height = g_malloc(header->code_size * sizeof(int));
- td.vt_stack_size = g_malloc(header->code_size * sizeof(int));
- td.n_data_items = 0;
- td.max_data_items = 0;
- td.data_items = NULL;
- td.data_hash = g_hash_table_new (NULL, NULL);
- rtm->data_items = td.data_items;
- for (i = 0; i < header->code_size; i++) {
- td.forward_refs [i] = -1;
- td.stack_height [i] = -1;
- }
- td.new_ip = td.new_code;
- td.last_new_ip = NULL;
-
- td.stack = g_malloc0(header->max_stack * sizeof(td.stack[0]));
- td.sp = td.stack;
- td.max_stack_height = 0;
-
- for (i = 0; i < header->num_clauses; i++) {
- MonoExceptionClause *c = header->clauses + i;
- td.stack_height [c->handler_offset] = 0;
- td.vt_stack_size [c->handler_offset] = 0;
- td.is_bb_start [c->handler_offset] = 1;
- if (c->flags == MONO_EXCEPTION_CLAUSE_NONE) {
- td.stack_height [c->handler_offset] = 1;
- td.stack_state [c->handler_offset] = g_malloc0(sizeof(StackInfo));
- td.stack_state [c->handler_offset][0].type = STACK_TYPE_O;
- td.stack_state [c->handler_offset][0].klass = NULL; /*FIX*/
- }
- }
-
- td.ip = header->code;
- end = td.ip + header->code_size;
-
- if (mono_interp_traceopt) {
- char *tmp = mono_disasm_code (NULL, method, td.ip, end);
- char *name = mono_method_full_name (method, TRUE);
- g_print ("Method %s, original code:\n", name);
- g_print ("%s\n", tmp);
- g_free (tmp);
- g_free (name);
- }
-
- for (i = 0; i < signature->param_count; i++)
- store_inarg(&td, i);
-
- body_start_offset = td.new_ip - td.new_code;
-
- for (i = 0; i < header->num_locals; i++) {
- int mt = mint_type(header->locals [i]);
- if (mt == MINT_TYPE_VT || mt == MINT_TYPE_O) {
- ADD_CODE(&td, MINT_INITLOCALS);
- break;
- }
- }
-
- while (td.ip < end) {
- int in_offset;
-
- g_assert (td.sp >= td.stack);
- g_assert (td.vt_sp < 0x10000000);
- in_offset = td.ip - header->code;
- td.in_offsets [in_offset] = td.new_ip - td.new_code;
- new_in_start_offset = td.new_ip - td.new_code;
- td.in_start = td.ip;
- while (td.forward_refs [in_offset] >= 0) {
- int j = td.forward_refs [in_offset];
- int slot;
- td.forward_refs [in_offset] = td.forward_refs [j];
- if (td.in_offsets [j] < 0) {
- int old_switch_offset = -td.in_offsets [j];
- int new_switch_offset = td.in_offsets [old_switch_offset];
- int switch_case = (j - old_switch_offset - 5) / 4;
- int n_cases = read32 (header->code + old_switch_offset + 1);
- offset = (td.new_ip - td.new_code) - (new_switch_offset + 2 * n_cases + 3);
- slot = new_switch_offset + 3 + 2 * switch_case;
- td.new_code [slot] = * (unsigned short *)(&offset);
- td.new_code [slot + 1] = * ((unsigned short *)&offset + 1);
- } else {
- int op = td.new_code [td.in_offsets [j]];
- if (mono_interp_opargtype [op] == MintOpShortBranch) {
- offset = (td.new_ip - td.new_code) - td.in_offsets [j];
- g_assert (offset <= 32767);
- slot = td.in_offsets [j] + 1;
- td.new_code [slot] = offset;
- } else {
- offset = (td.new_ip - td.new_code) - td.in_offsets [j];
- slot = td.in_offsets [j] + 1;
- td.new_code [slot] = * (unsigned short *)(&offset);
- td.new_code [slot + 1] = * ((unsigned short *)&offset + 1);
- }
- }
- }
- if (td.stack_height [in_offset] >= 0) {
- g_assert (is_bb_start [in_offset]);
- if (td.stack_height [in_offset] > 0)
- memcpy (td.stack, td.stack_state [in_offset], td.stack_height [in_offset] * sizeof(td.stack [0]));
- td.sp = td.stack + td.stack_height [in_offset];
- td.vt_sp = td.vt_stack_size [in_offset];
- }
- if (is_bb_start [in_offset]) {
- generating_code = 1;
- }
- if (!generating_code) {
- while (td.ip < end && !is_bb_start [td.ip - td.il_code])
- ++td.ip;
- continue;
- }
- if (mono_interp_traceopt > 1) {
- printf("IL_%04x %s %-10s -> IL_%04x, sp %d, %s %-12s vt_sp %u (max %u)\n",
- td.ip - td.il_code,
- td.is_bb_start [td.ip - td.il_code] == 3 ? "<>" :
- td.is_bb_start [td.ip - td.il_code] == 2 ? "< " :
- td.is_bb_start [td.ip - td.il_code] == 1 ? " >" : " ",
- mono_opcode_name (*td.ip), td.new_ip - td.new_code, td.sp - td.stack,
- td.sp > td.stack ? stack_type_string [td.sp [-1].type] : " ",
- (td.sp > td.stack && (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_VT)) ? (td.sp [-1].klass == NULL ? "?" : td.sp [-1].klass->name) : "",
- td.vt_sp, td.max_vt_sp);
- }
- switch (*td.ip) {
- case CEE_NOP:
- /* lose it */
- ++td.ip;
- break;
- case CEE_BREAK:
- SIMPLE_OP(td, MINT_BREAK);
- break;
- case CEE_LDARG_0:
- case CEE_LDARG_1:
- case CEE_LDARG_2:
- case CEE_LDARG_3:
- load_arg (&td, *td.ip - CEE_LDARG_0);
- ++td.ip;
- break;
- case CEE_LDLOC_0:
- case CEE_LDLOC_1:
- case CEE_LDLOC_2:
- case CEE_LDLOC_3:
- load_local (&td, *td.ip - CEE_LDLOC_0);
- ++td.ip;
- break;
- case CEE_STLOC_0:
- case CEE_STLOC_1:
- case CEE_STLOC_2:
- case CEE_STLOC_3:
- store_local (&td, *td.ip - CEE_STLOC_0);
- ++td.ip;
- break;
- case CEE_LDARG_S:
- load_arg (&td, ((guint8 *)td.ip)[1]);
- td.ip += 2;
- break;
- case CEE_LDARGA_S: {
- int n = ((guint8 *)td.ip)[1];
- if (n == 0 && signature->hasthis)
- ADD_CODE(&td, MINT_LDTHISA);
- else {
- ADD_CODE(&td, MINT_LDARGA);
- ADD_CODE(&td, td.rtm->arg_offsets [n - signature->hasthis]);
- }
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
- td.ip += 2;
- break;
- }
- case CEE_STARG_S:
- store_arg (&td, ((guint8 *)td.ip)[1]);
- td.ip += 2;
- break;
- case CEE_LDLOC_S:
- load_local (&td, ((guint8 *)td.ip)[1]);
- td.ip += 2;
- break;
- case CEE_LDLOCA_S:
- ADD_CODE(&td, MINT_LDLOCA_S);
- ADD_CODE(&td, td.rtm->local_offsets [((guint8 *)td.ip)[1]]);
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
- td.ip += 2;
- break;
- case CEE_STLOC_S:
- store_local (&td, ((guint8 *)td.ip)[1]);
- td.ip += 2;
- break;
- case CEE_LDNULL:
- SIMPLE_OP(td, MINT_LDNULL);
- PUSH_TYPE(&td, STACK_TYPE_O, NULL);
- break;
- case CEE_LDC_I4_M1:
- SIMPLE_OP(td, MINT_LDC_I4_M1);
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
- break;
- case CEE_LDC_I4_0:
- if (!td.is_bb_start[td.ip + 1 - td.il_code] && td.ip [1] == 0xfe && td.ip [2] == CEE_CEQ &&
- td.sp > td.stack && td.sp [-1].type == STACK_TYPE_I4) {
- SIMPLE_OP(td, MINT_CEQ0_I4);
- td.ip += 2;
- } else {
- SIMPLE_OP(td, MINT_LDC_I4_0);
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
- }
- break;
- case CEE_LDC_I4_1:
- if (!td.is_bb_start[td.ip + 1 - td.il_code] &&
- (td.ip [1] == CEE_ADD || td.ip [1] == CEE_SUB) && td.sp [-1].type == STACK_TYPE_I4) {
- ADD_CODE(&td, td.ip [1] == CEE_ADD ? MINT_ADD1_I4 : MINT_SUB1_I4);
- td.ip += 2;
- } else {
- SIMPLE_OP(td, MINT_LDC_I4_1);
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
- }
- break;
- case CEE_LDC_I4_2:
- case CEE_LDC_I4_3:
- case CEE_LDC_I4_4:
- case CEE_LDC_I4_5:
- case CEE_LDC_I4_6:
- case CEE_LDC_I4_7:
- case CEE_LDC_I4_8:
- SIMPLE_OP(td, (*td.ip - CEE_LDC_I4_0) + MINT_LDC_I4_0);
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
- break;
- case CEE_LDC_I4_S:
- ADD_CODE(&td, MINT_LDC_I4_S);
- ADD_CODE(&td, ((gint8 *) td.ip) [1]);
- td.ip += 2;
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
- break;
- case CEE_LDC_I4:
- i32 = read32 (td.ip + 1);
- ADD_CODE(&td, MINT_LDC_I4);
- WRITE32(&td, &i32);
- td.ip += 5;
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
- break;
- case CEE_LDC_I8: {
- gint64 val = read64 (td.ip + 1);
- ADD_CODE(&td, MINT_LDC_I8);
- WRITE64(&td, &val);
- td.ip += 9;
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I8);
- break;
- }
- case CEE_LDC_R4: {
- float val;
- readr4 (td.ip + 1, &val);
- ADD_CODE(&td, MINT_LDC_R4);
- WRITE32(&td, &val);
- td.ip += 5;
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_R8);
- break;
- }
- case CEE_LDC_R8: {
- double val;
- readr8 (td.ip + 1, &val);
- ADD_CODE(&td, MINT_LDC_R8);
- WRITE64(&td, &val);
- td.ip += 9;
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_R8);
- break;
- }
- case CEE_DUP: {
- int type = td.sp [-1].type;
- MonoClass *klass = td.sp [-1].klass;
- if (td.sp [-1].type == STACK_TYPE_VT) {
- gint32 size = mono_class_value_size (klass, NULL);
- PUSH_VT(&td, size);
- ADD_CODE(&td, MINT_DUP_VT);
- WRITE32(&td, &size);
- td.ip ++;
- } else
- SIMPLE_OP(td, MINT_DUP);
- PUSH_TYPE(&td, type, klass);
- break;
- }
- case CEE_POP:
- CHECK_STACK(&td, 1);
- SIMPLE_OP(td, MINT_POP);
- if (td.sp [-1].type == STACK_TYPE_VT) {
- int size = mono_class_value_size (td.sp [-1].klass, NULL);
- size = (size + 7) & ~7;
- ADD_CODE(&td, MINT_VTRESULT);
- ADD_CODE(&td, 0);
- WRITE32(&td, &size);
- td.vt_sp -= size;
- }
- --td.sp;
- break;
- case CEE_JMP: {
- MonoMethod *m;
- if (td.sp > td.stack)
- g_warning ("CEE_JMP: stack must be empty");
- token = read32 (td.ip + 1);
- m = mono_get_method_full (image, token, NULL, generic_context);
- ADD_CODE(&td, MINT_JMP);
- ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (m)));
- td.ip += 5;
- break;
- }
- case CEE_CALLVIRT: /* Fall through */
- case CEE_CALLI: /* Fall through */
- case CEE_CALL: {
- MonoMethod *m;
- MonoMethodSignature *csignature;
- int virtual = *td.ip == CEE_CALLVIRT;
- int calli = *td.ip == CEE_CALLI;
- int i;
- guint32 vt_stack_used = 0;
- guint32 vt_res_size = 0;
- int op = -1;
- int native = 0;
- int is_void = 0;
-
- token = read32 (td.ip + 1);
- if (calli) {
- CHECK_STACK(&td, 1);
- native = (method->wrapper_type != MONO_WRAPPER_DELEGATE_INVOKE && td.sp [-1].type == STACK_TYPE_I);
- --td.sp;
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- csignature = (MonoMethodSignature *)mono_method_get_wrapper_data (method, token);
- else
- csignature = mono_metadata_parse_signature (image, token);
- m = NULL;
- } else {
- if (method->wrapper_type == MONO_WRAPPER_NONE)
- m = mono_get_method_full (image, token, NULL, generic_context);
- else
- m = (MonoMethod *)mono_method_get_wrapper_data (method, token);
- csignature = mono_method_signature (m);
- if (m->klass == mono_defaults.string_class) {
- if (m->name [0] == 'g') {
- if (strcmp (m->name, "get_Chars") == 0)
- op = MINT_GETCHR;
- else if (strcmp (m->name, "get_Length") == 0)
- op = MINT_STRLEN;
- }
- } else if (m->klass == mono_defaults.array_class) {
- if (strcmp (m->name, "get_Rank") == 0)
- op = MINT_ARRAY_RANK;
- else if (strcmp (m->name, "get_Length") == 0)
- op = MINT_LDLEN;
- }
- }
- CHECK_STACK(&td, csignature->param_count + csignature->hasthis);
- if (!calli && (!virtual || (m->flags & METHOD_ATTRIBUTE_VIRTUAL) == 0) &&
- (m->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 &&
- (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) == 0) {
- int called_inited = mono_class_vtable (domain, m->klass)->initialized;
- MonoMethodHeader *mheader = mono_method_get_header (m);
-
- if (/*mono_metadata_signature_equal (method->signature, m->signature) */ method == m && *(td.ip + 5) == CEE_RET) {
- int offset;
- if (mono_interp_traceopt)
- g_print ("Optimize tail call of %s.%s\n", m->klass->name, m->name);
- for (i = csignature->param_count - 1; i >= 0; --i)
- store_arg (&td, i + csignature->hasthis);
-
- if (csignature->hasthis) {
- ADD_CODE(&td, MINT_STTHIS);
- --td.sp;
- }
- ADD_CODE(&td, MINT_BR_S);
- offset = body_start_offset - ((td.new_ip - 1) - td.new_code);
- ADD_CODE(&td, offset);
- if (!is_bb_start [td.ip + 5 - td.il_code])
- ++td.ip; /* gobble the CEE_RET if it isn't branched to */
- td.ip += 5;
- break;
- } else {
- /* mheader might not exist if this is a delegate invoc, etc */
- if (mheader && *mheader->code == CEE_RET && called_inited) {
- if (mono_interp_traceopt)
- g_print ("Inline (empty) call of %s.%s\n", m->klass->name, m->name);
- for (i = 0; i < csignature->param_count; i++)
- ADD_CODE(&td, MINT_POP); /*FIX: vt */
- if (csignature->hasthis) {
- if (virtual)
- ADD_CODE(&td, MINT_CKNULL);
- ADD_CODE(&td, MINT_POP);
- }
- td.sp -= csignature->param_count + csignature->hasthis;
- td.ip += 5;
- break;
- }
- }
- }
- if (method->wrapper_type == MONO_WRAPPER_NONE && m != NULL) {
- if (m->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
- m = mono_marshal_get_native_wrapper (m);
- if (!virtual && m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
- m = mono_marshal_get_synchronized_wrapper (m);
- }
- g_assert (csignature->call_convention == MONO_CALL_DEFAULT || csignature->call_convention == MONO_CALL_C);
- td.sp -= csignature->param_count + csignature->hasthis;
- for (i = 0; i < csignature->param_count; ++i) {
- if (td.sp [i + csignature->hasthis].type == STACK_TYPE_VT) {
- gint32 size;
- if (csignature->pinvoke && method->wrapper_type != MONO_WRAPPER_NONE)
- size = mono_class_native_size (csignature->params [i]->data.klass, NULL);
- else
- size = mono_class_value_size (csignature->params [i]->data.klass, NULL);
- size = (size + 7) & ~7;
- vt_stack_used += size;
- }
- }
-
- /* need to handle typedbyref ... */
- if (csignature->ret->type != MONO_TYPE_VOID) {
- int mt = mint_type(csignature->ret);
- MonoClass *klass = NULL;
- if (mt == MINT_TYPE_VT) {
- if (csignature->pinvoke && method->wrapper_type != MONO_WRAPPER_NONE)
- vt_res_size = mono_class_native_size (csignature->ret->data.klass, NULL);
- else
- vt_res_size = mono_class_value_size (csignature->ret->data.klass, NULL);
- PUSH_VT(&td, vt_res_size);
- klass = csignature->ret->data.klass;
- } else if (mt == MINT_TYPE_O)
- klass = mono_class_from_mono_type (csignature->ret);
- PUSH_TYPE(&td, stack_type[mt], klass);
- } else
- is_void = TRUE;
-
- if (op >= 0) {
- ADD_CODE(&td, op);
-#if SIZEOF_VOID_P == 8
- if (op == MINT_LDLEN)
- ADD_CODE(&td, MINT_CONV_I4_I8);
-#endif
- } else {
- if (calli)
- ADD_CODE(&td, native ? MINT_CALLI_NAT : MINT_CALLI);
- else if (virtual)
- ADD_CODE(&td, is_void ? MINT_VCALLVIRT : MINT_CALLVIRT);
- else
- ADD_CODE(&td, is_void ? MINT_VCALL : MINT_CALL);
- ADD_CODE(&td, get_data_item_index (&td, calli? (void *)csignature : (void *)mono_interp_get_runtime_method (m)));
- }
- td.ip += 5;
- if (vt_stack_used != 0 || vt_res_size != 0) {
- ADD_CODE(&td, MINT_VTRESULT);
- ADD_CODE(&td, vt_res_size);
- WRITE32(&td, &vt_stack_used);
- td.vt_sp -= vt_stack_used;
- }
- break;
- }
- case CEE_RET: {
- int vt_size = 0;
- if (signature->ret->type != MONO_TYPE_VOID) {
- --td.sp;
- if (mint_type(signature->ret) == MINT_TYPE_VT) {
- vt_size = mono_class_value_size (signature->ret->data.klass, NULL);
- vt_size = (vt_size + 7) & ~7;
- }
- }
- if (td.sp > td.stack)
- g_warning ("%s.%s: CEE_RET: more values on stack: %d", td.method->klass->name, td.method->name, td.sp - td.stack);
- if (td.vt_sp != vt_size)
- g_warning ("%s.%s: CEE_RET: value type stack: %d", td.method->klass->name, td.method->name, td.vt_sp);
- if (vt_size == 0)
- SIMPLE_OP(td, signature->ret->type == MONO_TYPE_VOID ? MINT_RET_VOID : MINT_RET);
- else {
- ADD_CODE(&td, MINT_RET_VT);
- WRITE32(&td, &vt_size);
- ++td.ip;
- }
- generating_code = 0;
- break;
- }
- case CEE_BR:
- handle_branch (&td, MINT_BR_S, MINT_BR, 5 + read32 (td.ip + 1));
- td.ip += 5;
- generating_code = 0;
- break;
- case CEE_BR_S:
- handle_branch (&td, MINT_BR_S, MINT_BR, 2 + (gint8)td.ip [1]);
- td.ip += 2;
- generating_code = 0;
- break;
- case CEE_BRFALSE:
- one_arg_branch (&td, MINT_BRFALSE_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BRFALSE_S:
- one_arg_branch (&td, MINT_BRFALSE_I4, 2 + (gint8)td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BRTRUE:
- one_arg_branch (&td, MINT_BRTRUE_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BRTRUE_S:
- one_arg_branch (&td, MINT_BRTRUE_I4, 2 + (gint8)td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BEQ:
- two_arg_branch (&td, MINT_BEQ_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BEQ_S:
- two_arg_branch (&td, MINT_BEQ_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BGE:
- two_arg_branch (&td, MINT_BGE_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BGE_S:
- two_arg_branch (&td, MINT_BGE_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BGT:
- two_arg_branch (&td, MINT_BGT_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BGT_S:
- two_arg_branch (&td, MINT_BGT_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BLT:
- two_arg_branch (&td, MINT_BLT_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BLT_S:
- two_arg_branch (&td, MINT_BLT_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BLE:
- two_arg_branch (&td, MINT_BLE_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BLE_S:
- two_arg_branch (&td, MINT_BLE_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BNE_UN:
- two_arg_branch (&td, MINT_BNE_UN_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BNE_UN_S:
- two_arg_branch (&td, MINT_BNE_UN_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BGE_UN:
- two_arg_branch (&td, MINT_BGE_UN_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BGE_UN_S:
- two_arg_branch (&td, MINT_BGE_UN_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BGT_UN:
- two_arg_branch (&td, MINT_BGT_UN_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BGT_UN_S:
- two_arg_branch (&td, MINT_BGT_UN_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BLE_UN:
- two_arg_branch (&td, MINT_BLE_UN_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BLE_UN_S:
- two_arg_branch (&td, MINT_BLE_UN_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_BLT_UN:
- two_arg_branch (&td, MINT_BLT_UN_I4, 5 + read32 (td.ip + 1));
- td.ip += 5;
- break;
- case CEE_BLT_UN_S:
- two_arg_branch (&td, MINT_BLT_UN_I4, 2 + (gint8) td.ip [1]);
- td.ip += 2;
- break;
- case CEE_SWITCH: {
- guint32 n;
- const unsigned char *next_ip;
- const unsigned char *base_ip = td.ip;
- unsigned short *next_new_ip;
- ++td.ip;
- n = read32 (td.ip);
- ADD_CODE(&td, MINT_SWITCH);
- ADD_CODE(&td, * (unsigned short *)(&n));
- ADD_CODE(&td, * ((unsigned short *)&n + 1));
- td.ip += 4;
- next_ip = td.ip + n * 4;
- next_new_ip = td.new_ip + n * 2;
- for (i = 0; i < n; i++) {
- offset = read32 (td.ip);
- target = next_ip - td.il_code + offset;
- if (offset < 0)
- target = td.in_offsets [target] - (next_new_ip - td.new_code);
- else {
- int prev = td.forward_refs [target];
- td.forward_refs [td.ip - td.il_code] = prev;
- td.forward_refs [target] = td.ip - td.il_code;
- td.in_offsets [td.ip - td.il_code] = - (base_ip - td.il_code);
- }
- ADD_CODE(&td, * (unsigned short *)(&target));
- ADD_CODE(&td, * ((unsigned short *)&target + 1));
- td.ip += 4;
- }
- --td.sp;
- break;
- }
- case CEE_LDIND_I1:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_I1);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDIND_U1:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_U1);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDIND_I2:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_I2);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDIND_U2:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_U2);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDIND_I4:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_I4);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDIND_U4:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_U4);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDIND_I8:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_I8);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
- break;
- case CEE_LDIND_I:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_I);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
- break;
- case CEE_LDIND_R4:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_R4);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
- break;
- case CEE_LDIND_R8:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_R8);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
- break;
- case CEE_LDIND_REF:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDIND_REF);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_O);
- break;
- case CEE_STIND_REF:
- CHECK_STACK (&td, 2);
- SIMPLE_OP (td, MINT_STIND_REF);
- td.sp -= 2;
- break;
- case CEE_STIND_I1:
- CHECK_STACK (&td, 2);
- SIMPLE_OP (td, MINT_STIND_I1);
- td.sp -= 2;
- break;
- case CEE_STIND_I2:
- CHECK_STACK (&td, 2);
- SIMPLE_OP (td, MINT_STIND_I2);
- td.sp -= 2;
- break;
- case CEE_STIND_I4:
- CHECK_STACK (&td, 2);
- SIMPLE_OP (td, MINT_STIND_I4);
- td.sp -= 2;
- break;
- case CEE_STIND_I:
- CHECK_STACK (&td, 2);
- SIMPLE_OP (td, MINT_STIND_I);
- td.sp -= 2;
- break;
- case CEE_STIND_I8:
- CHECK_STACK (&td, 2);
- SIMPLE_OP (td, MINT_STIND_I8);
- td.sp -= 2;
- break;
- case CEE_STIND_R4:
- CHECK_STACK (&td, 2);
- SIMPLE_OP (td, MINT_STIND_R4);
- td.sp -= 2;
- break;
- case CEE_STIND_R8:
- CHECK_STACK (&td, 2);
- SIMPLE_OP (td, MINT_STIND_R8);
- td.sp -= 2;
- break;
- case CEE_ADD:
- binary_arith_op(&td, MINT_ADD_I4);
- ++td.ip;
- break;
- case CEE_SUB:
- binary_arith_op(&td, MINT_SUB_I4);
- ++td.ip;
- break;
- case CEE_MUL:
- binary_arith_op(&td, MINT_MUL_I4);
- ++td.ip;
- break;
- case CEE_DIV:
- binary_arith_op(&td, MINT_DIV_I4);
- ++td.ip;
- break;
- case CEE_DIV_UN:
- binary_arith_op(&td, MINT_DIV_UN_I4);
- ++td.ip;
- break;
- case CEE_REM:
- binary_int_op (&td, MINT_REM_I4);
- ++td.ip;
- break;
- case CEE_REM_UN:
- binary_int_op (&td, MINT_REM_UN_I4);
- ++td.ip;
- break;
- case CEE_AND:
- binary_int_op (&td, MINT_AND_I4);
- ++td.ip;
- break;
- case CEE_OR:
- binary_int_op (&td, MINT_OR_I4);
- ++td.ip;
- break;
- case CEE_XOR:
- binary_int_op (&td, MINT_XOR_I4);
- ++td.ip;
- break;
- case CEE_SHL:
- shift_op (&td, MINT_SHL_I4);
- ++td.ip;
- break;
- case CEE_SHR:
- shift_op (&td, MINT_SHR_I4);
- ++td.ip;
- break;
- case CEE_SHR_UN:
- shift_op (&td, MINT_SHR_UN_I4);
- ++td.ip;
- break;
- case CEE_NEG:
- unary_arith_op (&td, MINT_NEG_I4);
- ++td.ip;
- break;
- case CEE_NOT:
- unary_arith_op (&td, MINT_NOT_I4);
- ++td.ip;
- break;
- case CEE_CONV_U1:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_U1_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_U1_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_U1_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_I1:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_I1_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_I1_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_I1_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_U2:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_U2_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_U2_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_U2_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_I2:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_I2_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_I2_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_I2_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_U:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
-#if SIZEOF_VOID_P == 4
- ADD_CODE(&td, MINT_CONV_U4_R8);
-#else
- ADD_CODE(&td, MINT_CONV_U8_R8);
-#endif
- break;
- case STACK_TYPE_I4:
-#if SIZEOF_VOID_P == 8
- ADD_CODE(&td, MINT_CONV_U8_I4);
-#endif
- break;
- case STACK_TYPE_I8:
-#if SIZEOF_VOID_P == 4
- ADD_CODE(&td, MINT_CONV_U4_I8);
-#endif
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
- break;
- case CEE_CONV_I:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
-#if SIZEOF_VOID_P == 8
- ADD_CODE(&td, MINT_CONV_I8_R8);
-#else
- ADD_CODE(&td, MINT_CONV_I4_R8);
-#endif
- break;
- case STACK_TYPE_I4:
-#if SIZEOF_VOID_P == 8
- ADD_CODE(&td, MINT_CONV_I8_I4);
-#endif
- break;
- case STACK_TYPE_O:
- break;
- case STACK_TYPE_MP:
- break;
- case STACK_TYPE_I8:
-#if SIZEOF_VOID_P == 4
- ADD_CODE(&td, MINT_CONV_I4_I8);
-#endif
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
- break;
- case CEE_CONV_U4:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_U4_R8);
- break;
- case STACK_TYPE_I4:
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_U4_I8);
- break;
- case STACK_TYPE_MP:
-#if SIZEOF_VOID_P == 8
- ADD_CODE(&td, MINT_CONV_U4_I8);
-#endif
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_I4:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_I4_R8);
- break;
- case STACK_TYPE_I4:
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_I4_I8);
- break;
- case STACK_TYPE_MP:
-#if SIZEOF_VOID_P == 8
- ADD_CODE(&td, MINT_CONV_I4_I8);
-#endif
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_I8:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_I8_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_I8_I4);
- break;
- case STACK_TYPE_I8:
- break;
- case STACK_TYPE_MP:
-#if SIZEOF_VOID_P == 4
- ADD_CODE(&td, MINT_CONV_I8_I4);
-#endif
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
- break;
- case CEE_CONV_R4:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_R4_R8);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_R4_I8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_R4_I4);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
- break;
- case CEE_CONV_R8:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_R8_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_R8_I8);
- break;
- case STACK_TYPE_R8:
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
- break;
- case CEE_CONV_U8:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_U8_I4);
- break;
- case STACK_TYPE_I8:
- break;
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_U8_R8);
- break;
- case STACK_TYPE_MP:
-#if SIZEOF_VOID_P == 4
- ADD_CODE(&td, MINT_CONV_U8_I4);
-#endif
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
- break;
-#if 0
- case CEE_CPOBJ: {
- MonoClass *vtklass;
- ++ip;
- vtklass = mono_class_get_full (image, read32 (ip), generic_context);
- ip += 4;
- sp -= 2;
- memcpy (sp [0].data.p, sp [1].data.p, mono_class_value_size (vtklass, NULL));
- break;
- }
-#endif
- case CEE_LDOBJ: {
- int size;
- CHECK_STACK (&td, 1);
-
- token = read32 (td.ip + 1);
-
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
- else
- klass = mono_class_get_full (image, token, generic_context);
-
- ADD_CODE(&td, MINT_LDOBJ);
- ADD_CODE(&td, get_data_item_index(&td, klass));
- if (klass->byval_arg.type == MONO_TYPE_VALUETYPE && !klass->byval_arg.data.klass->enumtype) {
- size = mono_class_value_size (klass, NULL);
- PUSH_VT(&td, size);
- }
- td.ip += 5;
- SET_TYPE(td.sp - 1, stack_type[mint_type(&klass->byval_arg)], klass);
- break;
- }
- case CEE_LDSTR: {
- MonoString *s;
- token = mono_metadata_token_index (read32 (td.ip + 1));
- td.ip += 5;
- if (method->wrapper_type != MONO_WRAPPER_NONE) {
- s = mono_string_new_wrapper(
- mono_method_get_wrapper_data (method, token));
- }
- else
- s = mono_ldstr (domain, image, token);
- ADD_CODE(&td, MINT_LDSTR);
- ADD_CODE(&td, get_data_item_index (&td, s));
- PUSH_TYPE(&td, STACK_TYPE_O, mono_defaults.string_class);
- break;
- }
- case CEE_NEWOBJ: {
- MonoMethod *m;
- MonoMethodSignature *csignature;
- guint32 vt_stack_used = 0;
- guint32 vt_res_size = 0;
-
- td.ip++;
- token = read32 (td.ip);
- td.ip += 4;
-
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- m = (MonoMethod *)mono_method_get_wrapper_data (method, token);
- else
- m = mono_get_method_full (image, token, NULL, generic_context);
-
- csignature = mono_method_signature (m);
- klass = m->klass;
- td.sp -= csignature->param_count;
- ADD_CODE(&td, MINT_NEWOBJ);
- ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (m)));
- if (klass->byval_arg.type == MONO_TYPE_VALUETYPE) {
- vt_res_size = mono_class_value_size (klass, NULL);
- PUSH_VT(&td, vt_res_size);
- }
- for (i = 0; i < csignature->param_count; ++i) {
- int mt = mint_type(csignature->params [i]);
- if (mt == MINT_TYPE_VT) {
- gint32 size = mono_class_value_size (csignature->params [i]->data.klass, NULL);
- size = (size + 7) & ~7;
- vt_stack_used += size;
- }
- }
- if (vt_stack_used != 0 || vt_res_size != 0) {
- ADD_CODE(&td, MINT_VTRESULT);
- ADD_CODE(&td, vt_res_size);
- WRITE32(&td, &vt_stack_used);
- td.vt_sp -= vt_stack_used;
- }
- PUSH_TYPE(&td, stack_type [mint_type (&klass->byval_arg)], klass);
- break;
- }
- case CEE_CASTCLASS:
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
- klass = mono_class_get_full (image, token, generic_context);
- ADD_CODE(&td, MINT_CASTCLASS);
- ADD_CODE(&td, get_data_item_index (&td, klass));
- td.sp [-1].klass = klass;
- td.ip += 5;
- break;
- case CEE_ISINST:
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
- klass = mono_class_get_full (image, token, generic_context);
- ADD_CODE(&td, MINT_ISINST);
- ADD_CODE(&td, get_data_item_index (&td, klass));
- td.ip += 5;
- break;
- case CEE_CONV_R_UN:
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_R_UN_I8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_R_UN_I4);
- break;
- default:
- g_assert_not_reached ();
- }
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
- ++td.ip;
- break;
- case CEE_UNBOX:
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
-
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
- else
- klass = mono_class_get_full (image, token, generic_context);
-
- ADD_CODE(&td, MINT_UNBOX);
- ADD_CODE(&td, get_data_item_index (&td, klass));
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
- td.ip += 5;
- break;
- case CEE_THROW:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_THROW);
- --td.sp;
- generating_code = 0;
- break;
- case CEE_LDFLDA:
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
- field = mono_field_from_token (image, token, &klass, generic_context);
- mono_class_init (klass);
- mt = mint_type(field->type);
- ADD_CODE(&td, MINT_LDFLDA);
- ADD_CODE(&td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
- td.ip += 5;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
- break;
- case CEE_LDFLD: {
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
- field = mono_field_from_token (image, token, &klass, generic_context);
- mono_class_init (klass);
- mt = mint_type(field->type);
- if (klass->marshalbyref) {
- ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_LDRMFLD_VT : MINT_LDRMFLD);
- ADD_CODE(&td, get_data_item_index (&td, field));
- } else {
- ADD_CODE(&td, MINT_LDFLD_I1 + mt - MINT_TYPE_I1);
- ADD_CODE(&td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
- }
- klass = NULL;
- if (mt == MINT_TYPE_VT) {
- int size = mono_class_value_size (field->type->data.klass, NULL);
- PUSH_VT(&td, size);
- WRITE32(&td, &size);
- klass = field->type->data.klass;
- } else if (mt == MINT_TYPE_O)
- klass = mono_class_from_mono_type (field->type);
- td.ip += 5;
- SET_TYPE(td.sp - 1, stack_type [mt], klass);
- break;
- }
- case CEE_STFLD:
- CHECK_STACK (&td, 2);
- token = read32 (td.ip + 1);
- field = mono_field_from_token (image, token, &klass, generic_context);
- mono_class_init (klass);
- mt = mint_type(field->type);
- if (klass->marshalbyref) {
- ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_STRMFLD_VT : MINT_STRMFLD);
- ADD_CODE(&td, get_data_item_index (&td, field));
- } else {
- ADD_CODE(&td, MINT_STFLD_I1 + mt - MINT_TYPE_I1);
- ADD_CODE(&td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
- }
- if (mt == MINT_TYPE_VT) {
- int size = mono_class_value_size (field->type->data.klass, NULL);
- POP_VT(&td, size);
- WRITE32(&td, &size);
- }
- td.ip += 5;
- td.sp -= 2;
- break;
- case CEE_LDSFLDA:
- token = read32 (td.ip + 1);
- field = mono_field_from_token (image, token, &klass, generic_context);
- ADD_CODE(&td, MINT_LDSFLDA);
- ADD_CODE(&td, get_data_item_index (&td, field));
- td.ip += 5;
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
- break;
- case CEE_LDSFLD:
- token = read32 (td.ip + 1);
- field = mono_field_from_token (image, token, &klass, generic_context);
- mt = mint_type(field->type);
- ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_LDSFLD_VT : MINT_LDSFLD);
- ADD_CODE(&td, get_data_item_index (&td, field));
- klass = NULL;
- if (mt == MINT_TYPE_VT) {
- int size = mono_class_value_size (field->type->data.klass, NULL);
- PUSH_VT(&td, size);
- WRITE32(&td, &size);
- klass = field->type->data.klass;
- } else {
- if (mt == MINT_TYPE_O)
- klass = mono_class_from_mono_type (field->type);
- if (!domain->special_static_fields || !g_hash_table_lookup (domain->special_static_fields, field)) {
- if (mt == MINT_TYPE_O)
- td.new_ip [-2] = MINT_LDSFLD_O;
- else if (mt == MINT_TYPE_I4)
- td.new_ip [-2] = MINT_LDSFLD_I4;
- }
- ADD_CODE(&td, get_data_item_index (&td, mono_class_vtable (domain, field->parent)));
- }
- td.ip += 5;
- PUSH_TYPE(&td, stack_type [mt], klass);
- break;
- case CEE_STSFLD:
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
- field = mono_field_from_token (image, token, &klass, generic_context);
- mt = mint_type(field->type);
- ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_STSFLD_VT : MINT_STSFLD);
- ADD_CODE(&td, get_data_item_index (&td, field));
- if (mt == MINT_TYPE_VT) {
- int size = mono_class_value_size (field->type->data.klass, NULL);
- POP_VT(&td, size);
- WRITE32(&td, &size);
- }
- td.ip += 5;
- --td.sp;
- break;
- case CEE_STOBJ: {
- int size;
- token = read32 (td.ip + 1);
-
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
- else
- klass = mono_class_get_full (image, token, generic_context);
-
- ADD_CODE(&td, td.sp [-1].type == STACK_TYPE_VT ? MINT_STOBJ_VT : MINT_STOBJ);
- ADD_CODE(&td, get_data_item_index (&td, klass));
- if (td.sp [-1].type == STACK_TYPE_VT) {
- size = mono_class_value_size (klass, NULL);
- size = (size + 7) & ~7;
- td.vt_sp -= size;
- }
- td.ip += 5;
- td.sp -= 2;
- break;
- }
- case CEE_CONV_OVF_I_UN:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
-#if SIZEOF_VOID_P == 8
- ADD_CODE(&td, MINT_CONV_OVF_I8_UN_R8);
-#else
- ADD_CODE(&td, MINT_CONV_OVF_I4_UN_R8);
-#endif
- break;
- case STACK_TYPE_I8:
- /*FIX*/
- break;
- case STACK_TYPE_I4:
-#if SIZEOF_VOID_P == 8
- ADD_CODE(&td, MINT_CONV_I8_U4);
-#endif
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
- ++td.ip;
- break;
- case CEE_CONV_OVF_I8_UN:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_I8_UN_R8);
- break;
- case STACK_TYPE_I8:
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_I8_U4);
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
- ++td.ip;
- break;
- case CEE_BOX: {
- int size;
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
- else
- klass = mono_class_get_full (image, token, generic_context);
- g_assert (klass->valuetype);
- if (klass->byval_arg.type == MONO_TYPE_VALUETYPE && !klass->enumtype) {
- size = mono_class_value_size (klass, NULL);
- size = (size + 7) & ~7;
- td.vt_sp -= size;
- }
- ADD_CODE(&td, MINT_BOX);
- ADD_CODE(&td, get_data_item_index (&td, klass));
- SET_TYPE(td.sp - 1, STACK_TYPE_O, klass);
- td.ip += 5;
- break;
- }
- case CEE_NEWARR:
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
-
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
- else
- klass = mono_class_get_full (image, token, generic_context);
-
- ADD_CODE(&td, MINT_NEWARR);
- ADD_CODE(&td, get_data_item_index (&td, klass));
- SET_TYPE(td.sp - 1, STACK_TYPE_O, klass);
- td.ip += 5;
- break;
- case CEE_LDLEN:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_LDLEN);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
- break;
- case CEE_LDELEMA:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- token = read32 (td.ip + 1);
-
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
- else
- klass = mono_class_get_full (image, token, generic_context);
-
- ADD_CODE(&td, MINT_LDELEMA);
- ADD_CODE(&td, get_data_item_index (&td, klass));
- td.ip += 5;
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
- break;
- case CEE_LDELEM_I1:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_I1);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDELEM_U1:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_U1);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDELEM_I2:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_I2);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDELEM_U2:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_U2);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDELEM_I4:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_I4);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDELEM_U4:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_U4);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_LDELEM_I8:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_I8);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
- break;
- case CEE_LDELEM_I:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_I);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
- break;
- case CEE_LDELEM_R4:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_R4);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
- break;
- case CEE_LDELEM_R8:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_R8);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
- break;
- case CEE_LDELEM_REF:
- CHECK_STACK (&td, 2);
- ENSURE_I4 (&td, 1);
- SIMPLE_OP (td, MINT_LDELEM_REF);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_O);
- break;
- case CEE_STELEM_I:
- CHECK_STACK (&td, 3);
- ENSURE_I4 (&td, 2);
- SIMPLE_OP (td, MINT_STELEM_I);
- td.sp -= 3;
- break;
- case CEE_STELEM_I1:
- CHECK_STACK (&td, 3);
- ENSURE_I4 (&td, 2);
- SIMPLE_OP (td, MINT_STELEM_I1);
- td.sp -= 3;
- break;
- case CEE_STELEM_I2:
- CHECK_STACK (&td, 3);
- ENSURE_I4 (&td, 2);
- SIMPLE_OP (td, MINT_STELEM_I2);
- td.sp -= 3;
- break;
- case CEE_STELEM_I4:
- CHECK_STACK (&td, 3);
- ENSURE_I4 (&td, 2);
- SIMPLE_OP (td, MINT_STELEM_I4);
- td.sp -= 3;
- break;
- case CEE_STELEM_I8:
- CHECK_STACK (&td, 3);
- ENSURE_I4 (&td, 2);
- SIMPLE_OP (td, MINT_STELEM_I8);
- td.sp -= 3;
- break;
- case CEE_STELEM_R4:
- CHECK_STACK (&td, 3);
- ENSURE_I4 (&td, 2);
- SIMPLE_OP (td, MINT_STELEM_R4);
- td.sp -= 3;
- break;
- case CEE_STELEM_R8:
- CHECK_STACK (&td, 3);
- ENSURE_I4 (&td, 2);
- SIMPLE_OP (td, MINT_STELEM_R8);
- td.sp -= 3;
- break;
- case CEE_STELEM_REF:
- CHECK_STACK (&td, 3);
- ENSURE_I4 (&td, 2);
- SIMPLE_OP (td, MINT_STELEM_REF);
- td.sp -= 3;
- break;
-#if 0
- case CEE_LDELEM:
- case CEE_STELEM:
- case CEE_UNBOX_ANY:
-
- case CEE_CONV_OVF_U1:
-
- case CEE_CONV_OVF_I8:
-
-#if SIZEOF_VOID_P == 8
- case CEE_CONV_OVF_U:
-#endif
- case CEE_REFANYVAL: ves_abort(); break;
-#endif
- case CEE_CKFINITE:
- CHECK_STACK (&td, 1);
- SIMPLE_OP (td, MINT_CKFINITE);
- break;
- case CEE_CONV_OVF_I1:
- case CEE_CONV_OVF_I1_UN:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_I1_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_OVF_I1_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_OVF_I1_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_OVF_U1:
- case CEE_CONV_OVF_U1_UN:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_U1_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_OVF_U1_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_OVF_U1_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_OVF_I2:
- case CEE_CONV_OVF_I2_UN:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_I2_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_OVF_I2_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_OVF_I2_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
- case CEE_CONV_OVF_U2_UN:
- case CEE_CONV_OVF_U2:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_U2_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_OVF_U2_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_OVF_U2_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
-#if SIZEOF_VOID_P == 4
- case CEE_CONV_OVF_I:
-#endif
- case CEE_CONV_OVF_I4:
- case CEE_CONV_OVF_I4_UN:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_I4_R8);
- break;
- case STACK_TYPE_I4:
- if (*td.ip == CEE_CONV_OVF_I4_UN)
- ADD_CODE(&td, MINT_CONV_OVF_I4_U4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_OVF_I4_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
-#if SIZEOF_VOID_P == 4
- case CEE_CONV_OVF_U:
-#endif
- case CEE_CONV_OVF_U4:
- case CEE_CONV_OVF_U4_UN:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_U4_R8);
- break;
- case STACK_TYPE_I4:
- if (*td.ip != CEE_CONV_OVF_U4_UN)
- ADD_CODE(&td, MINT_CONV_OVF_U4_I4);
- break;
- case STACK_TYPE_I8:
- ADD_CODE(&td, MINT_CONV_OVF_U4_I8);
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- break;
-#if SIZEOF_VOID_P == 8
- case CEE_CONV_OVF_I:
-#endif
- case CEE_CONV_OVF_I8:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_I8_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_I8_I4);
- break;
- case STACK_TYPE_I8:
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
- break;
-#if SIZEOF_VOID_P == 8
- case CEE_CONV_OVF_U:
-#endif
- case CEE_CONV_OVF_U8:
- CHECK_STACK (&td, 1);
- switch (td.sp [-1].type) {
- case STACK_TYPE_R8:
- ADD_CODE(&td, MINT_CONV_OVF_U8_R8);
- break;
- case STACK_TYPE_I4:
- ADD_CODE(&td, MINT_CONV_OVF_U8_I4);
- break;
- case STACK_TYPE_I8:
- break;
- default:
- g_assert_not_reached ();
- }
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
- break;
- case CEE_LDTOKEN: {
- int size;
- gpointer handle;
- token = read32 (td.ip + 1);
- handle = mono_ldtoken (image, token, &klass, generic_context);
- mt = mint_type(&klass->byval_arg);
- g_assert (mt == MINT_TYPE_VT);
- size = mono_class_value_size (klass, NULL);
- g_assert (size == sizeof(gpointer));
- PUSH_VT(&td, sizeof(gpointer));
- ADD_CODE(&td, MINT_LDTOKEN);
- ADD_CODE(&td, get_data_item_index (&td, handle));
- PUSH_SIMPLE_TYPE(&td, stack_type [mt]);
- td.ip += 5;
- break;
- }
- case CEE_ADD_OVF:
- binary_arith_op(&td, MINT_ADD_OVF_I4);
- ++td.ip;
- break;
- case CEE_ADD_OVF_UN:
- binary_arith_op(&td, MINT_ADD_OVF_UN_I4);
- ++td.ip;
- break;
- case CEE_MUL_OVF:
- binary_arith_op(&td, MINT_MUL_OVF_I4);
- ++td.ip;
- break;
- case CEE_MUL_OVF_UN:
- binary_arith_op(&td, MINT_MUL_OVF_UN_I4);
- ++td.ip;
- break;
- case CEE_SUB_OVF:
- binary_arith_op(&td, MINT_SUB_OVF_I4);
- ++td.ip;
- break;
- case CEE_SUB_OVF_UN:
- binary_arith_op(&td, MINT_SUB_OVF_UN_I4);
- ++td.ip;
- break;
- case CEE_ENDFINALLY:
- SIMPLE_OP (td, MINT_ENDFINALLY);
- generating_code = 0;
- break;
- case CEE_LEAVE:
- td.sp = td.stack;
- handle_branch (&td, MINT_LEAVE_S, MINT_LEAVE, 5 + read32 (td.ip + 1));
- td.ip += 5;
- generating_code = 0;
- break;
- case CEE_LEAVE_S:
- td.sp = td.stack;
- handle_branch (&td, MINT_LEAVE_S, MINT_LEAVE, 2 + (gint8)td.ip [1]);
- td.ip += 2;
- generating_code = 0;
- break;
- case CEE_UNUSED41:
- ++td.ip;
- switch (*td.ip) {
- case CEE_MONO_ICALL: {
- guint32 token;
- gpointer func;
- MonoJitICallInfo *info;
-
- token = read32 (td.ip + 1);
- td.ip += 5;
- func = mono_method_get_wrapper_data (method, token);
- info = mono_find_jit_icall_by_addr (func);
- g_assert (info);
-
- CHECK_STACK (&td, info->sig->param_count);
- switch (info->sig->param_count) {
- case 0:
- if (MONO_TYPE_IS_VOID (info->sig->ret))
- ADD_CODE (&td,MINT_ICALL_V_V);
- else
- g_assert_not_reached();
- break;
- case 1:
- if (MONO_TYPE_IS_VOID (info->sig->ret))
- ADD_CODE (&td,MINT_ICALL_P_V);
- else
- ADD_CODE (&td,MINT_ICALL_P_P);
- break;
- case 2:
- if (MONO_TYPE_IS_VOID (info->sig->ret)) {
- if (info->sig->params [1]->type == MONO_TYPE_I4)
- ADD_CODE (&td,MINT_ICALL_PI_V);
- else
- ADD_CODE (&td,MINT_ICALL_PP_V);
- } else {
- if (info->sig->params [1]->type == MONO_TYPE_I4)
- ADD_CODE (&td,MINT_ICALL_PI_P);
- else
- ADD_CODE (&td,MINT_ICALL_PP_P);
- }
- break;
- case 3:
- g_assert (MONO_TYPE_IS_VOID (info->sig->ret));
- if (info->sig->params [2]->type == MONO_TYPE_I4)
- ADD_CODE (&td,MINT_ICALL_PPI_V);
- else
- ADD_CODE (&td,MINT_ICALL_PPP_V);
- break;
- default:
- g_assert_not_reached ();
- }
- if (func == mono_ftnptr_to_delegate)
- func = mono_interp_ftnptr_to_delegate;
- ADD_CODE(&td, get_data_item_index (&td, func));
- td.sp -= info->sig->param_count;
-
- if (!MONO_TYPE_IS_VOID (info->sig->ret)) {
- td.sp ++;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
- }
- break;
- }
- case CEE_MONO_VTADDR: {
- int size;
- CHECK_STACK (&td, 1);
- if (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)
- size = mono_class_native_size(td.sp [-1].klass, NULL);
- else
- size = mono_class_value_size(td.sp [-1].klass, NULL);
- size = (size + 7) & ~7;
- ADD_CODE(&td, MINT_VTRESULT);
- ADD_CODE(&td, 0);
- WRITE32(&td, &size);
- td.vt_sp -= size;
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
- break;
- }
- case CEE_MONO_LDPTR:
- case CEE_MONO_CLASSCONST:
- token = read32 (td.ip + 1);
- td.ip += 5;
- ADD_CODE(&td, MINT_MONO_LDPTR);
- ADD_CODE(&td, get_data_item_index (&td, mono_method_get_wrapper_data (method, token)));
- td.sp [0].type = STACK_TYPE_I;
- ++td.sp;
- break;
- case CEE_MONO_OBJADDR:
- CHECK_STACK (&td, 1);
- ++td.ip;
- td.sp[-1].type = STACK_TYPE_MP;
- /* do nothing? */
- break;
- case CEE_MONO_NEWOBJ:
- token = read32 (td.ip + 1);
- td.ip += 5;
- ADD_CODE(&td, MINT_MONO_NEWOBJ);
- ADD_CODE(&td, get_data_item_index (&td, mono_method_get_wrapper_data (method, token)));
- td.sp [0].type = STACK_TYPE_O;
- ++td.sp;
- break;
- case CEE_MONO_RETOBJ:
- CHECK_STACK (&td, 1);
- token = read32 (td.ip + 1);
- td.ip += 5;
- ADD_CODE(&td, MINT_MONO_RETOBJ);
- td.sp--;
-
- klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
-
- /*stackval_from_data (signature->ret, frame->retval, sp->data.vt, signature->pinvoke);*/
-
- if (td.sp > td.stack)
- g_warning ("CEE_MONO_RETOBJ: more values on stack: %d", td.sp-td.stack);
- break;
- case CEE_MONO_LDNATIVEOBJ:
- token = read32 (td.ip + 1);
- td.ip += 5;
- klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
- g_assert(klass->valuetype);
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
- break;
- case CEE_MONO_SAVE_LMF:
- case CEE_MONO_RESTORE_LMF:
- case CEE_MONO_NOT_TAKEN:
- ++td.ip;
- break;
- default:
- g_error ("transform.c: Unimplemented opcode: 0xF0 %02x at 0x%x\n", *td.ip, td.ip-header->code);
- }
- break;
-#if 0
- case CEE_PREFIX7:
- case CEE_PREFIX6:
- case CEE_PREFIX5:
- case CEE_PREFIX4:
- case CEE_PREFIX3:
- case CEE_PREFIX2:
- case CEE_PREFIXREF: ves_abort(); break;
-#endif
- /*
- * Note: Exceptions thrown when executing a prefixed opcode need
- * to take into account the number of prefix bytes (usually the
- * throw point is just (ip - n_prefix_bytes).
- */
- case CEE_PREFIX1:
- ++td.ip;
- switch (*td.ip) {
-#if 0
- case CEE_ARGLIST: ves_abort(); break;
-#endif
- case CEE_CEQ:
- CHECK_STACK(&td, 2);
- if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
- ADD_CODE(&td, MINT_CEQ_I4 + STACK_TYPE_I - STACK_TYPE_I4);
- else
- ADD_CODE(&td, MINT_CEQ_I4 + td.sp [-1].type - STACK_TYPE_I4);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- ++td.ip;
- break;
- case CEE_CGT:
- CHECK_STACK(&td, 2);
- if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
- ADD_CODE(&td, MINT_CGT_I4 + STACK_TYPE_I - STACK_TYPE_I4);
- else
- ADD_CODE(&td, MINT_CGT_I4 + td.sp [-1].type - STACK_TYPE_I4);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- ++td.ip;
- break;
- case CEE_CGT_UN:
- CHECK_STACK(&td, 2);
- if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
- ADD_CODE(&td, MINT_CGT_UN_I4 + STACK_TYPE_I - STACK_TYPE_I4);
- else
- ADD_CODE(&td, MINT_CGT_UN_I4 + td.sp [-1].type - STACK_TYPE_I4);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- ++td.ip;
- break;
- case CEE_CLT:
- CHECK_STACK(&td, 2);
- if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
- ADD_CODE(&td, MINT_CLT_I4 + STACK_TYPE_I - STACK_TYPE_I4);
- else
- ADD_CODE(&td, MINT_CLT_I4 + td.sp [-1].type - STACK_TYPE_I4);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- ++td.ip;
- break;
- case CEE_CLT_UN:
- CHECK_STACK(&td, 2);
- if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
- ADD_CODE(&td, MINT_CLT_UN_I4 + STACK_TYPE_I - STACK_TYPE_I4);
- else
- ADD_CODE(&td, MINT_CLT_UN_I4 + td.sp [-1].type - STACK_TYPE_I4);
- --td.sp;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
- ++td.ip;
- break;
- case CEE_LDVIRTFTN: /* fallthrough */
- case CEE_LDFTN: {
- MonoMethod *m;
- if (*td.ip == CEE_LDVIRTFTN) {
- CHECK_STACK (&td, 1);
- --td.sp;
- }
- token = read32 (td.ip + 1);
- if (method->wrapper_type != MONO_WRAPPER_NONE)
- m = (MonoMethod *)mono_method_get_wrapper_data (method, token);
- else
- m = mono_get_method_full (image, token, NULL, generic_context);
-
- if (method->wrapper_type == MONO_WRAPPER_NONE && m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
- m = mono_marshal_get_synchronized_wrapper (m);
-
- ADD_CODE(&td, *td.ip == CEE_LDFTN ? MINT_LDFTN : MINT_LDVIRTFTN);
- ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (m)));
- td.ip += 5;
- PUSH_SIMPLE_TYPE (&td, STACK_TYPE_F);
- break;
- }
- case CEE_LDARG:
- load_arg (&td, read16 (td.ip + 1));
- td.ip += 3;
- break;
- case CEE_LDARGA: {
- int n = read16 (td.ip + 1);
- if (n == 0 && signature->hasthis)
- ADD_CODE(&td, MINT_LDTHISA);
- else {
- ADD_CODE(&td, MINT_LDARGA);
- ADD_CODE(&td, td.rtm->arg_offsets [n - signature->hasthis]); /* FIX for large offsets */
- }
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
- td.ip += 3;
- break;
- }
- case CEE_STARG:
- store_arg (&td, read16 (td.ip + 1));
- td.ip += 3;
- break;
- case CEE_LDLOC:
- load_local (&td, read16 (td.ip + 1));
- td.ip += 3;
- break;
- case CEE_LDLOCA:
- ADD_CODE(&td, MINT_LDLOCA_S);
- ADD_CODE(&td, td.rtm->local_offsets [read16 (td.ip + 1)]);
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
- td.ip += 3;
- break;
- case CEE_STLOC:
- store_local (&td, read16 (td.ip + 1));
- td.ip += 3;
- break;
- case CEE_LOCALLOC:
- CHECK_STACK (&td, 1);
-#if SIZEOF_VOID_P == 8
- if (td.sp [-1].type == STACK_TYPE_I8)
- ADD_CODE(&td, MINT_CONV_I4_I8);
-#endif
- ADD_CODE(&td, MINT_LOCALLOC);
- if (td.sp != td.stack + 1)
- g_warning("CEE_LOCALLOC: stack not empty");
- ++td.ip;
- SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
- break;
-#if 0
- case CEE_UNUSED57: ves_abort(); break;
- case CEE_ENDFILTER: ves_abort(); break;
-#endif
- case CEE_UNALIGNED_:
- ++td.ip;
- /* FIX: should do something? */;
- break;
- case CEE_VOLATILE_:
- ++td.ip;
- /* FIX: should do something? */;
- break;
- case CEE_TAIL_:
- ++td.ip;
- /* FIX: should do something? */;
- break;
- case CEE_INITOBJ:
- CHECK_STACK(&td, 1);
- token = read32 (td.ip + 1);
- klass = mono_class_get_full (image, token, generic_context);
- ADD_CODE(&td, MINT_INITOBJ);
- i32 = mono_class_value_size (klass, NULL);
- WRITE32(&td, &i32);
- td.ip += 5;
- --td.sp;
- break;
- case CEE_CPBLK:
- CHECK_STACK(&td, 3);
- /* FIX? convert length to I8? */
- ADD_CODE(&td, MINT_CPBLK);
- td.sp -= 3;
- ++td.ip;
- break;
-#if 0
- case CEE_CONSTRAINED_: {
- guint32 token;
- /* FIXME: implement */
- ++ip;
- token = read32 (ip);
- ip += 4;
- break;
- }
-#endif
- case CEE_INITBLK:
- CHECK_STACK(&td, 3);
- ADD_CODE(&td, MINT_INITBLK);
- td.sp -= 3;
- break;
-#if 0
- case CEE_NO_:
- /* FIXME: implement */
- ip += 2;
- break;
-#endif
- case CEE_RETHROW:
- SIMPLE_OP (td, MINT_RETHROW);
- generating_code = 0;
- break;
- case CEE_SIZEOF: {
- guint32 align;
- gint32 size;
- token = read32 (td.ip + 1);
- td.ip += 5;
- if (mono_metadata_token_table (token) == MONO_TABLE_TYPESPEC) {
- MonoType *type = mono_type_create_from_typespec (image, token);
- size = mono_type_size (type, &align);
- } else {
- MonoClass *szclass = mono_class_get_full (image, token, generic_context);
- mono_class_init (szclass);
-#if 0
- if (!szclass->valuetype)
- THROW_EX (mono_exception_from_name (mono_defaults.corlib, "System", "InvalidProgramException"), ip - 5);
-#endif
- size = mono_class_value_size (szclass, &align);
- }
- ADD_CODE(&td, MINT_LDC_I4);
- WRITE32(&td, &size);
- PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
- break;
- }
-#if 0
- case CEE_REFANYTYPE: ves_abort(); break;
-#endif
- default:
- g_error ("transform.c: Unimplemented opcode: 0xFE %02x at 0x%x\n", *td.ip, td.ip-header->code);
- }
- break;
- default:
- g_error ("transform.c: Unimplemented opcode: %02x at 0x%x\n", *td.ip, td.ip-header->code);
- }
-
- if (td.new_ip - td.new_code != new_in_start_offset)
- td.last_new_ip = td.new_code + new_in_start_offset;
- else if (td.is_bb_start [td.in_start - td.il_code])
- td.is_bb_start [td.ip - td.il_code] = 1;
-
- td.last_ip = td.in_start;
- }
-
- if (mono_interp_traceopt) {
- const guint16 *p = td.new_code;
- printf("Runtime method: %p, VT stack size: %d\n", rtm, td.max_vt_sp);
- printf("Calculated stack size: %d, stated size: %d\n", td.max_stack_height, header->max_stack);
- while (p < td.new_ip) {
- p = mono_interp_dis_mintop(td.new_code, p);
- printf("\n");
- }
- }
-
- rtm->clauses = mono_mempool_alloc (domain->mp, header->num_clauses * sizeof(MonoExceptionClause));
- memcpy (rtm->clauses, header->clauses, header->num_clauses * sizeof(MonoExceptionClause));
- rtm->code = mono_mempool_alloc (domain->mp, (td.new_ip - td.new_code) * sizeof(gushort));
- memcpy (rtm->code, td.new_code, (td.new_ip - td.new_code) * sizeof(gushort));
- g_free (td.new_code);
- rtm->new_body_start = rtm->code + body_start_offset;
- rtm->num_clauses = header->num_clauses;
- for (i = 0; i < header->num_clauses; i++) {
- MonoExceptionClause *c = rtm->clauses + i;
- int end_off = c->try_offset + c->try_len;
- c->try_offset = td.in_offsets [c->try_offset];
- c->try_len = td.in_offsets [end_off] - c->try_offset;
- end_off = c->handler_offset + c->handler_len;
- c->handler_offset = td.in_offsets [c->handler_offset];
- c->handler_len = td.in_offsets [end_off] - c->handler_offset;
- }
- rtm->vt_stack_size = td.max_vt_sp;
- rtm->alloca_size = rtm->locals_size + rtm->args_size + rtm->vt_stack_size + rtm->stack_size;
- rtm->data_items = mono_mempool_alloc (domain->mp, td.n_data_items * sizeof (td.data_items [0]));
- memcpy (rtm->data_items, td.data_items, td.n_data_items * sizeof (td.data_items [0]));
- g_free (td.in_offsets);
- g_free (td.forward_refs);
- for (i = 0; i < header->code_size; ++i)
- g_free (td.stack_state [i]);
- g_free (td.stack_state);
- g_free (td.stack_height);
- g_free (td.vt_stack_size);
- g_free (td.data_items);
- g_hash_table_destroy (td.data_hash);
-}
-
-static CRITICAL_SECTION calc_section;
-
-void
-mono_interp_transform_init (void)
-{
- InitializeCriticalSection(&calc_section);
-}
-
-MonoException *
-mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context)
-{
- int i, align, size, offset;
- MonoMethod *method = runtime_method->method;
- MonoImage *image = method->klass->image;
- MonoMethodHeader *header = mono_method_get_header (method);
- MonoMethodSignature *signature = mono_method_signature (method);
- register const unsigned char *ip, *end;
- const MonoOpcode *opcode;
- MonoMethod *m;
- MonoClass *class;
- MonoDomain *domain = mono_domain_get ();
- unsigned char *is_bb_start;
- int in;
- MonoVTable *method_class_vt;
- int backwards;
- MonoGenericContext *generic_context = NULL;
-
- method_class_vt = mono_class_vtable (domain, runtime_method->method->klass);
- if (!method_class_vt->initialized) {
- jmp_buf env;
- MonoInvocation *last_env_frame = context->env_frame;
- jmp_buf *old_env = context->current_env;
-
- if (setjmp(env)) {
- MonoException *failed = context->env_frame->ex;
- context->env_frame->ex = NULL;
- context->env_frame = last_env_frame;
- context->current_env = old_env;
- return failed;
- }
- context->env_frame = context->current_frame;
- context->current_env = &env;
- mono_runtime_class_init (method_class_vt);
- context->env_frame = last_env_frame;
- context->current_env = old_env;
- }
-
- mono_profiler_method_jit (method); /* sort of... */
-
- if (mono_method_signature (method)->is_inflated)
- generic_context = ((MonoMethodInflated *) method)->context;
-
- if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
- MonoMethod *nm = NULL;
- EnterCriticalSection(&calc_section);
- if (runtime_method->transformed) {
- LeaveCriticalSection(&calc_section);
- mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
- return NULL;
- }
-
- /* assumes all internal calls with an array this are built in... */
- if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL &&
- (! mono_method_signature (method)->hasthis || method->klass->rank == 0)) {
- runtime_method->code = g_malloc(sizeof(short));
- runtime_method->code[0] = MINT_CALLINT;
- if (((MonoMethodPInvoke*) method)->addr == NULL)
- ((MonoMethodPInvoke*) method)->addr = mono_lookup_internal_call (method);
- runtime_method->func = mono_arch_create_trampoline (mono_method_signature (method), method->string_ctor);
- } else {
- const char *name = method->name;
- if (method->klass->parent == mono_defaults.multicastdelegate_class) {
- if (*name == 'I' && (strcmp (name, "Invoke") == 0)) {
- nm = mono_marshal_get_delegate_invoke (method);
- } else if (*name == 'B' && (strcmp (name, "BeginInvoke") == 0)) {
- nm = mono_marshal_get_delegate_begin_invoke (method);
- } else if (*name == 'E' && (strcmp (name, "EndInvoke") == 0)) {
- nm = mono_marshal_get_delegate_end_invoke (method);
- }
- }
- if (nm == NULL) {
- runtime_method->code = g_malloc(sizeof(short));
- runtime_method->code[0] = MINT_CALLRUN;
- }
- }
- if (nm == NULL) {
- runtime_method->stack_size = sizeof (stackval); /* for tracing */
- runtime_method->alloca_size = runtime_method->stack_size;
- runtime_method->transformed = TRUE;
- LeaveCriticalSection(&calc_section);
- mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
- return NULL;
- }
- method = nm;
- header = mono_method_get_header (nm);
- LeaveCriticalSection(&calc_section);
- }
- g_assert ((signature->param_count + signature->hasthis) < 1000);
- g_assert (header->max_stack < 10000);
- /* intern the strings in the method. */
- ip = header->code;
- end = ip + header->code_size;
-
- is_bb_start = g_malloc0(header->code_size);
- is_bb_start [0] = 1;
- while (ip < end) {
- in = *ip;
- if (in == 0xfe) {
- ip++;
- in = *ip + 256;
- }
- else if (in == 0xf0) {
- ip++;
- in = *ip + MONO_CEE_MONO_ICALL;
- }
- opcode = &mono_opcodes [in];
- switch (opcode->argument) {
- case MonoInlineNone:
- ++ip;
- break;
- case MonoInlineString:
- if (method->wrapper_type == MONO_WRAPPER_NONE)
- mono_ldstr (domain, image, mono_metadata_token_index (read32 (ip + 1)));
- ip += 5;
- break;
- case MonoInlineType:
- if (method->wrapper_type == MONO_WRAPPER_NONE) {
- class = mono_class_get_full (image, read32 (ip + 1), generic_context);
- mono_class_init (class);
- /* quick fix to not do this for the fake ptr classes - probably should not be getting the vtable at all here */
- if (!(class->flags & TYPE_ATTRIBUTE_INTERFACE) && class->interface_offsets != NULL)
- mono_class_vtable (domain, class);
- }
- ip += 5;
- break;
- case MonoInlineMethod:
- if (method->wrapper_type == MONO_WRAPPER_NONE && *ip != CEE_CALLI) {
- m = mono_get_method_full (image, read32 (ip + 1), NULL, generic_context);
- if (m == NULL) {
- g_free (is_bb_start);
- return mono_get_exception_missing_method ();
- }
- mono_class_init (m->klass);
- if (!(m->klass->flags & TYPE_ATTRIBUTE_INTERFACE))
- mono_class_vtable (domain, m->klass);
- }
- ip += 5;
- break;
- case MonoInlineField:
- case MonoInlineSig:
- case MonoInlineI:
- case MonoInlineTok:
- case MonoShortInlineR:
- ip += 5;
- break;
- case MonoInlineBrTarget:
- offset = read32 (ip + 1);
- ip += 5;
- backwards = offset < 0;
- offset += ip - header->code;
- g_assert (offset >= 0 && offset < header->code_size);
- is_bb_start [offset] |= backwards ? 2 : 1;
- break;
- case MonoShortInlineBrTarget:
- offset = ((gint8 *)ip) [1];
- ip += 2;
- backwards = offset < 0;
- offset += ip - header->code;
- g_assert (offset >= 0 && offset < header->code_size);
- is_bb_start [offset] |= backwards ? 2 : 1;
- break;
- case MonoInlineVar:
- ip += 3;
- break;
- case MonoShortInlineVar:
- case MonoShortInlineI:
- ip += 2;
- break;
- case MonoInlineSwitch: {
- guint32 n;
- const unsigned char *next_ip;
- ++ip;
- n = read32 (ip);
- ip += 4;
- next_ip = ip + 4 * n;
- for (i = 0; i < n; i++) {
- offset = read32 (ip);
- backwards = offset < 0;
- offset += next_ip - header->code;
- g_assert (offset >= 0 && offset < header->code_size);
- is_bb_start [offset] |= backwards ? 2 : 1;
- ip += 4;
- }
- break;
- }
- case MonoInlineR:
- case MonoInlineI8:
- ip += 9;
- break;
- default:
- g_assert_not_reached ();
- }
- }
-
- /* the rest needs to be locked so it is only done once */
- EnterCriticalSection(&calc_section);
- if (runtime_method->transformed) {
- LeaveCriticalSection(&calc_section);
- g_free (is_bb_start);
- mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
- return NULL;
- }
-
- runtime_method->local_offsets = g_malloc (header->num_locals * sizeof(guint32));
- runtime_method->stack_size = (sizeof (stackval) + 2) * header->max_stack; /* + 1 for returns of called functions + 1 for 0-ing in trace*/
- runtime_method->stack_size = (runtime_method->stack_size + 7) & ~7;
- offset = 0;
- for (i = 0; i < header->num_locals; ++i) {
- size = mono_type_size (header->locals [i], &align);
- offset += align - 1;
- offset &= ~(align - 1);
- runtime_method->local_offsets [i] = offset;
- offset += size;
- }
- offset = (offset + 7) & ~7;
- runtime_method->locals_size = offset;
- g_assert (runtime_method->locals_size < 65536);
- offset = 0;
- runtime_method->arg_offsets = g_malloc(signature->param_count * sizeof(guint32));
- for (i = 0; i < signature->param_count; ++i) {
- if (signature->pinvoke) {
- size = mono_type_native_stack_size (signature->params [i], &align);
- align = 8;
- }
- else
- size = mono_type_stack_size (signature->params [i], &align);
- offset += align - 1;
- offset &= ~(align - 1);
- runtime_method->arg_offsets [i] = offset;
- offset += size;
- }
- offset = (offset + 7) & ~7;
- runtime_method->args_size = offset;
- g_assert (runtime_method->args_size < 10000);
-
- generate(method, runtime_method, is_bb_start);
-
- g_free (is_bb_start);
-
- mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
- runtime_method->transformed = TRUE;
- LeaveCriticalSection(&calc_section);
-
- return NULL;
-}
-
access.h \
collection.h \
context.h \
- critical-sections.h \
error.h \
events.h \
handles.h \
collection.h \
context.c \
context.h \
- critical-sections.c \
- critical-sections.h \
- critical-section-private.h \
error.c \
error.h \
events.c \
+++ /dev/null
-/*
- * critical-section-private.h: Private definitions for critical sections
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * Copyright (C) 2007 Novell, Inc.
- */
-
-#ifndef _WAPI_CRITICAL_SECTION_PRIVATE_H_
-#define _WAPI_CRITICAL_SECTION_PRIVATE_H_
-
-#include <config.h>
-#include <glib.h>
-
-extern void _wapi_critical_section_cleanup (void);
-
-#endif /* _WAPI_CRITICAL_SECTION_PRIVATE_H_ */
+++ /dev/null
-/*
- * critical-sections.c: Critical sections
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <pthread.h>
-#include <errno.h>
-
-#include <mono/io-layer/wapi.h>
-#include <mono/io-layer/critical-section-private.h>
-
-#include <mono/utils/mono-mutex.h>
-
-/* A critical section is really just like a lightweight mutex. It
- * can't be waited for, and doesn't have a handle.
- */
-
-/**
- * InitializeCriticalSection:
- * @section: The critical section to initialise
- *
- * Initialises a critical section.
- */
-void InitializeCriticalSection(WapiCriticalSection *section)
-{
- int ret;
-
- ret = mono_mutex_init_recursive (§ion->mutex);
- g_assert (ret == 0);
-}
-
-/**
- * InitializeCriticalSectionAndSpinCount:
- * @section: The critical section to initialise.
- * @spincount: The spin count for this critical section. Not
- * currently used.
- *
- * Initialises a critical section and sets the spin count. This
- * implementation just calls InitializeCriticalSection().
- *
- * Return value: %TRUE on success, %FALSE otherwise. (%FALSE never
- * happens).
- */
-gboolean InitializeCriticalSectionAndSpinCount(WapiCriticalSection *section,
- guint32 spincount G_GNUC_UNUSED)
-{
- InitializeCriticalSection(section);
-
- return(TRUE);
-}
-
-/**
- * DeleteCriticalSection:
- * @section: The critical section to delete.
- *
- * Releases all resources owned by critical section @section.
- */
-void DeleteCriticalSection(WapiCriticalSection *section)
-{
- int ret;
-
- ret = mono_mutex_destroy(§ion->mutex);
- if (ret)
- g_error ("Failed to destroy mutex %p error code %d errno %d", §ion->mutex, ret, errno);
-}
-
-/**
- * SetCriticalSectionSpinCount:
- * @section: The critical section to set
- * @spincount: The new spin count for this critical section. Not
- * currently used.
- *
- * Sets the spin count for the critical section @section. The spin
- * count is currently ignored, and set to zero.
- *
- * Return value: The previous spin count. (Currently always zero).
- */
-guint32 SetCriticalSectionSpinCount(WapiCriticalSection *section G_GNUC_UNUSED, guint32 spincount G_GNUC_UNUSED)
-{
- return(0);
-}
-
-/**
- * TryEnterCriticalSection:
- * @section: The critical section to try and enter
- *
- * Attempts to enter a critical section without blocking. If
- * successful the calling thread takes ownership of the critical
- * section.
- *
- * A thread can recursively call EnterCriticalSection() and
- * TryEnterCriticalSection(), but must call LeaveCriticalSection() an
- * equal number of times.
- *
- * Return value: %TRUE if the thread successfully locked the critical
- * section, %FALSE otherwise.
- */
-gboolean TryEnterCriticalSection(WapiCriticalSection *section)
-{
- int ret;
-
- ret=mono_mutex_trylock(§ion->mutex);
- if(ret==0) {
- return(TRUE);
- } else {
- return(FALSE);
- }
-}
-
+++ /dev/null
-/*
- * critical-sections.h: Critical sections
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_CRITICAL_SECTIONS_H_
-#define _WAPI_CRITICAL_SECTIONS_H_
-
-#include <glib.h>
-#include <pthread.h>
-
-#include <mono/utils/mono-mutex.h>
-
-G_BEGIN_DECLS
-
-typedef struct _WapiCriticalSection WapiCriticalSection;
-
-struct _WapiCriticalSection
-{
- guint32 depth;
- mono_mutex_t mutex;
-};
-
-extern void InitializeCriticalSection(WapiCriticalSection *section);
-extern gboolean InitializeCriticalSectionAndSpinCount(WapiCriticalSection *section, guint32 spincount);
-extern void DeleteCriticalSection(WapiCriticalSection *section);
-extern guint32 SetCriticalSectionSpinCount(WapiCriticalSection *section, guint32 spincount);
-extern gboolean TryEnterCriticalSection(WapiCriticalSection *section);
-
-/* These two are perf critical so avoid the wrapper function */
-
-#define EnterCriticalSection(section) do { \
- int ret = mono_mutex_lock(&(section)->mutex); \
- if (ret != 0) \
- g_warning ("Bad call to mono_mutex_lock result %d", ret); \
- g_assert (ret == 0); \
-} while (0)
-
-#define LeaveCriticalSection(section) do { \
- int ret = mono_mutex_unlock(&(section)->mutex); \
- if (ret != 0) \
- g_warning ("Bad call to mono_mutex_unlock result %d", ret); \
- g_assert (ret == 0); \
-} while (0)
-
-G_END_DECLS
-
-#endif /* _WAPI_CRITICAL_SECTIONS_H_ */
#include <mono/io-layer/shared.h>
#include <mono/io-layer/collection.h>
#include <mono/io-layer/process-private.h>
-#include <mono/io-layer/critical-section-private.h>
#include <mono/utils/mono-mutex.h>
#undef DEBUG_REFS
* 4MB array.
*/
static GHashTable *file_share_hash;
-static CRITICAL_SECTION file_share_hash_mutex;
+static mono_mutex_t file_share_hash_mutex;
-#define file_share_hash_lock() EnterCriticalSection (&file_share_hash_mutex)
-#define file_share_hash_unlock() LeaveCriticalSection (&file_share_hash_mutex)
+#define file_share_hash_lock() mono_mutex_lock (&file_share_hash_mutex)
+#define file_share_hash_unlock() mono_mutex_unlock (&file_share_hash_mutex)
guint32 _wapi_fd_reserve;
if (file_share_hash) {
g_hash_table_destroy (file_share_hash);
- DeleteCriticalSection (&file_share_hash_mutex);
+ mono_mutex_destroy (&file_share_hash_mutex);
}
for (i = 0; i < _WAPI_PRIVATE_MAX_SLOTS; ++i)
*/
if (!file_share_hash) {
file_share_hash = g_hash_table_new_full (wapi_share_info_hash, wapi_share_info_equal, NULL, g_free);
- InitializeCriticalSection (&file_share_hash_mutex);
+ mono_mutex_init_recursive (&file_share_hash_mutex);
}
tmp.device = device;
* Declare as __GetProcessId for unsupported targets. */
#define GetProcessId __GetProcessId
#endif
-#include <winsock2.h>
#include <windows.h>
#include <winbase.h>
+#include <winsock2.h>
/*
* The mingw version says:
* /usr/i686-pc-mingw32/sys-root/mingw/include/ws2tcpip.h:38:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."
}
#endif
-#if (defined(HAVE_STATVFS) || defined(HAVE_STATFS)) && !defined(PLATFORM_ANDROID)
+#if defined(HAVE_STATVFS) || defined(HAVE_STATFS)
gboolean GetDiskFreeSpaceEx(const gunichar2 *path_name, WapiULargeInteger *free_bytes_avail,
WapiULargeInteger *total_number_of_bytes,
WapiULargeInteger *total_number_of_free_bytes)
block_size = fsstat.f_frsize;
#elif defined(HAVE_STATFS)
ret = statfs (utf8_path_name, &fsstat);
+#if defined (MNT_RDONLY)
isreadonly = ((fsstat.f_flags & MNT_RDONLY) == MNT_RDONLY);
+#elif defined (MS_RDONLY)
+ isreadonly = ((fsstat.f_flags & MS_RDONLY) == MS_RDONLY);
+#endif
block_size = fsstat.f_bsize;
#endif
} while(ret == -1 && errno == EINTR);
return (drive_type);
}
-#if defined (PLATFORM_MACOSX) || defined (__linux__) || defined(PLATFORM_BSD) || defined(__native_client__)
+#if defined (PLATFORM_MACOSX) || defined (__linux__) || defined(PLATFORM_BSD) || defined(__native_client__) || defined(__FreeBSD_kernel__)
static gchar*
get_fstypename (gchar *utfpath)
{
typedef WapiOverlapped *LPOVERLAPPED;
typedef WapiOverlappedCB LPOVERLAPPED_COMPLETION_ROUTINE;
typedef WapiThreadStart LPTHREAD_START_ROUTINE;
-typedef WapiCriticalSection CRITICAL_SECTION;
-typedef WapiCriticalSection *LPCRITICAL_SECTION;
typedef WapiFileTime FILETIME;
typedef WapiFileTime *LPFILETIME;
typedef WapiSystemTime SYSTEMTIME;
#include <mono/io-layer/io.h>
#include <mono/io-layer/access.h>
#include <mono/io-layer/context.h>
-#include <mono/io-layer/critical-sections.h>
#include <mono/io-layer/error.h>
#include <mono/io-layer/events.h>
#include <mono/io-layer/messages.h>
#include <mono/io-layer/versioninfo.h>
#include <mono/io-layer/wait.h>
+#include <mono/utils/mono-mutex.h>
+
#endif /* _WAPI_WAPI_H_ */
--- /dev/null
+if HOST_WIN32
+win32_sources = \
+ console-win32.c
+
+platform_sources = $(win32_sources)
+
+# Use -m here. This will use / as directory separator (C:/WINNT).
+# The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
+# / by \ if running under WIN32.
+if CROSS_COMPILING
+assembliesdir = ${libdir}
+confdir = ${sysconfdir}
+else
+assembliesdir = `cygpath -m "${libdir}"`
+confdir = `cygpath -m "${sysconfdir}"`
+endif
+export HOST_CC
+# The mingw math.h has "extern inline" functions that dont appear in libs, so
+# optimisation is required to actually inline them
+AM_CFLAGS = -O
+else
+
+assembliesdir = $(exec_prefix)/lib
+confdir = $(sysconfdir)
+unix_sources = \
+ console-unix.c
+
+platform_sources = $(unix_sources)
+endif
+
+if SHARED_MONO
+if SUPPORT_BOEHM
+bin_PROGRAMS = pedump
+endif
+endif
+
+#
+# libtool is not capable of creating static/shared versions of the same
+# convenience lib, so we have to do it ourselves
+#
+if SUPPORT_SGEN
+if DISABLE_EXECUTABLES
+shared_sgen_libraries = libmonoruntimesgen.la
+else
+if SHARED_MONO
+shared_sgen_libraries = libmonoruntimesgen.la
+endif
+endif
+sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la
+endif
+
+if SUPPORT_BOEHM
+if DISABLE_EXECUTABLES
+shared_boehm_libraries = libmonoruntime.la
+else
+if SHARED_MONO
+shared_boehm_libraries = libmonoruntime.la
+endif
+endif
+boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
+endif
+
+if DISABLE_EXECUTABLES
+noinst_LTLIBRARIES = $(shared_sgen_libraries) $(shared_boehm_libraries)
+else
+noinst_LTLIBRARIES = $(boehm_libraries) $(sgen_libraries)
+endif
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
+
+#
+# Make sure any prefix changes are updated in the binaries too.
+#
+# assembly.c uses MONO_ASSEMBLIES
+# mono-config.c uses MONO_CFG_DIR
+#
+# This won't result in many more false positives than AC_DEFINEing them
+# in configure.ac.
+#
+assembly.lo mono-config.lo: Makefile
+
+CLEANFILES = mono-bundle.stamp
+
+libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
+
+null_sources = \
+ console-null.c
+
+null_gc_sources = \
+ null-gc.c
+
+common_sources = \
+ $(platform_sources) \
+ assembly.c \
+ attach.h \
+ attach.c \
+ char-conversions.h \
+ cil-coff.h \
+ class.c \
+ class-internals.h \
+ cominterop.c \
+ cominterop.h \
+ console-io.h \
+ coree.c \
+ coree.h \
+ culture-info.h \
+ culture-info-tables.h \
+ debug-helpers.c \
+ debug-mono-symfile.h \
+ debug-mono-symfile.c \
+ decimal.c \
+ decimal.h \
+ domain-internals.h \
+ environment.c \
+ environment.h \
+ exception.c \
+ exception.h \
+ file-io.c \
+ file-io.h \
+ filewatcher.c \
+ filewatcher.h \
+ gc-internal.h \
+ gc-memfuncs.c \
+ icall.c \
+ icall-def.h \
+ image.c \
+ loader.c \
+ locales.c \
+ locales.h \
+ lock-tracer.c \
+ lock-tracer.h \
+ marshal.c \
+ marshal.h \
+ mempool.c \
+ mempool.h \
+ mempool-internals.h \
+ metadata.c \
+ metadata-verify.c \
+ metadata-internals.h \
+ method-builder.h \
+ method-builder.c \
+ mono-basic-block.c \
+ mono-basic-block.h \
+ mono-config.c \
+ mono-cq.c \
+ mono-cq.h \
+ mono-debug.h \
+ mono-debug.c \
+ mono-debug-debugger.h \
+ mono-debug-debugger.c \
+ mono-endian.c \
+ mono-endian.h \
+ mono-hash.h \
+ mono-mlist.c \
+ mono-mlist.h \
+ mono-perfcounters.c \
+ mono-perfcounters.h \
+ mono-perfcounters-def.h \
+ mono-ptr-array.h \
+ mono-wsq.c \
+ mono-wsq.h \
+ monitor.h \
+ nacl-stub.c \
+ normalization-tables.h \
+ number-formatter.h \
+ object-internals.h \
+ opcodes.c \
+ socket-io.c \
+ socket-io.h \
+ process.c \
+ process.h \
+ profiler.c \
+ profiler-private.h \
+ rand.h \
+ rand.c \
+ runtime.c \
+ security.c \
+ security.h \
+ security-core-clr.c \
+ security-core-clr.h \
+ security-manager.c \
+ security-manager.h \
+ string-icalls.c \
+ string-icalls.h \
+ sysmath.h \
+ sysmath.c \
+ tabledefs.h \
+ threads.c \
+ threads-types.h \
+ threadpool.c \
+ threadpool.h \
+ threadpool-internals.h \
+ verify.c \
+ verify-internals.h \
+ wrapper-types.h \
+ reflection-internals.h \
+ file-mmap-posix.c \
+ file-mmap-windows.c \
+ file-mmap.h \
+ object-offsets.h \
+ abi-details.h \
+ metadata-cross-helpers.c
+
+
+# These source files have compile time dependencies on GC code
+gc_dependent_sources = \
+ appdomain.c \
+ domain.c \
+ gc.c \
+ monitor.c \
+ mono-hash.c \
+ object.c \
+ reflection.c
+
+boehm_sources = \
+ boehm-gc.c
+
+sgen_sources = \
+ sgen-os-posix.c \
+ sgen-os-mach.c \
+ sgen-os-win32.c \
+ sgen-gc.c \
+ sgen-internal.c \
+ sgen-marksweep.c \
+ sgen-marksweep-fixed.c \
+ sgen-marksweep-par.c \
+ sgen-marksweep-fixed-par.c \
+ sgen-los.c \
+ sgen-protocol.c \
+ sgen-bridge.c \
+ sgen-bridge.h \
+ sgen-old-bridge.c \
+ sgen-new-bridge.c \
+ sgen-tarjan-bridge.c \
+ sgen-toggleref.c \
+ sgen-toggleref.h \
+ sgen-gc.h \
+ sgen-conf.h \
+ sgen-archdep.h \
+ sgen-cardtable.c \
+ sgen-cardtable.h \
+ sgen-pointer-queue.c \
+ sgen-pointer-queue.h \
+ sgen-pinning.c \
+ sgen-pinning.h \
+ sgen-pinning-stats.c \
+ sgen-workers.c \
+ sgen-workers.h \
+ sgen-gray.c \
+ sgen-gray.h \
+ sgen-major-copy-object.h \
+ sgen-minor-copy-object.h \
+ sgen-copy-object.h \
+ sgen-major-scan-object.h \
+ sgen-minor-scan-object.h \
+ sgen-protocol.h \
+ sgen-scan-object.h \
+ sgen-nursery-allocator.c \
+ sgen-hash-table.c \
+ sgen-hash-table.h \
+ sgen-descriptor.c \
+ sgen-descriptor.h \
+ sgen-alloc.c \
+ sgen-debug.c \
+ sgen-simple-nursery.c \
+ sgen-split-nursery.c \
+ sgen-memory-governor.c \
+ sgen-memory-governor.h \
+ sgen-stw.c \
+ sgen-fin-weak-hash.c \
+ sgen-layout-stats.c \
+ sgen-layout-stats.h \
+ sgen-qsort.c \
+ sgen-qsort.h
+
+libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
+libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
+
+libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
+libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
+
+libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
+libmonoruntime_static_la_LDFLAGS = -static
+libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
+
+libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
+libmonoruntimesgen_static_la_LDFLAGS = -static
+libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
+
+libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
+
+libmonoruntimeinclude_HEADERS = \
+ assembly.h \
+ attrdefs.h \
+ appdomain.h \
+ blob.h \
+ class.h \
+ debug-helpers.h \
+ debug-mono-symfile.h \
+ threads.h \
+ environment.h \
+ exception.h \
+ image.h \
+ loader.h \
+ metadata.h \
+ mono-config.h \
+ mono-debug.h \
+ mono-gc.h \
+ sgen-bridge.h \
+ object.h \
+ opcodes.h \
+ profiler.h \
+ reflection.h \
+ row-indexes.h \
+ tokentype.h \
+ verify.h
+
+if DTRACE_G_REQUIRED
+
+PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
+
+pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
+ DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
+ --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
+
+else
+PEDUMP_DTRACE_OBJECT =
+endif
+
+if SHARED_MONO
+if SUPPORT_BOEHM
+pedump_SOURCES = \
+ pedump.c
+
+pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
+ $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
+
+if PLATFORM_DARWIN
+pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
+endif
+endif
+endif
+
+EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
+ tpool-poll.c tpool-epoll.c tpool-kqueue.c
+++ /dev/null
-if HOST_WIN32
-win32_sources = \
- console-win32.c
-
-platform_sources = $(win32_sources)
-
-# Use -m here. This will use / as directory separator (C:/WINNT).
-# The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
-# / by \ if running under WIN32.
-if CROSS_COMPILING
-assembliesdir = ${libdir}
-confdir = ${sysconfdir}
-else
-assembliesdir = `cygpath -m "${libdir}"`
-confdir = `cygpath -m "${sysconfdir}"`
-endif
-export HOST_CC
-# The mingw math.h has "extern inline" functions that dont appear in libs, so
-# optimisation is required to actually inline them
-AM_CFLAGS = -O
-else
-
-assembliesdir = $(exec_prefix)/lib
-confdir = $(sysconfdir)
-unix_sources = \
- console-unix.c
-
-platform_sources = $(unix_sources)
-endif
-
-if SHARED_MONO
-if SUPPORT_BOEHM
-bin_PROGRAMS = pedump
-endif
-endif
-
-#
-# libtool is not capable of creating static/shared versions of the same
-# convenience lib, so we have to do it ourselves
-#
-if SUPPORT_SGEN
-if DISABLE_EXECUTABLES
-shared_sgen_libraries = libmonoruntimesgen.la
-else
-if SHARED_MONO
-shared_sgen_libraries = libmonoruntimesgen.la
-endif
-endif
-sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la
-endif
-
-if SUPPORT_BOEHM
-if DISABLE_EXECUTABLES
-shared_boehm_libraries = libmonoruntime.la
-else
-if SHARED_MONO
-shared_boehm_libraries = libmonoruntime.la
-endif
-endif
-boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
-endif
-
-if DISABLE_EXECUTABLES
-noinst_LTLIBRARIES = $(shared_sgen_libraries) $(shared_boehm_libraries)
-else
-noinst_LTLIBRARIES = $(boehm_libraries) $(sgen_libraries)
-endif
-
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
-
-#
-# Make sure any prefix changes are updated in the binaries too.
-#
-# assembly.c uses MONO_ASSEMBLIES
-# mono-config.c uses MONO_CFG_DIR
-#
-# This won't result in many more false positives than AC_DEFINEing them
-# in configure.ac.
-#
-assembly.lo mono-config.lo: Makefile
-
-CLEANFILES = mono-bundle.stamp
-
-libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
-
-null_sources = \
- console-null.c
-
-null_gc_sources = \
- null-gc.c
-
-common_sources = \
- $(platform_sources) \
- assembly.c \
- attach.h \
- attach.c \
- char-conversions.h \
- cil-coff.h \
- class.c \
- class-internals.h \
- cominterop.c \
- cominterop.h \
- console-io.h \
- coree.c \
- coree.h \
- culture-info.h \
- culture-info-tables.h \
- debug-helpers.c \
- debug-mono-symfile.h \
- debug-mono-symfile.c \
- decimal.c \
- decimal.h \
- domain-internals.h \
- environment.c \
- environment.h \
- exception.c \
- exception.h \
- file-io.c \
- file-io.h \
- filewatcher.c \
- filewatcher.h \
- gc-internal.h \
- gc-memfuncs.c \
- icall.c \
- icall-def.h \
- image.c \
- loader.c \
- locales.c \
- locales.h \
- lock-tracer.c \
- lock-tracer.h \
- marshal.c \
- marshal.h \
- mempool.c \
- mempool.h \
- mempool-internals.h \
- metadata.c \
- metadata-verify.c \
- metadata-internals.h \
- method-builder.h \
- method-builder.c \
- mono-basic-block.c \
- mono-basic-block.h \
- mono-config.c \
- mono-cq.c \
- mono-cq.h \
- mono-debug.h \
- mono-debug.c \
- mono-debug-debugger.h \
- mono-debug-debugger.c \
- mono-endian.c \
- mono-endian.h \
- mono-hash.h \
- mono-mlist.c \
- mono-mlist.h \
- mono-perfcounters.c \
- mono-perfcounters.h \
- mono-perfcounters-def.h \
- mono-ptr-array.h \
- mono-wsq.c \
- mono-wsq.h \
- monitor.h \
- nacl-stub.c \
- normalization-tables.h \
- number-formatter.h \
- object-internals.h \
- opcodes.c \
- socket-io.c \
- socket-io.h \
- process.c \
- process.h \
- profiler.c \
- profiler-private.h \
- rand.h \
- rand.c \
- runtime.c \
- security.c \
- security.h \
- security-core-clr.c \
- security-core-clr.h \
- security-manager.c \
- security-manager.h \
- string-icalls.c \
- string-icalls.h \
- sysmath.h \
- sysmath.c \
- tabledefs.h \
- threads.c \
- threads-types.h \
- threadpool.c \
- threadpool.h \
- threadpool-internals.h \
- verify.c \
- verify-internals.h \
- wrapper-types.h \
- reflection-internals.h \
- file-mmap-posix.c \
- file-mmap-windows.c \
- file-mmap.h \
- object-offsets.h \
- abi-details.h \
- metadata-cross-helpers.c
-
-
-# These source files have compile time dependencies on GC code
-gc_dependent_sources = \
- appdomain.c \
- domain.c \
- gc.c \
- monitor.c \
- mono-hash.c \
- object.c \
- reflection.c
-
-boehm_sources = \
- boehm-gc.c
-
-sgen_sources = \
- sgen-os-posix.c \
- sgen-os-mach.c \
- sgen-os-win32.c \
- sgen-gc.c \
- sgen-internal.c \
- sgen-marksweep.c \
- sgen-marksweep-fixed.c \
- sgen-marksweep-par.c \
- sgen-marksweep-fixed-par.c \
- sgen-los.c \
- sgen-protocol.c \
- sgen-bridge.c \
- sgen-bridge.h \
- sgen-old-bridge.c \
- sgen-new-bridge.c \
- sgen-tarjan-bridge.c \
- sgen-toggleref.c \
- sgen-toggleref.h \
- sgen-gc.h \
- sgen-conf.h \
- sgen-archdep.h \
- sgen-cardtable.c \
- sgen-cardtable.h \
- sgen-pinning.c \
- sgen-pinning.h \
- sgen-pinning-stats.c \
- sgen-workers.c \
- sgen-workers.h \
- sgen-gray.c \
- sgen-gray.h \
- sgen-major-copy-object.h \
- sgen-minor-copy-object.h \
- sgen-copy-object.h \
- sgen-major-scan-object.h \
- sgen-minor-scan-object.h \
- sgen-protocol.h \
- sgen-scan-object.h \
- sgen-nursery-allocator.c \
- sgen-hash-table.c \
- sgen-hash-table.h \
- sgen-descriptor.c \
- sgen-descriptor.h \
- sgen-alloc.c \
- sgen-debug.c \
- sgen-simple-nursery.c \
- sgen-split-nursery.c \
- sgen-memory-governor.c \
- sgen-memory-governor.h \
- sgen-stw.c \
- sgen-fin-weak-hash.c \
- sgen-layout-stats.c \
- sgen-layout-stats.h \
- sgen-qsort.c \
- sgen-qsort.h
-
-libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
-libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
-
-libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
-libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
-
-libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
-libmonoruntime_static_la_LDFLAGS = -static
-libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
-
-libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
-libmonoruntimesgen_static_la_LDFLAGS = -static
-libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
-
-libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
-
-libmonoruntimeinclude_HEADERS = \
- assembly.h \
- attrdefs.h \
- appdomain.h \
- blob.h \
- class.h \
- debug-helpers.h \
- debug-mono-symfile.h \
- threads.h \
- environment.h \
- exception.h \
- image.h \
- loader.h \
- metadata.h \
- mono-config.h \
- mono-debug.h \
- mono-gc.h \
- sgen-bridge.h \
- object.h \
- opcodes.h \
- profiler.h \
- reflection.h \
- row-indexes.h \
- tokentype.h \
- verify.h
-
-if DTRACE_G_REQUIRED
-
-PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
-
-pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
- DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
- --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
-
-else
-PEDUMP_DTRACE_OBJECT =
-endif
-
-if SHARED_MONO
-if SUPPORT_BOEHM
-pedump_SOURCES = \
- pedump.c
-
-pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
- $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
-
-if PLATFORM_DARWIN
-pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
-endif
-endif
-endif
-
-EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
- tpool-poll.c tpool-epoll.c tpool-kqueue.c Makefile.am.in
-
-if HAS_EXTENSION_MODULE
-else
-Makefile.am: Makefile.am.in
- cp $< $@
-endif
gchar *filename;
} RuntimeConfig;
-CRITICAL_SECTION mono_delegate_section;
+mono_mutex_t mono_delegate_section;
-CRITICAL_SECTION mono_strtod_mutex;
+mono_mutex_t mono_strtod_mutex;
static gunichar2 process_guid [36];
static gboolean process_guid_set = FALSE;
domain->domain = ad;
domain->setup = setup;
- InitializeCriticalSection (&mono_delegate_section);
+ mono_mutex_init_recursive (&mono_delegate_section);
- InitializeCriticalSection (&mono_strtod_mutex);
+ mono_mutex_init_recursive (&mono_strtod_mutex);
mono_thread_attach (domain);
mono_context_init (domain);
unload_data *thread_data;
MonoNativeThreadId tid;
MonoDomain *caller_domain = mono_domain_get ();
+ char *name;
/* printf ("UNLOAD STARTING FOR %s (%p) IN THREAD 0x%x.\n", domain->friendly_name, domain, GetCurrentThreadId ()); */
thread_handle = mono_threads_create_thread ((LPTHREAD_START_ROUTINE)unload_thread_main, thread_data, 0, CREATE_SUSPENDED, &tid);
if (thread_handle == NULL)
return;
+ name = g_strdup_printf ("Unload thread for domain %x", domain);
+ mono_thread_info_set_name (tid, name);
mono_thread_info_resume (tid);
+ g_free (name);
/* Wait for the thread */
while (!thread_data->done && WaitForSingleObjectEx (thread_handle, INFINITE, TRUE) == WAIT_IO_COMPLETION) {
#endif
/* This protects loaded_assemblies and image->references */
-#define mono_assemblies_lock() EnterCriticalSection (&assemblies_mutex)
-#define mono_assemblies_unlock() LeaveCriticalSection (&assemblies_mutex)
-static CRITICAL_SECTION assemblies_mutex;
+#define mono_assemblies_lock() mono_mutex_lock (&assemblies_mutex)
+#define mono_assemblies_unlock() mono_mutex_unlock (&assemblies_mutex)
+static mono_mutex_t assemblies_mutex;
/* If defined, points to the bundled assembly information */
const MonoBundledAssembly **bundles;
check_path_env ();
check_extra_gac_path_env ();
- InitializeCriticalSection (&assemblies_mutex);
+ mono_mutex_init_recursive (&assemblies_mutex);
mono_mutex_init (&assembly_binding_mutex);
}
{
GSList *l;
- DeleteCriticalSection (&assemblies_mutex);
+ mono_mutex_destroy (&assemblies_mutex);
mono_mutex_destroy (&assembly_binding_mutex);
for (l = loaded_assembly_bindings; l; l = l->next) {
static gboolean needs_to_start, started;
-#define agent_lock() EnterCriticalSection (&agent_mutex)
-#define agent_unlock() LeaveCriticalSection (&agent_mutex)
-static CRITICAL_SECTION agent_mutex;
+#define agent_lock() mono_mutex_lock (&agent_mutex)
+#define agent_unlock() mono_mutex_unlock (&agent_mutex)
+static mono_mutex_t agent_mutex;
static void transport_connect (void);
void
mono_attach_init (void)
{
- InitializeCriticalSection (&agent_mutex);
+ mono_mutex_init_recursive (&agent_mutex);
config.enabled = TRUE;
}
mono_perfcounters->gc_gen0size = heap_size;
}
#endif
- gc_stats.major_gc_time_usecs += (mono_100ns_ticks () - gc_start_time) / 10;
+ gc_stats.major_gc_time += mono_100ns_ticks () - gc_start_time;
mono_trace_message (MONO_TRACE_GC, "gc took %d usecs", (mono_100ns_ticks () - gc_start_time) / 10);
break;
}
mono_metadata_load_generic_params (MonoImage *image, guint32 token,
MonoGenericContainer *parent_container);
-MONO_API void
-mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
- MonoGenericContainer *container);
-
-gboolean
-mono_metadata_load_generic_param_constraints_full (MonoImage *image, guint32 token,
- MonoGenericContainer *container) MONO_INTERNAL;
+MONO_API gboolean
+mono_metadata_load_generic_param_constraints_checked (MonoImage *image, guint32 token,
+ MonoGenericContainer *container, MonoError *error);
MonoMethodSignature*
mono_create_icall_signature (const char *sigstr) MONO_INTERNAL;
mono_class_is_valid_enum (MonoClass *klass);
MonoType *
-mono_type_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context) MONO_INTERNAL;
+mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
gboolean
mono_generic_class_is_generic_type_definition (MonoGenericClass *gklass) MONO_INTERNAL;
char*
mono_class_full_name (MonoClass *klass) MONO_INTERNAL;
+MonoClass*
+mono_class_inflate_generic_class_checked (MonoClass *gklass, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
+
+MonoClass *
+mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error) MONO_INTERNAL;
+
+MonoClass *
+mono_class_get_and_inflate_typespec_checked (MonoImage *image, guint32 type_token, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
+
+MonoClass *
+mono_class_from_name_case_checked (MonoImage *image, const char* name_space, const char *name, MonoError *error) MONO_INTERNAL;
+
#endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */
guint32 inflated_classes, inflated_classes_size, inflated_methods_size;
guint32 classes_size, class_ext_size;
+/* Low level lock which protects data structures in this module */
+static mono_mutex_t classes_mutex;
+
/* Function supplied by the runtime to find classes by name using information from the AOT file */
static MonoGetClassFromName get_class_from_name = NULL;
static GSList *gclass_recorded_list;
typedef gboolean (*gclass_record_func) (MonoClass*, void*);
+static inline void
+classes_lock (void)
+{
+ mono_locks_acquire (&classes_mutex, ClassesLock);
+}
+
+static inline void
+classes_unlock (void)
+{
+ mono_locks_release (&classes_mutex, ClassesLock);
+}
+
/*
* LOCKING: loader lock must be held until pairing disable_gclass_recording is called.
*/
mono_class_from_typeref (MonoImage *image, guint32 type_token)
{
MonoError error;
+ MonoClass *class = mono_class_from_typeref_checked (image, type_token, &error);
+ g_assert (mono_error_ok (&error)); /*FIXME proper error handling*/
+ return class;
+}
+
+MonoClass *
+mono_class_from_typeref_checked (MonoImage *image, guint32 type_token, MonoError *error)
+{
guint32 cols [MONO_TYPEREF_SIZE];
MonoTableInfo *t = &image->tables [MONO_TABLE_TYPEREF];
guint32 idx;
const char *name, *nspace;
- MonoClass *res;
+ MonoClass *res = NULL;
MonoImage *module;
- if (!mono_verifier_verify_typeref_row (image, (type_token & 0xffffff) - 1, &error)) {
- mono_trace_warning (MONO_TRACE_TYPE, "Failed to resolve typeref from %s due to '%s'", image->name, mono_error_get_message (&error));
+ mono_error_init (error);
+
+ if (!mono_verifier_verify_typeref_row (image, (type_token & 0xffffff) - 1, error))
return NULL;
- }
mono_metadata_decode_row (t, (type_token&0xffffff)-1, cols, MONO_TYPEREF_SIZE);
name = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAME]);
nspace = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAMESPACE]);
- idx = cols [MONO_TYPEREF_SCOPE] >> MONO_RESOLTION_SCOPE_BITS;
- switch (cols [MONO_TYPEREF_SCOPE] & MONO_RESOLTION_SCOPE_MASK) {
- case MONO_RESOLTION_SCOPE_MODULE:
+ idx = cols [MONO_TYPEREF_SCOPE] >> MONO_RESOLUTION_SCOPE_BITS;
+ switch (cols [MONO_TYPEREF_SCOPE] & MONO_RESOLUTION_SCOPE_MASK) {
+ case MONO_RESOLUTION_SCOPE_MODULE:
/*
LAMESPEC The spec says that a null module resolution scope should go through the exported type table.
This is not the observed behavior of existing implementations.
The defacto behavior is that it's just a typedef in disguise.
*/
/* a typedef in disguise */
- return mono_class_from_name (image, nspace, name);
- case MONO_RESOLTION_SCOPE_MODULEREF:
+ res = mono_class_from_name (image, nspace, name); /*FIXME proper error handling*/
+ goto done;
+
+ case MONO_RESOLUTION_SCOPE_MODULEREF:
module = mono_image_load_module (image, idx);
if (module)
- return mono_class_from_name (module, nspace, name);
- else {
- char *msg = g_strdup_printf ("%s%s%s", nspace, nspace [0] ? "." : "", name);
- char *human_name;
-
- human_name = mono_stringify_assembly_name (&image->assembly->aname);
- mono_loader_set_error_type_load (msg, human_name);
- g_free (msg);
- g_free (human_name);
-
- return NULL;
- }
- case MONO_RESOLTION_SCOPE_TYPEREF: {
+ res = mono_class_from_name (module, nspace, name); /*FIXME proper error handling*/
+ goto done;
+
+ case MONO_RESOLUTION_SCOPE_TYPEREF: {
MonoClass *enclosing;
GList *tmp;
if (idx == mono_metadata_token_index (type_token)) {
- mono_loader_set_error_bad_image (g_strdup_printf ("Image %s with self-referencing typeref token %08x.", image->name, type_token));
+ mono_error_set_bad_image (error, image, "Image with self-referencing typeref token %08x.", type_token);
return NULL;
}
- enclosing = mono_class_from_typeref (image, MONO_TOKEN_TYPE_REF | idx);
- if (!enclosing)
+ enclosing = mono_class_from_typeref_checked (image, MONO_TOKEN_TYPE_REF | idx, error);
+ if (!mono_error_ok (error))
return NULL;
if (enclosing->nested_classes_inited && enclosing->ext) {
guint32 string_offset = mono_metadata_decode_row_col (&enclosing->image->tables [MONO_TABLE_TYPEDEF], class_nested - 1, MONO_TYPEDEF_NAME);
const char *nname = mono_metadata_string_heap (enclosing->image, string_offset);
- if (strcmp (nname, name) == 0) {
- MonoClass *res = mono_class_create_from_typedef (enclosing->image, MONO_TOKEN_TYPE_DEF | class_nested, &error);
- if (!mono_error_ok (&error)) {
- mono_loader_set_error_from_mono_error (&error);
- mono_error_cleanup (&error); /*FIXME don't swallow error message.*/
- return NULL;
- }
- return res;
- }
+ if (strcmp (nname, name) == 0)
+ return mono_class_create_from_typedef (enclosing->image, MONO_TOKEN_TYPE_DEF | class_nested, error);
i = mono_metadata_nesting_typedef (enclosing->image, enclosing->type_token, i + 1);
}
}
g_warning ("TypeRef ResolutionScope not yet handled (%d) for %s.%s in image %s", idx, nspace, name, image->name);
- return NULL;
+ goto done;
}
- case MONO_RESOLTION_SCOPE_ASSEMBLYREF:
+ case MONO_RESOLUTION_SCOPE_ASSEMBLYREF:
break;
}
if (idx > image->tables [MONO_TABLE_ASSEMBLYREF].rows) {
- mono_loader_set_error_bad_image (g_strdup_printf ("Image %s with invalid assemblyref token %08x.", image->name, idx));
+ mono_error_set_bad_image (error, image, "Image with invalid assemblyref token %08x.", idx);
return NULL;
}
mono_assembly_get_assemblyref (image, idx - 1, &aname);
human_name = mono_stringify_assembly_name (&aname);
- mono_loader_set_error_assembly_load (human_name, image->assembly ? image->assembly->ref_only : FALSE);
- g_free (human_name);
-
+ mono_error_set_assembly_load_simple (error, human_name, image->assembly ? image->assembly->ref_only : FALSE);
return NULL;
}
- return mono_class_from_name (image->references [idx - 1]->image, nspace, name);
+ res = mono_class_from_name (image->references [idx - 1]->image, nspace, name);
+
+done:
+ /* Generic case, should be avoided for when a better error is possible. */
+ if (!res && mono_error_ok (error)) {
+ char *name = mono_class_name_from_token (image, type_token);
+ char *assembly = mono_assembly_name_from_token (image, type_token);
+ mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
+ }
+ return res;
}
return inflated;
}
-static MonoClass*
+MonoClass*
mono_class_inflate_generic_class_checked (MonoClass *gklass, MonoGenericContext *context, MonoError *error)
{
MonoClass *res;
* in a separate function since it is cheaper than calling mono_class_setup_fields.
*/
static MonoType*
-mono_class_find_enum_basetype (MonoClass *class)
+mono_class_find_enum_basetype (MonoClass *class, MonoError *error)
{
MonoGenericContainer *container = NULL;
MonoImage *m = class->image;
g_assert (class->enumtype);
+ mono_error_init (error);
+
if (class->generic_container)
container = class->generic_container;
else if (class->generic_class) {
if (cols [MONO_FIELD_FLAGS] & FIELD_ATTRIBUTE_STATIC) //no need to decode static fields
continue;
- if (!mono_verifier_verify_field_signature (class->image, cols [MONO_FIELD_SIGNATURE], NULL))
- return NULL;
+ if (!mono_verifier_verify_field_signature (class->image, cols [MONO_FIELD_SIGNATURE], NULL)) {
+ mono_error_set_bad_image (error, class->image, "Invalid field signature %x", cols [MONO_FIELD_SIGNATURE]);
+ goto fail;
+ }
sig = mono_metadata_blob_heap (m, cols [MONO_FIELD_SIGNATURE]);
mono_metadata_decode_value (sig, &sig);
/* FIELD signature == 0x06 */
- if (*sig != 0x06)
- return NULL;
+ if (*sig != 0x06) {
+ mono_error_set_bad_image (error, class->image, "Invalid field signature %x, expected 0x6 but got %x", cols [MONO_FIELD_SIGNATURE], *sig);
+ goto fail;
+ }
ftype = mono_metadata_parse_type_full (m, container, MONO_PARSE_FIELD, cols [MONO_FIELD_FLAGS], sig + 1, &sig);
- if (!ftype)
- return NULL;
+ if (!ftype) {
+ if (mono_loader_get_last_error ()) /*FIXME plug the above to not leak errors*/
+ mono_error_set_from_loader_error (error);
+ else
+ mono_error_set_bad_image (error, class->image, "Could not parse type for field signature %x", cols [MONO_FIELD_SIGNATURE]);
+ goto fail;
+ }
if (class->generic_class) {
//FIXME do we leak here?
- ftype = mono_class_inflate_generic_type (ftype, mono_class_get_context (class));
+ ftype = mono_class_inflate_generic_type_checked (ftype, mono_class_get_context (class), error);
+ if (!mono_error_ok (error))
+ goto fail;
ftype->attrs = cols [MONO_FIELD_FLAGS];
}
return ftype;
}
+ mono_error_set_type_load_class (error, class, "Could not find base type");
+fail:
+ g_assert (!mono_loader_get_last_error ());
return NULL;
}
* mono_class_setup_methods:
* @class: a class
*
- * Initializes the 'methods' array in the klass.
+ * Initializes the 'methods' array in CLASS.
* Calling this method should be avoided if possible since it allocates a lot
* of long-living MonoMethod structures.
* Methods belonging to an interface are assigned a sequential slot starting
void
mono_class_setup_methods (MonoClass *class)
{
- int i;
+ int i, count;
MonoMethod **methods;
if (class->methods)
return;
- mono_loader_lock ();
-
- if (class->methods) {
- mono_loader_unlock ();
- return;
- }
-
if (class->generic_class) {
MonoError error;
MonoClass *gklass = class->generic_class->container_class;
if (!gklass->exception_type)
mono_class_setup_methods (gklass);
if (gklass->exception_type) {
- /*FIXME make exception_data less opaque so it's possible to dup it here*/
+ /* FIXME make exception_data less opaque so it's possible to dup it here */
mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
- mono_loader_unlock ();
return;
}
/* The + 1 makes this always non-NULL to pass the check in mono_class_setup_methods () */
- class->method.count = gklass->method.count;
- methods = mono_class_alloc0 (class, sizeof (MonoMethod*) * (class->method.count + 1));
+ count = gklass->method.count;
+ methods = mono_class_alloc0 (class, sizeof (MonoMethod*) * (count + 1));
- for (i = 0; i < class->method.count; i++) {
+ for (i = 0; i < count; i++) {
methods [i] = mono_class_inflate_generic_method_full_checked (
gklass->methods [i], class, mono_class_get_context (class), &error);
if (!mono_error_ok (&error)) {
g_free (method);
mono_error_cleanup (&error);
- mono_loader_unlock ();
return;
}
}
int count_generic = 0, first_generic = 0;
int method_num = 0;
- class->method.count = 3 + (class->rank > 1? 2: 1);
+ count = 3 + (class->rank > 1? 2: 1);
mono_class_setup_interfaces (class, &error);
g_assert (mono_error_ok (&error)); /*FIXME can this fail for array types?*/
if (class->interface_count) {
count_generic = generic_array_methods (class);
- first_generic = class->method.count;
- class->method.count += class->interface_count * count_generic;
+ first_generic = count;
+ count += class->interface_count * count_generic;
}
- methods = mono_class_alloc0 (class, sizeof (MonoMethod*) * class->method.count);
+ methods = mono_class_alloc0 (class, sizeof (MonoMethod*) * count);
sig = mono_metadata_signature_alloc (class->image, class->rank);
sig->ret = &mono_defaults.void_class->byval_arg;
for (i = 0; i < class->interface_count; i++)
setup_generic_array_ifaces (class, class->interfaces [i], methods, first_generic + i * count_generic);
} else {
- methods = mono_class_alloc (class, sizeof (MonoMethod*) * class->method.count);
- for (i = 0; i < class->method.count; ++i) {
+ count = class->method.count;
+ methods = mono_class_alloc (class, sizeof (MonoMethod*) * count);
+ for (i = 0; i < count; ++i) {
int idx = mono_metadata_translate_token_index (class->image, MONO_TABLE_METHOD, class->method.first + i + 1);
methods [i] = mono_get_method (class->image, MONO_TOKEN_METHOD_DEF | idx, class);
}
if (MONO_CLASS_IS_INTERFACE (class)) {
int slot = 0;
/*Only assign slots to virtual methods as interfaces are allowed to have static methods.*/
- for (i = 0; i < class->method.count; ++i) {
+ for (i = 0; i < count; ++i) {
if (methods [i]->flags & METHOD_ATTRIBUTE_VIRTUAL)
methods [i]->slot = slot++;
}
}
- /* Needed because of the double-checking locking pattern */
- mono_memory_barrier ();
+ mono_image_lock (class->image);
- class->methods = methods;
+ if (!class->methods) {
+ class->method.count = count;
- mono_loader_unlock ();
+ /* Needed because of the double-checking locking pattern */
+ mono_memory_barrier ();
+
+ class->methods = methods;
+ }
+
+ mono_image_unlock (class->image);
}
/*
return klass->vtable_size;
}
-/*This method can fail the class.*/
+/*
+ * mono_class_setup_properties:
+ *
+ * Initialize class->ext.property and class->ext.properties.
+ *
+ * This method can fail the class.
+ */
static void
mono_class_setup_properties (MonoClass *class)
{
MonoTableInfo *msemt = &class->image->tables [MONO_TABLE_METHODSEMANTICS];
MonoProperty *properties;
guint32 last;
+ int first, count;
if (class->ext && class->ext->properties)
return;
- mono_loader_lock ();
-
- if (class->ext && class->ext->properties) {
- mono_loader_unlock ();
- return;
- }
-
- mono_class_alloc_ext (class);
-
if (class->generic_class) {
MonoClass *gklass = class->generic_class->container_class;
mono_class_setup_properties (gklass);
if (gklass->exception_type) {
mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
- mono_loader_unlock ();
return;
}
- class->ext->property = gklass->ext->property;
-
- properties = mono_class_new0 (class, MonoProperty, class->ext->property.count + 1);
+ properties = mono_class_new0 (class, MonoProperty, gklass->ext->property.count + 1);
- for (i = 0; i < class->ext->property.count; i++) {
+ for (i = 0; i < gklass->ext->property.count; i++) {
MonoProperty *prop = &properties [i];
*prop = gklass->ext->properties [i];
prop->parent = class;
}
+
+ first = gklass->ext->property.first;
+ count = gklass->ext->property.count;
} else {
- int first = mono_metadata_properties_from_typedef (class->image, mono_metadata_token_index (class->type_token) - 1, &last);
- int count = last - first;
+ first = mono_metadata_properties_from_typedef (class->image, mono_metadata_token_index (class->type_token) - 1, &last);
+ count = last - first;
if (count) {
mono_class_setup_methods (class);
- if (class->exception_type) {
- mono_loader_unlock ();
+ if (class->exception_type)
return;
- }
}
- class->ext->property.first = first;
- class->ext->property.count = count;
properties = mono_class_alloc0 (class, sizeof (MonoProperty) * count);
for (i = first; i < last; ++i) {
mono_metadata_decode_table_row (class->image, MONO_TABLE_PROPERTY, i, cols, MONO_PROPERTY_SIZE);
}
}
}
- /*Flush any pending writes as we do double checked locking on class->properties */
+
+ mono_class_alloc_ext (class);
+
+ mono_image_lock (class->image);
+
+ if (class->ext->properties) {
+ /* We leak 'properties' which was allocated from the image mempool */
+ mono_image_unlock (class->image);
+ return;
+ }
+
+ class->ext->property.first = first;
+ class->ext->property.count = count;
+
+ /* Flush any pending writes as we do double checked locking on class->ext->properties */
mono_memory_barrier ();
/* Leave this assignment as the last op in the function */
class->ext->properties = properties;
- mono_loader_unlock ();
+ mono_image_unlock (class->image);
}
static MonoMethod**
if (class->ext && class->ext->events)
return;
- mono_loader_lock ();
-
- if (class->ext && class->ext->events) {
- mono_loader_unlock ();
- return;
- }
-
- mono_class_alloc_ext (class);
-
if (class->generic_class) {
MonoClass *gklass = class->generic_class->container_class;
MonoGenericContext *context;
mono_class_setup_events (gklass);
if (gklass->exception_type) {
mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
- mono_loader_unlock ();
return;
}
- class->ext->event = gklass->ext->event;
- class->ext->events = mono_class_new0 (class, MonoEvent, class->ext->event.count);
+ first = gklass->ext->event.first;
+ count = gklass->ext->event.count;
- if (class->ext->event.count)
+ events = mono_class_new0 (class, MonoEvent, count);
+
+ if (count)
context = mono_class_get_context (class);
- for (i = 0; i < class->ext->event.count; i++) {
- MonoEvent *event = &class->ext->events [i];
+ for (i = 0; i < count; i++) {
+ MonoEvent *event = &events [i];
MonoEvent *gevent = &gklass->ext->events [i];
event->parent = class;
#endif
event->attrs = gevent->attrs;
}
+ } else {
+ first = mono_metadata_events_from_typedef (class->image, mono_metadata_token_index (class->type_token) - 1, &last);
+ count = last - first;
- mono_loader_unlock ();
- return;
- }
-
- first = mono_metadata_events_from_typedef (class->image, mono_metadata_token_index (class->type_token) - 1, &last);
- count = last - first;
-
- if (count) {
- mono_class_setup_methods (class);
- if (class->exception_type) {
- mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
- mono_loader_unlock ();
- return;
+ if (count) {
+ mono_class_setup_methods (class);
+ if (class->exception_type) {
+ mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Generic type definition failed to load"));
+ return;
+ }
}
- }
- class->ext->event.first = first;
- class->ext->event.count = count;
- events = mono_class_alloc0 (class, sizeof (MonoEvent) * class->ext->event.count);
- for (i = first; i < last; ++i) {
- MonoEvent *event = &events [i - first];
- mono_metadata_decode_table_row (class->image, MONO_TABLE_EVENT, i, cols, MONO_EVENT_SIZE);
- event->parent = class;
- event->attrs = cols [MONO_EVENT_FLAGS];
- event->name = mono_metadata_string_heap (class->image, cols [MONO_EVENT_NAME]);
+ events = mono_class_alloc0 (class, sizeof (MonoEvent) * count);
+ for (i = first; i < last; ++i) {
+ MonoEvent *event = &events [i - first];
- startm = mono_metadata_methods_from_event (class->image, i, &endm);
- for (j = startm; j < endm; ++j) {
- MonoMethod *method;
+ mono_metadata_decode_table_row (class->image, MONO_TABLE_EVENT, i, cols, MONO_EVENT_SIZE);
+ event->parent = class;
+ event->attrs = cols [MONO_EVENT_FLAGS];
+ event->name = mono_metadata_string_heap (class->image, cols [MONO_EVENT_NAME]);
- mono_metadata_decode_row (msemt, j, cols, MONO_METHOD_SEMA_SIZE);
+ startm = mono_metadata_methods_from_event (class->image, i, &endm);
+ for (j = startm; j < endm; ++j) {
+ MonoMethod *method;
- if (class->image->uncompressed_metadata)
- /* It seems like the MONO_METHOD_SEMA_METHOD column needs no remapping */
- method = mono_get_method (class->image, MONO_TOKEN_METHOD_DEF | cols [MONO_METHOD_SEMA_METHOD], class);
- else
- method = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
+ mono_metadata_decode_row (msemt, j, cols, MONO_METHOD_SEMA_SIZE);
- switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
- case METHOD_SEMANTIC_ADD_ON:
- event->add = method;
- break;
- case METHOD_SEMANTIC_REMOVE_ON:
- event->remove = method;
- break;
- case METHOD_SEMANTIC_FIRE:
- event->raise = method;
- break;
- case METHOD_SEMANTIC_OTHER: {
+ if (class->image->uncompressed_metadata)
+ /* It seems like the MONO_METHOD_SEMA_METHOD column needs no remapping */
+ method = mono_get_method (class->image, MONO_TOKEN_METHOD_DEF | cols [MONO_METHOD_SEMA_METHOD], class);
+ else
+ method = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
+
+ switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
+ case METHOD_SEMANTIC_ADD_ON:
+ event->add = method;
+ break;
+ case METHOD_SEMANTIC_REMOVE_ON:
+ event->remove = method;
+ break;
+ case METHOD_SEMANTIC_FIRE:
+ event->raise = method;
+ break;
+ case METHOD_SEMANTIC_OTHER: {
#ifndef MONO_SMALL_CONFIG
- int n = 0;
-
- if (event->other == NULL) {
- event->other = g_new0 (MonoMethod*, 2);
- } else {
- while (event->other [n])
- n++;
- event->other = g_realloc (event->other, (n + 2) * sizeof (MonoMethod*));
- }
- event->other [n] = method;
- /* NULL terminated */
- event->other [n + 1] = NULL;
+ int n = 0;
+
+ if (event->other == NULL) {
+ event->other = g_new0 (MonoMethod*, 2);
+ } else {
+ while (event->other [n])
+ n++;
+ event->other = g_realloc (event->other, (n + 2) * sizeof (MonoMethod*));
+ }
+ event->other [n] = method;
+ /* NULL terminated */
+ event->other [n + 1] = NULL;
#endif
- break;
- }
- default:
- break;
+ break;
+ }
+ default:
+ break;
+ }
}
}
}
- /*Flush any pending writes as we do double checked locking on class->properties */
+
+ mono_class_alloc_ext (class);
+
+ mono_image_lock (class->image);
+
+ if (class->ext->events) {
+ mono_image_unlock (class->image);
+ return;
+ }
+
+ class->ext->event.first = first;
+ class->ext->event.count = count;
+
+ /* Flush any pending writes as we do double checked locking on class->ext.events */
mono_memory_barrier ();
/* Leave this assignment as the last op in the function */
class->ext->events = events;
- mono_loader_unlock ();
+ mono_image_unlock (class->image);
}
/*
* Global pool of interface IDs, represented as a bitset.
- * LOCKING: this is supposed to be accessed with the loader lock held.
+ * LOCKING: Protected by the classes lock.
*/
static MonoBitSet *global_interface_bitset = NULL;
void
mono_unload_interface_ids (MonoBitSet *bitset)
{
- mono_loader_lock ();
+ classes_lock ();
mono_bitset_sub (global_interface_bitset, bitset);
- mono_loader_unlock ();
+ classes_unlock ();
}
void
mono_unload_interface_id (MonoClass *class)
{
if (global_interface_bitset && class->interface_id) {
- mono_loader_lock ();
+ classes_lock ();
mono_bitset_clear (global_interface_bitset, class->interface_id);
- mono_loader_unlock ();
+ classes_unlock ();
}
}
*
* Assign a unique integer ID to the interface represented by @class.
* The ID will positive and as small as possible.
- * LOCKING: this is supposed to be called with the loader lock held.
+ * LOCKING: Acquires the classes lock.
* Returns: the new ID.
*/
static guint
g_assert (MONO_CLASS_IS_INTERFACE (class));
+ classes_lock ();
+
if (!global_interface_bitset) {
global_interface_bitset = mono_bitset_new (128, 0);
}
mono_bitset_set (class->image->interface_bitset, iid);
}
+ classes_unlock ();
+
#ifndef MONO_SMALL_CONFIG
if (mono_print_vtable) {
int generic_id;
} else {
class->vtable_size = szarray_vtable_size[slot];
}
- class->has_finalize_inited = TRUE;
} else if (class->generic_class && !MONO_CLASS_IS_INTERFACE (class)) {
MonoClass *gklass = class->generic_class->container_class;
/* Generic instance case */
class->ghcimpl = gklass->ghcimpl;
- class->has_finalize = mono_class_has_finalizer (gklass);
- class->has_finalize_inited = TRUE;
class->has_cctor = gklass->has_cctor;
mono_class_setup_vtable (gklass);
gboolean
mono_class_has_finalizer (MonoClass *klass)
{
- if (!klass->has_finalize_inited) {
- MonoClass *class = klass;
+ MonoClass *class = klass;
+ gboolean has_finalize = FALSE;
- mono_loader_lock ();
+ if (klass->has_finalize_inited)
+ return klass->has_finalize;
- /* Interfaces and valuetypes are not supposed to have finalizers */
- if (!(MONO_CLASS_IS_INTERFACE (class) || class->valuetype)) {
- MonoMethod *cmethod = NULL;
+ /* Interfaces and valuetypes are not supposed to have finalizers */
+ if (!(MONO_CLASS_IS_INTERFACE (class) || class->valuetype)) {
+ MonoMethod *cmethod = NULL;
- if (class->parent && class->parent->has_finalize) {
- class->has_finalize = 1;
- } else {
- if (class->parent) {
- /*
- * Can't search in metadata for a method named Finalize, because that
- * ignores overrides.
- */
- mono_class_setup_vtable (class);
- if (class->exception_type || mono_loader_get_last_error ())
- goto leave;
+ if (class->rank == 1 && class->byval_arg.type == MONO_TYPE_SZARRAY) {
+ } else if (class->generic_class) {
+ MonoClass *gklass = class->generic_class->container_class;
+
+ has_finalize = mono_class_has_finalizer (gklass);
+ } else if (class->parent && class->parent->has_finalize) {
+ has_finalize = TRUE;
+ } else {
+ if (class->parent) {
+ /*
+ * Can't search in metadata for a method named Finalize, because that
+ * ignores overrides.
+ */
+ mono_class_setup_vtable (class);
+ if (class->exception_type || mono_loader_get_last_error ())
+ cmethod = NULL;
+ else
cmethod = class->vtable [finalize_slot];
- }
+ }
- if (cmethod) {
- g_assert (class->vtable_size > finalize_slot);
+ if (cmethod) {
+ g_assert (class->vtable_size > finalize_slot);
- class->has_finalize = 0;
- if (class->parent) {
- if (cmethod->is_inflated)
- cmethod = ((MonoMethodInflated*)cmethod)->declaring;
- if (cmethod != default_finalize) {
- class->has_finalize = 1;
- }
- }
+ if (class->parent) {
+ if (cmethod->is_inflated)
+ cmethod = ((MonoMethodInflated*)cmethod)->declaring;
+ if (cmethod != default_finalize)
+ has_finalize = TRUE;
}
}
}
+ }
+
+ mono_image_lock (klass->image);
+
+ if (!klass->has_finalize_inited) {
+ klass->has_finalize = has_finalize ? 1 : 0;
mono_memory_barrier ();
klass->has_finalize_inited = TRUE;
-
- mono_loader_unlock ();
}
- return klass->has_finalize;
+ mono_image_unlock (klass->image);
- leave:
- mono_loader_unlock ();
- return FALSE;
+ return klass->has_finalize;
}
gboolean
class->byval_arg.data.klass = class;
class->byval_arg.type = MONO_TYPE_CLASS;
}
- parent = mono_class_get_full (image, parent_token, context);
+ parent = mono_class_get_checked (image, parent_token, error);
+ if (parent && context) /* Always inflate */
+ parent = mono_class_inflate_generic_class_checked (parent, context, error);
if (parent == NULL) {
- mono_class_set_failure_from_loader_error (class, error, g_strdup_printf ("Could not load parent, token is %x", parent_token));
+ mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
goto parent_failure;
}
}
if (class->enumtype) {
- MonoType *enum_basetype = mono_class_find_enum_basetype (class);
+ MonoType *enum_basetype = mono_class_find_enum_basetype (class, error);
if (!enum_basetype) {
/*set it to a default value as the whole runtime can't handle this to be null*/
class->cast_class = class->element_class = mono_defaults.int32_class;
- mono_class_set_failure_and_error (class, error, "Could not enum basetype");
+ mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
mono_loader_unlock ();
mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
g_assert (!mono_loader_get_last_error ());
* We must do this after the class has been constructed to make certain recursive scenarios
* work.
*/
- if (class->generic_container && !mono_metadata_load_generic_param_constraints_full (image, type_token, class->generic_container)){
- mono_class_set_failure_from_loader_error (class, error, g_strdup ("Could not load generic parameter constraints"));
+ if (class->generic_container && !mono_metadata_load_generic_param_constraints_checked (image, type_token, class->generic_container, error)) {
+ mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load generic parameter constrains due to %s", mono_error_get_message (error)));
mono_loader_unlock ();
mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
g_assert (!mono_loader_get_last_error ());
}
ht = is_mvar ? image->mvar_cache_slow : image->var_cache_slow;
if (!ht) {
- mono_loader_lock ();
+ mono_image_lock (image);
ht = is_mvar ? image->mvar_cache_slow : image->var_cache_slow;
if (!ht) {
ht = g_hash_table_new (NULL, NULL);
else
image->var_cache_slow = ht;
}
- mono_loader_unlock ();
+ mono_image_unlock (image);
}
g_hash_table_insert (ht, GINT_TO_POINTER (n), klass);
static MonoType *
mono_type_retrieve_from_typespec (MonoImage *image, guint32 type_spec, MonoGenericContext *context, gboolean *did_inflate, MonoError *error)
{
- MonoType *t = mono_type_create_from_typespec (image, type_spec);
+ MonoType *t = mono_type_create_from_typespec_checked (image, type_spec, error);
- mono_error_init (error);
*did_inflate = FALSE;
- if (!t) {
- char *name = mono_class_name_from_token (image, type_spec);
- char *assembly = mono_assembly_name_from_token (image, type_spec);
- mono_error_set_type_load_name (error, name, assembly, "Could not resolve typespec token %08x", type_spec);
+ if (!t)
return NULL;
- }
if (context && (context->class_inst || context->method_inst)) {
MonoType *inflated = inflate_generic_type (NULL, t, context, error);
- if (!mono_error_ok (error))
+ if (!mono_error_ok (error)) {
+ g_assert (!mono_loader_get_last_error ());
return NULL;
+ }
if (inflated) {
t = inflated;
* from mono_class_from_mono_type (), mono_array_new (),
* Array:CreateInstance (), etc, so use a separate cache + a separate lock.
*/
- EnterCriticalSection (&image->szarray_cache_lock);
+ mono_mutex_lock (&image->szarray_cache_lock);
if (!image->szarray_cache)
image->szarray_cache = g_hash_table_new (mono_aligned_addr_hash, NULL);
class = g_hash_table_lookup (image->szarray_cache, eclass);
- LeaveCriticalSection (&image->szarray_cache_lock);
+ mono_mutex_unlock (&image->szarray_cache_lock);
if (class)
return class;
if (rank == 1 && !bounded) {
MonoClass *prev_class;
- EnterCriticalSection (&image->szarray_cache_lock);
+ mono_mutex_lock (&image->szarray_cache_lock);
prev_class = g_hash_table_lookup (image->szarray_cache, eclass);
if (prev_class)
/* Someone got in before us */
class = prev_class;
else
g_hash_table_insert (image->szarray_cache, eclass, class);
- LeaveCriticalSection (&image->szarray_cache_lock);
+ mono_mutex_unlock (&image->szarray_cache_lock);
} else {
list = g_slist_append (rootlist, class);
g_hash_table_insert (image->array_cache, eclass, list);
g_assert (field->type->attrs & FIELD_ATTRIBUTE_HAS_DEFAULT);
if (!klass->ext || !klass->ext->field_def_values) {
- mono_loader_lock ();
+ MonoFieldDefaultValue *def_values;
+
mono_class_alloc_ext (klass);
+
+ def_values = mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count);
+
+ mono_image_lock (klass->image);
+ mono_memory_barrier ();
if (!klass->ext->field_def_values)
- klass->ext->field_def_values = mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count);
- mono_loader_unlock ();
+ klass->ext->field_def_values = def_values;
+ mono_image_unlock (klass->image);
}
field_index = mono_field_get_index (field);
}
mono_metadata_decode_row (t, idx-1, cols, MONO_TYPEREF_SIZE);
- idx = cols [MONO_TYPEREF_SCOPE] >> MONO_RESOLTION_SCOPE_BITS;
- switch (cols [MONO_TYPEREF_SCOPE] & MONO_RESOLTION_SCOPE_MASK) {
- case MONO_RESOLTION_SCOPE_MODULE:
+ idx = cols [MONO_TYPEREF_SCOPE] >> MONO_RESOLUTION_SCOPE_BITS;
+ switch (cols [MONO_TYPEREF_SCOPE] & MONO_RESOLUTION_SCOPE_MASK) {
+ case MONO_RESOLUTION_SCOPE_MODULE:
/* FIXME: */
return g_strdup ("");
- case MONO_RESOLTION_SCOPE_MODULEREF:
+ case MONO_RESOLUTION_SCOPE_MODULEREF:
/* FIXME: */
return g_strdup ("");
- case MONO_RESOLTION_SCOPE_TYPEREF:
+ case MONO_RESOLUTION_SCOPE_TYPEREF:
/* FIXME: */
return g_strdup ("");
- case MONO_RESOLTION_SCOPE_ASSEMBLYREF:
+ case MONO_RESOLUTION_SCOPE_ASSEMBLYREF:
mono_assembly_get_assemblyref (image, idx - 1, &aname);
return mono_stringify_assembly_name (&aname);
default:
* @image: the image where the class resides
* @type_token: the token for the class
* @context: the generic context used to evaluate generic instantiations in
+ * @deprecated: Functions that expose MonoGenericContext are going away in mono 4.0
*
* Returns: the MonoClass that represents @type_token in @image
*/
mono_class_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context)
{
MonoError error;
+ MonoClass *class;
+ class = mono_class_get_checked (image, type_token, &error);
+
+ if (class && context && mono_metadata_token_table (type_token) == MONO_TABLE_TYPESPEC)
+ class = mono_class_inflate_generic_class_checked (class, context, &error);
+
+ if (!class) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /*FIXME don't swallow this error */
+ }
+ return class;
+}
+
+
+MonoClass *
+mono_class_get_and_inflate_typespec_checked (MonoImage *image, guint32 type_token, MonoGenericContext *context, MonoError *error)
+{
+ MonoClass *class;
+
+ mono_error_init (error);
+ class = mono_class_get_checked (image, type_token, error);
+
+ if (class && context && mono_metadata_token_table (type_token) == MONO_TABLE_TYPESPEC)
+ class = mono_class_inflate_generic_class_checked (class, context, error);
+
+ return class;
+}
+/**
+ * mono_class_get_checked:
+ * @image: the image where the class resides
+ * @type_token: the token for the class
+ * @error: error object to return any error
+ *
+ * Returns: the MonoClass that represents @type_token in @image
+ */
+MonoClass *
+mono_class_get_checked (MonoImage *image, guint32 type_token, MonoError *error)
+{
MonoClass *class = NULL;
+ mono_error_init (error);
+
if (image_is_dynamic (image)) {
int table = mono_metadata_token_table (type_token);
if (table != MONO_TABLE_TYPEDEF && table != MONO_TABLE_TYPEREF && table != MONO_TABLE_TYPESPEC) {
- mono_loader_set_error_bad_image (g_strdup ("Bad type token."));
+ mono_error_set_bad_image (error, image,"Bad token table for dynamic image: %x", table);
return NULL;
}
- return mono_lookup_dynamic_token (image, type_token, context);
+ class = mono_lookup_dynamic_token (image, type_token, NULL); /*FIXME proper error handling*/
+ goto done;
}
switch (type_token & 0xff000000){
case MONO_TOKEN_TYPE_DEF:
- class = mono_class_create_from_typedef (image, type_token, &error);
- if (!mono_error_ok (&error)) {
- mono_loader_set_error_from_mono_error (&error);
- /*FIXME don't swallow the error message*/
- mono_error_cleanup (&error);
- return NULL;
- }
+ class = mono_class_create_from_typedef (image, type_token, error);
break;
case MONO_TOKEN_TYPE_REF:
- class = mono_class_from_typeref (image, type_token);
+ class = mono_class_from_typeref_checked (image, type_token, error);
break;
case MONO_TOKEN_TYPE_SPEC:
- class = mono_class_create_from_typespec (image, type_token, context, &error);
- if (!mono_error_ok (&error)) {
- /*FIXME don't swallow the error message*/
- mono_error_cleanup (&error);
- }
+ class = mono_class_create_from_typespec (image, type_token, NULL, error);
break;
default:
- g_warning ("unknown token type %x", type_token & 0xff000000);
- g_assert_not_reached ();
+ mono_error_set_bad_image (error, image, "Unknown type token %x", type_token & 0xff000000);
}
- if (!class){
+done:
+ /* Generic case, should be avoided for when a better error is possible. */
+ if (!class && mono_error_ok (error)) {
char *name = mono_class_name_from_token (image, type_token);
char *assembly = mono_assembly_name_from_token (image, type_token);
- mono_loader_set_error_type_load (name, assembly);
- g_free (name);
- g_free (assembly);
+ mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
}
return class;
/**
- * mono_type_get_full:
+ * mono_type_get_checked:
* @image: the image where the type resides
* @type_token: the token for the type
* @context: the generic context used to evaluate generic instantiations in
+ * @error: Error handling context
*
* This functions exists to fullfill the fact that sometimes it's desirable to have access to the
*
* Returns: the MonoType that represents @type_token in @image
*/
MonoType *
-mono_type_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context)
+mono_type_get_checked (MonoImage *image, guint32 type_token, MonoGenericContext *context, MonoError *error)
{
- MonoError error;
MonoType *type = NULL;
gboolean inflated = FALSE;
+ mono_error_init (error);
+
//FIXME: this will not fix the very issue for which mono_type_get_full exists -but how to do it then?
if (image_is_dynamic (image))
return mono_class_get_type (mono_lookup_dynamic_token (image, type_token, context));
if ((type_token & 0xff000000) != MONO_TOKEN_TYPE_SPEC) {
- MonoClass *class = mono_class_get_full (image, type_token, context);
- return class ? mono_class_get_type (class) : NULL;
- }
+ MonoClass *class = mono_class_get_checked (image, type_token, error);
- type = mono_type_retrieve_from_typespec (image, type_token, context, &inflated, &error);
+ if (!class) {
+ g_assert (!mono_loader_get_last_error ());
+ return NULL;
+ }
- if (!mono_error_ok (&error)) {
- /*FIXME don't swalloc the error message.*/
- char *name = mono_class_name_from_token (image, type_token);
- char *assembly = mono_assembly_name_from_token (image, type_token);
+ g_assert (class);
+ return mono_class_get_type (class);
+ }
- g_warning ("Error loading type %s from %s due to %s", name, assembly, mono_error_get_message (&error));
+ type = mono_type_retrieve_from_typespec (image, type_token, context, &inflated, error);
- mono_error_cleanup (&error);
- mono_loader_set_error_type_load (name, assembly);
+ if (!type) {
+ g_assert (!mono_loader_get_last_error ());
return NULL;
}
* @image: The MonoImage where the type is looked up in
* @name_space: the type namespace
* @name: the type short name.
+ * @deprecated: use the _checked variant
*
* Obtains a MonoClass with a given namespace and a given name which
* is located in the given MonoImage. The namespace and name
*/
MonoClass *
mono_class_from_name_case (MonoImage *image, const char* name_space, const char *name)
+{
+ MonoError error;
+ MonoClass *res = mono_class_from_name_case_checked (image, name_space, name, &error);
+ g_assert (!mono_error_ok (&error));
+ return res;
+}
+
+MonoClass *
+mono_class_from_name_case_checked (MonoImage *image, const char* name_space, const char *name, MonoError *error)
{
MonoTableInfo *t = &image->tables [MONO_TABLE_TYPEDEF];
guint32 cols [MONO_TYPEDEF_SIZE];
const char *nspace;
guint32 i, visib;
+ mono_error_init (error);
+
if (image_is_dynamic (image)) {
guint32 token = 0;
FindUserData user_data;
mono_image_unlock (image);
if (token)
- return mono_class_get (image, MONO_TOKEN_TYPE_DEF | token);
+ return mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | token, error);
else
return NULL;
n = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAME]);
nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]);
if (mono_utf8_strcasecmp (n, name) == 0 && mono_utf8_strcasecmp (nspace, name_space) == 0)
- return mono_class_get (image, MONO_TOKEN_TYPE_DEF | i);
+ return mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | i, error);
}
return NULL;
}
case MONO_TOKEN_TYPE_DEF:
case MONO_TOKEN_TYPE_REF:
case MONO_TOKEN_TYPE_SPEC: {
+ MonoError error;
MonoType *type;
if (handle_class)
*handle_class = mono_defaults.typehandle_class;
- type = mono_type_get_full (image, token, context);
- if (!type)
+ type = mono_type_get_checked (image, token, context, &error);
+ if (!type) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /* FIXME Don't swallow the error */
return NULL;
+ }
mono_class_init (mono_class_from_mono_type (type));
/* We return a MonoType* as handle */
return type;
}
case MONO_TOKEN_FIELD_DEF: {
MonoClass *class;
+ MonoError error;
guint32 type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
if (!type)
return NULL;
if (handle_class)
*handle_class = mono_defaults.fieldhandle_class;
- class = mono_class_get_full (image, MONO_TOKEN_TYPE_DEF | type, context);
- if (!class)
+ class = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_DEF | type, context, &error);
+ if (!class) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /* FIXME Don't swallow the error */
return NULL;
+ }
mono_class_init (class);
return mono_class_get_field (class, token);
}
return NULL;
}
+static void
+setup_nested_types (MonoClass *klass)
+{
+ MonoError error;
+ GList *classes, *nested_classes, *l;
+ int i;
+
+ if (klass->nested_classes_inited)
+ return;
+
+ if (!klass->type_token)
+ klass->nested_classes_inited = TRUE;
+
+ i = mono_metadata_nesting_typedef (klass->image, klass->type_token, 1);
+ classes = NULL;
+ while (i) {
+ MonoClass* nclass;
+ guint32 cols [MONO_NESTED_CLASS_SIZE];
+ mono_metadata_decode_row (&klass->image->tables [MONO_TABLE_NESTEDCLASS], i - 1, cols, MONO_NESTED_CLASS_SIZE);
+ nclass = mono_class_create_from_typedef (klass->image, MONO_TOKEN_TYPE_DEF | cols [MONO_NESTED_CLASS_NESTED], &error);
+ if (!mono_error_ok (&error)) {
+ /*FIXME don't swallow the error message*/
+ mono_error_cleanup (&error);
+
+ i = mono_metadata_nesting_typedef (klass->image, klass->type_token, i + 1);
+ continue;
+ }
+
+ classes = g_list_prepend (classes, nclass);
+
+ i = mono_metadata_nesting_typedef (klass->image, klass->type_token, i + 1);
+ }
+
+ mono_class_alloc_ext (klass);
+
+ nested_classes = NULL;
+ for (l = classes; l; l = l->next)
+ nested_classes = g_list_prepend_image (klass->image, nested_classes, l->data);
+ g_list_free (classes);
+
+ mono_image_lock (klass->image);
+
+ mono_memory_barrier ();
+ if (!klass->nested_classes_inited) {
+ klass->ext->nested_classes = nested_classes;
+ mono_memory_barrier ();
+ klass->nested_classes_inited = TRUE;
+ }
+
+ mono_image_unlock (klass->image);
+}
+
/**
* mono_class_get_nested_types
* @klass: the MonoClass to act on
MonoClass*
mono_class_get_nested_types (MonoClass* klass, gpointer *iter)
{
- MonoError error;
GList *item;
- int i;
if (!iter)
return NULL;
- if (!klass->nested_classes_inited) {
- if (!klass->type_token)
- klass->nested_classes_inited = TRUE;
- mono_loader_lock ();
- if (!klass->nested_classes_inited) {
- i = mono_metadata_nesting_typedef (klass->image, klass->type_token, 1);
- while (i) {
- MonoClass* nclass;
- guint32 cols [MONO_NESTED_CLASS_SIZE];
- mono_metadata_decode_row (&klass->image->tables [MONO_TABLE_NESTEDCLASS], i - 1, cols, MONO_NESTED_CLASS_SIZE);
- nclass = mono_class_create_from_typedef (klass->image, MONO_TOKEN_TYPE_DEF | cols [MONO_NESTED_CLASS_NESTED], &error);
- if (!mono_error_ok (&error)) {
- /*FIXME don't swallow the error message*/
- mono_error_cleanup (&error);
-
- i = mono_metadata_nesting_typedef (klass->image, klass->type_token, i + 1);
- continue;
- }
- mono_class_alloc_ext (klass);
- klass->ext->nested_classes = g_list_prepend_image (klass->image, klass->ext->nested_classes, nclass);
-
- i = mono_metadata_nesting_typedef (klass->image, klass->type_token, i + 1);
- }
- }
- mono_memory_barrier ();
- klass->nested_classes_inited = TRUE;
- mono_loader_unlock ();
- }
+ if (!klass->nested_classes_inited)
+ setup_nested_types (klass);
if (!*iter) {
/* start from the first */
guint32 rva;
int field_index;
MonoClass *klass = field->parent;
+ MonoFieldDefaultValue *field_def_values;
g_assert (field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA);
if (!klass->ext || !klass->ext->field_def_values) {
- mono_loader_lock ();
mono_class_alloc_ext (klass);
+
+ field_def_values = mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count);
+
+ mono_image_lock (klass->image);
if (!klass->ext->field_def_values)
- klass->ext->field_def_values = mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * klass->field.count);
- mono_loader_unlock ();
+ klass->ext->field_def_values = field_def_values;
+ mono_image_unlock (klass->image);
}
field_index = mono_field_get_index (field);
void
mono_classes_init (void)
{
+ mono_mutex_init (&classes_mutex);
+
mono_counters_register ("Inflated methods size",
MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &inflated_methods_size);
mono_counters_register ("Inflated classes",
if (global_interface_bitset)
mono_bitset_free (global_interface_bitset);
global_interface_bitset = NULL;
+ mono_mutex_destroy (&classes_mutex);
}
/**
* mono_class_alloc_ext:
*
* Allocate klass->ext if not already done.
- * LOCKING: Assumes the loader lock is held.
*/
void
mono_class_alloc_ext (MonoClass *klass)
{
- if (!klass->ext) {
- klass->ext = mono_class_alloc0 (klass, sizeof (MonoClassExt));
- class_ext_size += sizeof (MonoClassExt);
- }
+ MonoClassExt *ext;
+
+ if (klass->ext)
+ return;
+
+ ext = mono_class_alloc0 (klass, sizeof (MonoClassExt));
+ mono_image_lock (klass->image);
+ mono_memory_barrier ();
+ if (!klass->ext)
+ klass->ext = ext;
+ class_ext_size += sizeof (MonoClassExt);
+ mono_image_unlock (klass->image);
}
/*
void
mono_class_setup_interfaces (MonoClass *klass, MonoError *error)
{
- int i;
+ int i, interface_count;
+ MonoClass **interfaces;
mono_error_init (error);
if (klass->interfaces_inited)
return;
- mono_loader_lock ();
-
- if (klass->interfaces_inited) {
- mono_loader_unlock ();
- return;
- }
-
if (klass->rank == 1 && klass->byval_arg.type != MONO_TYPE_ARRAY) {
MonoType *args [1];
/* generic IList, ICollection, IEnumerable */
- klass->interface_count = mono_defaults.generic_ireadonlylist_class ? 2 : 1;
- klass->interfaces = mono_image_alloc0 (klass->image, sizeof (MonoClass*) * klass->interface_count);
+ interface_count = mono_defaults.generic_ireadonlylist_class ? 2 : 1;
+ interfaces = mono_image_alloc0 (klass->image, sizeof (MonoClass*) * interface_count);
args [0] = &klass->element_class->byval_arg;
- klass->interfaces [0] = mono_class_bind_generic_parameters (
+ interfaces [0] = mono_class_bind_generic_parameters (
mono_defaults.generic_ilist_class, 1, args, FALSE);
- if (klass->interface_count > 1)
- klass->interfaces [1] = mono_class_bind_generic_parameters (
+ if (interface_count > 1)
+ interfaces [1] = mono_class_bind_generic_parameters (
mono_defaults.generic_ireadonlylist_class, 1, args, FALSE);
} else if (klass->generic_class) {
MonoClass *gklass = klass->generic_class->container_class;
- klass->interface_count = gklass->interface_count;
- klass->interfaces = mono_class_new0 (klass, MonoClass *, klass->interface_count);
- for (i = 0; i < klass->interface_count; i++) {
- klass->interfaces [i] = mono_class_inflate_generic_class_checked (gklass->interfaces [i], mono_generic_class_get_context (klass->generic_class), error);
+ mono_class_setup_interfaces (gklass, error);
+ if (!mono_error_ok (error)) {
+ mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Could not setup the interfaces"));
+ return;
+ }
+
+ interface_count = gklass->interface_count;
+ interfaces = mono_class_new0 (klass, MonoClass *, interface_count);
+ for (i = 0; i < interface_count; i++) {
+ interfaces [i] = mono_class_inflate_generic_class_checked (gklass->interfaces [i], mono_generic_class_get_context (klass->generic_class), error);
if (!mono_error_ok (error)) {
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, g_strdup ("Could not setup the interfaces"));
- klass->interfaces = NULL;
return;
}
}
+ } else {
+ interface_count = 0;
+ interfaces = NULL;
}
- mono_memory_barrier ();
+ mono_image_lock (klass->image);
- klass->interfaces_inited = TRUE;
+ if (!klass->interfaces_inited) {
+ klass->interface_count = interface_count;
+ klass->interfaces = interfaces;
- mono_loader_unlock ();
+ mono_memory_barrier ();
+
+ klass->interfaces_inited = TRUE;
+ }
+
+ mono_image_unlock (klass->image);
}
static void
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
#include <mono/metadata/loader.h>
+#include <mono/utils/mono-error.h>
MONO_BEGIN_DECLS
MONO_API MonoClass *
mono_class_from_typeref (MonoImage *image, uint32_t type_token);
+MONO_API MonoClass *
+mono_class_from_typeref_checked (MonoImage *image, uint32_t type_token, MonoError *error);
+
MONO_API MonoClass *
mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar);
#undef OPDEF
/* This mutex protects the various cominterop related caches in MonoImage */
-#define mono_cominterop_lock() EnterCriticalSection (&cominterop_mutex)
-#define mono_cominterop_unlock() LeaveCriticalSection (&cominterop_mutex)
-static CRITICAL_SECTION cominterop_mutex;
+#define mono_cominterop_lock() mono_mutex_lock (&cominterop_mutex)
+#define mono_cominterop_unlock() mono_mutex_unlock (&cominterop_mutex)
+static mono_mutex_t cominterop_mutex;
/* STDCALL on windows, CDECL everywhere else to work with XPCOM and MainWin COM */
#ifdef HOST_WIN32
{
const char* com_provider_env;
- InitializeCriticalSection (&cominterop_mutex);
+ mono_mutex_init_recursive (&cominterop_mutex);
com_provider_env = g_getenv ("MONO_COM");
if (com_provider_env && !strcmp(com_provider_env, "MS"))
void
mono_cominterop_cleanup (void)
{
- DeleteCriticalSection (&cominterop_mutex);
+ mono_mutex_destroy (&cominterop_mutex);
}
void
MonoObject* handle_target = mono_gchandle_get_target (ccw_iter->gc_handle);
/* Looks like the GC NULLs the weakref handle target before running the
- * finalizer. So if we get a NULL target, destroy the CCW as well. */
- if (!handle_target || handle_target == object) {
+ * finalizer. So if we get a NULL target, destroy the CCW as well.
+ * Unless looking up the object from the CCW shows it not the right object.
+ */
+ gboolean destroy_ccw = !handle_target || handle_target == object;
+ if (!handle_target) {
+ MonoCCWInterface* ccw_entry = g_hash_table_lookup (ccw_iter->vtable_hash, mono_class_get_iunknown_class ());
+ if (!(ccw_entry && object == cominterop_get_ccw_object (ccw_entry, FALSE)))
+ destroy_ccw = FALSE;
+ }
+
+ if (destroy_ccw) {
/* remove all interfaces */
g_hash_table_foreach_remove (ccw_iter->vtable_hash, mono_marshal_free_ccw_entry, NULL);
g_hash_table_destroy (ccw_iter->vtable_hash);
{3943, 2309, 323, 331, 44, 55, 0, 0, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {36041, 36052, 13523, 36063, 36074, 36081, 36090, 36103, 36110, 36123, 36136, 36149, 0}, {36041, 36052, 13523, 36063, 36074, 36081, 36090, 36103, 36110, 36123, 36136, 36149, 0}, {36041, 36052, 13523, 36063, 36074, 36081, 36090, 36103, 36110, 36123, 36136, 36149, 0}, {36041, 36052, 13523, 36063, 36074, 36081, 36090, 36103, 36110, 36123, 36136, 36149, 0}, 0, 6, 2541, 241, {2309,1236,1210,0,0,0,0,0,0,0,0,0,0,0},{3943,254,0,0,0,0,0,0},{331,274,35,0,0,0,0,0,0,0,0,0},{323,280,23,0,0,0,0,0,0}},
{1344, 2927, 323, 331, 1375, 1391, 1404, 1411, {1418, 1428, 1438, 1448, 1458, 1468, 1478}, {34903, 34910, 34917, 34924, 34931, 34938, 34945}, {1537, 1541, 1545, 1549, 1553, 1557, 1561}, {1655, 1660, 1665, 1670, 1675, 1680, 1685, 1690, 1695, 1700, 1706, 1712, 0}, {1655, 1660, 1665, 1670, 1675, 1680, 1685, 1690, 1695, 1700, 1706, 1712, 0}, {1655, 1660, 1665, 1670, 1675, 1680, 1685, 1690, 1695, 1700, 1706, 1712, 0}, {1655, 1660, 1665, 1670, 1675, 1680, 1685, 1690, 1695, 1700, 1706, 1712, 0}, 0, 0, 239, 241, {2927,1229,14,1765,1779,1366,1736,1210,0,0,0,0,0,0},{1344,36162,36189,2543,0,0,0,0},{331,274,0,0,0,0,0,0,0,0,0,0},{323,280,0,0,0,0,0,0,0}},
{2568, 2587, 280, 274, 1906, 1916, 2598, 2604, {2611, 2619, 2626, 2635, 2644, 2655, 2663}, {2671, 2674, 2677, 2680, 2683, 2686, 2689}, {2018, 2403, 2692, 2403, 2692, 2409, 2018}, {2694, 2701, 2709, 2715, 2721, 2725, 2730, 2735, 2742, 2752, 2760, 2769, 0}, {2694, 2701, 2709, 2715, 2721, 2725, 2730, 2735, 2742, 2752, 2760, 2769, 0}, {2778, 2782, 2786, 2791, 2721, 2795, 2799, 2803, 2807, 2811, 2815, 2819, 0}, {2778, 2782, 2786, 2791, 2721, 2795, 2799, 2803, 2807, 2811, 2815, 2819, 0}, 2, 1, 754, 241, {2587,1245,2835,35120,2843,1210,0,0,0,0,0,0,0,0},{2568,1882,35130,0,0,0,0,0},{274,331,8214,8204,2862,8237,8242,8223,8229,0,0,0},{280,323,8274,8287,2887,2873,2902,0,0}},
- {2909, 14812, 2936, 2947, 1906, 352, 7992, 21969, {3719, 3726, 3733, 3741, 3751, 3760, 3767}, {3776, 3780, 3784, 3788, 3792, 3796, 3800}, {2018, 2403, 2405, 3804, 2405, 2409, 2018}, {3806, 3814, 3823, 2715, 3829, 3833, 3838, 2735, 2742, 3843, 2760, 3851, 0}, {3806, 3814, 3823, 2715, 3829, 3833, 3838, 2735, 2742, 3843, 2760, 3851, 0}, {2778, 2782, 3860, 2791, 3829, 2795, 2799, 2803, 2807, 3864, 2815, 3868, 0}, {2778, 2782, 3860, 2791, 3829, 2795, 2799, 2803, 2807, 3864, 2815, 3868, 0}, 0, 0, 239, 241, {14812,1221,14,2835,1210,0,0,0,0,0,0,0,0,0},{2909,3672,0,0,0,0,0,0},{2947,35,274,331,0,0,0,0,0,0,0,0},{2936,23,280,323,0,0,0,0,0}},
+ {2909, 14812, 2936, 2947, 1906, 352, 7213, 7218, {3719, 3726, 3733, 3741, 3751, 3760, 3767}, {3776, 3780, 3784, 3788, 3792, 3796, 3800}, {2018, 2403, 2405, 3804, 2405, 2409, 2018}, {3806, 3814, 3823, 2715, 3829, 3833, 3838, 2735, 2742, 3843, 2760, 3851, 0}, {3806, 3814, 3823, 2715, 3829, 3833, 3838, 2735, 2742, 3843, 2760, 3851, 0}, {2778, 2782, 3860, 2791, 3829, 2795, 2799, 2803, 2807, 3864, 2815, 3868, 0}, {2778, 2782, 3860, 2791, 3829, 2795, 2799, 2803, 2807, 3864, 2815, 3868, 0}, 0, 0, 239, 241, {14812,1221,14,2835,1210,0,0,0,0,0,0,0,0,0},{2909,3672,0,0,0,0,0,0},{2947,35,274,331,0,0,0,0,0,0,0,0},{2936,23,280,323,0,0,0,0,0}},
{4342, 243, 23, 35, 947, 3985, 962, 968, {3997, 4005, 4011, 4018, 4029, 4036, 4044}, {4052, 4057, 4062, 4067, 4073, 4078, 4083}, {2692, 2411, 2403, 2403, 4089, 4091, 2018}, {4093, 4099, 4107, 4113, 4119, 4124, 4130, 4136, 4143, 4154, 4162, 4172, 0}, {4182, 4188, 4196, 1102, 4202, 4207, 4213, 4219, 4226, 1140, 4237, 4247, 0}, {4257, 4262, 4062, 4267, 4272, 4277, 4282, 4287, 4292, 4298, 4303, 4308, 0}, {4257, 4262, 4062, 4267, 4272, 4277, 4282, 4287, 4292, 4298, 4303, 4308, 0}, 0, 1, 239, 241, {243,14,1229,1236,1210,0,0,0,0,0,0,0,0,0},{4313,4342,4369,0,0,0,0,0},{35,2947,331,274,0,0,0,0,0,0,0,0},{23,2936,323,280,0,0,0,0,0}},
{36205, 243, 280, 274, 1906, 352, 1924, 1927, {4874, 4883, 4889, 4895, 4904, 4910, 4919}, {4926, 4931, 4936, 4941, 4946, 4951, 4956}, {2692, 2411, 2403, 2403, 4089, 4091, 2018}, {4961, 4969, 4978, 4983, 4989, 4993, 4998, 5006, 5012, 5022, 1148, 5030, 0}, {4961, 4969, 4978, 4983, 4989, 4993, 4998, 5006, 5012, 5022, 1148, 5030, 0}, {5040, 5046, 4978, 5053, 4989, 4993, 5058, 5006, 5064, 1195, 1200, 5070, 0}, {5040, 5046, 4978, 5053, 4989, 4993, 5058, 5006, 5064, 1195, 1200, 5070, 0}, 2, 1, 239, 241, {243,14,1245,1236,1210,0,0,0,0,0,0,0,0,0},{4857,5076,3672,0,0,0,0,0},{274,331,5085,5091,5101,0,0,0,0,0,0,0},{280,323,0,0,0,0,0,0,0}},
{1882, 2261, 323, 331, 1906, 11991, 36228, 36238, {9068, 9077, 9089, 9096, 9104, 9114, 9120}, {9127, 9131, 9135, 9139, 9143, 9148, 9152}, {0, 0, 0, 0, 0, 0, 0}, {2413, 2420, 15113, 2434, 2440, 2444, 2449, 11959, 36246, 36256, 36264, 36273, 0}, {2413, 2420, 15113, 2434, 2440, 2444, 2449, 11959, 36246, 36256, 36264, 36273, 0}, {2497, 2501, 2505, 2509, 2440, 2513, 2517, 11966, 2525, 2529, 2533, 2537, 0}, {2497, 2501, 2505, 2509, 2440, 2513, 2517, 11966, 2525, 2529, 2533, 2537, 0}, 0, 1, 754, 241, {2261,2843,1895,2587,9640,1245,11970,1210,0,0,0,0,0,0},{1882,2554,2568,0,0,0,0,0},{331,274,0,0,0,0,0,0,0,0,0,0},{323,280,0,0,0,0,0,0,0}},
if (_BitScanReverse (&bIndex, mask))
return bIndex;
return -1;
-#elif defined(__x86_64__) && defined(_MSC_VER)
+#elif defined(_M_X64) && defined(_MSC_VER)
unsigned long bIndex = 0;
if (_BitScanReverse64 (&bIndex, mask))
return bIndex;
i = sizeof (gsize) * 8;
while (i > 0) {
i --;
- if (mask & (1UL << i))
+ if (mask & (1ULL << i))
return i;
}
return -1;
#include <mono/metadata/mempool.h>
#include <mono/metadata/lock-tracer.h>
#include <mono/utils/mono-codeman.h>
+#include <mono/utils/mono-mutex.h>
#include <mono/metadata/mono-hash.h>
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-internal-hash.h>
#include <mono/io-layer/io-layer.h>
#include <mono/metadata/mempool-internals.h>
-extern CRITICAL_SECTION mono_delegate_section;
-extern CRITICAL_SECTION mono_strtod_mutex;
+
+extern mono_mutex_t mono_delegate_section;
+extern mono_mutex_t mono_strtod_mutex;
/*
* If this is set, the memory belonging to appdomains is not freed when a domain is
typedef struct
{
guint32 stack_size;
+ guint32 epilog_size;
} MonoArchEHJitInfo;
typedef struct {
* i.e. if both are taken by the same thread, the loader lock
* must taken first.
*/
- CRITICAL_SECTION lock;
+ mono_mutex_t lock;
MonoMemPool *mp;
MonoCodeManager *code_mp;
/*
GHashTable *proxy_vtable_hash;
/* Protected by 'jit_code_hash_lock' */
MonoInternalHashTable jit_code_hash;
- CRITICAL_SECTION jit_code_hash_lock;
+ mono_mutex_t jit_code_hash_lock;
int num_jit_info_tables;
MonoJitInfoTable *
volatile jit_info_table;
GHashTable *finalizable_objects_hash;
/* Protects the three hashes above */
- CRITICAL_SECTION finalizable_objects_hash_lock;
+ mono_mutex_t finalizable_objects_hash_lock;
/* Used when accessing 'domain_assemblies' */
- CRITICAL_SECTION assemblies_lock;
+ mono_mutex_t assemblies_lock;
GHashTable *method_rgctx_hash;
gboolean mono_dont_free_domains;
-#define mono_appdomains_lock() EnterCriticalSection (&appdomains_mutex)
-#define mono_appdomains_unlock() LeaveCriticalSection (&appdomains_mutex)
-static CRITICAL_SECTION appdomains_mutex;
+#define mono_appdomains_lock() mono_mutex_lock (&appdomains_mutex)
+#define mono_appdomains_unlock() mono_mutex_unlock (&appdomains_mutex)
+static mono_mutex_t appdomains_mutex;
static MonoDomain *mono_root_domain = NULL;
static MonoCreateDomainFunc create_domain_hook;
static MonoFreeDomainFunc free_domain_hook;
+/* AOT cache configuration */
+static MonoAotCacheConfig aot_cache_config;
+
/* This is intentionally not in the header file, so people don't misuse it. */
extern void _mono_debug_init_corlib (MonoDomain *domain);
mono_domain_get_tls_offset (void)
{
int offset = -1;
+
+#ifdef HOST_WIN32
+ if (appdomain_thread_id)
+ offset = appdomain_thread_id;
+#else
MONO_THREAD_VAR_OFFSET (tls_appdomain, offset);
-/* __asm ("jmp 1f; .section writetext, \"awx\"; 1: movl $tls_appdomain@ntpoff, %0; jmp 2f; .previous; 2:"
- : "=r" (offset));*/
+#endif
return offset;
}
domain->finalizable_objects_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
domain->ftnptrs_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
- InitializeCriticalSection (&domain->lock);
- InitializeCriticalSection (&domain->assemblies_lock);
- InitializeCriticalSection (&domain->jit_code_hash_lock);
- InitializeCriticalSection (&domain->finalizable_objects_hash_lock);
+ mono_mutex_init_recursive (&domain->lock);
+ mono_mutex_init_recursive (&domain->assemblies_lock);
+ mono_mutex_init_recursive (&domain->jit_code_hash_lock);
+ mono_mutex_init_recursive (&domain->finalizable_objects_hash_lock);
domain->method_rgctx_hash = NULL;
MONO_FAST_TLS_INIT (tls_appdomain);
mono_native_tls_alloc (&appdomain_thread_id, NULL);
- InitializeCriticalSection (&appdomains_mutex);
+ mono_mutex_init_recursive (&appdomains_mutex);
mono_metadata_init ();
mono_images_init ();
mono_metadata_cleanup ();
mono_native_tls_free (appdomain_thread_id);
- DeleteCriticalSection (&appdomains_mutex);
+ mono_mutex_destroy (&appdomains_mutex);
#ifndef HOST_WIN32
wapi_cleanup ();
domain->ftnptrs_hash = NULL;
}
- DeleteCriticalSection (&domain->finalizable_objects_hash_lock);
- DeleteCriticalSection (&domain->assemblies_lock);
- DeleteCriticalSection (&domain->jit_code_hash_lock);
- DeleteCriticalSection (&domain->lock);
+ mono_mutex_destroy (&domain->finalizable_objects_hash_lock);
+ mono_mutex_destroy (&domain->assemblies_lock);
+ mono_mutex_destroy (&domain->jit_code_hash_lock);
+ mono_mutex_destroy (&domain->lock);
domain->setup = NULL;
mono_gc_deregister_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED));
{
debug_domain_unload = enable;
}
+
+MonoAotCacheConfig *
+mono_get_aot_cache_config (void)
+{
+ return &aot_cache_config;
+}
MonoException *
mono_exception_from_token (MonoImage *image, guint32 token)
{
+ MonoError error;
MonoClass *klass;
MonoObject *o;
- klass = mono_class_get (image, token);
+ klass = mono_class_get_checked (image, token, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME handle the error. */
o = mono_object_new (mono_domain_get (), klass);
g_assert (o != NULL);
mono_exception_from_token_two_strings (MonoImage *image, guint32 token,
MonoString *a1, MonoString *a2)
{
- MonoClass *klass = mono_class_get (image, token);
+ MonoError error;
+ MonoClass *klass = mono_class_get_checked (image, token, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME handle the error. */
return create_exception_two_strings (klass, a1, a2);
}
typedef struct {
int minor_gc_count;
int major_gc_count;
- long long minor_gc_time_usecs;
- long long major_gc_time_usecs;
+ long long minor_gc_time;
+ long long major_gc_time;
#ifdef HEAVY_STATISTICS
unsigned long long gray_queue_section_alloc;
unsigned long long gray_queue_section_free;
#endif
} GCStats;
-#define mono_domain_finalizers_lock(domain) EnterCriticalSection (&(domain)->finalizable_objects_hash_lock);
-#define mono_domain_finalizers_unlock(domain) LeaveCriticalSection (&(domain)->finalizable_objects_hash_lock);
+#define mono_domain_finalizers_lock(domain) mono_mutex_lock (&(domain)->finalizable_objects_hash_lock);
+#define mono_domain_finalizers_unlock(domain) mono_mutex_unlock (&(domain)->finalizable_objects_hash_lock);
/* Register a memory area as a conservatively scanned GC root */
#define MONO_GC_REGISTER_ROOT_PINNING(x) mono_gc_register_root ((char*)&(x), sizeof(x), NULL)
static gboolean finalizing_root_domain = FALSE;
-#define mono_finalizer_lock() EnterCriticalSection (&finalizer_mutex)
-#define mono_finalizer_unlock() LeaveCriticalSection (&finalizer_mutex)
-static CRITICAL_SECTION finalizer_mutex;
-static CRITICAL_SECTION reference_queue_mutex;
+#define mono_finalizer_lock() mono_mutex_lock (&finalizer_mutex)
+#define mono_finalizer_unlock() mono_mutex_unlock (&finalizer_mutex)
+static mono_mutex_t finalizer_mutex;
+static mono_mutex_t reference_queue_mutex;
static GSList *domains_to_finalize= NULL;
static MonoMList *threads_to_finalize = NULL;
return mono_domain_get ()->ephemeron_tombstone;
}
-#define mono_allocator_lock() EnterCriticalSection (&allocator_section)
-#define mono_allocator_unlock() LeaveCriticalSection (&allocator_section)
-static CRITICAL_SECTION allocator_section;
-static CRITICAL_SECTION handle_section;
+#define mono_allocator_lock() mono_mutex_lock (&allocator_section)
+#define mono_allocator_unlock() mono_mutex_unlock (&allocator_section)
+static mono_mutex_t allocator_section;
+static mono_mutex_t handle_section;
typedef enum {
HANDLE_WEAK,
{NULL, NULL, 0, HANDLE_PINNED, 0}
};
-#define lock_handles(handles) EnterCriticalSection (&handle_section)
-#define unlock_handles(handles) LeaveCriticalSection (&handle_section)
+#define lock_handles(handles) mono_mutex_lock (&handle_section)
+#define unlock_handles(handles) mono_mutex_unlock (&handle_section)
static int
find_first_unset (guint32 bitmap)
void
mono_gc_init (void)
{
- InitializeCriticalSection (&handle_section);
- InitializeCriticalSection (&allocator_section);
+ mono_mutex_init_recursive (&handle_section);
+ mono_mutex_init_recursive (&allocator_section);
- InitializeCriticalSection (&finalizer_mutex);
- InitializeCriticalSection (&reference_queue_mutex);
+ mono_mutex_init_recursive (&finalizer_mutex);
+ mono_mutex_init_recursive (&reference_queue_mutex);
MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_NORMAL].entries);
MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_PINNED].entries);
mono_counters_register ("Created object count", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &mono_stats.new_object_count);
mono_counters_register ("Minor GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &gc_stats.minor_gc_count);
mono_counters_register ("Major GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &gc_stats.major_gc_count);
- mono_counters_register ("Minor GC time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &gc_stats.minor_gc_time_usecs);
- mono_counters_register ("Major GC time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &gc_stats.major_gc_time_usecs);
+ mono_counters_register ("Minor GC time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &gc_stats.minor_gc_time);
+ mono_counters_register ("Major GC time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &gc_stats.major_gc_time);
#ifdef HEAVY_STATISTICS
mono_counters_register ("Gray Queue alloc section", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &gc_stats.gray_queue_section_alloc);
mono_counters_register ("Gray Queue free section", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &gc_stats.gray_queue_section_free);
mono_reference_queue_cleanup ();
- DeleteCriticalSection (&handle_section);
- DeleteCriticalSection (&allocator_section);
- DeleteCriticalSection (&finalizer_mutex);
- DeleteCriticalSection (&reference_queue_mutex);
+ mono_mutex_destroy (&handle_section);
+ mono_mutex_destroy (&allocator_section);
+ mono_mutex_destroy (&finalizer_mutex);
+ mono_mutex_destroy (&reference_queue_mutex);
}
#else
void mono_gc_init (void)
{
- InitializeCriticalSection (&handle_section);
+ mono_mutex_init_recursive (&handle_section);
}
void mono_gc_cleanup (void)
reference_queue_proccess (queue);
restart:
- EnterCriticalSection (&reference_queue_mutex);
+ mono_mutex_lock (&reference_queue_mutex);
for (iter = &ref_queues; *iter;) {
queue = *iter;
if (!queue->should_be_deleted) {
continue;
}
if (queue->queue) {
- LeaveCriticalSection (&reference_queue_mutex);
+ mono_mutex_unlock (&reference_queue_mutex);
reference_queue_proccess (queue);
goto restart;
}
*iter = queue->next;
g_free (queue);
}
- LeaveCriticalSection (&reference_queue_mutex);
+ mono_mutex_unlock (&reference_queue_mutex);
}
static void
MonoReferenceQueue *res = g_new0 (MonoReferenceQueue, 1);
res->callback = callback;
- EnterCriticalSection (&reference_queue_mutex);
+ mono_mutex_lock (&reference_queue_mutex);
res->next = ref_queues;
ref_queues = res;
- LeaveCriticalSection (&reference_queue_mutex);
+ mono_mutex_unlock (&reference_queue_mutex);
return res;
}
ICALL(ASSEM_16, "InternalImageRuntimeVersion", ves_icall_System_Reflection_Assembly_InternalImageRuntimeVersion)
ICALL(ASSEM_17, "LoadFrom", ves_icall_System_Reflection_Assembly_LoadFrom)
ICALL(ASSEM_18, "LoadPermissions", ves_icall_System_Reflection_Assembly_LoadPermissions)
- /*
- * Private icalls for the Mono Debugger
- */
-ICALL(ASSEM_19, "MonoDebugger_GetMethodToken", ves_icall_MonoDebugger_GetMethodToken)
/* normal icalls again */
ICALL(ASSEM_20, "get_EntryPoint", ves_icall_System_Reflection_Assembly_get_EntryPoint)
if (*ptr){
/* mono_strtod () is not thread-safe */
- EnterCriticalSection (&mono_strtod_mutex);
+ mono_mutex_lock (&mono_strtod_mutex);
*result = mono_strtod (ptr, &endptr);
- LeaveCriticalSection (&mono_strtod_mutex);
+ mono_mutex_unlock (&mono_strtod_mutex);
}
if (!*ptr || (endptr && *endptr))
ICALL_EXPORT void
ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor (MonoImage *image)
{
- MONO_ARCH_SAVE_REGS;
+ MonoError error;
mono_image_check_for_module_cctor (image);
if (image->has_module_cctor) {
- MonoClass *module_klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | 1);
+ MonoClass *module_klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | 1, &error);
+ mono_error_raise_exception (&error);
/*It's fine to raise the exception here*/
mono_runtime_class_init (mono_class_vtable_full (mono_domain_get (), module_klass, TRUE));
}
{
MonoError error;
MonoType *type = mono_field_get_type_checked (field->field, &error);
- if (!mono_error_ok (&error))
- mono_error_raise_exception (&error);
+ mono_error_raise_exception (&error);
return type_array_from_modifiers (field->field->parent->image, type, optional);
}
MonoClass *parent = field->field->parent;
if (!parent->size_inited)
mono_class_init (parent);
+ mono_class_setup_fields_locking (parent);
return field->field->offset - sizeof (MonoObject);
}
attrs = mono_metadata_decode_row_col (tdef, i, MONO_TYPEDEF_FLAGS);
visibility = attrs & TYPE_ATTRIBUTE_VISIBILITY_MASK;
if (!exportedOnly || (visibility == TYPE_ATTRIBUTE_PUBLIC || visibility == TYPE_ATTRIBUTE_NESTED_PUBLIC)) {
- klass = mono_class_get (image, (i + 1) | MONO_TOKEN_TYPE_DEF);
+ MonoError error;
+ klass = mono_class_get_checked (image, (i + 1) | MONO_TOKEN_TYPE_DEF, &error);
+ g_assert (!mono_loader_get_last_error ()); /* Plug any leaks */
+
if (klass) {
mono_array_setref (res, count, mono_type_get_object (domain, &klass->byval_arg));
} else {
- MonoLoaderError *error;
- MonoException *ex;
-
- error = mono_loader_get_last_error ();
- g_assert (error != NULL);
-
- ex = mono_loader_error_prepare_exception (error);
+ MonoException *ex = mono_error_convert_to_exception (&error);
mono_array_setref (*exceptions, count, ex);
}
- if (mono_loader_get_last_error ())
- mono_loader_clear_error ();
count++;
}
}
mono_loader_clear_error ();
exl = mono_array_new (domain, mono_defaults.exception_class, length);
- /* Types for which mono_class_get () succeeded */
+ /* Types for which mono_class_get_checked () succeeded */
for (i = 0, tmp = list; tmp; i++, tmp = tmp->next) {
MonoException *exc = mono_class_get_exception_for_failure (tmp->data);
mono_array_setref (exl, i, exc);
ICALL_EXPORT MonoReflectionType*
ves_icall_System_Reflection_Module_GetGlobalType (MonoReflectionModule *module)
{
+ MonoError error;
MonoDomain *domain = mono_object_domain (module);
MonoClass *klass;
/* These images do not have a global type */
return NULL;
- klass = mono_class_get (module->image, 1 | MONO_TOKEN_TYPE_DEF);
+ klass = mono_class_get_checked (module->image, 1 | MONO_TOKEN_TYPE_DEF, &error);
+ mono_error_raise_exception (&error);
return mono_type_get_object (domain, &klass->byval_arg);
}
}
ICALL_EXPORT MonoType*
-ves_icall_System_Reflection_Module_ResolveTypeToken (MonoImage *image, guint32 token, MonoArray *type_args, MonoArray *method_args, MonoResolveTokenError *error)
+ves_icall_System_Reflection_Module_ResolveTypeToken (MonoImage *image, guint32 token, MonoArray *type_args, MonoArray *method_args, MonoResolveTokenError *resolve_error)
{
MonoClass *klass;
int table = mono_metadata_token_table (token);
int index = mono_metadata_token_index (token);
MonoGenericContext context;
+ MonoError error;
- *error = ResolveTokenError_Other;
+ *resolve_error = ResolveTokenError_Other;
/* Validate token */
if ((table != MONO_TABLE_TYPEDEF) && (table != MONO_TABLE_TYPEREF) &&
(table != MONO_TABLE_TYPESPEC)) {
- *error = ResolveTokenError_BadTable;
+ *resolve_error = ResolveTokenError_BadTable;
return NULL;
}
}
if ((index <= 0) || (index > image->tables [table].rows)) {
- *error = ResolveTokenError_OutOfRange;
+ *resolve_error = ResolveTokenError_OutOfRange;
return NULL;
}
init_generic_context_from_args (&context, type_args, method_args);
- klass = mono_class_get_full (image, token, &context);
-
- if (mono_loader_get_last_error ())
- mono_raise_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
+ klass = mono_class_get_checked (image, token, &error);
+ if (klass)
+ klass = mono_class_inflate_generic_class_checked (klass, &context, &error);
+ mono_error_raise_exception (&error);
if (klass)
return &klass->byval_arg;
*to_upper_data_high = ToUpperDataHigh;
}
-ICALL_EXPORT gint32
-ves_icall_MonoDebugger_GetMethodToken (MonoReflectionMethod *method)
-{
- return method->method->token;
-}
-
/*
* We return NULL for no modifiers so the corlib code can return Type.EmptyTypes
* and avoid useless allocations.
+ *
+ * MAY THROW
*/
static MonoArray*
type_array_from_modifiers (MonoImage *image, MonoType *type, int optional)
count = 0;
for (i = 0; i < type->num_mods; ++i) {
if ((optional && !type->modifiers [i].required) || (!optional && type->modifiers [i].required)) {
- MonoClass *klass = mono_class_get (image, type->modifiers [i].token);
+ MonoError error;
+ MonoClass *klass = mono_class_get_checked (image, type->modifiers [i].token, &error);
+ mono_error_raise_exception (&error); /* this is safe, no cleanup needed on callers */
mono_array_setref (res, count, mono_type_get_object (mono_domain_get (), &klass->byval_arg));
count++;
}
static gboolean debug_assembly_unload = FALSE;
-#define mono_images_lock() if (mutex_inited) EnterCriticalSection (&images_mutex)
-#define mono_images_unlock() if (mutex_inited) LeaveCriticalSection (&images_mutex)
+#define mono_images_lock() if (mutex_inited) mono_mutex_lock (&images_mutex)
+#define mono_images_unlock() if (mutex_inited) mono_mutex_unlock (&images_mutex)
static gboolean mutex_inited;
-static CRITICAL_SECTION images_mutex;
+static mono_mutex_t images_mutex;
typedef struct ImageUnloadHook ImageUnloadHook;
struct ImageUnloadHook {
void
mono_images_init (void)
{
- InitializeCriticalSection (&images_mutex);
+ mono_mutex_init_recursive (&images_mutex);
loaded_images_hash = g_hash_table_new (g_str_hash, g_str_equal);
loaded_images_refonly_hash = g_hash_table_new (g_str_hash, g_str_equal);
GHashTableIter iter;
MonoImage *image;
- DeleteCriticalSection (&images_mutex);
+ mono_mutex_destroy (&images_mutex);
g_hash_table_iter_init (&iter, loaded_images_hash);
while (g_hash_table_iter_next (&iter, NULL, (void**)&image))
void
mono_image_init (MonoImage *image)
{
- InitializeCriticalSection (&image->lock);
- InitializeCriticalSection (&image->szarray_cache_lock);
+ mono_mutex_init_recursive (&image->lock);
+ mono_mutex_init_recursive (&image->szarray_cache_lock);
image->mempool = mono_mempool_new_size (512);
mono_internal_hash_table_init (&image->class_cache,
g_direct_hash,
class_key_extract,
class_next_value);
-#ifdef HOST_WIN32
- // FIXME:
image->field_cache = mono_conc_hashtable_new (&image->lock, NULL, NULL);
-#else
- image->field_cache = mono_conc_hashtable_new (&image->lock.mutex, NULL, NULL);
-#endif
image->typespec_cache = g_hash_table_new (NULL, NULL);
image->memberref_signatures = g_hash_table_new (NULL, NULL);
if (image->modules_loaded)
g_free (image->modules_loaded);
- DeleteCriticalSection (&image->szarray_cache_lock);
- DeleteCriticalSection (&image->lock);
+ mono_mutex_destroy (&image->szarray_cache_lock);
+ mono_mutex_destroy (&image->lock);
/*g_print ("destroy image %p (dynamic: %d)\n", image, image->dynamic);*/
if (image_is_dynamic (image)) {
* See domain-internals.h for locking policy in combination with the
* domain lock.
*/
-static CRITICAL_SECTION loader_mutex;
+static mono_mutex_t loader_mutex;
static gboolean loader_lock_inited;
/* Statistics */
static gboolean inited;
if (!inited) {
- InitializeCriticalSection (&loader_mutex);
+ mono_mutex_init_recursive (&loader_mutex);
loader_lock_inited = TRUE;
mono_native_tls_alloc (&loader_error_thread_id, NULL);
mono_native_tls_free (loader_error_thread_id);
mono_native_tls_free (loader_lock_nest_id);
- DeleteCriticalSection (&loader_mutex);
+ mono_mutex_destroy (&loader_mutex);
loader_lock_inited = FALSE;
}
{
gpointer res;
- mono_loader_lock ();
+ mono_image_lock (image);
res = g_hash_table_lookup (image->memberref_signatures, GUINT_TO_POINTER (sig_idx));
- mono_loader_unlock ();
+ mono_image_unlock (image);
return res;
}
{
gpointer prev_sig;
- mono_loader_lock ();
+ mono_image_lock (image);
prev_sig = g_hash_table_lookup (image->memberref_signatures, GUINT_TO_POINTER (sig_idx));
if (prev_sig) {
/* Somebody got in before us */
/* An approximation based on glib 2.18 */
memberref_sig_cache_size += sizeof (gpointer) * 4;
}
-
- mono_loader_unlock ();
+ mono_image_unlock (image);
return sig;
}
const char *fname;
const char *ptr;
guint32 idx = mono_metadata_token_index (token);
+ MonoError error;
mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE);
nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS;
switch (class) {
case MONO_MEMBERREF_PARENT_TYPEDEF:
class_table = MONO_TOKEN_TYPE_DEF;
- klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | nindex);
+ klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | nindex, &error);
+ if (!mono_error_ok (&error)) {
+ /*FIXME don't swallow the error message*/
+ mono_error_cleanup (&error);
+ }
+
break;
case MONO_MEMBERREF_PARENT_TYPEREF:
class_table = MONO_TOKEN_TYPE_REF;
- klass = mono_class_from_typeref (image, MONO_TOKEN_TYPE_REF | nindex);
+ klass = mono_class_from_typeref_checked (image, MONO_TOKEN_TYPE_REF | nindex, &error);
+ if (!mono_error_ok (&error)) {
+ /*FIXME don't swallow the error message*/
+ mono_error_cleanup (&error);
+ }
+
break;
case MONO_MEMBERREF_PARENT_TYPESPEC:
class_table = MONO_TOKEN_TYPE_SPEC;
- klass = mono_class_get_full (image, MONO_TOKEN_TYPE_SPEC | nindex, context);
+ klass = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_SPEC | nindex, context, &error);
+ if (!mono_error_ok (&error)) {
+ /*FIXME don't swallow the error message*/
+ mono_error_cleanup (&error);
+ }
break;
default:
/*FIXME this must set a loader error!*/
mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass,
MonoGenericContext *context)
{
+ MonoError error;
MonoClass *k;
guint32 type;
MonoClassField *field;
type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
if (!type)
return NULL;
- k = mono_class_get (image, MONO_TOKEN_TYPE_DEF | type);
- if (!k)
+ k = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | type, &error);
+ if (!k) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
return NULL;
+ }
mono_class_init (k);
if (retklass)
*retklass = k;
const char *mname;
MonoMethodSignature *sig;
const char *ptr;
+ MonoError error;
mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, 3);
nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS;
switch (class) {
case MONO_MEMBERREF_PARENT_TYPEREF:
- klass = mono_class_from_typeref (image, MONO_TOKEN_TYPE_REF | nindex);
+ klass = mono_class_from_typeref_checked (image, MONO_TOKEN_TYPE_REF | nindex, &error);
if (!klass) {
- char *name = mono_class_name_from_token (image, MONO_TOKEN_TYPE_REF | nindex);
- g_warning ("Missing method %s in assembly %s, type %s", mname, image->name, name);
- mono_loader_set_error_type_load (name, image->assembly_name);
- g_free (name);
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /* FIXME Don't swallow the error */
return NULL;
}
break;
/*
* Parse the TYPESPEC in the parent's context.
*/
- klass = mono_class_get_full (image, MONO_TOKEN_TYPE_SPEC | nindex, typespec_context);
+ klass = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_SPEC | nindex, typespec_context, &error);
if (!klass) {
- char *name = mono_class_name_from_token (image, MONO_TOKEN_TYPE_SPEC | nindex);
- g_warning ("Missing method %s in assembly %s, type %s", mname, image->name, name);
- mono_loader_set_error_type_load (name, image->assembly_name);
- g_free (name);
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
return NULL;
}
break;
case MONO_MEMBERREF_PARENT_TYPEDEF:
- klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | nindex);
+ klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | nindex, &error);
if (!klass) {
- char *name = mono_class_name_from_token (image, MONO_TOKEN_TYPE_DEF | nindex);
- g_warning ("Missing method %s in assembly %s, type %s", mname, image->name, name);
- mono_loader_set_error_type_load (name, image->assembly_name);
- g_free (name);
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
return NULL;
}
break;
mono_metadata_decode_value (ptr, &ptr);
ptr++;
param_count = mono_metadata_decode_value (ptr, &ptr);
- g_assert (param_count);
inst = mono_metadata_parse_generic_inst (image, NULL, param_count, ptr, &ptr);
if (!inst)
mono_loader_init ();
- mono_loader_lock ();
-
if (!assembly) {
entry = g_malloc0 (sizeof (MonoDllMap));
entry->dll = dll? g_strdup (dll): NULL;
entry->target = tdll? g_strdup (tdll): NULL;
entry->func = func? g_strdup (func): NULL;
entry->target_func = tfunc? g_strdup (tfunc): NULL;
+
+ mono_loader_lock ();
entry->next = global_dll_map;
global_dll_map = entry;
+ mono_loader_unlock ();
} else {
entry = mono_image_alloc0 (assembly, sizeof (MonoDllMap));
entry->dll = dll? mono_image_strdup (assembly, dll): NULL;
entry->target = tdll? mono_image_strdup (assembly, tdll): NULL;
entry->func = func? mono_image_strdup (assembly, func): NULL;
entry->target_func = tfunc? mono_image_strdup (assembly, tfunc): NULL;
+
+ mono_image_lock (assembly);
entry->next = assembly->dll_map;
assembly->dll_map = entry;
+ mono_image_unlock (assembly);
}
-
- mono_loader_unlock ();
}
static void
mono_dllmap_lookup (image, orig_scope, import, &new_scope, &import);
if (!module) {
- mono_loader_lock ();
+ mono_image_lock (image);
if (!image->pinvoke_scopes) {
image->pinvoke_scopes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
image->pinvoke_scope_filenames = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
}
module = g_hash_table_lookup (image->pinvoke_scopes, new_scope);
found_name = g_hash_table_lookup (image->pinvoke_scope_filenames, new_scope);
- mono_loader_unlock ();
+ mono_image_unlock (image);
if (module)
cached = TRUE;
if (found_name)
if (!cached) {
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
"DllImport loaded library '%s'.", found_name);
- mono_loader_lock ();
+ mono_image_lock (image);
if (!g_hash_table_lookup (image->pinvoke_scopes, new_scope)) {
g_hash_table_insert (image->pinvoke_scopes, g_strdup (new_scope), module);
g_hash_table_insert (image->pinvoke_scope_filenames, g_strdup (new_scope), g_strdup (found_name));
}
- mono_loader_unlock ();
+ mono_image_unlock (image);
}
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
MonoGenericContext *context, gboolean *used_context)
{
+ MonoError error;
MonoMethod *result;
int table = mono_metadata_token_table (token);
int idx = mono_metadata_token_index (token);
return NULL;
}
+ if (!klass) {
+ guint32 type = mono_metadata_typedef_from_method (image, token);
+ if (!type)
+ return NULL;
+ klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | type, &error);
+ if (klass == NULL) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
+ return NULL;
+ }
+ }
+
mono_metadata_decode_row (&image->tables [MONO_TABLE_METHOD], idx - 1, cols, 6);
if ((cols [2] & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
mono_stats.method_count ++;
- if (!klass) { /*FIXME put this before the image alloc*/
- guint32 type = mono_metadata_typedef_from_method (image, token);
- if (!type)
- return NULL;
- klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | type);
- if (klass == NULL)
- return NULL;
- }
-
result->slot = -1;
result->klass = klass;
result->flags = cols [2];
if (*sig & 0x10)
generic_container = mono_metadata_load_generic_params (image, token, container);
if (generic_container) {
+ MonoError error;
result->is_generic = TRUE;
generic_container->owner.method = result;
/*FIXME put this before the image alloc*/
- if (!mono_metadata_load_generic_param_constraints_full (image, token, generic_container))
+ if (!mono_metadata_load_generic_param_constraints_checked (image, token, generic_container, &error)) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
return NULL;
+ }
container = generic_container;
}
mono_get_method_constrained_with_method (MonoImage *image, MonoMethod *method, MonoClass *constrained_class,
MonoGenericContext *context)
{
- MonoMethod *result;
-
g_assert (method);
- mono_loader_lock ();
-
- result = get_method_constrained (image, method, constrained_class, context);
-
- mono_loader_unlock ();
- return result;
+ return get_method_constrained (image, method, constrained_class, context);
}
+
/**
* mono_get_method_constrained:
*
{
MonoMethod *result;
- mono_loader_lock ();
-
*cil_method = mono_get_method_from_token (image, token, NULL, context, NULL);
- if (!*cil_method) {
- mono_loader_unlock ();
+ if (!*cil_method)
return NULL;
- }
result = get_method_constrained (image, *cil_method, constrained_class, context);
- mono_loader_unlock ();
return result;
}
mono_get_eh_callbacks ()->mono_walk_stack_with_ctx (stack_walk_adapter, NULL, MONO_UNWIND_DEFAULT, &ud);
}
+/*
+ * mono_stack_walk_async_safe:
+ *
+ * Async safe version callable from signal handlers.
+ */
+void
+mono_stack_walk_async_safe (MonoStackWalk func, gpointer user_data)
+{
+ StackWalkUserData ud = { func, user_data };
+ mono_get_eh_callbacks ()->mono_walk_stack_with_ctx (stack_walk_adapter, NULL, MONO_UNWIND_NONE, &ud);
+}
+
static gboolean
last_managed (MonoMethod *m, gint no, gint ilo, gboolean managed, gpointer data)
{
const char *sig;
gboolean can_cache_signature;
MonoGenericContainer *container;
- MonoMethodSignature *signature = NULL;
+ MonoMethodSignature *signature = NULL, *sig2;
guint32 sig_offset;
/* We need memory barriers below because of the double-checked locking pattern */
if (m->signature)
return m->signature;
- mono_loader_lock ();
-
- if (m->signature) {
- mono_loader_unlock ();
- return m->signature;
- }
+ img = m->klass->image;
if (m->is_inflated) {
MonoMethodInflated *imethod = (MonoMethodInflated *) m;
/* the lock is recursive */
signature = mono_method_signature (imethod->declaring);
signature = inflate_generic_signature_checked (imethod->declaring->klass->image, signature, mono_method_get_context (m), error);
- if (!mono_error_ok (error)) {
- mono_loader_unlock ();
+ if (!mono_error_ok (error))
return NULL;
- }
inflated_signatures_size += mono_metadata_signature_size (signature);
+ mono_image_lock (img);
+
mono_memory_barrier ();
- m->signature = signature;
- mono_loader_unlock ();
+ if (!m->signature)
+ m->signature = signature;
+
+ mono_image_unlock (img);
+
return m->signature;
}
g_assert (mono_metadata_token_table (m->token) == MONO_TABLE_METHOD);
idx = mono_metadata_token_index (m->token);
- img = m->klass->image;
sig = mono_metadata_blob_heap (img, sig_offset = mono_metadata_decode_row_col (&img->tables [MONO_TABLE_METHOD], idx - 1, MONO_METHOD_SIGNATURE));
if (mono_metadata_method_has_param_attrs (img, idx))
can_cache_signature = FALSE;
- if (can_cache_signature)
+ if (can_cache_signature) {
+ mono_image_lock (img);
signature = g_hash_table_lookup (img->method_signatures, sig);
+ mono_image_unlock (img);
+ }
if (!signature) {
const char *sig_body;
/*TODO we should cache the failure result somewhere*/
- if (!mono_verifier_verify_method_signature (img, sig_offset, error)) {
- mono_loader_unlock ();
+ if (!mono_verifier_verify_method_signature (img, sig_offset, error))
return NULL;
- }
size = mono_metadata_decode_blob_size (sig, &sig_body);
signature = mono_metadata_parse_method_signature_full (img, container, idx, sig_body, NULL);
if (!signature) {
mono_error_set_from_loader_error (error);
- mono_loader_unlock ();
return NULL;
}
- if (can_cache_signature)
- g_hash_table_insert (img->method_signatures, (gpointer)sig, signature);
+ if (can_cache_signature) {
+ mono_image_lock (img);
+ sig2 = g_hash_table_lookup (img->method_signatures, sig);
+ if (!sig2)
+ g_hash_table_insert (img->method_signatures, (gpointer)sig, signature);
+ mono_image_unlock (img);
+ }
signatures_size += mono_metadata_signature_size (signature);
}
/* Verify metadata consistency */
if (signature->generic_param_count) {
if (!container || !container->is_method) {
- mono_loader_unlock ();
mono_error_set_method_load (error, m->klass, m->name, "Signature claims method has generic parameters, but generic_params table says it doesn't for method 0x%08x from image %s", idx, img->name);
return NULL;
}
if (container->type_argc != signature->generic_param_count) {
- mono_loader_unlock ();
mono_error_set_method_load (error, m->klass, m->name, "Inconsistent generic parameter count. Signature says %d, generic_params table says %d for method 0x%08x from image %s", signature->generic_param_count, container->type_argc, idx, img->name);
return NULL;
}
} else if (container && container->is_method && container->type_argc) {
- mono_loader_unlock ();
mono_error_set_method_load (error, m->klass, m->name, "generic_params table claims method has generic parameters, but signature says it doesn't for method 0x%08x from image %s", idx, img->name);
return NULL;
}
case PINVOKE_ATTRIBUTE_CALL_CONV_GENERIC:
case PINVOKE_ATTRIBUTE_CALL_CONV_GENERICINST:
default:
- mono_loader_unlock ();
mono_error_set_method_load (error, m->klass, m->name, "unsupported calling convention : 0x%04x for method 0x%08x from image %s", piinfo->piflags, idx, img->name);
return NULL;
}
signature->call_convention = conv;
}
+ mono_image_lock (img);
+
mono_memory_barrier ();
- m->signature = signature;
+ if (!m->signature)
+ m->signature = signature;
+
+ mono_image_unlock (img);
- mono_loader_unlock ();
return m->signature;
}
if ((method->flags & METHOD_ATTRIBUTE_ABSTRACT) || (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) || (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
return NULL;
+ img = method->klass->image;
+
if (method->is_inflated) {
MonoMethodInflated *imethod = (MonoMethodInflated *) method;
- MonoMethodHeader *header;
+ MonoMethodHeader *header, *iheader;
- mono_loader_lock ();
+ header = mono_method_get_header (imethod->declaring);
+ if (!header)
+ return NULL;
+
+ iheader = inflate_generic_header (header, mono_method_get_context (method));
+ mono_metadata_free_mh (header);
+
+ mono_image_lock (img);
if (imethod->header) {
- mono_loader_unlock ();
+ mono_metadata_free_mh (iheader);
+ mono_image_unlock (img);
return imethod->header;
}
- header = mono_method_get_header (imethod->declaring);
- if (!header) {
- mono_loader_unlock ();
- return NULL;
- }
+ mono_memory_barrier ();
+ imethod->header = iheader;
+
+ mono_image_unlock (img);
- imethod->header = inflate_generic_header (header, mono_method_get_context (method));
- mono_loader_unlock ();
- mono_metadata_free_mh (header);
return imethod->header;
}
*/
g_assert (mono_metadata_token_table (method->token) == MONO_TABLE_METHOD);
idx = mono_metadata_token_index (method->token);
- img = method->klass->image;
rva = mono_metadata_decode_row_col (&img->tables [MONO_TABLE_METHOD], idx - 1, MONO_METHOD_RVA);
if (!mono_verifier_verify_method_header (img, rva, NULL))
* Find the method index in the metadata methodDef table.
*/
guint32
-mono_method_get_index (MonoMethod *method) {
+mono_method_get_index (MonoMethod *method)
+{
MonoClass *klass = method->klass;
int i;
}
return 0;
}
-
MONO_API void
mono_stack_walk_no_il (MonoStackWalk func, void* user_data);
+MONO_API void
+mono_stack_walk_async_safe (MonoStackWalk func, void* user_data);
+
MONO_END_DECLS
#endif
*
* To log more kind of locks just do the following:
* - add an entry into the RuntimeLocks enum
- * - change EnterCriticalSection(mutex) to mono_locks_acquire (mutex, LockName)
- * - change LeaveCriticalSection to mono_locks_release (mutex, LockName)
+ * - change mono_mutex_lock(mutex) to mono_locks_acquire (mutex, LockName)
+ * - change mono_mutex_unlock to mono_locks_release (mutex, LockName)
* - change the decoder to understand the new lock kind.
*
* TODO:
#endif
static FILE *trace_file;
-static CRITICAL_SECTION tracer_lock;
+static mono_mutex_t tracer_lock;
static size_t base_address;
typedef enum {
Dl_info info;
int res;
char *name;
- InitializeCriticalSection (&tracer_lock);
+ mono_mutex_init_recursive (&tracer_lock);
if (!g_getenv ("MONO_ENABLE_LOCK_TRACER"))
return;
name = g_strdup_printf ("locks.%d", getpid ());
#endif
#define mono_locks_acquire(LOCK, NAME) do { \
- EnterCriticalSection (LOCK); \
+ mono_mutex_lock (LOCK); \
mono_locks_lock_acquired (NAME, LOCK); \
} while (0)
#define mono_locks_release(LOCK, NAME) do { \
mono_locks_lock_released (NAME, LOCK); \
- LeaveCriticalSection (LOCK); \
+ mono_mutex_unlock (LOCK); \
} while (0)
#define mono_locks_mutex_acquire(LOCK, NAME) do { \
*/
#define mono_marshal_lock() mono_locks_acquire (&marshal_mutex, MarshalLock)
#define mono_marshal_unlock() mono_locks_release (&marshal_mutex, MarshalLock)
-static CRITICAL_SECTION marshal_mutex;
+static mono_mutex_t marshal_mutex;
static gboolean marshal_mutex_initialized;
static MonoNativeTlsKey last_error_tls_id;
if (!module_initialized) {
module_initialized = TRUE;
- InitializeCriticalSection (&marshal_mutex);
+ mono_mutex_init_recursive (&marshal_mutex);
marshal_mutex_initialized = TRUE;
register_icall (ves_icall_System_Threading_Thread_ResetAbort, "ves_icall_System_Threading_Thread_ResetAbort", "void", TRUE);
mono_native_tls_free (load_type_info_tls_id);
mono_native_tls_free (last_error_tls_id);
- DeleteCriticalSection (&marshal_mutex);
+ mono_mutex_destroy (&marshal_mutex);
marshal_mutex_initialized = FALSE;
}
return res;
}
+/*
+ * mono_mb_create:
+ *
+ * Create a MonoMethod from MB, set INFO as wrapper info.
+ */
+static MonoMethod*
+mono_mb_create (MonoMethodBuilder *mb, MonoMethodSignature *sig,
+ int max_stack, WrapperInfo *info)
+{
+ MonoMethod *res;
+
+ res = mono_mb_create_method (mb, sig, max_stack);
+ if (info)
+ mono_marshal_set_wrapper_info (res, info);
+ return res;
+}
+
/* Create the method from the builder and place it in the cache */
static MonoMethod*
mono_mb_create_and_cache_full (GHashTable *cache, gpointer key,
MonoMethodBuilder *mb, MonoMethodSignature *sig,
- int max_stack, gboolean *out_found)
+ int max_stack, WrapperInfo *info, gboolean *out_found)
{
MonoMethod *res;
if (!res) {
res = newm;
g_hash_table_insert (cache, key, res);
- mono_marshal_set_wrapper_info (res, key);
+ if (info)
+ mono_marshal_set_wrapper_info (res, info);
+ else
+ mono_marshal_set_wrapper_info (res, key);
mono_marshal_unlock ();
} else {
if (out_found)
MonoMethodBuilder *mb, MonoMethodSignature *sig,
int max_stack)
{
- return mono_mb_create_and_cache_full (cache, key, mb, sig, max_stack, NULL);
+ return mono_mb_create_and_cache_full (cache, key, mb, sig, max_stack, NULL, NULL);
}
static inline MonoMethod*
}
static WrapperInfo*
-mono_wrapper_info_create (MonoMethod *wrapper, WrapperSubtype subtype)
+mono_wrapper_info_create (MonoMethodBuilder *mb, WrapperSubtype subtype)
{
WrapperInfo *info;
- info = mono_image_alloc0 (wrapper->klass->image, sizeof (WrapperInfo));
+ info = mono_image_alloc0 (mb->method->klass->image, sizeof (WrapperInfo));
info->subtype = subtype;
return info;
}
static MonoClass*
get_wrapper_target_class (MonoImage *image)
{
+ MonoError error;
MonoClass *klass;
/*
* To avoid these problems, we put the wrappers into the <Module> class of
* the image.
*/
- if (image_is_dynamic (image))
+ if (image_is_dynamic (image)) {
klass = ((MonoDynamicImage*)image)->wrappers_type;
- else
- klass = mono_class_get (image, mono_metadata_make_token (MONO_TABLE_TYPEDEF, 1));
+ } else {
+ klass = mono_class_get_checked (image, mono_metadata_make_token (MONO_TABLE_TYPEDEF, 1), &error);
+ g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
+ }
g_assert (klass);
return klass;
new_key = g_new0 (SignatureMethodPair, 1);
*new_key = key;
- res = mono_mb_create_and_cache_full (cache, new_key, mb, sig, sig->param_count + 16, &found);
+ info = mono_wrapper_info_create (mb, subtype);
+
+ res = mono_mb_create_and_cache_full (cache, new_key, mb, sig, sig->param_count + 16, info, &found);
if (found)
g_free (new_key);
- info = mono_wrapper_info_create (res, subtype);
- mono_marshal_set_wrapper_info (res, info);
} else {
- res = mono_mb_create_and_cache (cache, cache_key, mb, sig, sig->param_count + 16);
+ info = mono_wrapper_info_create (mb, subtype);
- info = mono_wrapper_info_create (res, subtype);
- mono_marshal_set_wrapper_info (res, info);
+ res = mono_mb_create_and_cache_full (cache, cache_key, mb, sig, sig->param_count + 16, info, NULL);
}
mono_mb_free (mb);
MonoMethodSignature *res = mono_metadata_signature_dup (sig);
int i;
+ res->generic_param_count = 0;
res->ret = get_runtime_invoke_type (sig->ret, TRUE);
for (i = 0; i < res->param_count; ++i)
res->params [i] = get_runtime_invoke_type (sig->params [i], FALSE);
#ifndef DISABLE_JIT
mb->skip_visibility = 1;
#endif
- res = mono_mb_create_and_cache (cache, method, mb, csig, sig->param_count + 16);
- info = mono_wrapper_info_create (res, virtual ? WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL : WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT);
+ info = mono_wrapper_info_create (mb, virtual ? WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL : WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT);
info->d.runtime_invoke.method = method;
- mono_marshal_set_wrapper_info (res, info);
+ res = mono_mb_create_and_cache_full (cache, method, mb, csig, sig->param_count + 16, info, NULL);
} else {
/* taken from mono_mb_create_and_cache */
mono_marshal_lock ();
res = g_hash_table_lookup (cache, callsig);
mono_marshal_unlock ();
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL);
+ info->d.runtime_invoke.sig = callsig;
+
/* Somebody may have created it before us */
if (!res) {
MonoMethod *newm;
- newm = mono_mb_create_method (mb, csig, sig->param_count + 16);
+ newm = mono_mb_create (mb, csig, sig->param_count + 16, info);
mono_marshal_lock ();
res = g_hash_table_lookup (cache, callsig);
g_hash_table_insert (cache, callsig, res);
/* Can't insert it into wrapper_hash since the key is a signature */
g_hash_table_insert (method->klass->image->runtime_invoke_direct_cache, method, res);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL);
- info->d.runtime_invoke.sig = callsig;
- mono_marshal_set_wrapper_info (res, info);
} else {
mono_free_method (newm);
}
mono_mb_emit_byte (mb, CEE_RET);
#endif /* DISABLE_JIT */
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_DYNAMIC);
+
mono_marshal_lock ();
/* double-checked locking */
- if (!method) {
- method = mono_mb_create_method (mb, csig, 16);
- info = mono_wrapper_info_create (method, WRAPPER_SUBTYPE_RUNTIME_INVOKE_DYNAMIC);
- mono_marshal_set_wrapper_info (method, info);
- }
+ if (!method)
+ method = mono_mb_create (mb, csig, 16, info);
+
mono_marshal_unlock ();
mono_mb_free (mb);
mono_marshal_unlock ();
if (!res) {
MonoMethod *newm;
- newm = mono_mb_create_method (mb, sig, 4);
+ newm = mono_mb_create (mb, sig, 4, NULL);
mono_marshal_lock ();
res = cached;
if (!res) {
MonoMethod *res;
MonoClass *klass;
GHashTable *cache;
+ WrapperInfo *info;
char *name;
int t, pos0, pos1 = 0;
mono_mb_emit_byte (mb, CEE_RET);
#endif /* DISABLE_JIT */
- res = mono_mb_create_and_cache (cache, klass,
- mb, sig, sig->param_count + 16);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ info->d.proxy.klass = klass;
+ res = mono_mb_create_and_cache_full (cache, klass,
+ mb, sig, sig->param_count + 16, info, NULL);
mono_mb_free (mb);
return res;
MonoMethod *res;
MonoClass *klass;
GHashTable *cache;
+ WrapperInfo *info;
char *name;
int t, pos0, pos1, pos2, pos3;
mono_mb_emit_byte (mb, CEE_RET);
#endif
- res = mono_mb_create_and_cache (cache, klass,
- mb, sig, sig->param_count + 16);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ info->d.proxy.klass = klass;
+ res = mono_mb_create_and_cache_full (cache, klass,
+ mb, sig, sig->param_count + 16,
+ info, NULL);
mono_mb_free (mb);
return res;
mono_marshal_unlock ();
if (!res) {
MonoMethod *newm;
- newm = mono_mb_create_method (mb, sig, 6);
+ newm = mono_mb_create (mb, sig, 6, NULL);
mono_marshal_lock ();
res = cached;
if (!res) {
MonoMethod *res;
MonoClass *klass;
GHashTable *cache;
+ WrapperInfo *info;
char *name;
int t, pos;
mono_mb_emit_byte (mb, CEE_RET);
#endif
- res = mono_mb_create_and_cache (cache, klass,
- mb, sig, sig->param_count + 16);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ info->d.proxy.klass = klass;
+ res = mono_mb_create_and_cache_full (cache, klass,
+ mb, sig, sig->param_count + 16,
+ info, NULL);
mono_mb_free (mb);
return res;
if (csig->call_convention == MONO_CALL_VARARG)
csig->call_convention = 0;
- res = mono_mb_create_method (mb, csig, csig->param_count + 16);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_ICALL_WRAPPER);
+ info->d.icall.func = (gpointer)func;
+ res = mono_mb_create (mb, csig, csig->param_count + 16, info);
mono_mb_free (mb);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_ICALL_WRAPPER);
- info->d.icall.func = (gpointer)func;
- mono_marshal_set_wrapper_info (res, info);
-
return res;
}
mono_mb_emit_byte (mb, CEE_RET);
#endif
- /* use native_wrapper_cache because internal calls are looked up there */
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, csig->param_count + 1);
-
- mono_mb_free (mb);
-
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_STRING_CTOR);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_STRING_CTOR);
info->d.string_ctor.method = method;
- mono_marshal_set_wrapper_info (res, info);
+ /* use native_wrapper_cache because internal calls are looked up there */
+ res = mono_mb_create_and_cache_full (cache, method, mb, csig,
+ csig->param_count + 1, info, NULL);
+ mono_mb_free (mb);
return res;
}
#ifndef DISABLE_JIT
mono_mb_emit_exception (mb, exc_class, exc_arg);
#endif
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ info->d.managed_to_native.method = method;
+
csig = signature_dup (method->klass->image, sig);
csig->pinvoke = 0;
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, csig->param_count + 16);
+ res = mono_mb_create_and_cache_full (cache, method, mb, csig,
+ csig->param_count + 16, info, NULL);
mono_mb_free (mb);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_NONE);
- info->d.managed_to_native.method = method;
- mono_marshal_set_wrapper_info (res, info);
-
return res;
}
emit_thread_interrupt_checkpoint (mb);
mono_mb_emit_byte (mb, CEE_RET);
#endif
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ info->d.managed_to_native.method = method;
csig = signature_dup (method->klass->image, csig);
csig->pinvoke = 0;
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, csig->param_count + 16);
-
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_NONE);
- info->d.managed_to_native.method = method;
- mono_marshal_set_wrapper_info (res, info);
+ res = mono_mb_create_and_cache_full (cache, method, mb, csig, csig->param_count + 16,
+ info, NULL);
mono_mb_free (mb);
return res;
mono_marshal_emit_native_wrapper (mb->method->klass->image, mb, sig, piinfo, mspecs, piinfo->addr, aot, check_exceptions, FALSE);
#endif
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_PINVOKE);
+ info->d.managed_to_native.method = method;
csig = signature_dup (method->klass->image, sig);
csig->pinvoke = 0;
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, csig->param_count + 16);
+ res = mono_mb_create_and_cache_full (cache, method, mb, csig, csig->param_count + 16,
+ info, NULL);
mono_mb_free (mb);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_PINVOKE);
- info->d.managed_to_native.method = method;
- mono_marshal_set_wrapper_info (res, info);
-
#ifndef DISABLE_JIT
for (i = sig->param_count; i >= 0; i--)
if (mspecs [i])
mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, NULL, FALSE, TRUE, TRUE);
#endif
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NATIVE_FUNC_AOT);
+ info->d.managed_to_native.method = invoke;
+
g_assert (!sig->hasthis);
csig = signature_dup_add_this (image, sig, mono_defaults.int_class);
csig->pinvoke = 0;
- res = mono_mb_create_and_cache (cache, invoke,
- mb, csig, csig->param_count + 16);
+ res = mono_mb_create_and_cache_full (cache, invoke,
+ mb, csig, csig->param_count + 16,
+ info, NULL);
mono_mb_free (mb);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_NATIVE_FUNC_AOT);
- info->d.managed_to_native.method = invoke;
-
- mono_marshal_set_wrapper_info (res, info);
-
for (i = mono_method_signature (invoke)->param_count; i >= 0; i--)
if (mspecs [i])
mono_metadata_free_marshal_spec (mspecs [i]);
/* Why is this a modopt ? */
if (sig->ret && sig->ret->num_mods) {
for (i = 0; i < sig->ret->num_mods; ++i) {
- MonoClass *cmod_class = mono_class_get (method->klass->image, sig->ret->modifiers [i].token);
- g_assert (cmod_class);
+ MonoError error;
+ MonoClass *cmod_class = mono_class_get_checked (method->klass->image, sig->ret->modifiers [i].token, &error);
+ g_assert (mono_error_ok (&error));
if ((cmod_class->image == mono_defaults.corlib) && !strcmp (cmod_class->name_space, "System.Runtime.CompilerServices")) {
if (!strcmp (cmod_class->name, "CallConvCdecl"))
csig->call_convention = MONO_CALL_C;
if (!target_handle) {
WrapperInfo *info;
- res = mono_mb_create_and_cache (cache, method,
- mb, csig, sig->param_count + 16);
// FIXME: Associate it with the method+delegate_klass pair
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_NONE);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
info->d.native_to_managed.method = method;
info->d.native_to_managed.klass = delegate_klass;
- mono_marshal_set_wrapper_info (res, info);
+
+ res = mono_mb_create_and_cache_full (cache, method,
+ mb, csig, sig->param_count + 16,
+ info, NULL);
} else {
#ifndef DISABLE_JIT
mb->dynamic = 1;
#endif
- res = mono_mb_create_method (mb, csig, sig->param_count + 16);
+ res = mono_mb_create (mb, csig, sig->param_count + 16, NULL);
}
mono_mb_free (mb);
#ifndef DISABLE_JIT
mb->dynamic = 1;
#endif
- method = mono_mb_create_method (mb, csig, sig->param_count + 16);
+ method = mono_mb_create (mb, csig, sig->param_count + 16, NULL);
mono_mb_free (mb);
for (i = sig->param_count; i >= 0; i--)
mb->dynamic = 1;
#endif
- method = mono_mb_create_method (mb, sig, param_count);
+ method = mono_mb_create (mb, sig, param_count, NULL);
mono_mb_free (mb);
return mono_compile_method (method);
mono_mb_emit_byte (mb, CEE_RET);
#endif /* DISABLE_JIT */
- res = mono_mb_create_method (mb, sig, 8);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_CASTCLASS_WITH_CACHE);
- mono_marshal_set_wrapper_info (res, info);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_CASTCLASS_WITH_CACHE);
+ res = mono_mb_create (mb, sig, 8, info);
STORE_STORE_FENCE;
if (InterlockedCompareExchangePointer ((volatile gpointer *)&cached, res, NULL)) {
mono_mb_emit_byte (mb, CEE_RET);
#endif
- res = mono_mb_create_method (mb, sig, 8);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_ISINST_WITH_CACHE);
- mono_marshal_set_wrapper_info (res, info);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_ISINST_WITH_CACHE);
+ res = mono_mb_create (mb, sig, 8, info);
STORE_STORE_FENCE;
if (InterlockedCompareExchangePointer ((volatile gpointer *)&cached, res, NULL)) {
static MonoMethodSignature *isint_sig = NULL;
GHashTable *cache;
MonoMethod *res;
+ WrapperInfo *info;
int pos_was_ok, pos_end;
#ifndef DISABLE_REMOTING
int pos_end2, pos_failed;
#endif /* DISABLE_REMOTING */
#endif /* DISABLE_JIT */
- res = mono_mb_create_and_cache (cache, klass, mb, isint_sig, isint_sig->param_count + 16);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ info->d.proxy.klass = klass;
+ res = mono_mb_create_and_cache_full (cache, klass, mb, isint_sig, isint_sig->param_count + 16, info, NULL);
mono_mb_free (mb);
return res;
mono_mb_emit_byte (mb, CEE_RET);
#endif /* DISABLE_JIT */
- res = mono_mb_create_and_cache (cache, klass, mb, castclass_sig, castclass_sig->param_count + 16);
- mono_mb_free (mb);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_NONE);
- mono_marshal_set_wrapper_info (res, info);
+ res = mono_mb_create_and_cache_full (cache, klass, mb, castclass_sig, castclass_sig->param_count + 16,
+ info, NULL);
+ mono_mb_free (mb);
return res;
}
static MonoMethodSignature *isint_sig = NULL;
GHashTable *cache;
MonoMethod *res;
+ WrapperInfo *info;
int pos_failed, pos_end;
char *name, *klass_name;
MonoMethod *can_cast_to;
mono_mb_emit_byte (mb, CEE_RET);
#endif
- res = mono_mb_create_and_cache (cache, klass, mb, isint_sig, isint_sig->param_count + 16);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ info->d.proxy.klass = klass;
+ res = mono_mb_create_and_cache_full (cache, klass, mb, isint_sig, isint_sig->param_count + 16, info, NULL);
mono_mb_free (mb);
return res;
mono_mb_emit_byte (mb, CEE_RET);
#endif
-
- res = mono_mb_create_method (mb, mono_signature_no_pinvoke (stoptr), 0);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_STRUCTURE_TO_PTR);
+ res = mono_mb_create (mb, mono_signature_no_pinvoke (stoptr), 0, info);
mono_mb_free (mb);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_STRUCTURE_TO_PTR);
- mono_marshal_set_wrapper_info (res, info);
-
klass->marshal_info->str_to_ptr = res;
return res;
}
mono_mb_emit_byte (mb, CEE_RET);
#endif
-
- res = mono_mb_create_method (mb, ptostr, 0);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_PTR_TO_STRUCTURE);
+ res = mono_mb_create (mb, ptostr, 0, info);
mono_mb_free (mb);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_PTR_TO_STRUCTURE);
- mono_marshal_set_wrapper_info (res, info);
-
klass->marshal_info->ptr_to_str = res;
return res;
}
mono_mb_emit_byte (mb, CEE_RET);
#endif
sig = signature_dup (method->klass->image, mono_method_signature (method));
- res = mono_mb_create_method (mb, sig, 0);
- mono_mb_free (mb);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_SYNCHRONIZED_INNER);
+
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_SYNCHRONIZED_INNER);
info->d.synchronized_inner.method = method;
- mono_marshal_set_wrapper_info (res, info);
+ res = mono_mb_create (mb, sig, 0, info);
+ mono_mb_free (mb);
if (ctx)
res = mono_class_inflate_generic_method (res, ctx);
return res;
g_assert (0);
}
#endif /* DISABLE_JIT */
-
- res = mono_mb_create_method (mb, signature, 4);
- res->flags |= METHOD_ATTRIBUTE_VIRTUAL;
-
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_VIRTUAL_STELEMREF);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_VIRTUAL_STELEMREF);
info->d.virtual_stelemref.kind = kind;
- mono_marshal_set_wrapper_info (res, info);
+ res = mono_mb_create (mb, signature, 4, info);
+ res->flags |= METHOD_ATTRIBUTE_VIRTUAL;
mono_marshal_lock ();
if (!cached_methods [kind]) {
* The wrapper info for the wrapper is a WrapperInfo structure.
*/
MonoMethod*
-mono_marshal_get_stelemref ()
+mono_marshal_get_stelemref (void)
{
static MonoMethod* ret = NULL;
MonoMethodSignature *sig;
mono_mb_emit_byte (mb, CEE_RET);
#endif
-
- ret = mono_mb_create_method (mb, sig, 4);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ ret = mono_mb_create (mb, sig, 4, info);
mono_mb_free (mb);
- info = mono_wrapper_info_create (ret, WRAPPER_SUBTYPE_NONE);
- mono_marshal_set_wrapper_info (ret, info);
-
return ret;
}
*/
mono_mb_emit_byte (mb, CEE_RET);
#endif
-
- ret = mono_mb_create_method (mb, sig, 4);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_GSHAREDVT_IN);
+ ret = mono_mb_create (mb, sig, 4, info);
mono_mb_free (mb);
- info = mono_wrapper_info_create (ret, WRAPPER_SUBTYPE_GSHAREDVT_IN);
- mono_marshal_set_wrapper_info (ret, info);
-
return ret;
}
*/
mono_mb_emit_byte (mb, CEE_RET);
#endif
-
- ret = mono_mb_create_method (mb, sig, 4);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_GSHAREDVT_OUT);
+ ret = mono_mb_create (mb, sig, 4, info);
mono_mb_free (mb);
- info = mono_wrapper_info_create (ret, WRAPPER_SUBTYPE_GSHAREDVT_OUT);
- mono_marshal_set_wrapper_info (ret, info);
-
return ret;
}
MonoMethod *ret;
MonoMethodBuilder *mb;
MonoMethodSignature *sig;
+ WrapperInfo *info;
int i, bounds, ind, realidx;
int branch_pos, *branch_positions;
int cached;
g_free (branch_positions);
#endif /* DISABLE_JIT */
- ret = mono_mb_create_method (mb, sig, 4);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_ELEMENT_ADDR);
+ info->d.element_addr.rank = rank;
+ info->d.element_addr.elem_size = elem_size;
+ ret = mono_mb_create (mb, sig, 4, info);
mono_mb_free (mb);
/* cache the result */
}
}
if (!cached) {
- WrapperInfo *info;
-
if (elem_addr_cache_next >= elem_addr_cache_size) {
int new_size = elem_addr_cache_size + 4;
ArrayElemAddr *new_array = g_new0 (ArrayElemAddr, new_size);
elem_addr_cache [elem_addr_cache_next].elem_size = elem_size;
elem_addr_cache [elem_addr_cache_next].method = ret;
elem_addr_cache_next ++;
-
- info = mono_wrapper_info_create (ret, WRAPPER_SUBTYPE_ELEMENT_ADDR);
- info->d.element_addr.rank = rank;
- info->d.element_addr.elem_size = elem_size;
- mono_marshal_set_wrapper_info (ret, info);
}
mono_marshal_unlock ();
return ret;
def = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
} else {
- res = mono_mb_create_and_cache (cache, method,
- mb, sig, sig->param_count + 16);
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_ARRAY_ACCESSOR);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_ARRAY_ACCESSOR);
info->d.array_accessor.method = method;
- mono_marshal_set_wrapper_info (res, info);
+
+ res = mono_mb_create_and_cache_full (cache, method,
+ mb, sig, sig->param_count + 16,
+ info, NULL);
}
mono_mb_free (mb);
/* We can corlib internal methods */
mb->skip_visibility = TRUE;
#endif
-
- res = mono_mb_create_method (mb, csig, csig->param_count + 16);
-
- info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER);
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER);
info->d.generic_array_helper.method = method;
- mono_marshal_set_wrapper_info (res, info);
+ res = mono_mb_create (mb, csig, csig->param_count + 16, info);
mono_mb_free (mb);
MonoMethod *method;
} ArrayAccessorWrapperInfo;
+typedef struct {
+ MonoClass *klass;
+} ProxyWrapperInfo;
+
/*
* This structure contains additional information to uniquely identify a given wrapper
* method. It can be retrieved by mono_marshal_get_wrapper_info () for certain types
ICallWrapperInfo icall;
/* ARRAY_ACCESSOR */
ArrayAccessorWrapperInfo array_accessor;
+ /* PROXY_ISINST etc. */
+ ProxyWrapperInfo proxy;
} d;
} WrapperInfo;
#include "metadata/appdomain.h"
#include "metadata/metadata-internals.h"
-static CRITICAL_SECTION mempool_tracing_lock;
+static mono_mutex_t mempool_tracing_lock;
#define BACKTRACE_DEPTH 7
static void
mono_backtrace (int size)
static gboolean inited;
if (!inited) {
- InitializeCriticalSection (&mempool_tracing_lock);
+ mono_mutex_init_recursive (&mempool_tracing_lock);
inited = TRUE;
}
- EnterCriticalSection (&mempool_tracing_lock);
+ mono_mutex_lock (&mempool_tracing_lock);
g_print ("Allocating %d bytes\n", size);
symbols = backtrace (array, BACKTRACE_DEPTH);
names = backtrace_symbols (array, symbols);
g_print ("\t%s\n", names [i]);
}
free (names);
- LeaveCriticalSection (&mempool_tracing_lock);
+ mono_mutex_unlock (&mempool_tracing_lock);
}
#endif
#ifdef MALLOC_ALLOCATION
{
- Chunk *c = g_malloc (size);
+ Chunk *c = g_malloc (size + sizeof (Chunk));
c->next = pool->chunks;
pool->chunks = c;
MonoConcurrentHashTable *field_cache; /*protected by the image lock*/
/* indexed by typespec tokens. */
- GHashTable *typespec_cache;
+ GHashTable *typespec_cache; /* protected by the image lock */
/* indexed by token */
GHashTable *memberref_signatures;
GHashTable *helper_signatures;
GHashTable *szarray_cache;
/* This has a separate lock to improve scalability */
- CRITICAL_SECTION szarray_cache_lock;
+ mono_mutex_t szarray_cache_lock;
/*
* indexed by MonoMethodSignature
MonoDllMap *dll_map;
/* interfaces IDs from this image */
+ /* protected by the classes lock */
MonoBitSet *interface_bitset;
/* when the image is being closed, this is abused as a list of
* No other runtime locks must be taken while holding this lock.
* It's meant to be used only to mutate and query structures part of this image.
*/
- CRITICAL_SECTION lock;
+ mono_mutex_t lock;
};
/*
GHashTable *gclass_cache, *ginst_cache, *gmethod_cache, *gsignature_cache;
- CRITICAL_SECTION lock;
+ mono_mutex_t lock;
/*
* Memory for generic instances owned by this image set should be allocated from
MonoType *params [MONO_ZERO_LEN_ARRAY];
};
+/*
+ * AOT cache configuration loaded from config files.
+ * Doesn't really belong here.
+ */
+typedef struct {
+ /*
+ * Enable aot caching for applications whose main assemblies are in
+ * this list.
+ */
+ GSList *apps;
+ GSList *assemblies;
+ char *aot_options;
+} MonoAotCacheConfig;
+
#define MONO_SIZEOF_METHOD_SIGNATURE (sizeof (struct _MonoMethodSignature) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
static inline gboolean
void mono_type_set_alignment (MonoTypeEnum type, int align) MONO_INTERNAL;
+MonoAotCacheConfig *mono_get_aot_cache_config (void) MONO_INTERNAL;
+MonoType *
+mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, MonoError *error) MONO_INTERNAL;
+
#endif /* __MONO_METADATA_INTERNALS_H__ */
static MonoImageSet *mscorlib_image_set;
/* Protected by image_sets_mutex */
static GPtrArray *image_sets;
-static CRITICAL_SECTION image_sets_mutex;
+static mono_mutex_t image_sets_mutex;
static guint mono_generic_class_hash (gconstpointer data);
for (i = 0; i < NBUILTIN_TYPES (); ++i)
g_hash_table_insert (type_cache, (gpointer) &builtin_types [i], (gpointer) &builtin_types [i]);
- InitializeCriticalSection (&image_sets_mutex);
+ mono_mutex_init_recursive (&image_sets_mutex);
}
/**
type_cache = NULL;
g_ptr_array_free (image_sets, TRUE);
image_sets = NULL;
- DeleteCriticalSection (&image_sets_mutex);
+ mono_mutex_destroy (&image_sets_mutex);
}
/**
static inline void
image_sets_lock (void)
{
- EnterCriticalSection (&image_sets_mutex);
+ mono_mutex_lock (&image_sets_mutex);
}
static inline void
image_sets_unlock (void)
{
- LeaveCriticalSection (&image_sets_mutex);
+ mono_mutex_unlock (&image_sets_mutex);
}
/*
set = g_new0 (MonoImageSet, 1);
set->nimages = nimages;
set->images = g_new0 (MonoImage*, nimages);
- InitializeCriticalSection (&set->lock);
+ mono_mutex_init_recursive (&set->lock);
for (i = 0; i < nimages; ++i)
set->images [i] = images [i];
set->gclass_cache = g_hash_table_new_full (mono_generic_class_hash, mono_generic_class_equal, NULL, (GDestroyNotify)free_generic_class);
if (set->mempool)
mono_mempool_destroy (set->mempool);
g_free (set->images);
- DeleteCriticalSection (&set->lock);
+ mono_mutex_destroy (&set->lock);
g_free (set);
}
static void
mono_image_set_lock (MonoImageSet *set)
{
- EnterCriticalSection (&set->lock);
+ mono_mutex_lock (&set->lock);
}
static void
mono_image_set_unlock (MonoImageSet *set)
{
- LeaveCriticalSection (&set->lock);
+ mono_mutex_unlock (&set->lock);
}
gpointer
*/
ginst_data.image = gclass_data.image = image;
ginst_data.list = gclass_data.list = NULL;
- mono_loader_lock ();
/* Collect the items to delete */
/* delete_image_set () modifies the lists so make a copy */
delete_image_set (set);
}
g_slist_free (set_list);
-
- mono_loader_unlock ();
}
static void
case MONO_TYPE_CLASS: {
guint32 token;
MonoClass *class;
+ MonoError error;
token = mono_metadata_parse_typedef_or_ref (m, ptr, &ptr);
- class = mono_class_get (m, token);
+ class = mono_class_get_checked (m, token, &error);
type->data.klass = class;
- if (!class)
+ if (!class) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /*FIXME don't swallow the error message*/
return FALSE;
+ }
if (!compare_type_literals (class->byval_arg.type, type->type))
return FALSE;
break;
if (ec->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
ec->data.filter_offset = tof_value;
} else if (ec->flags == MONO_EXCEPTION_CLAUSE_NONE) {
- ec->data.catch_class = tof_value? mono_class_get (m, tof_value): 0;
+ ec->data.catch_class = NULL;
+ if (tof_value) {
+ MonoError error;
+ ec->data.catch_class = mono_class_get_checked (m, tof_value, &error);
+ if (!mono_error_ok (&error)) {
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
+ g_free (clauses);
+ return NULL;
+ }
+ }
} else {
ec->data.catch_class = NULL;
}
MonoMethodHeader *
mono_metadata_parse_mh_full (MonoImage *m, MonoGenericContainer *container, const char *ptr)
{
- MonoMethodHeader *mh;
+ MonoMethodHeader *mh = NULL;
unsigned char flags = *(const unsigned char *) ptr;
unsigned char format = flags & METHOD_HEADER_FORMAT_MASK;
guint16 fat_flags;
if (local_var_sig_tok) {
int idx = (local_var_sig_tok & 0xffffff)-1;
if (idx >= t->rows || idx < 0)
- return NULL;
+ goto fail;
mono_metadata_decode_row (t, idx, cols, 1);
if (!mono_verifier_verify_standalone_signature (m, cols [MONO_STAND_ALONE_SIGNATURE], NULL))
- return NULL;
+ goto fail;
}
if (fat_flags & METHOD_HEADER_MORE_SECTS)
clauses = parse_section_data (m, &num_clauses, (const unsigned char*)ptr);
for (i = 0; i < len; ++i) {
mh->locals [i] = mono_metadata_parse_type_internal (m, container,
MONO_PARSE_LOCAL, 0, TRUE, locals_ptr, &locals_ptr);
- if (!mh->locals [i]) {
- g_free (clauses);
- g_free (mh);
- return NULL;
- }
+ if (!mh->locals [i])
+ goto fail;
}
} else {
mh = g_malloc0 (MONO_SIZEOF_METHOD_HEADER + num_clauses * sizeof (MonoExceptionClause));
mh->num_clauses = num_clauses;
}
return mh;
+fail:
+ g_free (clauses);
+ g_free (mh);
+ return NULL;
+
}
/*
*
* Decode the method header at @ptr, including pointer to the IL code,
* info about local variables and optional exception tables.
- * This is a Mono runtime internal function.
*
- * Returns: a MonoMethodHeader.
+ * Returns: a transient MonoMethodHeader allocated from the heap.
*/
MonoMethodHeader *
mono_metadata_parse_mh (MonoImage *m, const char *ptr)
{
- MonoMethodHeader *res;
-
- mono_loader_lock ();
-
- res = mono_metadata_parse_mh_full (m, NULL, ptr);
-
- mono_loader_unlock ();
-
- return res;
+ return mono_metadata_parse_mh_full (m, NULL, ptr);
}
/*
* The array of interfaces that the @index typedef token implements is returned in
* @interfaces. The number of elements in the array is returned in @count.
*
- * LOCKING: Assumes the loader lock is held.
- *
+
* Returns: TRUE on success, FALSE on failure.
*/
gboolean
pos = start;
while (pos < tdef->rows) {
+ MonoError error;
MonoClass *iface;
mono_metadata_decode_row (tdef, pos, cols, MONO_INTERFACEIMPL_SIZE);
if (cols [MONO_INTERFACEIMPL_CLASS] != loc.idx)
break;
- iface = mono_class_get_full (
- meta, mono_metadata_token_from_dor (cols [MONO_INTERFACEIMPL_INTERFACE]), context);
- if (iface == NULL)
+ iface = mono_class_get_and_inflate_typespec_checked (
+ meta, mono_metadata_token_from_dor (cols [MONO_INTERFACEIMPL_INTERFACE]), context, &error);
+ if (iface == NULL) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /* FIXME Don't swallow the error */
return FALSE;
+ }
result [pos - start] = iface;
++pos;
}
MonoClass **interfaces;
gboolean rv;
- mono_loader_lock ();
rv = mono_metadata_interfaces_from_typedef_full (meta, index, &interfaces, count, TRUE, NULL);
- mono_loader_unlock ();
if (rv)
return interfaces;
else
/**
* @image: context where the image is created
* @type_spec: typespec token
+ * @deprecated use mono_type_create_from_typespec_checked that has proper error handling
*
* Creates a MonoType representing the TypeSpec indexed by the @type_spec
* token.
*/
MonoType *
mono_type_create_from_typespec (MonoImage *image, guint32 type_spec)
+{
+ MonoError error;
+ MonoType *type = mono_type_create_from_typespec_checked (image, type_spec, &error);
+ if (!type) {
+ mono_loader_set_error_from_mono_error (&error);
+ mono_error_cleanup (&error); /* FIXME don't swallow error*/
+ }
+ return type;
+}
+
+MonoType *
+mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, MonoError *error)
+
{
guint32 idx = mono_metadata_token_index (type_spec);
MonoTableInfo *t;
guint32 len;
MonoType *type, *type2;
- mono_loader_lock ();
+ mono_error_init (error);
+ mono_image_lock (image);
type = g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec));
- if (type) {
- mono_loader_unlock ();
+ mono_image_unlock (image);
+ if (type)
return type;
- }
t = &image->tables [MONO_TABLE_TYPESPEC];
ptr = mono_metadata_blob_heap (image, cols [MONO_TYPESPEC_SIGNATURE]);
if (!mono_verifier_verify_typespec_signature (image, cols [MONO_TYPESPEC_SIGNATURE], type_spec, NULL)) {
- mono_loader_unlock ();
+ mono_error_set_bad_image (error, image, "Could not verify type spec %08x.", type_spec);
return NULL;
}
type = mono_metadata_parse_type_internal (image, NULL, MONO_PARSE_TYPE, 0, TRUE, ptr, &ptr);
if (!type) {
- mono_loader_unlock ();
+ if (mono_loader_get_last_error ())
+ mono_error_set_from_loader_error (error);
+ else
+ mono_error_set_bad_image (error, image, "Could not parse type spec %08x.", type_spec);
return NULL;
}
- type2 = g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec));
-
- if (type2) {
- mono_loader_unlock ();
- return type2;
- }
-
type2 = mono_metadata_type_dup (image, type);
- g_hash_table_insert (image->typespec_cache, GUINT_TO_POINTER (type_spec), type2);
mono_metadata_free_type (type);
- mono_loader_unlock ();
+ mono_image_lock (image);
+ type = g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec));
+ /* We might leak some data in the image mempool if found */
+ if (!type) {
+ g_hash_table_insert (image->typespec_cache, GUINT_TO_POINTER (type_spec), type2);
+ type = type2;
+ }
+ mono_image_unlock (image);
- return type2;
+ return type;
}
}
static gboolean
-get_constraints (MonoImage *image, int owner, MonoClass ***constraints, MonoGenericContainer *container)
+get_constraints (MonoImage *image, int owner, MonoClass ***constraints, MonoGenericContainer *container, MonoError *error)
{
MonoTableInfo *tdef = &image->tables [MONO_TABLE_GENERICPARAMCONSTRAINT];
guint32 cols [MONO_GENPARCONSTRAINT_SIZE];
GSList *cons = NULL, *tmp;
MonoGenericContext *context = &container->context;
+ mono_error_init (error);
+
*constraints = NULL;
found = 0;
for (i = 0; i < tdef->rows; ++i) {
mono_metadata_decode_row (tdef, i, cols, MONO_GENPARCONSTRAINT_SIZE);
if (cols [MONO_GENPARCONSTRAINT_GENERICPAR] == owner) {
token = mono_metadata_token_from_dor (cols [MONO_GENPARCONSTRAINT_CONSTRAINT]);
- klass = mono_class_get_full (image, token, context);
+ klass = mono_class_get_and_inflate_typespec_checked (image, token, context, error);
if (!klass) {
g_slist_free (cons);
return FALSE;
* Memory is allocated from IMAGE's mempool.
*/
gboolean
-mono_metadata_load_generic_param_constraints_full (MonoImage *image, guint32 token,
- MonoGenericContainer *container)
+mono_metadata_load_generic_param_constraints_checked (MonoImage *image, guint32 token,
+ MonoGenericContainer *container, MonoError *error)
{
guint32 start_row, i, owner;
+ mono_error_init (error);
+
if (! (start_row = mono_metadata_get_generic_param_row (image, token, &owner)))
return TRUE;
for (i = 0; i < container->type_argc; i++) {
- if (!get_constraints (image, start_row + i, &mono_generic_container_get_param_info (container, i)->constraints, container))
+ if (!get_constraints (image, start_row + i, &mono_generic_container_get_param_info (container, i)->constraints, container, error)) {
+ g_assert (!mono_loader_get_last_error ());
return FALSE;
+ }
}
return TRUE;
}
-/*
- * mono_metadata_load_generic_param_constraints:
- *
- * @image: metadata context
- * @token: metadata token to load the contraints, can be methodef or typedef.
- * @container: generic container to load into.
- *
- * Load the generic parameter constraints for the newly created generic type or method
- * represented by @token and @container. The @container is the new container which has
- * been returned by a call to mono_metadata_load_generic_params() with this @token.
- * Memory is allocated from IMAGE's mempool.
- */
-void
-mono_metadata_load_generic_param_constraints (MonoImage *image, guint32 token,
- MonoGenericContainer *container)
-{
- mono_metadata_load_generic_param_constraints_full (image, token, container);
- /*FIXME this function can potentially exit with a pending loader error and cause all sort of havok */
-}
-
/*
* mono_metadata_load_generic_params:
*
MonoThreadsSync monitors [MONO_ZERO_LEN_ARRAY];
};
-#define mono_monitor_allocator_lock() EnterCriticalSection (&monitor_mutex)
-#define mono_monitor_allocator_unlock() LeaveCriticalSection (&monitor_mutex)
-static CRITICAL_SECTION monitor_mutex;
+#define mono_monitor_allocator_lock() mono_mutex_lock (&monitor_mutex)
+#define mono_monitor_allocator_unlock() mono_mutex_unlock (&monitor_mutex)
+static mono_mutex_t monitor_mutex;
static MonoThreadsSync *monitor_freelist;
static MonitorArray *monitor_allocated;
static int array_size = 16;
void
mono_monitor_init (void)
{
- InitializeCriticalSection (&monitor_mutex);
+ mono_mutex_init_recursive (&monitor_mutex);
}
void
MonoThreadsSync *mon;
/* MonitorArray *marray, *next = NULL; */
- /*DeleteCriticalSection (&monitor_mutex);*/
+ /*mono_mutex_destroy (&monitor_mutex);*/
/* The monitors on the freelist don't have weak links - mark them */
for (mon = monitor_freelist; mon; mon = mon->data)
NULL, /* finish */
};
+static void
+aot_cache_start (gpointer user_data,
+ const gchar *element_name,
+ const gchar **attribute_names,
+ const gchar **attribute_values)
+{
+ int i;
+ MonoAotCacheConfig *config;
+
+ if (strcmp (element_name, "aotcache") != 0)
+ return;
+
+ config = mono_get_aot_cache_config ();
+
+ /* Per-app configuration */
+ for (i = 0; attribute_names [i]; ++i) {
+ if (!strcmp (attribute_names [i], "app")) {
+ config->apps = g_slist_prepend (config->apps, g_strdup (attribute_values [i]));
+ }
+ }
+
+ /* Global configuration */
+ for (i = 0; attribute_names [i]; ++i) {
+ if (!strcmp (attribute_names [i], "assemblies")) {
+ char **parts, **ptr;
+ char *part;
+
+ parts = g_strsplit (attribute_values [i], " ", -1);
+ for (ptr = parts; ptr && *ptr; ptr ++) {
+ part = *ptr;
+ config->assemblies = g_slist_prepend (config->assemblies, g_strdup (part));
+ }
+ g_strfreev (parts);
+ } else if (!strcmp (attribute_names [i], "options")) {
+ config->aot_options = g_strdup (attribute_values [i]);
+ }
+ }
+}
+
+static const MonoParseHandler
+aot_cache_handler = {
+ "aotcache",
+ NULL, /* init */
+ aot_cache_start,
+ NULL, /* text */
+ NULL, /* end */
+ NULL, /* finish */
+};
+
static int inited = 0;
static void
config_handlers = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (config_handlers, (gpointer) dllmap_handler.element_name, (gpointer) &dllmap_handler);
g_hash_table_insert (config_handlers, (gpointer) legacyUEP_handler.element_name, (gpointer) &legacyUEP_handler);
+ g_hash_table_insert (config_handlers, (gpointer) aot_cache_handler.element_name, (gpointer) &aot_cache_handler);
}
void
if (!g_file_get_contents (filename, &text, &len, NULL))
return 0;
-
offset = 0;
if (len > 3 && text [0] == '\xef' && text [1] == (gchar) '\xbb' && text [2] == '\xbf')
offset = 3; /* Skip UTF-8 BOM */
#include <mono/metadata/mono-endian.h>
static guint32 debugger_lock_level = 0;
-static CRITICAL_SECTION debugger_lock_mutex;
+static mono_mutex_t debugger_lock_mutex;
typedef struct
{
mono_debugger_lock (void)
{
g_assert (initialized);
- EnterCriticalSection (&debugger_lock_mutex);
+ mono_mutex_lock (&debugger_lock_mutex);
debugger_lock_level++;
}
{
g_assert (initialized);
debugger_lock_level--;
- LeaveCriticalSection (&debugger_lock_mutex);
+ mono_mutex_unlock (&debugger_lock_mutex);
}
void
mono_debugger_initialize ()
{
- InitializeCriticalSection (&debugger_lock_mutex);
+ mono_mutex_init_recursive (&debugger_lock_mutex);
initialized = 1;
}
NUM_COUNTERS
};
-static CRITICAL_SECTION perfctr_mutex;
-#define perfctr_lock() EnterCriticalSection (&perfctr_mutex)
-#define perfctr_unlock() LeaveCriticalSection (&perfctr_mutex)
+static mono_mutex_t perfctr_mutex;
+#define perfctr_lock() mono_mutex_lock (&perfctr_mutex)
+#define perfctr_unlock() mono_mutex_unlock (&perfctr_mutex)
typedef struct {
char reserved [16];
d_offset += 7;
d_offset &= ~7;
- InitializeCriticalSection (&perfctr_mutex);
+ mono_mutex_init_recursive (&perfctr_mutex);
shared_area = mono_shared_area ();
shared_area->counters_start = G_STRUCT_OFFSET (MonoSharedArea, counters);
gpointer suspend_event;
gpointer suspended_event;
gpointer resume_event;
- CRITICAL_SECTION *synch_cs;
+ mono_mutex_t *synch_cs;
MonoBoolean threadpool_thread;
MonoBoolean thread_dump_requested;
MonoBoolean thread_interrupt_requested;
mono_string_to_utf8_internal (MonoMemPool *mp, MonoImage *image, MonoString *s, gboolean ignore_error, MonoError *error);
-#define ldstr_lock() EnterCriticalSection (&ldstr_section)
-#define ldstr_unlock() LeaveCriticalSection (&ldstr_section)
-static CRITICAL_SECTION ldstr_section;
+#define ldstr_lock() mono_mutex_lock (&ldstr_section)
+#define ldstr_unlock() mono_mutex_unlock (&ldstr_section)
+static mono_mutex_t ldstr_section;
static gboolean profile_allocs = TRUE;
guint32 initializing_tid;
guint32 waiting_count;
gboolean done;
- CRITICAL_SECTION initialization_section;
+ mono_mutex_t initialization_section;
} TypeInitializationLock;
/* for locking access to type_initialization_hash and blocked_thread_hash */
-#define mono_type_initialization_lock() EnterCriticalSection (&type_initialization_section)
-#define mono_type_initialization_unlock() LeaveCriticalSection (&type_initialization_section)
-static CRITICAL_SECTION type_initialization_section;
+#define mono_type_initialization_lock() mono_mutex_lock (&type_initialization_section)
+#define mono_type_initialization_unlock() mono_mutex_unlock (&type_initialization_section)
+static mono_mutex_t type_initialization_section;
/* from vtable to lock */
static GHashTable *type_initialization_hash;
void
mono_type_initialization_init (void)
{
- InitializeCriticalSection (&type_initialization_section);
+ mono_mutex_init_recursive (&type_initialization_section);
type_initialization_hash = g_hash_table_new (NULL, NULL);
blocked_thread_hash = g_hash_table_new (NULL, NULL);
- InitializeCriticalSection (&ldstr_section);
+ mono_mutex_init_recursive (&ldstr_section);
}
void
/* This is causing race conditions with
* mono_release_type_locks
*/
- DeleteCriticalSection (&type_initialization_section);
+ mono_mutex_destroy (&type_initialization_section);
g_hash_table_destroy (type_initialization_hash);
type_initialization_hash = NULL;
#endif
- DeleteCriticalSection (&ldstr_section);
+ mono_mutex_destroy (&ldstr_section);
g_hash_table_destroy (blocked_thread_hash);
blocked_thread_hash = NULL;
if (!klass->image->checked_module_cctor) {
mono_image_check_for_module_cctor (klass->image);
if (klass->image->has_module_cctor) {
- MonoClass *module_klass = mono_class_get (klass->image, MONO_TOKEN_TYPE_DEF | 1);
- MonoVTable *module_vtable = mono_class_vtable_full (vtable->domain, module_klass, raise_exception);
+ MonoError error;
+ MonoClass *module_klass;
+ MonoVTable *module_vtable;
+
+ module_klass = mono_class_get_checked (klass->image, MONO_TOKEN_TYPE_DEF | 1, &error);
+ if (!module_klass) {
+ exc = mono_error_convert_to_exception (&error);
+ if (raise_exception)
+ mono_raise_exception (exc);
+ return exc;
+ }
+
+ module_vtable = mono_class_vtable_full (vtable->domain, module_klass, raise_exception);
if (!module_vtable)
return NULL;
exc = mono_runtime_class_init_full (module_vtable, raise_exception);
}
}
lock = g_malloc (sizeof(TypeInitializationLock));
- InitializeCriticalSection (&lock->initialization_section);
+ mono_mutex_init_recursive (&lock->initialization_section);
lock->initializing_tid = tid;
lock->waiting_count = 1;
lock->done = FALSE;
/* grab the vtable lock while this thread still owns type_initialization_section */
- EnterCriticalSection (&lock->initialization_section);
+ mono_mutex_lock (&lock->initialization_section);
g_hash_table_insert (type_initialization_hash, vtable, lock);
do_initialization = 1;
} else {
if (last_domain)
mono_domain_set (last_domain, TRUE);
lock->done = TRUE;
- LeaveCriticalSection (&lock->initialization_section);
+ mono_mutex_unlock (&lock->initialization_section);
} else {
/* this just blocks until the initializing thread is done */
- EnterCriticalSection (&lock->initialization_section);
- LeaveCriticalSection (&lock->initialization_section);
+ mono_mutex_lock (&lock->initialization_section);
+ mono_mutex_unlock (&lock->initialization_section);
}
mono_type_initialization_lock ();
g_hash_table_remove (blocked_thread_hash, GUINT_TO_POINTER (tid));
--lock->waiting_count;
if (lock->waiting_count == 0) {
- DeleteCriticalSection (&lock->initialization_section);
+ mono_mutex_destroy (&lock->initialization_section);
g_hash_table_remove (type_initialization_hash, vtable);
g_free (lock);
}
* and get_type_init_exception_for_class () needs to be aware of this.
*/
vtable->init_failed = 1;
- LeaveCriticalSection (&lock->initialization_section);
+ mono_mutex_unlock (&lock->initialization_section);
--lock->waiting_count;
if (lock->waiting_count == 0) {
- DeleteCriticalSection (&lock->initialization_section);
+ mono_mutex_destroy (&lock->initialization_section);
g_free (lock);
return TRUE;
}
MonoObject *
mono_object_new_from_token (MonoDomain *domain, MonoImage *image, guint32 token)
{
+ MonoError error;
MonoClass *class;
- class = mono_class_get (image, token);
+ class = mono_class_get_checked (image, token, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
return mono_object_new (domain, class);
}
return s;
}
+/**
+ * mono_string_new_utf32:
+ * @text: a pointer to an utf32 string
+ * @len: the length of the string
+ *
+ * Returns: A newly created string object which contains @text.
+ */
+MonoString *
+mono_string_new_utf32 (MonoDomain *domain, const mono_unichar4 *text, gint32 len)
+{
+ MonoString *s;
+ mono_unichar2 *utf16_output = NULL;
+ gint32 utf16_len = 0;
+ GError *error = NULL;
+ glong items_written;
+
+ utf16_output = g_ucs4_to_utf16 (text, len, NULL, &items_written, &error);
+
+ if (error)
+ g_error_free (error);
+
+ while (utf16_output [utf16_len]) utf16_len++;
+
+ s = mono_string_new_size (domain, utf16_len);
+ g_assert (s != NULL);
+
+ memcpy (mono_string_chars (s), utf16_output, utf16_len * 2);
+
+ g_free (utf16_output);
+
+ return s;
+}
+
/**
* mono_string_new_size:
* @text: a pointer to an utf16 string
return (gunichar2 *)(as);
}
+/**
+ * mono_string_to_utf32:
+ * @s: a MonoString
+ *
+ * Return an null-terminated array of the UTF-32 (UCS-4) chars
+ * contained in @s. The result must be freed with g_free().
+ */
+mono_unichar4*
+mono_string_to_utf32 (MonoString *s)
+{
+ mono_unichar4 *utf32_output = NULL;
+ GError *error = NULL;
+ glong items_written;
+
+ if (s == NULL)
+ return NULL;
+
+ utf32_output = g_utf16_to_ucs4 (s->chars, s->length, NULL, &items_written, &error);
+
+ if (error)
+ g_error_free (error);
+
+ return utf32_output;
+}
+
/**
* mono_string_from_utf16:
* @data: the UTF16 string (LPWSTR) to convert
return mono_string_new_utf16 (domain, data, len);
}
+/**
+ * mono_string_from_utf32:
+ * @data: the UTF32 string (LPWSTR) to convert
+ *
+ * Converts a UTF32 (UCS-4)to a MonoString.
+ *
+ * Returns: a MonoString.
+ */
+MonoString *
+mono_string_from_utf32 (mono_unichar4 *data)
+{
+ MonoString* result = NULL;
+ mono_unichar2 *utf16_output = NULL;
+ GError *error = NULL;
+ glong items_written;
+ int len = 0;
+
+ if (!data)
+ return NULL;
+
+ while (data [len]) len++;
+
+ utf16_output = g_ucs4_to_utf16 (data, len, NULL, &items_written, &error);
+
+ if (error)
+ g_error_free (error);
+
+ result = mono_string_from_utf16 (utf16_output);
+ g_free (utf16_output);
+ return result;
+}
static char *
mono_string_to_utf8_internal (MonoMemPool *mp, MonoImage *image, MonoString *s, gboolean ignore_error, MonoError *error)
MONO_API MonoString*
mono_string_new_len (MonoDomain *domain, const char *text, unsigned int length);
+MONO_API MonoString*
+mono_string_new_utf32 (MonoDomain *domain, const mono_unichar4 *text, int32_t len);
+
MONO_API char *
mono_string_to_utf8 (MonoString *string_obj);
MONO_API mono_unichar2 *
mono_string_to_utf16 (MonoString *string_obj);
+MONO_API mono_unichar4 *
+mono_string_to_utf32 (MonoString *string_obj);
+
MONO_API MonoString *
mono_string_from_utf16 (mono_unichar2 *data);
+MONO_API MonoString *
+mono_string_from_utf32 (mono_unichar4 *data);
+
MONO_API mono_bool
mono_string_equal (MonoString *s1, MonoString *s2);
static ProfilerDesc *prof_list = NULL;
-#define mono_profiler_coverage_lock() EnterCriticalSection (&profiler_coverage_mutex)
-#define mono_profiler_coverage_unlock() LeaveCriticalSection (&profiler_coverage_mutex)
-static CRITICAL_SECTION profiler_coverage_mutex;
+#define mono_profiler_coverage_lock() mono_mutex_lock (&profiler_coverage_mutex)
+#define mono_profiler_coverage_unlock() mono_mutex_unlock (&profiler_coverage_mutex)
+static mono_mutex_t profiler_coverage_mutex;
/* this is directly accessible to other mono libs.
* It is the ORed value of all the profiler's events.
{
ProfilerDesc *desc = g_new0 (ProfilerDesc, 1);
if (!prof_list)
- InitializeCriticalSection (&profiler_coverage_mutex);
+ mono_mutex_init_recursive (&profiler_coverage_mutex);
desc->profiler = prof;
desc->shutdown_callback = callback;
desc->next = prof_list;
MonoObject*
mono_custom_attrs_get_attr_checked (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass, MonoError *error) MONO_INTERNAL;
-#endif
\ No newline at end of file
+#endif
if (type->num_mods) {
for (i = 0; i < type->num_mods; ++i) {
if (field_image) {
- MonoClass *class = mono_class_get (field_image, type->modifiers [i].token);
- g_assert (class);
+ MonoError error;
+ MonoClass *class = mono_class_get_checked (field_image, type->modifiers [i].token, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
+
token = mono_image_typedef_or_ref (assembly, &class->byval_arg);
} else {
token = type->modifiers [i].token;
values = table->values + token * MONO_MODULEREF_SIZE;
values [MONO_MODULEREF_NAME] = string_heap_insert (&assembly->sheap, image->module_name);
- token <<= MONO_RESOLTION_SCOPE_BITS;
- token |= MONO_RESOLTION_SCOPE_MODULEREF;
+ token <<= MONO_RESOLUTION_SCOPE_BITS;
+ token |= MONO_RESOLUTION_SCOPE_MODULEREF;
g_hash_table_insert (assembly->handleref, image, GUINT_TO_POINTER (token));
return token;
} else {
values [MONO_ASSEMBLYREF_PUBLIC_KEY] = 0;
}
- token <<= MONO_RESOLTION_SCOPE_BITS;
- token |= MONO_RESOLTION_SCOPE_ASSEMBLYREF;
+ token <<= MONO_RESOLUTION_SCOPE_BITS;
+ token |= MONO_RESOLUTION_SCOPE_ASSEMBLYREF;
g_hash_table_insert (assembly->handleref, image, GUINT_TO_POINTER (token));
return token;
}
enclosing = mono_image_typedef_or_ref_full (assembly, &klass->nested_in->byval_arg, FALSE);
/* get the typeref idx of the enclosing type */
enclosing >>= MONO_TYPEDEFORREF_BITS;
- scope = (enclosing << MONO_RESOLTION_SCOPE_BITS) | MONO_RESOLTION_SCOPE_TYPEREF;
+ scope = (enclosing << MONO_RESOLUTION_SCOPE_BITS) | MONO_RESOLUTION_SCOPE_TYPEREF;
} else {
scope = resolution_scope_from_image (assembly, klass->image);
}
t = &image->tables [MONO_TABLE_TYPEDEF];
for (i = 0; i < t->rows; ++i) {
- MonoClass *klass = mono_class_get (image, mono_metadata_make_token (MONO_TABLE_TYPEDEF, i + 1));
+ MonoError error;
+ MonoClass *klass = mono_class_get_checked (image, mono_metadata_make_token (MONO_TABLE_TYPEDEF, i + 1), &error);
+ g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
if (klass->flags & TYPE_ATTRIBUTE_PUBLIC)
mono_image_fill_export_table_from_class (domain, klass, module_index, 0, assembly);
forwarder = FALSE;
} else {
scope = resolution_scope_from_image (assembly, klass->image);
- g_assert ((scope & MONO_RESOLTION_SCOPE_MASK) == MONO_RESOLTION_SCOPE_ASSEMBLYREF);
- scope_idx = scope >> MONO_RESOLTION_SCOPE_BITS;
+ g_assert ((scope & MONO_RESOLUTION_SCOPE_MASK) == MONO_RESOLUTION_SCOPE_ASSEMBLYREF);
+ scope_idx = scope >> MONO_RESOLUTION_SCOPE_BITS;
impl = (scope_idx << MONO_IMPLEMENTATION_BITS) + MONO_IMPLEMENTATION_ASSEMBLYREF;
}
if (!image)
image = mono_defaults.corlib;
- if (ignorecase)
- klass = mono_class_from_name_case (image, info->name_space, info->name);
- else
+ if (ignorecase) {
+ MonoError error;
+ klass = mono_class_from_name_case_checked (image, info->name_space, info->name, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME Don't swallow the error */
+ } else {
klass = mono_class_from_name (image, info->name_space, info->name);
+ }
if (!klass)
return NULL;
for (mod = info->nested; mod; mod = mod->next) {
mono_class_init (parent);
while ((klass = mono_class_get_nested_types (parent, &iter))) {
- if (ignorecase) {
- if (mono_utf8_strcasecmp (klass->name, mod->data) == 0)
- break;
+ char *lastp;
+ char *nested_name, *nested_nspace;
+ gboolean match = TRUE;
+
+ lastp = strrchr (mod->data, '.');
+ if (lastp) {
+ /* Nested classes can have namespaces */
+ int nspace_len;
+
+ nested_name = g_strdup (lastp + 1);
+ nspace_len = lastp - (char*)mod->data;
+ nested_nspace = g_malloc (nspace_len + 1);
+ memcpy (nested_nspace, mod->data, nspace_len);
+ nested_nspace [nspace_len] = '\0';
+
} else {
- if (strcmp (klass->name, mod->data) == 0)
- break;
+ nested_name = mod->data;
+ nested_nspace = NULL;
+ }
+
+ if (nested_nspace) {
+ if (ignorecase) {
+ if (!(klass->name_space && mono_utf8_strcasecmp (klass->name_space, nested_nspace) == 0))
+ match = FALSE;
+ } else {
+ if (!(klass->name_space && strcmp (klass->name_space, nested_nspace) == 0))
+ match = FALSE;
+ }
+ }
+ if (match) {
+ if (ignorecase) {
+ if (mono_utf8_strcasecmp (klass->name, nested_name) != 0)
+ match = FALSE;
+ } else {
+ if (strcmp (klass->name, nested_name) != 0)
+ match = FALSE;
+ }
}
+ if (lastp) {
+ g_free (nested_name);
+ g_free (nested_nspace);
+ }
+ if (match)
+ break;
}
+
if (!klass)
break;
}
mono_class_set_ref_info (klass, tb);
- /* Put into cache so mono_class_get () will find it.
+ /* Put into cache so mono_class_get_checked () will find it.
Skip nested types as those should not be available on the global scope. */
if (!tb->nesting_type)
mono_image_add_to_name_cache (klass->image, klass->name_space, klass->name, tb->table_idx);
klass->has_finalize = 1;
klass->has_finalize_inited = 1;
- /* fool mono_class_setup_parent */
- klass->supertypes = NULL;
mono_class_setup_parent (klass, klass->parent);
+ /* fool mono_class_setup_supertypes */
+ klass->supertypes = NULL;
+ mono_class_setup_supertypes (klass);
mono_class_setup_mono_type (klass);
#if 0
MONO_CUSTOM_ATTR_TYPE_MASK = 7
};
+enum {
+ MONO_RESOLUTION_SCOPE_MODULE,
+ MONO_RESOLUTION_SCOPE_MODULEREF,
+ MONO_RESOLUTION_SCOPE_ASSEMBLYREF,
+ MONO_RESOLUTION_SCOPE_TYPEREF,
+ MONO_RESOLUTION_SCOPE_BITS = 2,
+ MONO_RESOLUTION_SCOPE_MASK = 3
+};
+
+/* Kept for compatibility since this is a public header file */
enum {
MONO_RESOLTION_SCOPE_MODULE,
MONO_RESOLTION_SCOPE_MODULEREF,
gboolean success = FALSE;
PACL pDACL = NULL;
PSID pEveryoneSid = NULL;
+ PSECURITY_DESCRIPTOR pSecurityDescriptor = NULL;
DWORD dwRes = GetNamedSecurityInfoW (path, SE_FILE_OBJECT,
- DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, NULL);
+ DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, &pSecurityDescriptor);
if (dwRes != ERROR_SUCCESS)
return FALSE;
/* Note: we don't need to check our own access -
we'll know soon enough when reading the file */
- if (pDACL)
- LocalFree (pDACL);
+ if (pSecurityDescriptor)
+ LocalFree (pSecurityDescriptor);
return success;
}
static void
zero_tlab_if_necessary (void *p, size_t size)
{
- if (nursery_clear_policy == CLEAR_AT_TLAB_CREATION) {
+ if (nursery_clear_policy == CLEAR_AT_TLAB_CREATION || nursery_clear_policy == CLEAR_AT_TLAB_CREATION_DEBUG) {
memset (p, 0, size);
} else {
/*
guint8*
mono_gc_get_card_table (int *shift_bits, gpointer *mask)
{
+#ifndef MANAGED_WBARRIER
+ return NULL;
+#else
if (!sgen_cardtable)
return NULL;
#endif
return sgen_cardtable;
+#endif
}
gboolean
/*
* Configurable cementing parameters.
*
- * The hash table size should be a prime. If there are too many
- * pinned nursery objects with many references from the major heap,
- * this number must be increased.
+ * If there are too many pinned nursery objects with many references
+ * from the major heap, the hash table size must be increased.
*
* The threshold is the number of references from the major heap to a
* pinned nursery object which triggers cementing: if there are more
* than that number of references, the pinned object is cemented until
* the next major collection.
*/
-#define SGEN_CEMENT_HASH_SIZE 61
+#define SGEN_CEMENT_HASH_SHIFT 6
+#define SGEN_CEMENT_HASH_SIZE (1 << SGEN_CEMENT_HASH_SHIFT)
+#define SGEN_CEMENT_HASH(hv) (((hv) ^ ((hv) >> SGEN_CEMENT_HASH_SHIFT)) & (SGEN_CEMENT_HASH_SIZE - 1))
#define SGEN_CEMENT_THRESHOLD 1000
#endif
* License 2.0 along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
+#include "mono/utils/mono-compiler.h"
+
extern long long stat_copy_object_called_nursery;
extern long long stat_objects_copied_nursery;
* This function can be used even if the vtable of obj is not valid
* anymore, which is the case in the parallel collector.
*/
-static inline void
+static MONO_ALWAYS_INLINE void
par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword objsize, SgenGrayQueue *queue)
{
-#ifdef __GNUC__
- static const void *copy_labels [] = { &&LAB_0, &&LAB_1, &&LAB_2, &&LAB_3, &&LAB_4, &&LAB_5, &&LAB_6, &&LAB_7, &&LAB_8 };
-#endif
-
SGEN_ASSERT (9, vt->klass->inited, "vtable %p for class %s:%s was not initialized", vt, vt->klass->name_space, vt->klass->name);
SGEN_LOG (9, " (to %p, %s size: %lu)", destination, ((MonoObject*)obj)->vtable->klass->name, (unsigned long)objsize);
binary_protocol_copy (obj, destination, vt, objsize);
}
#endif
-#ifdef __GNUC__
- if (objsize <= sizeof (gpointer) * 8) {
- mword *dest = (mword*)destination;
- goto *copy_labels [objsize / sizeof (gpointer)];
- LAB_8:
- (dest) [7] = ((mword*)obj) [7];
- LAB_7:
- (dest) [6] = ((mword*)obj) [6];
- LAB_6:
- (dest) [5] = ((mword*)obj) [5];
- LAB_5:
- (dest) [4] = ((mword*)obj) [4];
- LAB_4:
- (dest) [3] = ((mword*)obj) [3];
- LAB_3:
- (dest) [2] = ((mword*)obj) [2];
- LAB_2:
- (dest) [1] = ((mword*)obj) [1];
- LAB_1:
- ;
- LAB_0:
- ;
- } else {
- /*can't trust memcpy doing word copies */
- mono_gc_memmove_aligned (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
- }
-#else
- mono_gc_memmove_aligned (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
-#endif
+ memcpy (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
+
/* adjust array->bounds */
SGEN_ASSERT (9, vt->gc_descr, "vtable %p for class %s:%s has no gc descriptor", vt, vt->klass->name_space, vt->klass->name);
/*
* This can return OBJ itself on OOM.
*/
-#ifdef _MSC_VER
-static __declspec(noinline) void*
-#else
-static G_GNUC_UNUSED void* __attribute__((noinline))
-#endif
+static MONO_NEVER_INLINE void*
copy_object_no_checks (void *obj, SgenGrayQueue *queue)
{
MonoVTable *vt = ((MonoObject*)obj)->vtable;
static void report_registered_roots (void);
static void pin_from_roots (void *start_nursery, void *end_nursery, GrayQueue *queue);
-static int pin_objects_from_addresses (GCMemSection *section, void **start, void **end, void *start_nursery, void *end_nursery, ScanCopyContext ctx);
static void finish_gray_stack (int generation, GrayQueue *queue);
void mono_gc_scan_for_specific_ref (MonoObject *key, gboolean precise);
}
/*
- * Addresses from start to end are already sorted. This function finds
+ * Addresses in the pin queue are already sorted. This function finds
* the object header for each address and pins the object. The
- * addresses must be inside the passed section. The (start of the)
+ * addresses must be inside the nursery section. The (start of the)
* address array is overwritten with the addresses of the actually
* pinned objects. Return the number of pinned objects.
*/
static int
-pin_objects_from_addresses (GCMemSection *section, void **start, void **end, void *start_nursery, void *end_nursery, ScanCopyContext ctx)
+pin_objects_from_nursery_pin_queue (ScanCopyContext ctx)
{
+ GCMemSection *section = nursery_section;
+ void **start = section->pin_queue_start;
+ void **end = start + section->pin_queue_num_entries;
+ void *start_nursery = section->data;
+ void *end_nursery = section->next_data;
void *last = NULL;
int count = 0;
void *search_start;
- void *last_obj = NULL;
- size_t last_obj_size = 0;
void *addr;
+ void *pinning_front = start_nursery;
size_t idx;
void **definitely_pinned = start;
ScanObjectFunc scan_func = ctx.scan_func;
sgen_nursery_allocator_prepare_for_pinning ();
while (start < end) {
+ void *obj_to_pin = NULL;
+ size_t obj_to_pin_size = 0;
+
addr = *start;
- /* the range check should be reduntant */
- if (addr != last && addr >= start_nursery && addr < end_nursery) {
- SGEN_LOG (5, "Considering pinning addr %p", addr);
- /* multiple pointers to the same object */
- if (addr >= last_obj && (char*)addr < (char*)last_obj + last_obj_size) {
- start++;
+
+ SGEN_ASSERT (0, addr >= start_nursery && addr < end_nursery, "Potential pinning address out of range");
+ SGEN_ASSERT (0, addr >= last, "Pin queue not sorted");
+
+ if (addr == last) {
+ ++start;
+ continue;
+ }
+
+ SGEN_LOG (5, "Considering pinning addr %p", addr);
+ /* We've already processed everything up to pinning_front. */
+ if (addr < pinning_front) {
+ start++;
+ continue;
+ }
+
+ /*
+ * Find the closest scan start <= addr. We might search backward in the
+ * scan_starts array because entries might be NULL. In the worst case we
+ * start at start_nursery.
+ */
+ idx = ((char*)addr - (char*)section->data) / SCAN_START_SIZE;
+ SGEN_ASSERT (0, idx < section->num_scan_start, "Scan start index out of range");
+ search_start = (void*)section->scan_starts [idx];
+ if (!search_start || search_start > addr) {
+ while (idx) {
+ --idx;
+ search_start = section->scan_starts [idx];
+ if (search_start && search_start <= addr)
+ break;
+ }
+ if (!search_start || search_start > addr)
+ search_start = start_nursery;
+ }
+
+ /*
+ * If the pinning front is closer than the scan start we found, start
+ * searching at the front.
+ */
+ if (search_start < pinning_front)
+ search_start = pinning_front;
+
+ /*
+ * Now addr should be in an object a short distance from search_start.
+ *
+ * search_start must point to zeroed mem or point to an object.
+ */
+ do {
+ size_t obj_size;
+
+ /* Skip zeros. */
+ if (!*(void**)search_start) {
+ search_start = (void*)ALIGN_UP ((mword)search_start + sizeof (gpointer));
+ /* The loop condition makes sure we don't overrun addr. */
continue;
}
- idx = ((char*)addr - (char*)section->data) / SCAN_START_SIZE;
- g_assert (idx < section->num_scan_start);
- search_start = (void*)section->scan_starts [idx];
- if (!search_start || search_start > addr) {
- while (idx) {
- --idx;
- search_start = section->scan_starts [idx];
- if (search_start && search_start <= addr)
- break;
- }
- if (!search_start || search_start > addr)
- search_start = start_nursery;
+
+ obj_size = ALIGN_UP (safe_object_get_size ((MonoObject*)search_start));
+
+ if (addr >= search_start && (char*)addr < (char*)search_start + obj_size) {
+ /* This is the object we're looking for. */
+ obj_to_pin = search_start;
+ obj_to_pin_size = obj_size;
+ break;
}
- if (search_start < last_obj)
- search_start = (char*)last_obj + last_obj_size;
- /* now addr should be in an object a short distance from search_start
- * Note that search_start must point to zeroed mem or point to an object.
- */
- do {
- if (!*(void**)search_start) {
- /* Consistency check */
- /*
- for (frag = nursery_fragments; frag; frag = frag->next) {
- if (search_start >= frag->fragment_start && search_start < frag->fragment_end)
- g_assert_not_reached ();
- }
- */
+ /* Skip to the next object */
+ search_start = (void*)((char*)search_start + obj_size);
+ } while (search_start <= addr);
- search_start = (void*)ALIGN_UP ((mword)search_start + sizeof (gpointer));
- continue;
- }
- last_obj = search_start;
- last_obj_size = ALIGN_UP (safe_object_get_size ((MonoObject*)search_start));
+ /* We've searched past the address we were looking for. */
+ if (!obj_to_pin) {
+ pinning_front = search_start;
+ goto next_pin_queue_entry;
+ }
- if (((MonoObject*)last_obj)->synchronisation == GINT_TO_POINTER (-1)) {
- /* Marks the beginning of a nursery fragment, skip */
- } else {
- SGEN_LOG (8, "Pinned try match %p (%s), size %zd", last_obj, safe_name (last_obj), last_obj_size);
- if (addr >= search_start && (char*)addr < (char*)last_obj + last_obj_size) {
- if (scan_func) {
- scan_func (search_start, queue);
- } else {
- SGEN_LOG (4, "Pinned object %p, vtable %p (%s), count %d\n",
- search_start, *(void**)search_start, safe_name (search_start), count);
- binary_protocol_pin (search_start,
- (gpointer)LOAD_VTABLE (search_start),
- safe_object_get_size (search_start));
+ /*
+ * We've found an object to pin. It might still be a dummy array, but we
+ * can advance the pinning front in any case.
+ */
+ pinning_front = (char*)obj_to_pin + obj_to_pin_size;
+
+ /*
+ * If this is a dummy array marking the beginning of a nursery
+ * fragment, we don't pin it.
+ */
+ if (((MonoObject*)obj_to_pin)->synchronisation == GINT_TO_POINTER (-1))
+ goto next_pin_queue_entry;
+
+ /*
+ * Finally - pin the object!
+ */
+ if (scan_func) {
+ scan_func (obj_to_pin, queue);
+ } else {
+ SGEN_LOG (4, "Pinned object %p, vtable %p (%s), count %d\n",
+ obj_to_pin, *(void**)obj_to_pin, safe_name (obj_to_pin), count);
+ binary_protocol_pin (obj_to_pin,
+ (gpointer)LOAD_VTABLE (obj_to_pin),
+ safe_object_get_size (obj_to_pin));
#ifdef ENABLE_DTRACE
- if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
- int gen = sgen_ptr_in_nursery (search_start) ? GENERATION_NURSERY : GENERATION_OLD;
- MonoVTable *vt = (MonoVTable*)LOAD_VTABLE (search_start);
- MONO_GC_OBJ_PINNED ((mword)search_start,
- sgen_safe_object_get_size (search_start),
- vt->klass->name_space, vt->klass->name, gen);
- }
+ if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
+ int gen = sgen_ptr_in_nursery (obj_to_pin) ? GENERATION_NURSERY : GENERATION_OLD;
+ MonoVTable *vt = (MonoVTable*)LOAD_VTABLE (obj_to_pin);
+ MONO_GC_OBJ_PINNED ((mword)obj_to_pin,
+ sgen_safe_object_get_size (obj_to_pin),
+ vt->klass->name_space, vt->klass->name, gen);
+ }
#endif
- pin_object (search_start);
- GRAY_OBJECT_ENQUEUE (queue, search_start);
- if (G_UNLIKELY (do_pin_stats))
- sgen_pin_stats_register_object (search_start, last_obj_size);
- definitely_pinned [count] = search_start;
- count++;
- }
- break;
- }
- }
- /* skip to the next object */
- search_start = (void*)((char*)search_start + last_obj_size);
- } while (search_start <= addr);
- /* we either pinned the correct object or we ignored the addr because
- * it points to unused zeroed memory.
- */
- last = addr;
+ pin_object (obj_to_pin);
+ GRAY_OBJECT_ENQUEUE (queue, obj_to_pin);
+ if (G_UNLIKELY (do_pin_stats))
+ sgen_pin_stats_register_object (obj_to_pin, obj_to_pin_size);
+ definitely_pinned [count] = obj_to_pin;
+ count++;
}
- start++;
+
+ next_pin_queue_entry:
+ last = addr;
+ ++start;
}
//printf ("effective pinned: %d (at the end: %d)\n", count, (char*)end_nursery - (char*)last);
if (mono_profiler_get_events () & MONO_PROFILE_GC_ROOTS) {
return count;
}
-void
-sgen_pin_objects_in_section (GCMemSection *section, ScanCopyContext ctx)
-{
- size_t num_entries = section->pin_queue_num_entries;
- if (num_entries) {
- void **start = section->pin_queue_start;
- size_t reduced_to;
- reduced_to = pin_objects_from_addresses (section, start, start + num_entries,
- section->data, section->next_data, ctx);
- section->pin_queue_num_entries = reduced_to;
- if (!reduced_to)
- section->pin_queue_start = NULL;
- }
+static void
+pin_objects_in_nursery (ScanCopyContext ctx)
+{
+ size_t reduced_to;
+
+ if (!nursery_section->pin_queue_num_entries)
+ return;
+
+ reduced_to = pin_objects_from_nursery_pin_queue (ctx);
+ nursery_section->pin_queue_num_entries = reduced_to;
+ if (!reduced_to)
+ nursery_section->pin_queue_start = NULL;
}
/* pin cemented objects */
sgen_cement_iterate (pin_stage_object_callback, NULL);
/* identify pinned objects */
- sgen_optimize_pin_queue (0);
+ sgen_optimize_pin_queue ();
sgen_pinning_setup_section (nursery_section);
ctx.scan_func = NULL;
ctx.copy_func = NULL;
ctx.queue = WORKERS_DISTRIBUTE_GRAY_QUEUE;
- sgen_pin_objects_in_section (nursery_section, ctx);
+ pin_objects_in_nursery (ctx);
sgen_pinning_trim_queue_to_section (nursery_section);
TV_GETTIME (atv);
sgen_workers_reset_data ();
if (objects_pinned) {
- sgen_optimize_pin_queue (0);
+ sgen_optimize_pin_queue ();
sgen_pinning_setup_section (nursery_section);
}
major_collector.finish_nursery_collection ();
TV_GETTIME (all_btv);
- gc_stats.minor_gc_time_usecs += TV_ELAPSED (all_atv, all_btv);
+ gc_stats.minor_gc_time += TV_ELAPSED (all_atv, all_btv);
if (heap_dump_file)
dump_heap ("minor", gc_stats.minor_gc_count - 1, NULL);
sgen_cement_reset ();
}
- sgen_optimize_pin_queue (0);
+ sgen_optimize_pin_queue ();
/*
* The concurrent collector doesn't move objects, neither on
if (concurrent_collection_in_progress && sgen_minor_collector.is_split) {
scan_nursery_objects (ctx);
} else {
- sgen_pin_objects_in_section (nursery_section, ctx);
+ pin_objects_in_nursery (ctx);
if (check_nursery_objects_pinned && !sgen_minor_collector.is_split)
sgen_check_nursery_objects_pinned (!concurrent_collection_in_progress || finish_up_concurrent_mark);
}
/*This is slow, but we just OOM'd*/
sgen_pin_queue_clear_discarded_entries (nursery_section, old_next_pin_slot);
- sgen_optimize_pin_queue (0);
+ sgen_optimize_pin_queue ();
sgen_find_section_pin_queue_start_end (nursery_section);
objects_pinned = 0;
}
major_finish_collection (reason, old_next_pin_slot, FALSE);
TV_GETTIME (all_btv);
- gc_stats.major_gc_time_usecs += TV_ELAPSED (all_atv, all_btv);
+ gc_stats.major_gc_time += TV_ELAPSED (all_atv, all_btv);
/* FIXME: also report this to the user, preferably in gc-end. */
if (major_collector.get_and_reset_num_major_objects_marked)
binary_protocol_thread_register ((gpointer)mono_thread_info_get_tid (info));
/* On win32, stack_start_limit should be 0, since the stack can grow dynamically */
-#ifndef HOST_WIN32
mono_thread_info_get_stack_bounds (&staddr, &stsize);
-#endif
if (staddr) {
+#ifndef HOST_WIN32
info->stack_start_limit = staddr;
+#endif
info->stack_end = staddr + stsize;
} else {
gsize stack_bottom = (gsize)addr;
binary_protocol_thread_unregister ((gpointer)tid);
SGEN_LOG (3, "unregister thread %p (%p)", p, (gpointer)tid);
+#ifndef HAVE_KW_THREAD
+ mono_native_tls_set_value (thread_info_key, NULL);
+#else
+ sgen_thread_info = NULL;
+#endif
+
if (p->info.runtime_thread)
mono_threads_add_joinable_thread ((gpointer)tid);
nursery_clear_policy = CLEAR_AT_GC;
} else if (!strcmp (opt, "clear-nursery-at-gc")) {
nursery_clear_policy = CLEAR_AT_GC;
+ } else if (!strcmp (opt, "clear-at-tlab-creation")) {
+ nursery_clear_policy = CLEAR_AT_TLAB_CREATION;
+ } else if (!strcmp (opt, "debug-clear-at-tlab-creation")) {
+ nursery_clear_policy = CLEAR_AT_TLAB_CREATION_DEBUG;
} else if (!strcmp (opt, "check-scan-starts")) {
do_scan_starts_check = TRUE;
} else if (!strcmp (opt, "verify-nursery-at-minor-gc")) {
}
} else if (g_str_has_prefix (opt, "binary-protocol=")) {
char *filename = strchr (opt, '=') + 1;
- binary_protocol_init (filename);
+ char *colon = strrchr (filename, ':');
+ size_t limit = -1;
+ if (colon) {
+ if (!mono_gc_parse_environment_string_extract_number (colon + 1, &limit)) {
+ sgen_env_var_error (MONO_GC_DEBUG_NAME, "Ignoring limit.", "Binary protocol file size limit must be an integer.");
+ limit = -1;
+ }
+ *colon = '\0';
+ }
+ binary_protocol_init (filename, (long long)limit);
} else if (!sgen_bridge_handle_gc_debug (opt)) {
sgen_env_var_error (MONO_GC_DEBUG_NAME, "Ignoring.", "Unknown option `%s`.", opt);
fprintf (stderr, " disable-major\n");
fprintf (stderr, " xdomain-checks\n");
fprintf (stderr, " check-concurrent\n");
- fprintf (stderr, " clear-at-gc\n");
- fprintf (stderr, " clear-nursery-at-gc\n");
+ fprintf (stderr, " clear-[nursery-]at-gc\n");
+ fprintf (stderr, " clear-at-tlab-creation\n");
+ fprintf (stderr, " debug-clear-at-tlab-creation\n");
fprintf (stderr, " check-scan-starts\n");
fprintf (stderr, " no-managed-allocator\n");
fprintf (stderr, " print-allowance\n");
fprintf (stderr, " print-pinning\n");
fprintf (stderr, " heap-dump=<filename>\n");
- fprintf (stderr, " binary-protocol=<filename>\n");
+ fprintf (stderr, " binary-protocol=<filename>[:<file-size-limit>]\n");
sgen_bridge_print_gc_debug_usage ();
fprintf (stderr, "\n");
*/
typedef enum {
CLEAR_AT_GC,
- CLEAR_AT_TLAB_CREATION
+ CLEAR_AT_TLAB_CREATION,
+ CLEAR_AT_TLAB_CREATION_DEBUG
} NurseryClearPolicy;
NurseryClearPolicy sgen_get_nursery_clear_policy (void) MONO_INTERNAL;
#include "metadata/sgen-memory-governor.h"
/* keep each size a multiple of ALLOC_ALIGN */
+#if SIZEOF_VOID_P == 4
static const int allocator_sizes [] = {
8, 16, 24, 32, 40, 48, 64, 80,
- 96, 128, 160, 192, 224, 248, 320, 384,
- 448, 528, 584, 680, 816, 1088, 1360, 2040,
- 2336, 2728, 3272, 4088, 5456, 8184 };
+ 96, 128, 160, 192, 224, 248, 296, 320,
+ 384, 448, 504, 528, 584, 680, 816, 1088,
+ 1360, 2040, 2336, 2728, 3272, 4088, 5456, 8184 };
+#else
+static const int allocator_sizes [] = {
+ 8, 16, 24, 32, 40, 48, 64, 80,
+ 96, 128, 160, 192, 224, 248, 320, 328,
+ 384, 448, 528, 584, 680, 816, 1016, 1088,
+ 1360, 2040, 2336, 2728, 3272, 4088, 5456, 8184 };
+#endif
#define NUM_ALLOCATORS (sizeof (allocator_sizes) / sizeof (int))
g_assert ((size & 1) == 0);
/*
- * size + sizeof (LOSObject) <= SIZE_MAX - (mono_pagesize () - 1)
+ * size + sizeof (LOSObject) <= SSIZE_MAX - (mono_pagesize () - 1)
*
* therefore:
*
- * size <= SIZE_MAX - (mono_pagesize () - 1) - sizeof (LOSObject)
+ * size <= SSIZE_MAX - (mono_pagesize () - 1) - sizeof (LOSObject)
*/
- if (size > SIZE_MAX - (mono_pagesize () - 1) - sizeof (LOSObject))
+ if (size > SSIZE_MAX - (mono_pagesize () - 1) - sizeof (LOSObject))
return NULL;
#ifdef LOS_DUMMY
extern long long stat_nursery_copy_object_failed_to_space; /* from sgen-gc.c */
+#include "mono/utils/mono-compiler.h"
+
#include "sgen-copy-object.h"
/*
* copy_object could be made into a macro once debugged (use inline for now).
*/
-#ifdef _MSC_VER
-static __forceinline void
-#else
-static inline void __attribute__((always_inline))
-#endif
+static MONO_ALWAYS_INLINE void
SERIAL_COPY_OBJECT (void **obj_slot, SgenGrayQueue *queue)
{
char *forwarded;
*
* Similar to SERIAL_COPY_OBJECT, but assumes that OBJ_SLOT is part of an object, so it handles global remsets as well.
*/
-#ifdef _MSC_VER
-static __forceinline void
-#else
-static inline void __attribute__((always_inline))
-#endif
+static MONO_ALWAYS_INLINE void
SERIAL_COPY_OBJECT_FROM_OBJ (void **obj_slot, SgenGrayQueue *queue)
{
char *forwarded;
#define XREFS old_xrefs
#endif
+#define OPTIMIZATION_COPY
+#define OPTIMIZATION_FORWARD
+#define OPTIMIZATION_SINGLETON_DYN_ARRAY
+
typedef struct {
int size;
int capacity; /* if negative, data points to another DynArray's data */
static void
dyn_array_ptr_uninit (DynPtrArray *da)
{
+#ifdef OPTIMIZATION_SINGLETON_DYN_ARRAY
if (da->array.capacity == 1)
dyn_array_ptr_init (da);
else
+#endif
dyn_array_uninit (&da->array, sizeof (void*));
}
static void
dyn_array_ptr_empty (DynPtrArray *da)
{
- dyn_array_empty (&da->array);
+#ifdef OPTIMIZATION_SINGLETON_DYN_ARRAY
+ if (da->array.capacity == 1)
+ dyn_array_ptr_init (da);
+ else
+#endif
+ dyn_array_empty (&da->array);
}
static void*
dyn_array_ptr_get (DynPtrArray *da, int x)
{
+#ifdef OPTIMIZATION_SINGLETON_DYN_ARRAY
if (da->array.capacity == 1) {
g_assert (x == 0);
return da->array.data;
}
+#endif
return ((void**)da->array.data)[x];
}
{
void **p;
+#ifdef OPTIMIZATION_SINGLETON_DYN_ARRAY
if (da->array.capacity == 0) {
da->array.capacity = 1;
da->array.size = 1;
p0 = dyn_array_add (&da->array, sizeof (void*));
*p0 = ptr0;
p = dyn_array_add (&da->array, sizeof (void*));
- } else {
+ } else
+#endif
+ {
p = dyn_array_add (&da->array, sizeof (void*));
}
*p = ptr;
int size = da->array.size;
void *p;
g_assert (size > 0);
+#ifdef OPTIMIZATION_SINGLETON_DYN_ARRAY
if (da->array.capacity == 1) {
p = dyn_array_ptr_get (da, 0);
dyn_array_init (&da->array);
- } else {
+ } else
+#endif
+ {
g_assert (da->array.capacity > 1);
dyn_array_ensure_independent (&da->array, sizeof (void*));
p = dyn_array_ptr_get (da, size - 1);
static HashEntry*
follow_forward (HashEntry *entry)
{
+#ifdef OPTIMIZATION_FORWARD
while (entry->v.dfs1.forwarded_to) {
HashEntry *next = entry->v.dfs1.forwarded_to;
if (next->v.dfs1.forwarded_to)
entry->v.dfs1.forwarded_to = next->v.dfs1.forwarded_to;
entry = next;
}
+#else
+ g_assert (!entry->v.dfs1.forwarded_to);
+#endif
return entry;
}
* continuing processing this object, we start over with the
* object it points to.
*/
+#ifdef OPTIMIZATION_FORWARD
if (!obj_entry->is_bridge && num_links == 1) {
HashEntry *dst_entry = dyn_array_ptr_pop (&dfs_stack);
HashEntry *obj_entry_again = dyn_array_ptr_pop (&dfs_stack);
}
goto again;
}
+#endif
}
if (src) {
return;
src->flag = TRUE;
dyn_array_int_add (&dst->old_xrefs, src->index);
+#ifdef OPTIMIZATION_COPY
} else if (dyn_array_int_size (&dst->old_xrefs) == 0) {
dyn_array_int_copy (&dst->old_xrefs, &src->old_xrefs);
+#endif
} else {
int i;
for (i = 0; i < dyn_array_int_size (&src->old_xrefs); ++i) {
* allocating from this dying fragment as it doesn't respect SGEN_MAX_NURSERY_WASTE
* when doing second chance allocation.
*/
- if (sgen_get_nursery_clear_policy () == CLEAR_AT_TLAB_CREATION && claim_remaining_size (frag, end)) {
+ if ((sgen_get_nursery_clear_policy () == CLEAR_AT_TLAB_CREATION || sgen_get_nursery_clear_policy () == CLEAR_AT_TLAB_CREATION_DEBUG) && claim_remaining_size (frag, end)) {
sgen_clear_range (end, frag->fragment_end);
HEAVY_STAT (InterlockedExchangeAdd (&stat_wasted_bytes_trailer, frag->fragment_end - end));
#ifdef NALLOC_DEBUG
void
sgen_clear_nursery_fragments (void)
{
- if (sgen_get_nursery_clear_policy () == CLEAR_AT_TLAB_CREATION) {
+ if (sgen_get_nursery_clear_policy () == CLEAR_AT_TLAB_CREATION || sgen_get_nursery_clear_policy () == CLEAR_AT_TLAB_CREATION_DEBUG) {
sgen_clear_allocator_fragments (&mutator_allocator);
sgen_minor_collector.clear_fragments ();
}
/* memsetting just the first chunk start is bound to provide better cache locality */
if (sgen_get_nursery_clear_policy () == CLEAR_AT_GC)
memset (frag_start, 0, frag_size);
+ else if (sgen_get_nursery_clear_policy () == CLEAR_AT_TLAB_CREATION_DEBUG)
+ memset (frag_start, 0xff, frag_size);
#ifdef NALLOC_DEBUG
/* XXX convert this into a flight record entry
#include "metadata/object-internals.h"
#include "utils/mono-signal-handler.h"
-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
const static int suspend_signal_num = SIGXFSZ;
#else
const static int suspend_signal_num = SIGPWR;
#include "metadata/sgen-gc.h"
#include "metadata/sgen-pinning.h"
#include "metadata/sgen-protocol.h"
+#include "metadata/sgen-pointer-queue.h"
-static void** pin_queue;
-static size_t pin_queue_size = 0;
-static size_t next_pin_slot = 0;
+static SgenPointerQueue pin_queue;
static size_t last_num_pinned = 0;
#define PIN_HASH_SIZE 1024
void
sgen_finish_pinning (void)
{
- last_num_pinned = next_pin_slot;
- next_pin_slot = 0;
-}
-
-static void
-realloc_pin_queue (void)
-{
- size_t new_size = pin_queue_size? pin_queue_size + pin_queue_size/2: 1024;
- void **new_pin = sgen_alloc_internal_dynamic (sizeof (void*) * new_size, INTERNAL_MEM_PIN_QUEUE, TRUE);
- memcpy (new_pin, pin_queue, sizeof (void*) * next_pin_slot);
- sgen_free_internal_dynamic (pin_queue, sizeof (void*) * pin_queue_size, INTERNAL_MEM_PIN_QUEUE);
- pin_queue = new_pin;
- pin_queue_size = new_size;
- SGEN_LOG (4, "Reallocated pin queue to size: %zd", new_size);
+ last_num_pinned = pin_queue.next_slot;
+ sgen_pointer_queue_clear (&pin_queue);
}
void
pin_hash_filter [hash_idx] = ptr;
- if (next_pin_slot >= pin_queue_size)
- realloc_pin_queue ();
-
- pin_queue [next_pin_slot++] = ptr;
-}
-
-static size_t
-optimized_pin_queue_search (void *addr)
-{
- size_t first = 0, last = next_pin_slot;
- while (first < last) {
- size_t middle = first + ((last - first) >> 1);
- if (addr <= pin_queue [middle])
- last = middle;
- else
- first = middle + 1;
- }
- g_assert (first == last);
- return first;
+ sgen_pointer_queue_add (&pin_queue, ptr);
}
void**
sgen_find_optimized_pin_queue_area (void *start, void *end, size_t *num)
{
size_t first, last;
- first = optimized_pin_queue_search (start);
- last = optimized_pin_queue_search (end);
+ first = sgen_pointer_queue_search (&pin_queue, start);
+ last = sgen_pointer_queue_search (&pin_queue, end);
*num = last - first;
if (first == last)
return NULL;
- return pin_queue + first;
+ return pin_queue.data + first;
}
void
void
sgen_pinning_setup_section (GCMemSection *section)
{
- section->pin_queue_start = pin_queue;
- section->pin_queue_num_entries = next_pin_slot;
+ section->pin_queue_start = pin_queue.data;
+ section->pin_queue_num_entries = pin_queue.next_slot;
}
void
sgen_pinning_trim_queue_to_section (GCMemSection *section)
{
- next_pin_slot = section->pin_queue_num_entries;
+ pin_queue.next_slot = section->pin_queue_num_entries;
}
void
sgen_pin_queue_clear_discarded_entries (GCMemSection *section, size_t max_pin_slot)
{
void **start = section->pin_queue_start + section->pin_queue_num_entries;
- void **end = pin_queue + max_pin_slot;
+ void **end = pin_queue.data + max_pin_slot;
void *addr;
if (!start)
/* reduce the info in the pin queue, removing duplicate pointers and sorting them */
void
-sgen_optimize_pin_queue (size_t start_slot)
+sgen_optimize_pin_queue (void)
{
- void **start, **cur, **end;
- /* sort and uniq pin_queue: we just sort and we let the rest discard multiple values */
- /* it may be better to keep ranges of pinned memory instead of individually pinning objects */
- SGEN_LOG (5, "Sorting pin queue, size: %zd", next_pin_slot);
- if ((next_pin_slot - start_slot) > 1)
- sgen_sort_addresses (pin_queue + start_slot, next_pin_slot - start_slot);
- start = cur = pin_queue + start_slot;
- end = pin_queue + next_pin_slot;
- while (cur < end) {
- *start = *cur++;
- while (*start == *cur && cur < end)
- cur++;
- start++;
- };
- next_pin_slot = start - pin_queue;
- SGEN_LOG (5, "Pin queue reduced to size: %zd", next_pin_slot);
+ sgen_pointer_queue_sort_uniq (&pin_queue);
}
size_t
sgen_get_pinned_count (void)
{
- return next_pin_slot;
+ return pin_queue.next_slot;
}
void
int i;
for (i = 0; i < last_num_pinned; ++i) {
- SGEN_LOG (3, "Bastard pinning obj %p (%s), size: %zd", pin_queue [i], sgen_safe_name (pin_queue [i]), sgen_safe_object_get_size (pin_queue [i]));
- }
+ void *ptr = pin_queue.data [i];
+ SGEN_LOG (3, "Bastard pinning obj %p (%s), size: %zd", ptr, sgen_safe_name (ptr), sgen_safe_object_get_size (ptr));
+ }
}
typedef struct _CementHashEntry CementHashEntry;
gboolean
sgen_cement_lookup (char *obj)
{
- int i = mono_aligned_addr_hash (obj) % SGEN_CEMENT_HASH_SIZE;
+ guint hv = mono_aligned_addr_hash (obj);
+ int i = SGEN_CEMENT_HASH (hv);
SGEN_ASSERT (5, sgen_ptr_in_nursery (obj), "Looking up cementing for non-nursery objects makes no sense");
gboolean
sgen_cement_lookup_or_register (char *obj)
{
+ guint hv;
int i;
CementHashEntry *hash;
gboolean concurrent_cementing = sgen_concurrent_collection_in_progress ();
else
hash = cement_hash;
- /*
- * We use modulus hashing, which is fine with constants as gcc
- * can optimize them to multiplication, but with variable
- * values it would be a bad idea given armv7 has no hardware
- * for division, making it 20x slower than a multiplication.
- *
- * This code path can be quite hot, depending on the workload,
- * so if we make the hash size user-adjustable we should
- * figure out something not involving division.
- */
- i = mono_aligned_addr_hash (obj) % SGEN_CEMENT_HASH_SIZE;
+ hv = mono_aligned_addr_hash (obj);
+ i = SGEN_CEMENT_HASH (hv);
SGEN_ASSERT (5, sgen_ptr_in_nursery (obj), "Can only cement pointers to nursery objects");
};
void sgen_pin_stage_ptr (void *ptr) MONO_INTERNAL;
-void sgen_optimize_pin_queue (size_t start_slot) MONO_INTERNAL;
+void sgen_optimize_pin_queue (void) MONO_INTERNAL;
void sgen_init_pinning (void) MONO_INTERNAL;
void sgen_finish_pinning (void) MONO_INTERNAL;
void sgen_pin_queue_clear_discarded_entries (GCMemSection *section, size_t max_pin_slot) MONO_INTERNAL;
--- /dev/null
+/*
+ * sgen-pointer-queue.c: A pointer queue that can be sorted.
+ *
+ * Copyright (C) 2014 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "metadata/sgen-gc.h"
+#include "metadata/sgen-pointer-queue.h"
+
+#ifdef HAVE_SGEN_GC
+
+void
+sgen_pointer_queue_clear (SgenPointerQueue *queue)
+{
+ queue->next_slot = 0;
+}
+
+static void
+realloc_queue (SgenPointerQueue *queue)
+{
+ size_t new_size = queue->size ? queue->size + queue->size/2 : 1024;
+ void **new_data = sgen_alloc_internal_dynamic (sizeof (void*) * new_size, INTERNAL_MEM_PIN_QUEUE, TRUE);
+ memcpy (new_data, queue->data, sizeof (void*) * queue->next_slot);
+ sgen_free_internal_dynamic (queue->data, sizeof (void*) * queue->size, INTERNAL_MEM_PIN_QUEUE);
+ queue->data = new_data;
+ queue->size = new_size;
+ SGEN_LOG (4, "Reallocated pointer queue to size: %lu", new_size);
+}
+
+void
+sgen_pointer_queue_add (SgenPointerQueue *queue, void *ptr)
+{
+ if (queue->next_slot >= queue->size)
+ realloc_queue (queue);
+
+ queue->data [queue->next_slot++] = ptr;
+}
+
+size_t
+sgen_pointer_queue_search (SgenPointerQueue *queue, void *addr)
+{
+ size_t first = 0, last = queue->next_slot;
+ while (first < last) {
+ size_t middle = first + ((last - first) >> 1);
+ if (addr <= queue->data [middle])
+ last = middle;
+ else
+ first = middle + 1;
+ }
+ g_assert (first == last);
+ return first;
+}
+
+void
+sgen_pointer_queue_sort_uniq (SgenPointerQueue *queue)
+{
+ void **start, **cur, **end;
+ /* sort and uniq pin_queue: we just sort and we let the rest discard multiple values */
+ /* it may be better to keep ranges of pinned memory instead of individually pinning objects */
+ SGEN_LOG (5, "Sorting pointer queue, size: %lu", queue->next_slot);
+ if (queue->next_slot > 1)
+ sgen_sort_addresses (queue->data, queue->next_slot);
+ start = cur = queue->data;
+ end = queue->data + queue->next_slot;
+ while (cur < end) {
+ *start = *cur++;
+ while (*start == *cur && cur < end)
+ cur++;
+ start++;
+ };
+ queue->next_slot = start - queue->data;
+ SGEN_LOG (5, "Pointer queue reduced to size: %lu", queue->next_slot);
+}
+
+#endif
--- /dev/null
+/*
+ * sgen-pointer-queue.h: A pointer queue that can be sorted.
+ *
+ * Copyright (C) 2014 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __MONO_SGEN_POINTER_QUEUE_H__
+#define __MONO_SGEN_POINTER_QUEUE_H__
+
+typedef struct {
+ void **data;
+ size_t size;
+ size_t next_slot;
+} SgenPointerQueue;
+
+void sgen_pointer_queue_add (SgenPointerQueue *queue, void *ptr) MONO_INTERNAL;
+void sgen_pointer_queue_clear (SgenPointerQueue *queue) MONO_INTERNAL;
+void sgen_pointer_queue_sort_uniq (SgenPointerQueue *queue) MONO_INTERNAL;
+size_t sgen_pointer_queue_search (SgenPointerQueue *queue, void *addr) MONO_INTERNAL;
+
+#endif
static BinaryProtocolBuffer * volatile binary_protocol_buffers = NULL;
-void
-binary_protocol_init (const char *filename)
+static char* filename_or_prefix = NULL;
+static int current_file_index = 0;
+static long long current_file_size = 0;
+static long long file_size_limit;
+
+static char*
+filename_for_index (int index)
+{
+ char *filename;
+
+ SGEN_ASSERT (0, file_size_limit > 0, "Indexed binary protocol filename must only be used with file size limit");
+
+ filename = sgen_alloc_internal_dynamic (strlen (filename_or_prefix) + 32, INTERNAL_MEM_BINARY_PROTOCOL, TRUE);
+ sprintf (filename, "%s.%d", filename_or_prefix, index);
+
+ return filename;
+}
+
+static void
+free_filename (char *filename)
{
+ SGEN_ASSERT (0, file_size_limit > 0, "Indexed binary protocol filename must only be used with file size limit");
+
+ sgen_free_internal_dynamic (filename, strlen (filename_or_prefix) + 32, INTERNAL_MEM_BINARY_PROTOCOL);
+}
+
+static void
+binary_protocol_open_file (void)
+{
+ char *filename;
+
+ if (file_size_limit > 0)
+ filename = filename_for_index (current_file_index);
+ else
+ filename = filename_or_prefix;
+
binary_protocol_file = fopen (filename, "w");
+
+ if (file_size_limit > 0)
+ free_filename (filename);
+}
+
+void
+binary_protocol_init (const char *filename, long long limit)
+{
+ filename_or_prefix = sgen_alloc_internal_dynamic (strlen (filename) + 1, INTERNAL_MEM_BINARY_PROTOCOL, TRUE);
+ strcpy (filename_or_prefix, filename);
+
+ file_size_limit = limit;
+
+ binary_protocol_open_file ();
}
gboolean
{
g_assert (buffer->index > 0);
fwrite (buffer->buffer, 1, buffer->index, binary_protocol_file);
+ current_file_size += buffer->index;
sgen_free_os_memory (buffer, sizeof (BinaryProtocolBuffer), SGEN_ALLOC_INTERNAL);
}
+static void
+binary_protocol_check_file_overflow (void)
+{
+ if (file_size_limit <= 0 || current_file_size < file_size_limit)
+ return;
+
+ fclose (binary_protocol_file);
+ binary_protocol_file = NULL;
+
+ if (current_file_index > 0) {
+ char *filename = filename_for_index (current_file_index - 1);
+ unlink (filename);
+ free_filename (filename);
+ }
+
+ ++current_file_index;
+ current_file_size = 0;
+
+ binary_protocol_open_file ();
+}
+
void
binary_protocol_flush_buffers (gboolean force)
{
binary_protocol_buffers = NULL;
- for (i = num_buffers - 1; i >= 0; --i)
+ for (i = num_buffers - 1; i >= 0; --i) {
binary_protocol_flush_buffer (bufs [i]);
+ binary_protocol_check_file_overflow ();
+ }
sgen_free_internal_dynamic (buf, num_buffers * sizeof (BinaryProtocolBuffer*), INTERNAL_MEM_BINARY_PROTOCOL);
/* missing: finalizers, roots, non-store wbarriers */
-void binary_protocol_init (const char *filename) MONO_INTERNAL;
+void binary_protocol_init (const char *filename, long long limit) MONO_INTERNAL;
gboolean binary_protocol_is_enabled (void) MONO_INTERNAL;
void binary_protocol_flush_buffers (gboolean force) MONO_INTERNAL;
} \
-#endif
\ No newline at end of file
+#endif
};
typedef struct {
- CRITICAL_SECTION io_lock; /* access to sock_to_state */
+ mono_mutex_t io_lock; /* access to sock_to_state */
int inited; // 0 -> not initialized , 1->initializing, 2->initialized, 3->cleaned up
MonoGHashTable *sock_to_state;
static MonoClass *process_async_call_klass;
static GPtrArray *wsqs;
-CRITICAL_SECTION wsqs_lock;
+mono_mutex_t wsqs_lock;
static gboolean suspended;
/* Hooks */
static void
socket_io_cleanup (SocketIOData *data)
{
- EnterCriticalSection (&data->io_lock);
+ mono_mutex_lock (&data->io_lock);
if (data->inited != 2) {
- LeaveCriticalSection (&data->io_lock);
+ mono_mutex_unlock (&data->io_lock);
return;
}
data->inited = 3;
data->shutdown (data->event_data);
- LeaveCriticalSection (&data->io_lock);
+ mono_mutex_unlock (&data->io_lock);
}
static int
if (socket_io_data.inited == 0)
return;
- EnterCriticalSection (&socket_io_data.io_lock);
+ mono_mutex_lock (&socket_io_data.io_lock);
if (socket_io_data.sock_to_state == NULL) {
- LeaveCriticalSection (&socket_io_data.io_lock);
+ mono_mutex_unlock (&socket_io_data.io_lock);
return;
}
list = mono_g_hash_table_lookup (socket_io_data.sock_to_state, GINT_TO_POINTER (sock));
if (list)
mono_g_hash_table_remove (socket_io_data.sock_to_state, GINT_TO_POINTER (sock));
- LeaveCriticalSection (&socket_io_data.io_lock);
+ mono_mutex_unlock (&socket_io_data.io_lock);
while (list) {
state = (MonoSocketAsyncResult *) mono_mlist_get_data (list);
}
}
- EnterCriticalSection (&data->io_lock);
+ mono_mutex_lock (&data->io_lock);
data->sock_to_state = mono_g_hash_table_new_type (g_direct_hash, g_direct_equal, MONO_HASH_VALUE_GC);
#ifdef HAVE_EPOLL
data->event_system = EPOLL_BACKEND;
init_event_system (data);
mono_thread_create_internal (mono_get_root_domain (), data->wait, data, TRUE, SMALL_STACK);
- LeaveCriticalSection (&data->io_lock);
+ mono_mutex_unlock (&data->io_lock);
data->inited = 2;
threadpool_start_thread (&async_io_tp);
}
MONO_OBJECT_SETREF (state, ares, ares);
fd = GPOINTER_TO_INT (state->handle);
- EnterCriticalSection (&data->io_lock);
+ mono_mutex_lock (&data->io_lock);
if (data->sock_to_state == NULL) {
- LeaveCriticalSection (&data->io_lock);
+ mono_mutex_unlock (&data->io_lock);
return;
}
list = mono_g_hash_table_lookup (data->sock_to_state, GINT_TO_POINTER (fd));
g_print ("Queued: %d\n", (tp->tail - tp->head));
if (tp == &async_tp) {
int i;
- EnterCriticalSection (&wsqs_lock);
+ mono_mutex_lock (&wsqs_lock);
for (i = 0; i < wsqs->len; i++) {
g_print ("\tWSQ %d: %d\n", i, mono_wsq_count (g_ptr_array_index (wsqs, i)));
}
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
} else {
g_print ("\tSockets: %d\n", mono_g_hash_table_size (socket_io_data.sock_to_state));
}
continue;
need_one = (mono_cq_count (tp->queue) > 0);
if (!need_one && !tp->is_io) {
- EnterCriticalSection (&wsqs_lock);
+ mono_mutex_lock (&wsqs_lock);
for (i = 0; wsqs != NULL && i < wsqs->len; i++) {
MonoWSQ *wsq;
wsq = g_ptr_array_index (wsqs, i);
break;
}
}
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
}
if (need_one)
threadpool_start_thread (tp);
}
MONO_GC_REGISTER_ROOT_FIXED (socket_io_data.sock_to_state);
- InitializeCriticalSection (&socket_io_data.io_lock);
+ mono_mutex_init_recursive (&socket_io_data.io_lock);
if (g_getenv ("MONO_THREADS_PER_CPU") != NULL) {
threads_per_cpu = atoi (g_getenv ("MONO_THREADS_PER_CPU"));
if (threads_per_cpu < 1)
async_call_klass = mono_class_from_name (mono_defaults.corlib, "System", "MonoAsyncCall");
g_assert (async_call_klass);
- InitializeCriticalSection (&wsqs_lock);
+ mono_mutex_init_recursive (&wsqs_lock);
wsqs = g_ptr_array_sized_new (MAX (100 * cpu_count, thread_count));
#ifndef DISABLE_PERFCOUNTERS
}
if (wsqs) {
- EnterCriticalSection (&wsqs_lock);
+ mono_mutex_lock (&wsqs_lock);
mono_wsq_cleanup ();
if (wsqs)
g_ptr_array_free (wsqs, TRUE);
wsqs = NULL;
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
MONO_SEM_DESTROY (&async_tp.new_job);
}
}
threadpool_clear_queue (&async_tp, domain);
threadpool_clear_queue (&async_io_tp, domain);
- EnterCriticalSection (&socket_io_data.io_lock);
+ mono_mutex_lock (&socket_io_data.io_lock);
if (socket_io_data.sock_to_state)
mono_g_hash_table_foreach_remove (socket_io_data.sock_to_state, remove_sockstate_for_domain, domain);
- LeaveCriticalSection (&socket_io_data.io_lock);
+ mono_mutex_unlock (&socket_io_data.io_lock);
/*
* There might be some threads out that could be about to execute stuff from the given domain.
int i;
MonoWSQ *wsq;
- EnterCriticalSection (&wsqs_lock);
+ mono_mutex_lock (&wsqs_lock);
wsq = mono_wsq_create ();
if (wsqs == NULL) {
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
return NULL;
}
for (i = 0; i < wsqs->len; i++) {
if (g_ptr_array_index (wsqs, i) == NULL) {
wsqs->pdata [i] = wsq;
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
return wsq;
}
}
g_ptr_array_add (wsqs, wsq);
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
return wsq;
}
if (wsq == NULL)
return;
- EnterCriticalSection (&wsqs_lock);
+ mono_mutex_lock (&wsqs_lock);
if (wsqs == NULL) {
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
return;
}
g_ptr_array_remove_fast (wsqs, wsq);
}
}
mono_wsq_destroy (wsq);
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
}
static void
if (mono_runtime_is_shutting_down ())
return;
- EnterCriticalSection (&wsqs_lock);
+ mono_mutex_lock (&wsqs_lock);
for (i = 0; wsqs != NULL && i < wsqs->len; i++) {
MonoWSQ *wsq;
continue;
mono_wsq_try_steal (wsqs->pdata [i], data, ms);
if (*data != NULL) {
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
return;
}
}
- LeaveCriticalSection (&wsqs_lock);
+ mono_mutex_unlock (&wsqs_lock);
ms += 10;
} while (retry && ms < 11);
}
#include <mono/metadata/marshal.h>
#include <mono/metadata/runtime.h>
#include <mono/io-layer/io-layer.h>
-#ifndef HOST_WIN32
-#include <mono/io-layer/threads.h>
-#endif
#include <mono/metadata/object-internals.h>
#include <mono/metadata/mono-debug-debugger.h>
#include <mono/utils/mono-compiler.h>
#define UICULTURES_START_IDX NUM_CACHED_CULTURES
/* Controls access to the 'threads' hash table */
-#define mono_threads_lock() EnterCriticalSection (&threads_mutex)
-#define mono_threads_unlock() LeaveCriticalSection (&threads_mutex)
-static CRITICAL_SECTION threads_mutex;
+#define mono_threads_lock() mono_mutex_lock (&threads_mutex)
+#define mono_threads_unlock() mono_mutex_unlock (&threads_mutex)
+static mono_mutex_t threads_mutex;
/* Controls access to context static data */
-#define mono_contexts_lock() EnterCriticalSection (&contexts_mutex)
-#define mono_contexts_unlock() LeaveCriticalSection (&contexts_mutex)
-static CRITICAL_SECTION contexts_mutex;
+#define mono_contexts_lock() mono_mutex_lock (&contexts_mutex)
+#define mono_contexts_unlock() mono_mutex_unlock (&contexts_mutex)
+static mono_mutex_t contexts_mutex;
/* Controls access to the 'joinable_threads' hash table */
-#define joinable_threads_lock() EnterCriticalSection (&joinable_threads_mutex)
-#define joinable_threads_unlock() LeaveCriticalSection (&joinable_threads_mutex)
-static CRITICAL_SECTION joinable_threads_mutex;
+#define joinable_threads_lock() mono_mutex_lock (&joinable_threads_mutex)
+#define joinable_threads_unlock() mono_mutex_unlock (&joinable_threads_mutex)
+static mono_mutex_t joinable_threads_mutex;
/* Holds current status of static data heap */
static StaticDataInfo thread_static_info;
static void ref_stack_destroy (gpointer rs);
/* Spin lock for InterlockedXXX 64 bit functions */
-#define mono_interlocked_lock() EnterCriticalSection (&interlocked_mutex)
-#define mono_interlocked_unlock() LeaveCriticalSection (&interlocked_mutex)
-static CRITICAL_SECTION interlocked_mutex;
+#define mono_interlocked_lock() mono_mutex_lock (&interlocked_mutex)
+#define mono_interlocked_unlock() mono_mutex_unlock (&interlocked_mutex)
+static mono_mutex_t interlocked_mutex;
/* global count of thread interruptions requested */
static gint32 thread_interruption_requested = 0;
static void ensure_synch_cs_set (MonoInternalThread *thread)
{
- CRITICAL_SECTION *synch_cs;
+ mono_mutex_t *synch_cs;
if (thread->synch_cs != NULL) {
return;
}
- synch_cs = g_new0 (CRITICAL_SECTION, 1);
- InitializeCriticalSection (synch_cs);
+ synch_cs = g_new0 (mono_mutex_t, 1);
+ mono_mutex_init_recursive (synch_cs);
if (InterlockedCompareExchangePointer ((gpointer *)&thread->synch_cs,
synch_cs, NULL) != NULL) {
/* Another thread must have installed this CS */
- DeleteCriticalSection (synch_cs);
+ mono_mutex_destroy (synch_cs);
g_free (synch_cs);
}
}
ensure_synch_cs_set (thread);
g_assert (thread->synch_cs);
- EnterCriticalSection (thread->synch_cs);
+ mono_mutex_lock (thread->synch_cs);
}
static inline void
unlock_thread (MonoInternalThread *thread)
{
- LeaveCriticalSection (thread->synch_cs);
+ mono_mutex_unlock (thread->synch_cs);
}
/*
vt = mono_class_vtable (mono_get_root_domain (), mono_defaults.internal_thread_class);
thread = (MonoInternalThread*)mono_gc_alloc_mature (vt);
- thread->synch_cs = g_new0 (CRITICAL_SECTION, 1);
- InitializeCriticalSection (thread->synch_cs);
+ thread->synch_cs = g_new0 (mono_mutex_t, 1);
+ mono_mutex_init_recursive (thread->synch_cs);
thread->apartment_state = ThreadApartmentState_Unknown;
thread->managed_id = get_next_managed_thread_id ();
/* if the name was set before starting, we didn't invoke the profiler callback */
if (internal->name && (internal->flags & MONO_THREAD_FLAG_NAME_SET)) {
- char *tname = g_utf16_to_utf8 (internal->name, -1, NULL, NULL, NULL);
+ char *tname = g_utf16_to_utf8 (internal->name, internal->name_len, NULL, NULL, NULL);
mono_profiler_thread_name (internal->tid, tname);
g_free (tname);
}
mono_thread_detach_internal (thread->internal_thread);
}
+/*
+ * mono_thread_detach_if_exiting:
+ *
+ * Detach the current thread from the runtime if it is exiting, i.e. it is running pthread dtors.
+ * This should be used at the end of embedding code which calls into managed code, and which
+ * can be called from pthread dtors, like dealloc: implementations in objective-c.
+ */
+void
+mono_thread_detach_if_exiting (void)
+{
+ if (mono_thread_info_is_exiting ()) {
+ MonoInternalThread *thread;
+
+ thread = mono_thread_internal_current ();
+ if (thread) {
+ mono_thread_detach_internal (thread);
+ mono_thread_info_detach ();
+ }
+ }
+}
+
void
mono_thread_exit ()
{
CloseHandle (thread);
if (this->synch_cs) {
- CRITICAL_SECTION *synch_cs = this->synch_cs;
+ mono_mutex_t *synch_cs = this->synch_cs;
this->synch_cs = NULL;
- DeleteCriticalSection (synch_cs);
+ mono_mutex_destroy (synch_cs);
g_free (synch_cs);
}
{
LOCK_THREAD (this_obj);
- if (this_obj->flags & MONO_THREAD_FLAG_NAME_SET) {
+ if ((this_obj->flags & MONO_THREAD_FLAG_NAME_SET) && !this_obj->threadpool_thread) {
UNLOCK_THREAD (this_obj);
mono_raise_exception (mono_get_exception_invalid_operation ("Thread.Name can only be set once."));
return;
}
+ if (this_obj->name) {
+ g_free (this_obj->name);
+ this_obj->name_len = 0;
+ }
if (name) {
this_obj->name = g_new (gunichar2, mono_string_length (name));
memcpy (this_obj->name, mono_string_chars (name), mono_string_length (name) * 2);
* functions in the io-layer until the signal handler calls QueueUserAPC which will
* make it return.
*/
- wait_handle = wapi_prepare_interrupt_thread (thread->handle);
+ wait_handle = mono_thread_info_prepare_interrupt (thread->handle);
/* fixme: store the state somewhere */
mono_thread_kill (thread, mono_thread_get_abort_signal ());
- wapi_finish_interrupt_thread (wait_handle);
+ mono_thread_info_finish_interrupt (wait_handle);
#endif /* HOST_WIN32 */
}
void mono_thread_init (MonoThreadStartCB start_cb,
MonoThreadAttachCB attach_cb)
{
- InitializeCriticalSection(&threads_mutex);
- InitializeCriticalSection(&interlocked_mutex);
- InitializeCriticalSection(&contexts_mutex);
- InitializeCriticalSection(&joinable_threads_mutex);
+ mono_mutex_init_recursive(&threads_mutex);
+ mono_mutex_init_recursive(&interlocked_mutex);
+ mono_mutex_init_recursive(&contexts_mutex);
+ mono_mutex_init_recursive(&joinable_threads_mutex);
background_change_event = CreateEvent (NULL, TRUE, FALSE, NULL);
g_assert(background_change_event != NULL);
* critical sections can be locked when mono_thread_cleanup is
* called.
*/
- DeleteCriticalSection (&threads_mutex);
- DeleteCriticalSection (&interlocked_mutex);
- DeleteCriticalSection (&contexts_mutex);
- DeleteCriticalSection (&delayed_free_table_mutex);
- DeleteCriticalSection (&small_id_mutex);
+ mono_mutex_destroy (&threads_mutex);
+ mono_mutex_destroy (&interlocked_mutex);
+ mono_mutex_destroy (&contexts_mutex);
+ mono_mutex_destroy (&delayed_free_table_mutex);
+ mono_mutex_destroy (&small_id_mutex);
CloseHandle (background_change_event);
#endif
* to get correct user and system times from getrusage/wait/time(1)).
* This could be removed if we avoid pthread_detach() and use pthread_join().
*/
-#ifndef HOST_WIN32
mono_thread_info_yield ();
-#endif
}
static void terminate_thread (gpointer key, gpointer value, gpointer user)
printf ("Full thread dump:\n");
- /*
- * Make a copy of the hashtable since we can't do anything with
- * threads while threads_mutex is held.
- */
+ /* We take the loader lock and the root domain lock as to increase our odds of not deadlocking if
+ something needs then in the process.
+ */
+ mono_loader_lock ();
+ mono_domain_lock (mono_get_root_domain ());
+
mono_threads_lock ();
mono_g_hash_table_foreach (threads, dump_thread, NULL);
mono_threads_unlock ();
+ mono_domain_unlock (mono_get_root_domain ());
+ mono_loader_unlock ();
+
thread_dump_requested = FALSE;
}
WaitForSingleObjectEx (GetCurrentThread(), 0, TRUE);
#endif
InterlockedDecrement (&thread_interruption_requested);
-#ifndef HOST_WIN32
/* Clear the interrupted flag of the thread so it can wait again */
- wapi_clear_interruption ();
-#endif
+ mono_thread_info_clear_interruption ();
}
if ((thread->state & ThreadState_AbortRequested) != 0) {
#ifdef HOST_WIN32
QueueUserAPC ((PAPCFUNC)dummy_apc, thread->handle, (ULONG_PTR)NULL);
#else
- wapi_self_interrupt ();
+ mono_thread_info_self_interrupt ();
#endif
return NULL;
}
return NULL;
InterlockedIncrement (&thread_interruption_requested);
-#ifndef HOST_WIN32
- wapi_self_interrupt ();
-#endif
+ mono_thread_info_self_interrupt ();
+
return mono_thread_execute_interruption (thread);
}
MonoException *exc = mono_thread_request_interruption (can_raise_exception);
if (exc)
mono_raise_exception (exc);
-#ifndef HOST_WIN32
- wapi_interrupt_thread (thread->handle);
-#endif
+ mono_thread_info_interrupt (thread->handle);
return;
}
* functions in the io-layer until the signal handler calls QueueUserAPC which will
* make it return.
*/
-#ifndef HOST_WIN32
gpointer interrupt_handle;
- interrupt_handle = wapi_prepare_interrupt_thread (thread->handle);
-#endif
+
+ interrupt_handle = mono_thread_info_prepare_interrupt (thread->handle);
mono_thread_info_finish_suspend_and_resume (info);
-#ifndef HOST_WIN32
- wapi_finish_interrupt_thread (interrupt_handle);
-#endif
+ mono_thread_info_finish_interrupt (interrupt_handle);
}
/*FIXME we need to wait for interruption to complete -- figure out how much into interruption we should wait for here*/
}
if (running_managed && !protected_wrapper) {
transition_to_suspended (thread, info);
} else {
-#ifndef HOST_WIN32
gpointer interrupt_handle;
-#endif
if (InterlockedCompareExchange (&thread->interruption_requested, 1, 0) == 0)
InterlockedIncrement (&thread_interruption_requested);
-#ifndef HOST_WIN32
if (interrupt)
- interrupt_handle = wapi_prepare_interrupt_thread (thread->handle);
-#endif
+ interrupt_handle = mono_thread_info_prepare_interrupt (thread->handle);
mono_thread_info_finish_suspend_and_resume (info);
-#ifndef HOST_WIN32
if (interrupt)
- wapi_finish_interrupt_thread (interrupt_handle);
-#endif
+ mono_thread_info_finish_interrupt (interrupt_handle);
UNLOCK_THREAD (thread);
}
}
MONO_API mono_bool mono_thread_is_foreign (MonoThread *thread);
+extern MONO_API void mono_thread_detach_if_exiting (void);
+
MONO_END_DECLS
#endif /* _MONO_METADATA_THREADS_H_ */
}
}
}
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
}
static void
return;
}
- EnterCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_lock (&socket_io_data->io_lock);
if (socket_io_data->inited == 3) {
g_free (events);
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
return; /* cleanup called */
}
epoll_ctl (epollfd, EPOLL_CTL_DEL, fd, evt);
}
}
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
threadpool_append_jobs (&async_io_tp, (MonoObject **) async_results, nresults);
mono_gc_bzero_aligned (async_results, sizeof (gpointer) * nresults);
}
EV_SET (&evt, fd, EVFILT_WRITE, EV_ADD | EV_ENABLE | EV_ONESHOT, 0, 0, 0);
kevent_change (data->fd, &evt, "ADD write");
}
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
}
static void
return;
}
- EnterCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_lock (&socket_io_data->io_lock);
if (socket_io_data->inited == 3) {
g_free (events);
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
return; /* cleanup called */
}
mono_g_hash_table_remove (socket_io_data->sock_to_state, GINT_TO_POINTER (fd));
}
}
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
threadpool_append_jobs (&async_io_tp, (MonoObject **) async_results, nresults);
mono_gc_bzero_aligned (async_results, sizeof (gpointer) * nresults);
}
socket_io_data = p;
data = socket_io_data->event_data;
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
MONO_SEM_WAIT (&data->new_sem);
INIT_POLLFD (&data->newpfd, GPOINTER_TO_INT (fd), events);
if (nsock == 0)
continue;
- EnterCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_lock (&socket_io_data->io_lock);
if (socket_io_data->inited == 3) {
g_free (pfds);
mono_ptr_array_destroy (async_results);
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
return; /* cleanup called */
}
maxfd--;
}
}
- LeaveCriticalSection (&socket_io_data->io_lock);
+ mono_mutex_unlock (&socket_io_data->io_lock);
threadpool_append_jobs (&async_io_tp, (MonoObject **) async_results.data, nresults);
mono_ptr_array_clear (async_results);
}
MonoClass *class = mono_method_get_wrapper_data (ctx->method, (guint32)token);
type = class ? &class->byval_arg : NULL;
} else {
+ MonoError error;
if (!IS_TYPE_DEF_OR_REF_OR_SPEC (token) || !token_bounds_check (ctx->image, token)) {
ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Invalid type token 0x%08x at 0x%04x", token, ctx->ip_offset), MONO_EXCEPTION_BAD_IMAGE);
return NULL;
}
- type = mono_type_get_full (ctx->image, token, ctx->generic_context);
+ type = mono_type_get_checked (ctx->image, token, ctx->generic_context, &error);
+ mono_error_cleanup (&error); /*FIXME don't swallow the error */
}
if (!type || mono_loader_get_last_error ()) {
g_hash_table_remove_all (addr_loads);
for (ins = bb->code; ins; ins = ins->next) {
+handle_instruction:
switch (ins->opcode) {
case OP_LDADDR:
g_hash_table_insert (addr_loads, GINT_TO_POINTER (ins->dreg), ins);
tmp = g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->sreg1));
if (tmp) {
if (cfg->verbose_level > 2) { printf ("Found candidate load:"); mono_print_ins (ins); }
- needs_dce |= lower_load (cfg, ins, tmp);
+ if (lower_load (cfg, ins, tmp)) {
+ needs_dce = TRUE;
+ /* Try to propagate known aliases if an OP_MOVE was inserted */
+ goto handle_instruction;
+ }
}
break;
tmp = g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->dreg));
if (tmp) {
if (cfg->verbose_level > 2) { printf ("Found candidate store:"); mono_print_ins (ins); }
- needs_dce |= lower_store (cfg, ins, tmp);
+ if (lower_store (cfg, ins, tmp)) {
+ needs_dce = TRUE;
+ /* Try to propagate known aliases if an OP_MOVE was inserted */
+ goto handle_instruction;
+ }
}
break;
needs_dce |= lower_store_imm (cfg, ins, tmp);
}
break;
+ case OP_CHECK_THIS:
+ case OP_NOT_NULL:
+ tmp = g_hash_table_lookup (addr_loads, GINT_TO_POINTER (ins->sreg1));
+ if (tmp) {
+ if (cfg->verbose_level > 2) { printf ("Found null check over local: "); mono_print_ins (ins); }
+ NULLIFY_INS (ins);
+ needs_dce = TRUE;
+ }
+ break;
}
}
}
}
static gboolean
-recompute_aliased_variables (MonoCompile *cfg)
+recompute_aliased_variables (MonoCompile *cfg, int *restored_vars)
{
int i;
MonoBasicBlock *bb;
MonoInst *ins;
int kills = 0;
int adds = 0;
+ *restored_vars = 0;
for (i = 0; i < cfg->num_varinfo; i++) {
MonoInst *var = cfg->varinfo [i];
}
}
}
-
+ *restored_vars = adds;
+
mono_jit_stats.alias_found += kills;
mono_jit_stats.alias_removed += kills - adds;
if (kills > adds) {
void
mono_local_alias_analysis (MonoCompile *cfg)
{
+ int i, restored_vars = 1;
if (!cfg->has_indirection)
return;
/*
Some variables no longer need to be flagged as indirect, find them.
+ Since indirect vars are converted into global vregs, each pass eliminates only one level of indirection.
+ Most cases only need one pass and some 2.
*/
- if (!recompute_aliased_variables (cfg))
- goto done;
-
- /*
- A lot of simplification just took place, we recompute local variables and do DCE to
- really profit from the previous gains
- */
- mono_handle_global_vregs (cfg);
- if (cfg->opt & MONO_OPT_DEADCE)
- mono_local_deadce (cfg);
+ for (i = 0; i < 3 && restored_vars > 0 && recompute_aliased_variables (cfg, &restored_vars); ++i) {
+ /*
+ A lot of simplification just took place, we recompute local variables and do DCE to
+ really profit from the previous gains
+ */
+ mono_handle_global_vregs (cfg);
+ if (cfg->opt & MONO_OPT_DEADCE)
+ mono_local_deadce (cfg);
+ }
done:
if (cfg->verbose_level > 2)
gboolean use_trampolines_page;
gboolean no_instances;
gboolean gnu_asm;
+ gboolean llvm;
int nthreads;
int ntrampolines;
int nrgctx_trampolines;
char *mtriple;
char *llvm_path;
char *instances_logfile_path;
+ char *logfile;
} MonoAotOptions;
typedef struct MonoAotStats {
MonoAotStats stats;
int method_index;
char *static_linking_symbol;
- CRITICAL_SECTION mutex;
+ mono_mutex_t mutex;
gboolean use_bin_writer;
gboolean gas_line_numbers;
MonoImageWriter *w;
int objc_selector_index, objc_selector_index_2;
GPtrArray *objc_selectors;
GHashTable *objc_selector_to_index;
+ FILE *logfile;
FILE *instances_logfile;
} MonoAotCompile;
gboolean jit_used, llvm_used;
} MonoPltEntry;
-#define mono_acfg_lock(acfg) EnterCriticalSection (&((acfg)->mutex))
-#define mono_acfg_unlock(acfg) LeaveCriticalSection (&((acfg)->mutex))
+#define mono_acfg_lock(acfg) mono_mutex_lock (&((acfg)->mutex))
+#define mono_acfg_unlock(acfg) mono_mutex_unlock (&((acfg)->mutex))
/* This points to the current acfg in LLVM mode */
static MonoAotCompile *llvm_acfg;
static char*
get_plt_entry_debug_sym (MonoAotCompile *acfg, MonoJumpInfo *ji, GHashTable *cache);
+static void
+aot_printf (MonoAotCompile *acfg, const gchar *format, ...)
+{
+ FILE *output;
+ va_list args;
+
+ if (acfg->logfile)
+ output = acfg->logfile;
+ else
+ output = stdout;
+
+ va_start (args, format);
+ vfprintf (output, format, args);
+ va_end (args);
+}
+
+static void
+aot_printerrf (MonoAotCompile *acfg, const gchar *format, ...)
+{
+ FILE *output;
+ va_list args;
+
+ if (acfg->logfile)
+ output = acfg->logfile;
+ else
+ output = stderr;
+
+ va_start (args, format);
+ vfprintf (output, format, args);
+ va_end (args);
+}
+
/* Wrappers around the image writer functions */
static inline void
if (!acfg->typespec_classes) {
acfg->typespec_classes = mono_mempool_alloc0 (acfg->mempool, sizeof (MonoClass*) * len);
for (i = 0; i < len; ++i) {
- acfg->typespec_classes [i] = mono_class_get_full (acfg->image, MONO_TOKEN_TYPE_SPEC | (i + 1), NULL);
+ MonoError error;
+ acfg->typespec_classes [i] = mono_class_get_and_inflate_typespec_checked (acfg->image, MONO_TOKEN_TYPE_SPEC | (i + 1), NULL, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME error handling */
}
}
for (i = 0; i < len; ++i) {
case MONO_WRAPPER_LDFLDA:
case MONO_WRAPPER_STFLD:
case MONO_WRAPPER_ISINST: {
- MonoClass *proxy_class = mono_marshal_get_wrapper_info (method);
- encode_klass_ref (acfg, proxy_class, p, &p);
+ WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+
+ g_assert (info);
+ encode_klass_ref (acfg, info->d.proxy.klass, p, &p);
break;
}
case MONO_WRAPPER_LDFLD_REMOTE:
method = mini_get_shared_method (method);
if (acfg->aot_opts.log_generics)
- printf ("%*sAdding method %s.\n", depth, "", mono_method_full_name (method, TRUE));
+ aot_printf (acfg, "%*sAdding method %s.\n", depth, "", mono_method_full_name (method, TRUE));
add_method_full (acfg, method, TRUE, depth);
}
/* delegate-invoke wrappers */
for (i = 0; i < acfg->image->tables [MONO_TABLE_TYPEDEF].rows; ++i) {
+ MonoError error;
MonoClass *klass;
MonoCustomAttrInfo *cattr;
token = MONO_TOKEN_TYPE_DEF | (i + 1);
- klass = mono_class_get (acfg->image, token);
+ klass = mono_class_get_checked (acfg->image, token, &error);
if (!klass) {
- mono_loader_clear_error ();
+ mono_error_cleanup (&error);
continue;
}
/* array access wrappers */
for (i = 0; i < acfg->image->tables [MONO_TABLE_TYPESPEC].rows; ++i) {
+ MonoError error;
MonoClass *klass;
token = MONO_TOKEN_TYPE_SPEC | (i + 1);
- klass = mono_class_get (acfg->image, token);
+ klass = mono_class_get_checked (acfg->image, token, &error);
if (!klass) {
- mono_loader_clear_error ();
+ mono_error_cleanup (&error);
continue;
}
/* StructureToPtr/PtrToStructure wrappers */
for (i = 0; i < acfg->image->tables [MONO_TABLE_TYPEDEF].rows; ++i) {
+ MonoError error;
MonoClass *klass;
token = MONO_TOKEN_TYPE_DEF | (i + 1);
- klass = mono_class_get (acfg->image, token);
+ klass = mono_class_get_checked (acfg->image, token, &error);
if (!klass) {
- mono_loader_clear_error ();
+ mono_error_cleanup (&error);
continue;
}
for (i = 0; i < inst->type_argc; ++i) {
MonoType *t = inst->type_argv [i];
- if (t->type == MONO_TYPE_VALUETYPE)
+ if (MONO_TYPE_ISSTRUCT (t) || t->type == MONO_TYPE_VALUETYPE)
return TRUE;
}
return FALSE;
return;
if (acfg->aot_opts.log_generics)
- printf ("%*sAdding generic instance %s [%s].\n", depth, "", mono_type_full_name (&klass->byval_arg), ref);
+ aot_printf (acfg, "%*sAdding generic instance %s [%s].\n", depth, "", mono_type_full_name (&klass->byval_arg), ref);
g_hash_table_insert (acfg->ginst_hash, klass, klass);
method = mono_marshal_get_delegate_invoke (method, NULL);
if (acfg->aot_opts.log_generics)
- printf ("%*sAdding method %s.\n", depth, "", mono_method_full_name (method, TRUE));
+ aot_printf (acfg, "%*sAdding method %s.\n", depth, "", mono_method_full_name (method, TRUE));
add_method (acfg, method);
}
}
for (i = 0; i < acfg->image->tables [MONO_TABLE_TYPESPEC].rows; ++i) {
+ MonoError error;
MonoClass *klass;
token = MONO_TOKEN_TYPE_SPEC | (i + 1);
- klass = mono_class_get (acfg->image, token);
+ klass = mono_class_get_checked (acfg->image, token, &error);
if (!klass || klass->rank) {
- mono_loader_clear_error ();
+ mono_error_cleanup (&error);
continue;
}
} else {
encode_value (0, p, &p);
}
+ encode_value (patch_info->data.del_tramp->virtual, p, &p);
break;
case MONO_PATCH_INFO_FIELD:
case MONO_PATCH_INFO_SFLDA:
encoded = mono_unwind_ops_encode (cfg->unwind_ops, &encoded_len);
unwind_desc = get_unwind_info_offset (acfg, encoded, encoded_len);
- g_assert (unwind_desc < 0xffff);
- if (cfg->has_unwind_info_for_epilog) {
- /*
- * The lower 16 bits identify the unwind descriptor, the upper 16 bits contain the offset of
- * the start of the epilog from the end of the method.
- */
- g_assert (cfg->code_size - cfg->epilog_begin < 0xffff);
- encode_value (((cfg->code_size - cfg->epilog_begin) << 16) | unwind_desc, p, &p);
- g_free (encoded);
- } else {
- encode_value (unwind_desc, p, &p);
- }
+ encode_value (unwind_desc, p, &p);
} else {
encode_value (jinfo->unwind_info, p, &p);
}
eh_info = mono_jit_info_get_arch_eh_info (jinfo);
encode_value (eh_info->stack_size, p, &p);
+ encode_value (eh_info->epilog_size, p, &p);
}
if (jinfo->has_generic_jit_info) {
static guint32
emit_klass_info (MonoAotCompile *acfg, guint32 token)
{
- MonoClass *klass = mono_class_get (acfg->image, token);
+ MonoError error;
+ MonoClass *klass = mono_class_get_checked (acfg->image, token, &error);
guint8 *p, *buf;
int i, buf_size, res;
gboolean no_special_static, cant_encode;
gpointer iter = NULL;
if (!klass) {
- mono_loader_clear_error ();
+ mono_error_cleanup (&error);
buf_size = 16;
opts->instances_logfile_path = g_strdup (arg + strlen ("log-instances="));
} else if (str_begins_with (arg, "log-instances")) {
opts->log_instances = TRUE;
+ } else if (str_begins_with (arg, "internal-logfile=")) {
+ opts->logfile = g_strdup (arg + strlen ("internal-logfile="));
} else if (str_begins_with (arg, "mtriple=")) {
opts->mtriple = g_strdup (arg + strlen ("mtriple="));
} else if (str_begins_with (arg, "llvm-path=")) {
opts->llvm_path = g_strdup (arg + strlen ("llvm-path="));
+ } else if (!strcmp (arg, "llvm")) {
+ opts->llvm = TRUE;
} else if (str_begins_with (arg, "readonly-value=")) {
add_readonly_value (opts, arg + strlen ("readonly-value="));
} else if (str_begins_with (arg, "info")) {
gboolean skip;
int index, depth;
MonoMethod *wrapped;
+ JitFlags flags;
if (acfg->aot_opts.metadata_only)
return;
* the runtime will not see AOT methods during AOT compilation,so it
* does not need to support them by creating a fake GOT etc.
*/
- cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), acfg->aot_opts.full_aot ? (JIT_FLAG_AOT|JIT_FLAG_FULL_AOT) : (JIT_FLAG_AOT), 0);
+ flags = JIT_FLAG_AOT;
+ if (acfg->aot_opts.full_aot)
+ flags |= JIT_FLAG_FULL_AOT;
+ if (acfg->llvm)
+ flags |= JIT_FLAG_LLVM;
+ cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0);
mono_loader_clear_error ();
if (cfg->exception_type == MONO_EXCEPTION_GENERIC_SHARING_FAILED) {
* Emit the LLVM code into an LLVM bytecode file, and compile it using the LLVM
* tools.
*/
-static void
+static gboolean
emit_llvm_file (MonoAotCompile *acfg)
{
char *command, *opts, *tempbc;
opts = g_strdup ("-targetlibinfo -no-aa -basicaa -notti -instcombine -simplifycfg -sroa -domtree -early-cse -lazy-value-info -correlated-propagation -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -indvars -loop-idiom -loop-deletion -loop-unroll -memdep -gvn -memdep -memcpyopt -sccp -instcombine -lazy-value-info -correlated-propagation -domtree -memdep -adce -simplifycfg -instcombine -strip-dead-prototypes -domtree -verify");
#if 1
command = g_strdup_printf ("%sopt -f %s -o \"%s.opt.bc\" \"%s.bc\"", acfg->aot_opts.llvm_path, opts, acfg->tmpbasename, acfg->tmpbasename);
- printf ("Executing opt: %s\n", command);
- if (system (command) != 0) {
- exit (1);
- }
+ aot_printf (acfg, "Executing opt: %s\n", command);
+ if (system (command) != 0)
+ return FALSE;
#endif
g_free (opts);
command = g_strdup_printf ("%sllc %s -disable-gnu-eh-frame -enable-mono-eh-frame -o \"%s\" \"%s.opt.bc\"", acfg->aot_opts.llvm_path, acfg->llc_args->str, acfg->tmpfname, acfg->tmpbasename);
- printf ("Executing llc: %s\n", command);
+ aot_printf (acfg, "Executing llc: %s\n", command);
- if (system (command) != 0) {
- exit (1);
- }
+ if (system (command) != 0)
+ return FALSE;
+ return TRUE;
}
#endif
for (i = 0; i < table_size; ++i)
g_ptr_array_add (table, NULL);
for (i = 0; i < acfg->image->tables [MONO_TABLE_TYPEDEF].rows; ++i) {
+ MonoError error;
token = MONO_TOKEN_TYPE_DEF | (i + 1);
- klass = mono_class_get (acfg->image, token);
+ klass = mono_class_get_checked (acfg->image, token, &error);
if (!klass) {
- mono_loader_clear_error ();
+ mono_error_cleanup (&error);
continue;
}
full_name = mono_type_get_name_full (mono_class_get_type (klass), MONO_TYPE_NAME_FORMAT_FULL_NAME);
#endif
}
-static void
+static gboolean
collect_methods (MonoAotCompile *acfg)
{
int mindex, i;
method = mono_get_method (acfg->image, token, NULL);
if (!method) {
- printf ("Failed to load method 0x%x from '%s'.\n", token, image->name);
- printf ("Run with MONO_LOG_LEVEL=debug for more information.\n");
- exit (1);
+ aot_printerrf (acfg, "Failed to load method 0x%x from '%s'.\n", token, image->name);
+ aot_printerrf (acfg, "Run with MONO_LOG_LEVEL=debug for more information.\n");
+ return FALSE;
}
/* Load all methods eagerly to skip the slower lazy loading code */
if (acfg->aot_opts.full_aot)
add_wrappers (acfg);
+ return TRUE;
}
static void
#endif
if (acfg->aot_opts.asm_only) {
- printf ("Output file: '%s'.\n", acfg->tmpfname);
+ aot_printf (acfg, "Output file: '%s'.\n", acfg->tmpfname);
if (acfg->aot_opts.static_link)
- printf ("Linking symbol: '%s'.\n", acfg->static_linking_symbol);
+ aot_printf (acfg, "Linking symbol: '%s'.\n", acfg->static_linking_symbol);
return 0;
}
objfile = g_strdup_printf ("%s.o", acfg->tmpfname);
}
command = g_strdup_printf ("%s%s %s %s -o %s %s", tool_prefix, AS_NAME, AS_OPTIONS, acfg->as_args ? acfg->as_args->str : "", objfile, acfg->tmpfname);
- printf ("Executing the native assembler: %s\n", command);
+ aot_printf (acfg, "Executing the native assembler: %s\n", command);
if (system (command) != 0) {
g_free (command);
g_free (objfile);
g_free (command);
if (acfg->aot_opts.static_link) {
- printf ("Output file: '%s'.\n", objfile);
- printf ("Linking symbol: '%s'.\n", acfg->static_linking_symbol);
+ aot_printf (acfg, "Output file: '%s'.\n", objfile);
+ aot_printf (acfg, "Linking symbol: '%s'.\n", acfg->static_linking_symbol);
g_free (objfile);
return 0;
}
#else
command = g_strdup_printf ("%sld %s -shared -o %s %s.o", tool_prefix, LD_OPTIONS, tmp_outfile_name, acfg->tmpfname);
#endif
- printf ("Executing the native linker: %s\n", command);
+ aot_printf (acfg, "Executing the native linker: %s\n", command);
if (system (command) != 0) {
g_free (tmp_outfile_name);
g_free (outfile_name);
* happens a lot in emit_and_reloc_code (), so we need to get rid of them.
*/
command = g_strdup_printf ("%sstrip --strip-symbol=\\$a --strip-symbol=\\$d %s", tool_prefix, tmp_outfile_name);
- printf ("Stripping the binary: %s\n", command);
+ aot_printf (acfg, "Stripping the binary: %s\n", command);
if (system (command) != 0) {
g_free (tmp_outfile_name);
g_free (outfile_name);
#if defined(TARGET_MACH)
command = g_strdup_printf ("dsymutil %s", outfile_name);
- printf ("Executing dsymutil: %s\n", command);
+ aot_printf (acfg, "Executing dsymutil: %s\n", command);
if (system (command) != 0) {
return 1;
}
g_free (objfile);
if (acfg->aot_opts.save_temps)
- printf ("Retained input file.\n");
+ aot_printf (acfg, "Retained input file.\n");
else
unlink (acfg->tmpfname);
acfg->klass_blob_hash = g_hash_table_new (NULL, NULL);
acfg->method_blob_hash = g_hash_table_new (NULL, NULL);
acfg->plt_entry_debug_sym_cache = g_hash_table_new (g_str_hash, g_str_equal);
- InitializeCriticalSection (&acfg->mutex);
+ mono_mutex_init_recursive (&acfg->mutex);
return acfg;
}
TV_DECLARE (atv);
TV_DECLARE (btv);
-#if !defined(MONO_ARCH_GSHAREDVT_SUPPORTED) || !defined(ENABLE_GSHAREDVT)
- if (opts & MONO_OPT_GSHAREDVT) {
- fprintf (stderr, "-O=gsharedvt not supported on this platform.\n");
- exit (1);
- }
-#endif
-
- printf ("Mono Ahead of Time compiler - compiling assembly %s\n", image->name);
-
acfg = acfg_create (ass, opts);
memset (&acfg->aot_opts, 0, sizeof (acfg->aot_opts));
mono_aot_parse_options (aot_options, &acfg->aot_opts);
+ if (acfg->aot_opts.logfile) {
+ acfg->logfile = fopen (acfg->aot_opts.logfile, "a+");
+ }
+
if (acfg->aot_opts.static_link)
acfg->aot_opts.autoreg = TRUE;
//acfg->aot_opts.print_skipped_methods = TRUE;
+#if !defined(MONO_ARCH_GSHAREDVT_SUPPORTED) || !defined(ENABLE_GSHAREDVT)
+ if (opts & MONO_OPT_GSHAREDVT) {
+ aot_printerrf (acfg, "-O=gsharedvt not supported on this platform.\n");
+ return 1;
+ }
+#endif
+
+ aot_printf (acfg, "Mono Ahead of Time compiler - compiling assembly %s\n", image->name);
+
#ifndef MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES
if (acfg->aot_opts.full_aot) {
- printf ("--aot=full is not supported on this platform.\n");
+ aot_printerrf (acfg, "--aot=full is not supported on this platform.\n");
return 1;
}
#endif
if (acfg->aot_opts.direct_pinvoke && !acfg->aot_opts.static_link) {
- fprintf (stderr, "The 'direct-pinvoke' AOT option also requires the 'static' AOT option.\n");
- exit (1);
+ aot_printerrf (acfg, "The 'direct-pinvoke' AOT option also requires the 'static' AOT option.\n");
+ return 1;
}
if (acfg->aot_opts.static_link)
opt->gen_seq_points = TRUE;
if (!mono_debug_enabled ()) {
- fprintf (stderr, "The soft-debug AOT option requires the --debug option.\n");
+ aot_printerrf (acfg, "The soft-debug AOT option requires the --debug option.\n");
return 1;
}
acfg->flags |= MONO_AOT_FILE_FLAG_DEBUG;
}
- if (mono_use_llvm) {
+ if (mono_use_llvm || acfg->aot_opts.llvm) {
acfg->llvm = TRUE;
acfg->aot_opts.asm_writer = TRUE;
acfg->flags |= MONO_AOT_FILE_FLAG_WITH_LLVM;
if (acfg->aot_opts.soft_debug) {
- fprintf (stderr, "The 'soft-debug' option is not supported when compiling with LLVM.\n");
- exit (1);
+ aot_printerrf (acfg, "The 'soft-debug' option is not supported when compiling with LLVM.\n");
+ return 1;
}
+
+ mini_llvm_init ();
}
if (acfg->aot_opts.full_aot)
if (acfg->aot_opts.instances_logfile_path) {
acfg->instances_logfile = fopen (acfg->aot_opts.instances_logfile_path, "w");
if (!acfg->instances_logfile) {
- fprintf (stderr, "Unable to create logfile: '%s'.\n", acfg->aot_opts.instances_logfile_path);
- exit (1);
+ aot_printerrf (acfg, "Unable to create logfile: '%s'.\n", acfg->aot_opts.instances_logfile_path);
+ return 1;
}
}
mono_set_partial_sharing_supported (TRUE);
*/
- collect_methods (acfg);
+ res = collect_methods (acfg);
+ if (!res)
+ return 1;
acfg->cfgs_size = acfg->methods->len + 32;
acfg->cfgs = g_new0 (MonoCompile*, acfg->cfgs_size);
#ifdef ENABLE_LLVM
if (acfg->llvm) {
+ gboolean res;
+
if (acfg->aot_opts.asm_only) {
if (acfg->aot_opts.outfile) {
acfg->tmpfname = g_strdup_printf ("%s", acfg->aot_opts.outfile);
acfg->tmpfname = g_strdup_printf ("%s.s", acfg->tmpbasename);
}
- emit_llvm_file (acfg);
+ res = emit_llvm_file (acfg);
+ if (!res)
+ return 1;
}
#endif
acfg->fp = fopen (tmp_outfile_name, "w");
if (!acfg->fp) {
- printf ("Unable to create temporary file '%s': %s\n", tmp_outfile_name, strerror (errno));
+ aot_printf (acfg, "Unable to create temporary file '%s': %s\n", tmp_outfile_name, strerror (errno));
return 1;
}
}
}
if (acfg->fp == 0) {
- fprintf (stderr, "Unable to open file '%s': %s\n", acfg->tmpfname, strerror (errno));
+ aot_printerrf (acfg, "Unable to open file '%s': %s\n", acfg->tmpfname, strerror (errno));
return 1;
}
acfg->w = img_writer_create (acfg->fp, FALSE);
if (!acfg->aot_opts.nodebug || acfg->aot_opts.dwarf_debug) {
if (acfg->aot_opts.dwarf_debug && !mono_debug_enabled ()) {
- fprintf (stderr, "The dwarf AOT option requires the --debug option.\n");
+ aot_printerrf (acfg, "The dwarf AOT option requires the --debug option.\n");
return 1;
}
acfg->dwarf = mono_dwarf_writer_create (acfg->w, NULL, 0, FALSE, !acfg->gas_line_numbers);
all_sizes = acfg->stats.code_size + acfg->stats.info_size + acfg->stats.ex_info_size + acfg->stats.unwind_info_size + acfg->stats.class_info_size + acfg->stats.got_info_size + acfg->stats.offsets_size + acfg->stats.plt_size;
- printf ("Code: %d(%d%%) Info: %d(%d%%) Ex Info: %d(%d%%) Unwind Info: %d(%d%%) Class Info: %d(%d%%) PLT: %d(%d%%) GOT Info: %d(%d%%) Offsets: %d(%d%%) GOT: %d\n",
+ aot_printf (acfg, "Code: %d(%d%%) Info: %d(%d%%) Ex Info: %d(%d%%) Unwind Info: %d(%d%%) Class Info: %d(%d%%) PLT: %d(%d%%) GOT Info: %d(%d%%) Offsets: %d(%d%%) GOT: %d\n",
acfg->stats.code_size, acfg->stats.code_size * 100 / all_sizes,
acfg->stats.info_size, acfg->stats.info_size * 100 / all_sizes,
acfg->stats.ex_info_size, acfg->stats.ex_info_size * 100 / all_sizes,
acfg->stats.got_info_size, acfg->stats.got_info_size * 100 / all_sizes,
acfg->stats.offsets_size, acfg->stats.offsets_size * 100 / all_sizes,
(int)(acfg->got_offset * sizeof (gpointer)));
- printf ("Compiled: %d/%d (%d%%)%s, No GOT slots: %d (%d%%), Direct calls: %d (%d%%)\n",
+ aot_printf (acfg, "Compiled: %d/%d (%d%%)%s, No GOT slots: %d (%d%%), Direct calls: %d (%d%%)\n",
acfg->stats.ccount, acfg->stats.mcount, acfg->stats.mcount ? (acfg->stats.ccount * 100) / acfg->stats.mcount : 100,
llvm_stats_msg,
acfg->stats.methods_without_got_slots, acfg->stats.mcount ? (acfg->stats.methods_without_got_slots * 100) / acfg->stats.mcount : 100,
acfg->stats.direct_calls, acfg->stats.all_calls ? (acfg->stats.direct_calls * 100) / acfg->stats.all_calls : 100);
if (acfg->stats.genericcount)
- printf ("%d methods are generic (%d%%)\n", acfg->stats.genericcount, acfg->stats.mcount ? (acfg->stats.genericcount * 100) / acfg->stats.mcount : 100);
+ aot_printf (acfg, "%d methods are generic (%d%%)\n", acfg->stats.genericcount, acfg->stats.mcount ? (acfg->stats.genericcount * 100) / acfg->stats.mcount : 100);
if (acfg->stats.abscount)
- printf ("%d methods contain absolute addresses (%d%%)\n", acfg->stats.abscount, acfg->stats.mcount ? (acfg->stats.abscount * 100) / acfg->stats.mcount : 100);
+ aot_printf (acfg, "%d methods contain absolute addresses (%d%%)\n", acfg->stats.abscount, acfg->stats.mcount ? (acfg->stats.abscount * 100) / acfg->stats.mcount : 100);
if (acfg->stats.lmfcount)
- printf ("%d methods contain lmf pointers (%d%%)\n", acfg->stats.lmfcount, acfg->stats.mcount ? (acfg->stats.lmfcount * 100) / acfg->stats.mcount : 100);
+ aot_printf (acfg, "%d methods contain lmf pointers (%d%%)\n", acfg->stats.lmfcount, acfg->stats.mcount ? (acfg->stats.lmfcount * 100) / acfg->stats.mcount : 100);
if (acfg->stats.ocount)
- printf ("%d methods have other problems (%d%%)\n", acfg->stats.ocount, acfg->stats.mcount ? (acfg->stats.ocount * 100) / acfg->stats.mcount : 100);
+ aot_printf (acfg, "%d methods have other problems (%d%%)\n", acfg->stats.ocount, acfg->stats.mcount ? (acfg->stats.ocount * 100) / acfg->stats.mcount : 100);
TV_GETTIME (atv);
res = img_writer_emit_writeout (acfg->w);
int err = rename (tmp_outfile_name, outfile_name);
if (err) {
- printf ("Unable to rename '%s' to '%s': %s\n", tmp_outfile_name, outfile_name, strerror (errno));
+ aot_printf (acfg, "Unable to rename '%s' to '%s': %s\n", tmp_outfile_name, outfile_name, strerror (errno));
return 1;
}
} else {
if (acfg->aot_opts.stats) {
int i;
- printf ("GOT slot distribution:\n");
+ aot_printf (acfg, "GOT slot distribution:\n");
for (i = 0; i < MONO_PATCH_INFO_NONE; ++i)
if (acfg->stats.got_slot_types [i])
- printf ("\t%s: %d (%d)\n", get_patch_name (i), acfg->stats.got_slot_types [i], acfg->stats.got_slot_info_sizes [i]);
+ aot_printf (acfg, "\t%s: %d (%d)\n", get_patch_name (i), acfg->stats.got_slot_types [i], acfg->stats.got_slot_info_sizes [i]);
}
- printf ("JIT time: %d ms, Generation time: %d ms, Assembly+Link time: %d ms.\n", acfg->stats.jit_time / 1000, acfg->stats.gen_time / 1000, acfg->stats.link_time / 1000);
+ aot_printf (acfg, "JIT time: %d ms, Generation time: %d ms, Assembly+Link time: %d ms.\n", acfg->stats.jit_time / 1000, acfg->stats.gen_time / 1000, acfg->stats.link_time / 1000);
acfg_free (acfg);
#include <mono/utils/mono-mmap.h>
#include "mono/utils/mono-compiler.h"
#include <mono/utils/mono-counters.h>
+#include <mono/utils/mono-digest.h>
#include "mini.h"
#include "version.h"
#ifndef DISABLE_AOT
+#ifdef TARGET_OSX
+#define ENABLE_AOT_CACHE
+#endif
+
#ifdef TARGET_WIN32
#define SHARED_EXT ".dll"
#elif ((defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__)) || defined(__MACH__)) && !defined(__linux__)
MonoDl *sofile;
JitInfoMap *async_jit_info_table;
- CRITICAL_SECTION mutex;
+ mono_mutex_t mutex;
} MonoAotModule;
typedef struct {
} TrampolinePage;
static GHashTable *aot_modules;
-#define mono_aot_lock() EnterCriticalSection (&aot_mutex)
-#define mono_aot_unlock() LeaveCriticalSection (&aot_mutex)
-static CRITICAL_SECTION aot_mutex;
+#define mono_aot_lock() mono_mutex_lock (&aot_mutex)
+#define mono_aot_unlock() mono_mutex_unlock (&aot_mutex)
+static mono_mutex_t aot_mutex;
/*
* Maps assembly names to the mono_aot_module_<NAME>_info symbols in the
/*
* Whenever to AOT compile loaded assemblies on demand and store them in
- * a cache under $HOME/.mono/aot-cache.
+ * a cache.
*/
-static gboolean use_aot_cache = FALSE;
+static gboolean enable_aot_cache = FALSE;
-/*
- * Whenever to spawn a new process to AOT a file or do it in-process. Only relevant if
- * use_aot_cache is TRUE.
- */
-static gboolean spawn_compiler = TRUE;
+static gboolean mscorlib_aot_loaded;
/* For debugging */
static gint32 mono_last_aot_method = -1;
#define USE_PAGE_TRAMPOLINES 0
#endif
-#define mono_aot_page_lock() EnterCriticalSection (&aot_page_mutex)
-#define mono_aot_page_unlock() LeaveCriticalSection (&aot_page_mutex)
-static CRITICAL_SECTION aot_page_mutex;
+#define mono_aot_page_lock() mono_mutex_lock (&aot_page_mutex)
+#define mono_aot_page_unlock() mono_mutex_unlock (&aot_page_mutex)
+static mono_mutex_t aot_page_mutex;
static void
init_plt (MonoAotModule *info);
static inline void
amodule_lock (MonoAotModule *amodule)
{
- EnterCriticalSection (&amodule->mutex);
+ mono_mutex_lock (&amodule->mutex);
}
static inline void
amodule_unlock (MonoAotModule *amodule)
{
- LeaveCriticalSection (&amodule->mutex);
+ mono_mutex_unlock (&amodule->mutex);
}
/*
assembly = mono_assembly_load (&amodule->image_names [index], amodule->assembly->basedir, &status);
if (!assembly) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module %s is unusable because dependency %s is not found.\n", amodule->aot_name, amodule->image_names [index].name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: module %s is unusable because dependency %s is not found.\n", amodule->aot_name, amodule->image_names [index].name);
amodule->out_of_date = TRUE;
if (set_error) {
}
if (strcmp (assembly->image->guid, amodule->image_guids [index])) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module %s is unusable (GUID of dependent assembly %s doesn't match (expected '%s', got '%s').\n", amodule->aot_name, amodule->image_names [index].name, amodule->image_guids [index], assembly->image->guid);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: module %s is unusable (GUID of dependent assembly %s doesn't match (expected '%s', got '%s').\n", amodule->aot_name, amodule->image_names [index].name, amodule->image_guids [index], assembly->image->guid);
amodule->out_of_date = TRUE;
return NULL;
}
static MonoClass*
decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf)
{
+ MonoError error;
MonoImage *image;
MonoClass *klass = NULL, *eklass;
guint32 token, rank, idx;
image = load_image (module, 0, TRUE);
if (!image)
return NULL;
- klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF + idx);
+ klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF + idx, &error);
+ g_assert (mono_error_ok (&error));
break;
case MONO_AOT_TYPEREF_TYPEDEF_INDEX_IMAGE:
idx = decode_value (p, &p);
image = load_image (module, decode_value (p, &p), TRUE);
if (!image)
return NULL;
- klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF + idx);
+ klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF + idx, &error);
+ g_assert (mono_error_ok (&error));
break;
case MONO_AOT_TYPEREF_TYPESPEC_TOKEN:
token = decode_value (p, &p);
image = module->assembly->image;
if (!image)
return NULL;
- klass = mono_class_get (image, token);
+ klass = mono_class_get_checked (image, token, &error);
+ g_assert (mono_error_ok (&error));
break;
case MONO_AOT_TYPEREF_GINST: {
MonoClass *gclass;
serial = decode_value (p, &p);
}
- // FIXME: Memory management
t = g_new0 (MonoType, 1);
t->type = type;
if (container) {
g_assert (serial == 0);
} else {
/* Anonymous */
- MonoGenericParam *par = (MonoGenericParam*)g_new0 (MonoGenericParamFull, 1);
+ MonoGenericParam *par = (MonoGenericParam*)mono_image_alloc0 (module->assembly->image, sizeof (MonoGenericParamFull));
par->num = num;
par->serial = serial;
// FIXME:
return decode_resolve_method_ref_with_target (module, NULL, buf, endbuf);
}
+#ifdef ENABLE_AOT_CACHE
+
+/* AOT CACHE */
+
+/*
+ * FIXME:
+ * - Add options for controlling the cache size
+ * - Handle full cache by deleting old assemblies lru style
+ * - Maybe add a threshold after an assembly is AOT compiled
+ * - Add options for enabling this for specific main assemblies
+ */
+
+/* The cache directory */
+static char *cache_dir;
+
+/* The number of assemblies AOTed in this run */
+static int cache_count;
+
+/* Whenever to AOT in-process */
+static gboolean in_process;
+
static void
-create_cache_structure (void)
+collect_assemblies (gpointer data, gpointer user_data)
{
- const char *home;
- char *tmp;
- int err;
+ MonoAssembly *ass = data;
+ GSList **l = user_data;
- home = g_get_home_dir ();
- if (!home)
- return;
+ *l = g_slist_prepend (*l, ass);
+}
- tmp = g_build_filename (home, ".mono", NULL);
- if (!g_file_test (tmp, G_FILE_TEST_IS_DIR)) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT creating directory %s", tmp);
-#ifdef HOST_WIN32
- err = mkdir (tmp);
-#else
- err = mkdir (tmp, 0777);
-#endif
- if (err) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT failed: %s", g_strerror (errno));
- g_free (tmp);
- return;
- }
+#define SHA1_DIGEST_LENGTH 20
+
+/*
+ * get_aot_config_hash:
+ *
+ * Return a hash for all the version information an AOT module depends on.
+ */
+static G_GNUC_UNUSED char*
+get_aot_config_hash (MonoAssembly *assembly)
+{
+ char *build_info;
+ GSList *l, *assembly_list = NULL;
+ GString *s;
+ int i;
+ guint8 digest [SHA1_DIGEST_LENGTH];
+ char *digest_str;
+
+ build_info = mono_get_runtime_build_info ();
+
+ s = g_string_new (build_info);
+
+ mono_assembly_foreach (collect_assemblies, &assembly_list);
+
+ /*
+ * The assembly list includes the current assembly as well, no need
+ * to add it.
+ */
+ for (l = assembly_list; l; l = l->next) {
+ MonoAssembly *ass = l->data;
+
+ g_string_append (s, "_");
+ g_string_append (s, ass->aname.name);
+ g_string_append (s, "_");
+ g_string_append (s, ass->image->guid);
}
- g_free (tmp);
- tmp = g_build_filename (home, ".mono", "aot-cache", NULL);
- if (!g_file_test (tmp, G_FILE_TEST_IS_DIR)) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT creating directory %s", tmp);
-#ifdef HOST_WIN32
- err = mkdir (tmp);
-#else
- err = mkdir (tmp, 0777);
-#endif
- if (err) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT failed: %s", g_strerror (errno));
- g_free (tmp);
- return;
- }
+
+ for (i = 0; i < s->len; ++i) {
+ if (!isalnum (s->str [i]) && s->str [i] != '-')
+ s->str [i] = '_';
}
- g_free (tmp);
+
+ mono_sha1_get_digest ((guint8*)s->str, s->len, digest);
+
+ digest_str = g_malloc0 ((SHA1_DIGEST_LENGTH * 2) + 1);
+ for (i = 0; i < SHA1_DIGEST_LENGTH; ++i)
+ sprintf (digest_str + (i * 2), "%02x", digest [i]);
+
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT: file dependencies: %s, hash %s", s->str, digest_str);
+
+ g_string_free (s, TRUE);
+
+ return digest_str;
+}
+
+static void
+aot_cache_init (void)
+{
+ if (mono_aot_only)
+ return;
+ enable_aot_cache = TRUE;
+ in_process = TRUE;
}
/*
- * load_aot_module_from_cache:
+ * aot_cache_load_module:
*
- * Experimental code to AOT compile loaded assemblies on demand.
- *
- * FIXME:
- * - Add environment variable MONO_AOT_CACHE_OPTIONS
- * - Add options for controlling the cache size
- * - Handle full cache by deleting old assemblies lru style
- * - Add options for excluding assemblies during development
- * - Maybe add a threshold after an assembly is AOT compiled
- * - invoking a new mono process is a security risk
- * - recompile the AOT module if one of its dependencies changes
+ * Load the AOT image corresponding to ASSEMBLY from the aot cache, AOTing it if neccessary.
*/
static MonoDl*
-load_aot_module_from_cache (MonoAssembly *assembly, char **aot_name)
+aot_cache_load_module (MonoAssembly *assembly, char **aot_name)
{
- char *fname, *cmd, *tmp2, *aot_options;
+ MonoAotCacheConfig *config;
+ GSList *l;
+ char *fname, *tmp2, *aot_options, *failure_fname;
const char *home;
MonoDl *module;
gboolean res;
- gchar *out, *err;
gint exit_status;
+ char *hash;
+ int pid;
+ gboolean enabled;
+ FILE *failure_file;
*aot_name = NULL;
if (image_is_dynamic (assembly->image))
return NULL;
- create_cache_structure ();
+ /* Check in the list of assemblies enabled for aot caching */
+ config = mono_get_aot_cache_config ();
+
+ enabled = FALSE;
+ if (config->apps) {
+ MonoDomain *domain = mono_domain_get ();
+ MonoAssembly *entry_assembly = domain->entry_assembly;
+
+ // FIXME: This cannot be used for mscorlib during startup, since entry_assembly is not set yet
+ for (l = config->apps; l; l = l->next) {
+ char *n = l->data;
- home = g_get_home_dir ();
+ if ((entry_assembly && !strcmp (entry_assembly->aname.name, n)) || (!entry_assembly && !strcmp (assembly->aname.name, n)))
+ break;
+ }
+ if (l)
+ enabled = TRUE;
+ }
- tmp2 = g_strdup_printf ("%s-%s%s", assembly->image->assembly_name, assembly->image->guid, SHARED_EXT);
- fname = g_build_filename (home, ".mono", "aot-cache", tmp2, NULL);
+ if (!enabled) {
+ for (l = config->assemblies; l; l = l->next) {
+ char *n = l->data;
+
+ if (!strcmp (assembly->aname.name, n))
+ break;
+ }
+ if (l)
+ enabled = TRUE;
+ }
+ if (!enabled)
+ return NULL;
+
+ if (!cache_dir) {
+ home = g_get_home_dir ();
+ if (!home)
+ return NULL;
+ cache_dir = g_strdup_printf ("%s/Library/Caches/mono/aot-cache", home);
+ if (!g_file_test (cache_dir, G_FILE_TEST_EXISTS|G_FILE_TEST_IS_DIR))
+ g_mkdir_with_parents (cache_dir, 0777);
+ }
+
+ /*
+ * The same assembly can be used in multiple configurations, i.e. multiple
+ * versions of the runtime, with multiple versions of dependent assemblies etc.
+ * To handle this, we compute a version string containing all this information, hash it,
+ * and use the hash as a filename suffix.
+ */
+ hash = get_aot_config_hash (assembly);
+
+ tmp2 = g_strdup_printf ("%s-%s%s", assembly->image->assembly_name, hash, SHARED_EXT);
+ fname = g_build_filename (cache_dir, tmp2, NULL);
*aot_name = fname;
g_free (tmp2);
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT trying to load from cache: '%s'.", fname);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: loading from cache: '%s'.", fname);
module = mono_dl_open (fname, MONO_DL_LAZY, NULL);
- if (!module) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT not found.");
+ if (module) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: found in cache: '%s'.", fname);
+ return module;
+ }
- mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT precompiling assembly '%s'... ", assembly->image->name);
+ if (!strcmp (assembly->aname.name, "mscorlib") && !mscorlib_aot_loaded)
+ /*
+ * Can't AOT this during startup, so we AOT it when called later from
+ * mono_aot_get_method ().
+ */
+ return NULL;
- aot_options = g_strdup_printf ("outfile=%s", fname);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: not found.");
- if (spawn_compiler) {
- /* FIXME: security */
- /* FIXME: Has to pass the assembly loading path to the child process */
- cmd = g_strdup_printf ("mono -O=all --aot=%s %s", aot_options, assembly->image->name);
+ /* Only AOT one assembly per run to avoid slowing down execution too much */
+ if (cache_count > 0)
+ return NULL;
+ cache_count ++;
+
+ /* Check for previous failure */
+ failure_fname = g_strdup_printf ("%s.failure", fname);
+ failure_file = fopen (failure_fname, "r");
+ if (failure_file) {
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT: assembly '%s' previously failed to compile '%s' ('%s')... ", assembly->image->name, fname, failure_fname);
+ g_free (failure_fname);
+ return NULL;
+ } else {
+ g_free (failure_fname);
+ fclose (failure_file);
+ }
- res = g_spawn_command_line_sync (cmd, &out, &err, &exit_status, NULL);
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT: compiling assembly '%s', logfile: '%s.log'... ", assembly->image->name, fname);
-#if !defined(HOST_WIN32) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__powerpc__)
- if (res) {
- if (!WIFEXITED (exit_status) && (WEXITSTATUS (exit_status) == 0))
- mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT failed: %s.", err);
- else
- mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT succeeded.");
- g_free (out);
- g_free (err);
- }
-#endif
- g_free (cmd);
+ /*
+ * We need to invoke the AOT compiler here. There are multiple approaches:
+ * - spawn a new runtime process. This can be hard when running with mkbundle, and
+ * its hard to make the new process load the same set of assemblies.
+ * - doing it in-process. This exposes the current process to bugs/leaks/side effects of
+ * the AOT compiler.
+ * - fork a new process and do the work there.
+ */
+ if (in_process) {
+ aot_options = g_strdup_printf ("outfile=%s,internal-logfile=%s.log%s%s", fname, fname, config->aot_options ? "," : "", config->aot_options ? config->aot_options : "");
+ /* Maybe due this in another thread ? */
+ res = mono_compile_assembly (assembly, mono_parse_default_optimizations (NULL), aot_options);
+ if (res) {
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT: compilation failed.");
+ failure_fname = g_strdup_printf ("%s.failure", fname);
+ failure_file = fopen (failure_fname, "a+");
+ fclose (failure_file);
+ g_free (failure_fname);
} else {
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT: compilation succeeded.");
+ }
+ } else {
+ /*
+ * - Avoid waiting for the aot process to finish ?
+ * (less overhead, but multiple processes could aot the same assembly at the same time)
+ */
+ pid = fork ();
+ if (pid == 0) {
+ FILE *logfile;
+ char *logfile_name;
+
+ /* Child */
+
+ logfile_name = g_strdup_printf ("%s/aot.log", cache_dir);
+ logfile = fopen (logfile_name, "a+");
+ g_free (logfile_name);
+
+ dup2 (fileno (logfile), 1);
+ dup2 (fileno (logfile), 2);
+
+ aot_options = g_strdup_printf ("outfile=%s", fname);
res = mono_compile_assembly (assembly, mono_parse_default_optimizations (NULL), aot_options);
if (!res) {
- mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT failed.");
+ exit (1);
} else {
- mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT succeeded.");
+ exit (0);
}
+ } else {
+ /* Parent */
+ waitpid (pid, &exit_status, 0);
+ if (!WIFEXITED (exit_status) && (WEXITSTATUS (exit_status) == 0))
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT: failed.");
+ else
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT: succeeded.");
}
-
- module = mono_dl_open (fname, MONO_DL_LAZY, NULL);
-
- g_free (aot_options);
}
+ module = mono_dl_open (fname, MONO_DL_LAZY, NULL);
+
return module;
}
+#else
+
+static void
+aot_cache_init (void)
+{
+}
+
+static MonoDl*
+aot_cache_load_module (MonoAssembly *assembly, char **aot_name)
+{
+ return NULL;
+}
+
+#endif
+
static void
find_symbol (MonoDl *module, gpointer *globals, const char *name, gpointer *value)
{
info = NULL;
mono_aot_unlock ();
+ sofile = NULL;
+
if (info) {
/* Statically linked AOT module */
- sofile = NULL;
aot_name = g_strdup_printf ("%s", assembly->aname.name);
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "Found statically linked AOT module '%s'.\n", aot_name);
globals = info->globals;
} else {
- if (use_aot_cache)
- sofile = load_aot_module_from_cache (assembly, &aot_name);
- else {
+ if (enable_aot_cache)
+ sofile = aot_cache_load_module (assembly, &aot_name);
+ if (!sofile) {
char *err;
aot_name = g_strdup_printf ("%s%s", assembly->image->name, SHARED_EXT);
fprintf (stderr, "Failed to load AOT module '%s' while running in aot-only mode: %s.\n", aot_name, msg);
exit (1);
} else {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module %s is unusable: %s.\n", aot_name, msg);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: module %s is unusable: %s.\n", aot_name, msg);
}
g_free (msg);
g_free (aot_name);
amodule->method_to_code = g_hash_table_new (mono_aligned_addr_hash, NULL);
amodule->blob = blob;
- InitializeCriticalSection (&amodule->mutex);
+ mono_mutex_init_recursive (&amodule->mutex);
/* Read image table */
{
}
if (amodule->out_of_date) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT Module %s is unusable because a dependency is out-of-date.\n", assembly->image->name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: Module %s is unusable because a dependency is out-of-date.\n", assembly->image->name);
if (mono_aot_only) {
fprintf (stderr, "Failed to load AOT module '%s' while running in aot-only mode because a dependency cannot be found or it is out of date.\n", aot_name);
exit (1);
}
}
else
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT loaded AOT Module for %s.\n", assembly->image->name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT: loaded AOT Module for %s.\n", assembly->image->name);
}
/*
void
mono_aot_init (void)
{
- InitializeCriticalSection (&aot_mutex);
- InitializeCriticalSection (&aot_page_mutex);
+ mono_mutex_init_recursive (&aot_mutex);
+ mono_mutex_init_recursive (&aot_page_mutex);
aot_modules = g_hash_table_new (NULL, NULL);
#ifndef __native_client__
if (g_getenv ("MONO_LASTAOT"))
mono_last_aot_method = atoi (g_getenv ("MONO_LASTAOT"));
- if (g_getenv ("MONO_AOT_CACHE"))
- use_aot_cache = TRUE;
+ aot_cache_init ();
}
void
name_space2 = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]);
if (!strcmp (name, name2) && !strcmp (name_space, name_space2)) {
+ MonoError error;
amodule_unlock (amodule);
- *klass = mono_class_get (image, token);
+ *klass = mono_class_get_checked (image, token, &error);
+ if (!mono_error_ok (&error))
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
/* Add to cache */
if (*klass) {
eh_info = mono_jit_info_get_arch_eh_info (jinfo);
eh_info->stack_size = decode_value (p, &p);
+ eh_info->epilog_size = decode_value (p, &p);
}
if (async) {
mono_aot_unlock ();
}
- /* The upper 16 bits of ji->unwind_info might contain the epilog offset */
- p = amodule->unwind_info + (ji->unwind_info & 0xffff);
+ p = amodule->unwind_info + ji->unwind_info;
*unwind_info_len = decode_value (p, &p);
return p;
}
goto cleanup;
break;
case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE:
- ji->data.del_tramp = mono_mempool_alloc0 (mp, sizeof (MonoClassMethodPair));
+ ji->data.del_tramp = mono_mempool_alloc0 (mp, sizeof (MonoDelegateClassMethodPair));
ji->data.del_tramp->klass = decode_klass_ref (aot_module, p, &p);
if (!ji->data.del_tramp->klass)
goto cleanup;
if (!ji->data.del_tramp->method)
goto cleanup;
}
+ ji->data.del_tramp->virtual = decode_value (p, &p) ? TRUE : FALSE;
break;
case MONO_PATCH_INFO_IMAGE:
ji->data.image = load_image (aot_module, decode_value (p, &p), TRUE);
MonoJitInfo *jinfo = NULL;
guint8 *code, *info;
- if (mono_profiler_get_events () & MONO_PROFILE_ENTER_LEAVE)
+ if (mono_profiler_get_events () & MONO_PROFILE_ENTER_LEAVE) {
+ if (mono_aot_only)
+ /* The caller cannot handle this */
+ g_assert_not_reached ();
return NULL;
+ }
if ((domain != mono_get_root_domain ()) && (!(amodule->info.opts & MONO_OPT_SHARED)))
/* Non shared AOT code can't be used in other appdomains */
if (!method)
method = mono_get_method (image, token, NULL);
full_name = mono_method_full_name (method, TRUE);
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT NOT FOUND: %s.", full_name);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: NOT FOUND: %s.", full_name);
g_free (full_name);
}
return NULL;
if (!jinfo)
jinfo = mono_aot_find_jit_info (domain, amodule->assembly->image, code);
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT FOUND method %s [%p - %p %p]", full_name, code, code + jinfo->code_size, info);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: FOUND method %s [%p - %p %p]", full_name, code, code + jinfo->code_size, info);
g_free (full_name);
}
MonoAotModule *amodule = klass->image->aot_module;
guint8 *code;
+ if (enable_aot_cache && !amodule && domain->entry_assembly && klass->image == mono_defaults.corlib) {
+ /* This cannot be AOTed during startup, so do it now */
+ if (!mscorlib_aot_loaded) {
+ mscorlib_aot_loaded = TRUE;
+ load_aot_module (klass->image->assembly, NULL);
+ amodule = klass->image->aot_module;
+ }
+ }
+
if (!amodule)
return NULL;
if (!code)
g_error ("Symbol '%s' not found in AOT file '%s'.\n", name, amodule->aot_name);
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT FOUND function '%s' in AOT file '%s'.", name, amodule->aot_name);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: FOUND function '%s' in AOT file '%s'.", name, amodule->aot_name);
/* Load info */
make_unreadable = unreadable;
if (make_unreadable && !inited) {
- mono_counters_register ("AOT pagefaults", MONO_COUNTER_JIT | MONO_COUNTER_INT, &n_pagefaults);
+ mono_counters_register ("AOT: pagefaults", MONO_COUNTER_JIT | MONO_COUNTER_INT, &n_pagefaults);
}
}
cgt.un: dest:c len:8
clt: dest:c len:8
clt.un: dest:c len:8
-localloc: dest:i src1:i len:84
+localloc: dest:i src1:i len:96
compare: src1:i src2:i len:3
lcompare: src1:i src2:i len:3
icompare: src1:i src2:i len:3
dyn_call: src1:i src2:i len:64 clob:c nacl:128
-localloc_imm: dest:i len:84
+localloc_imm: dest:i len:96
load_mem: dest:i len:16
loadi8_mem: dest:i len:16
long_conv_to_ovf_i4_2: dest:i src1:i src2:i len:36
-vcall2: len:32 clob:c
-vcall2_reg: src1:i len:32 clob:c
-vcall2_membase: src1:b len:32 clob:c
+vcall2: len:40 clob:c
+vcall2_reg: src1:i len:40 clob:c
+vcall2_membase: src1:b len:40 clob:c
dyn_call: src1:i src2:i len:120 clob:c
# This is different from the original JIT opcodes
static ReplyPacket reply_packets [128];
int nreply_packets;
-#define dbg_lock() EnterCriticalSection (&debug_mutex)
-#define dbg_unlock() LeaveCriticalSection (&debug_mutex)
-static CRITICAL_SECTION debug_mutex;
+#define dbg_lock() mono_mutex_lock (&debug_mutex)
+#define dbg_unlock() mono_mutex_unlock (&debug_mutex)
+static mono_mutex_t debug_mutex;
static void transport_init (void);
static void transport_connect (const char *address);
void
mono_debugger_agent_init (void)
{
- InitializeCriticalSection (&debug_mutex);
+ mono_mutex_init_recursive (&debug_mutex);
if (!agent_config.enabled)
return;
/* Read answer */
res = transport_recv (buf, strlen (handshake_msg));
- if ((res != strlen (handshake_msg)) || (memcmp (buf, handshake_msg, strlen (handshake_msg) != 0))) {
+ if ((res != strlen (handshake_msg)) || (memcmp (buf, handshake_msg, strlen (handshake_msg)) != 0)) {
fprintf (stderr, "debugger-agent: DWP handshake failed.\n");
return FALSE;
}
#endif
/* This is _not_ equivalent to ves_icall_System_Threading_Thread_Abort () */
-#ifdef HOST_WIN32
- QueueUserAPC (notify_thread_apc, thread->handle, (ULONG_PTR)NULL);
-#else
if (mono_thread_info_new_interrupt_enabled ()) {
MonoThreadInfo *info;
MonoJitInfo *ji;
mono_thread_info_finish_suspend_and_resume (info);
}
} else {
+#ifdef HOST_WIN32
+ // FIXME: Remove this since new interrupt is used on win32 now
+ QueueUserAPC (notify_thread_apc, thread->handle, (ULONG_PTR)NULL);
+#else
res = mono_thread_kill (thread, mono_thread_get_abort_signal ());
if (res) {
DEBUG(1, fprintf (log_file, "[%p] mono_thread_kill () failed for %p: %d...\n", (gpointer)GetCurrentThreadId (), (gpointer)tid, res));
*/
tls->terminated = TRUE;
}
- }
#endif
+ }
}
static void
buffer_add_value (buf, t, mono_object_unbox (val), domain);
}
-static void
+static int
buffer_add_cattrs (Buffer *buf, MonoDomain *domain, MonoImage *image, MonoClass *attr_klass, MonoCustomAttrInfo *cinfo)
{
int i, j;
if (!cinfo) {
buffer_add_int (buf, 0);
- return;
+ return ERR_NONE;
}
for (i = 0; i < cinfo->num_attrs; ++i) {
MonoError error;
mono_reflection_create_custom_attr_data_args (image, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo, &error);
- g_assert (mono_error_ok (&error));
+ if (!mono_error_ok (&error)) {
+ DEBUG(2, fprintf (log_file, "[dbg] mono_reflection_create_custom_attr_data_args () failed with: '%s'\n", mono_error_get_message (&error)));
+ mono_error_cleanup (&error);
+ return ERR_LOADER_ERROR;
+ }
buffer_add_methodid (buf, domain, attr->ctor);
g_free (arginfo);
}
}
+
+ return ERR_NONE;
}
/* FIXME: Code duplication with icall.c */
cinfo = mono_custom_attrs_from_class (klass);
- buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo);
+ err = buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo);
+ if (err)
+ return err;
break;
}
case CMD_TYPE_GET_FIELD_CATTRS: {
cinfo = mono_custom_attrs_from_field (klass, field);
- buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo);
+ err = buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo);
+ if (err)
+ return err;
break;
}
case CMD_TYPE_GET_PROPERTY_CATTRS: {
cinfo = mono_custom_attrs_from_property (klass, prop);
- buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo);
+ err = buffer_add_cattrs (buf, domain, klass->image, attr_klass, cinfo);
+ if (err)
+ return err;
break;
}
case CMD_TYPE_GET_VALUES:
cinfo = mono_custom_attrs_from_method (method);
- buffer_add_cattrs (buf, domain, method->klass->image, attr_klass, cinfo);
+ err = buffer_add_cattrs (buf, domain, method->klass->image, attr_klass, cinfo);
+ if (err)
+ return err;
break;
}
case CMD_METHOD_MAKE_GENERIC_METHOD: {
mono_load_coree (argv [i]);
#endif
+ /* Parse gac loading options before loading assemblies. */
+ if (mono_compile_aot || action == DO_EXEC || action == DO_DEBUGGER) {
+ mono_config_parse (config_file);
+ }
+
mono_set_defaults (mini_verbose, opt);
domain = mini_init (argv [i], forced_version);
break;
}
- /* Parse gac loading options before loading assemblies. */
- if (mono_compile_aot || action == DO_EXEC || action == DO_DEBUGGER) {
- mono_config_parse (config_file);
- }
-
#ifdef MONO_JIT_INFO_TABLE_TEST
if (test_jit_info_table)
jit_info_table_test (domain);
void
mono_jit_cleanup (MonoDomain *domain)
{
+ mono_thread_manage ();
+
mini_cleanup (domain);
}
static char*
token_handler (MonoDisHelper *dh, MonoMethod *method, guint32 token)
{
+ MonoError error;
char *res, *desc;
MonoMethod *cmethod;
MonoClass *klass;
case CEE_ISINST:
case CEE_CASTCLASS:
case CEE_LDELEMA:
- if (method->wrapper_type)
+ if (method->wrapper_type) {
klass = data;
- else
- klass = mono_class_get_full (method->klass->image, token, NULL);
+ } else {
+ klass = mono_class_get_checked (method->klass->image, token, &error);
+ g_assert (mono_error_ok (&error)); /* FIXME error handling */
+ }
res = g_strdup_printf ("<%s>", klass->name);
break;
case CEE_NEWOBJ:
void *mono_win_vectored_exception_handle;
#define W32_SEH_HANDLE_EX(_ex) \
- if (_ex##_handler) _ex##_handler(0, ep, sctx)
+ if (_ex##_handler) _ex##_handler(0, ep, ctx)
static LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep)
{
{
EXCEPTION_RECORD* er;
CONTEXT* ctx;
- MonoContext* sctx;
LONG res;
MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
er = ep->ExceptionRecord;
ctx = ep->ContextRecord;
- sctx = g_malloc(sizeof(MonoContext));
-
- /* Copy Win32 context to UNIX style context */
- sctx->rax = ctx->Rax;
- sctx->rbx = ctx->Rbx;
- sctx->rcx = ctx->Rcx;
- sctx->rdx = ctx->Rdx;
- sctx->rbp = ctx->Rbp;
- sctx->rsp = ctx->Rsp;
- sctx->rsi = ctx->Rsi;
- sctx->rdi = ctx->Rdi;
- sctx->rip = ctx->Rip;
- sctx->r12 = ctx->R12;
- sctx->r13 = ctx->R13;
- sctx->r14 = ctx->R14;
- sctx->r15 = ctx->R15;
switch (er->ExceptionCode) {
case EXCEPTION_ACCESS_VIOLATION:
* can correctly chain the exception.
*/
res = EXCEPTION_CONTINUE_SEARCH;
- } else {
- /* Copy context back */
- /* Nonvolatile */
- ctx->Rsp = sctx->rsp;
- ctx->Rdi = sctx->rdi;
- ctx->Rsi = sctx->rsi;
- ctx->Rbx = sctx->rbx;
- ctx->Rbp = sctx->rbp;
- ctx->R12 = sctx->r12;
- ctx->R13 = sctx->r13;
- ctx->R14 = sctx->r14;
- ctx->R15 = sctx->r15;
- ctx->Rip = sctx->rip;
-
- /* Volatile But should not matter?*/
- ctx->Rax = sctx->rax;
- ctx->Rcx = sctx->rcx;
- ctx->Rdx = sctx->rdx;
}
- /* TODO: Find right place to free this in stack overflow case */
- if (er->ExceptionCode != EXCEPTION_STACK_OVERFLOW)
- g_free (sctx);
-
return res;
}
guint8 *cfa;
guint32 unwind_info_len;
guint8 *unwind_info;
- guint8 *epilog;
+ guint8 *epilog = NULL;
frame->type = FRAME_TYPE_MANAGED;
printf ("%s %p %p\n", ji->d.method->name, ji->code_start, ip);
mono_print_unwind_info (unwind_info, unwind_info_len);
*/
- epilog = (guint8*)ji->code_start + ji->code_size - (ji->unwind_info >> 16);
+ /* LLVM compiled code doesn't have this info */
+ if (ji->has_arch_eh_info)
+ epilog = (guint8*)ji->code_start + ji->code_size - mono_jinfo_get_epilog_size (ji);
regs [AMD64_RAX] = new_ctx->rax;
regs [AMD64_RBX] = new_ctx->rbx;
mono_unwind_frame (unwind_info, unwind_info_len, ji->code_start,
(guint8*)ji->code_start + ji->code_size,
- ip, &epilog, regs, MONO_MAX_IREGS + 1,
+ ip, epilog ? &epilog : NULL, regs, MONO_MAX_IREGS + 1,
save_locations, MONO_MAX_IREGS, &cfa);
new_ctx->rax = regs [AMD64_RAX];
/* Adjust IP */
new_ctx->rip --;
-#ifndef MONO_AMD64_NO_PUSHES
- /* Pop arguments off the stack */
- if (ji->has_arch_eh_info)
- new_ctx->rsp += mono_jit_info_get_arch_eh_info (ji)->stack_size;
-#endif
-
return TRUE;
} else if (*lmf) {
guint64 rip;
ucontext_t *ctx = (ucontext_t*)sigctx;
return (gpointer)UCONTEXT_REG_RIP (ctx);
+#elif defined(HOST_WIN32)
+ return ((CONTEXT*)sigctx)->Rip;
#else
MonoContext *ctx = sigctx;
return (gpointer)ctx->rip;
#include "mini.h"
#include "mini-arm.h"
#include "mono/utils/mono-sigcontext.h"
+#include "mono/utils/mono-compiler.h"
/*
* arch_get_restore_context:
* This works around a gcc 4.5 bug:
* https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/721531
*/
-#if defined(__GNUC__)
-__attribute__((noinline))
-#endif
-static gpointer
+static MONO_NEVER_INLINE gpointer
get_handle_signal_exception_addr (void)
{
return handle_signal_exception;
#endif
#define W32_SEH_HANDLE_EX(_ex) \
- if (_ex##_handler) _ex##_handler(0, ep, sctx)
+ if (_ex##_handler) _ex##_handler(0, ep, ctx)
LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep)
{
{
EXCEPTION_RECORD* er;
CONTEXT* ctx;
- struct sigcontext* sctx;
LONG res;
MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
er = ep->ExceptionRecord;
ctx = ep->ContextRecord;
- sctx = g_malloc(sizeof(struct sigcontext));
-
- /* Copy Win32 context to UNIX style context */
- sctx->eax = ctx->Eax;
- sctx->ebx = ctx->Ebx;
- sctx->ecx = ctx->Ecx;
- sctx->edx = ctx->Edx;
- sctx->ebp = ctx->Ebp;
- sctx->esp = ctx->Esp;
- sctx->esi = ctx->Esi;
- sctx->edi = ctx->Edi;
- sctx->eip = ctx->Eip;
switch (er->ExceptionCode) {
case EXCEPTION_STACK_OVERFLOW:
- win32_handle_stack_overflow (ep, sctx);
+ win32_handle_stack_overflow (ep, ctx);
break;
case EXCEPTION_ACCESS_VIOLATION:
W32_SEH_HANDLE_EX(segv);
* can correctly chain the exception.
*/
res = EXCEPTION_CONTINUE_SEARCH;
- } else {
- /* Copy context back */
- ctx->Eax = sctx->eax;
- ctx->Ebx = sctx->ebx;
- ctx->Ecx = sctx->ecx;
- ctx->Edx = sctx->edx;
- ctx->Ebp = sctx->ebp;
- ctx->Esp = sctx->esp;
- ctx->Esi = sctx->esi;
- ctx->Edi = sctx->edi;
- ctx->Eip = sctx->eip;
}
- /* TODO: Find right place to free this in stack overflow case */
- if (er->ExceptionCode != EXCEPTION_STACK_OVERFLOW)
- g_free (sctx);
-
return res;
}
void win32_seh_cleanup()
{
- if (mono_old_win_toplevel_exception_filter) SetUnhandledExceptionFilter(mono_old_win_toplevel_exception_filter);
- RemoveVectoredExceptionHandler (seh_unhandled_exception_filter);
+ if (mono_old_win_toplevel_exception_filter)
+ SetUnhandledExceptionFilter(mono_old_win_toplevel_exception_filter);
+ RemoveVectoredExceptionHandler (mono_win_vectored_exception_handle);
}
void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler)
#if defined(__native_client__)
printf("WARNING: mono_arch_ip_from_context() called!\n");
return (NULL);
-#else
-#ifdef MONO_ARCH_USE_SIGACTION
+#elif defined(MONO_ARCH_USE_SIGACTION)
ucontext_t *ctx = (ucontext_t*)sigctx;
return (gpointer)UCONTEXT_REG_EIP (ctx);
+#elif defined(HOST_WIN32)
+ return ((CONTEXT*)sigctx)->Eip;
#else
struct sigcontext *ctx = sigctx;
return (gpointer)ctx->SC_EIP;
#endif
-#endif /* __native_client__ */
}
/*
// The tests use arrays to pass/receive values to keep the calling convention of the methods stable, which is a current limitation of the runtime support for gsharedvt.
//
+//
+// Interfaces are used to prevent the AOT compiler from discovering instantiations, thus forcing the usage of the gsharedvt
+// versions of methods. Unused vtype type arguments are used to test gsharedvt methods with ref type arguments, i.e.
+// when calling foo<T,T2> as foo<object,bool>, the gsharedvt version is used, but with a ref type argument.
+//
+
// FIXME: Add mixed ref/noref tests, i.e. Dictionary<string, int>
#if MOBILE
res = iface.Unbox<AnEnum, int> (AnEnum.One, 0, AnEnum.Two);
if (res != AnEnum.Two)
return 2;
+ int res2 = iface.Unbox<int, AnEnum> (0, AnEnum.One, AnEnum.Two);
+ if (res2 != 1)
+ return 3;
return 0;
}
return 0;
}
+ public interface IFace1<T> {
+ void m1 ();
+ void m2 ();
+ void m3 ();
+ void m4 ();
+ void m5 ();
+ }
+
+ public class ClassIFace<T> : IFace1<T> {
+ public void m1 () {
+ }
+ public void m2 () {
+ }
+ public void m3 () {
+ }
+ public void m4 () {
+ }
+ public void m5 () {
+ }
+ }
+
+ interface IFaceIFaceCall {
+ void call<T, T2> (IFace1<object> iface);
+ }
+
+ class MakeIFaceCall : IFaceIFaceCall {
+ public void call<T, T2> (IFace1<object> iface) {
+ iface.m1 ();
+ }
+ }
+
+ // Check normal interface calls from gsharedvt call to fully instantiated methods
+ public static int test_0_instatiated_iface_call () {
+ ClassIFace<object> c1 = new ClassIFace<object> ();
+
+ IFaceIFaceCall c = new MakeIFaceCall ();
+
+ c.call<object, int> (c1);
+ return 0;
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
static string to_string<T, T2>(T t, T2 t2) {
return t.ToString ();
return 0;
}
- struct Pair<T1, T2> {
+ interface IConstrainedCalls {
+ Pair<int, int> vtype_ret<T, T2>(T t, T2 t2) where T: IReturnVType;
+ }
+
+ public interface IReturnVType {
+ Pair<int, int> return_vtype ();
+ }
+
+ public class CConstrainedCalls : IConstrainedCalls {
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public Pair<int, int> vtype_ret<T, T2>(T t, T2 t2) where T : IReturnVType {
+ return t.return_vtype ();
+ }
+ }
+
+ class ReturnVType : IReturnVType {
+ public Pair<int, int> return_vtype () {
+ return new Pair<int, int> () { First = 1, Second = 2 };
+ }
+ }
+
+ public static int test_0_constrained_vtype_ret () {
+ IConstrainedCalls c = new CConstrainedCalls ();
+ var r = c.vtype_ret<ReturnVType, int> (new ReturnVType (), 1);
+ if (r.First != 1 || r.Second != 2)
+ return 1;
+ return 0;
+ }
+
+ public struct Pair<T1, T2> {
public T1 First;
public T2 Second;
}
return action(null, state);
}
+ [Category ("!FULLAOT")]
public static int test_0_delegate_wrappers () {
Func<object, Pair<int, int>, Pair<int, int>> del1 = delegate (object o, Pair<int, int> p) { return p; };
Func<object, Pair<int, int>, Pair<int, int>> del2 = delegate (object o, Pair<int, int> p) { return p; };
var c = new ReadOnlyCollection<AnEnum> (arr);
return c.Contains (AnEnum.Two) == false ? 0 : 1;
}
+
+ interface IFaceCallPatching {
+ bool caller<T, T2> ();
+ }
+
+ class CallPatching2<T> {
+ T t;
+ public object o;
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public bool callee () {
+ return (string)o == "ABC";
+ }
+ }
+
+ class CallPatching : IFaceCallPatching {
+ public bool caller<T, T2> () {
+ var c = new CallPatching2<T> ();
+ c.o = "ABC";
+ return c.callee ();
+ }
+ }
+
+ //
+ // This tests that generic calls made from gsharedvt methods are not patched normally.
+ // If they are, the first call to 'caller' would patch in the gshared version of
+ // 'callee', causing the second call to fail because the gshared version of callee
+ // wouldn't work with CallPatching2<bool> since it has a different object layout.
+ //
+ public static int test_0_call_patching () {
+ IFaceCallPatching c = new CallPatching ();
+ c.caller<object, bool> ();
+ if (!c.caller<bool, bool> ())
+ return 1;
+ return 0;
+ }
}
// #13191
#endif
#include "jit-icalls.h"
-
+#include <mono/utils/mono-error-internals.h>
void*
mono_ldftn (MonoMethod *method)
{
MonoObject*
mono_helper_newobj_mscorlib (guint32 idx)
{
- MonoClass *klass = mono_class_get (mono_defaults.corlib, MONO_TOKEN_TYPE_DEF | idx);
-
- g_assert (klass);
+ MonoError error;
+ MonoClass *klass = mono_class_get_checked (mono_defaults.corlib, MONO_TOKEN_TYPE_DEF | idx, &error);
+ mono_error_raise_exception (&error);
return mono_object_new (mono_domain_get (), klass);
}
mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass)
{
MonoJitTlsData *jit_tls = NULL;
+ MonoClass *oklass;
if (mini_get_debug_options ()->better_cast_details) {
jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
if (!obj)
return NULL;
- if (klass->enumtype && obj->vtable->klass == klass->element_class)
+ oklass = obj->vtable->klass;
+ if ((klass->enumtype && oklass == klass->element_class) || (oklass->enumtype && klass == oklass->element_class))
return obj;
if (mono_object_isinst (obj, klass))
return obj;
if (mini_get_debug_options ()->better_cast_details) {
- jit_tls->class_cast_from = obj->vtable->klass;
+ jit_tls->class_cast_from = oklass;
jit_tls->class_cast_to = klass;
}
* Returns NULL and set the cfg exception on error.
*/
static G_GNUC_UNUSED MonoInst*
-handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, MonoMethod *method, int context_used)
+handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, MonoMethod *method, int context_used, gboolean virtual)
{
MonoInst *ptr;
int dreg;
- MonoDelegateTrampInfo *trampoline;
+ gpointer trampoline;
MonoInst *obj, *method_ins, *tramp_ins;
MonoDomain *domain;
guint8 **code_slot;
+
+ // FIXME reenable optimisation for virtual case
+ if (virtual)
+ return NULL;
+
+ if (virtual) {
+ MonoMethod *invoke = mono_get_delegate_invoke (klass);
+ g_assert (invoke);
+
+ if (!mono_get_delegate_virtual_invoke_impl (mono_method_signature (invoke), context_used ? NULL : method))
+ return NULL;
+ }
obj = handle_alloc (cfg, klass, FALSE, 0);
if (!obj)
/* Set method field */
method_ins = emit_get_rgctx_method (cfg, context_used, method, MONO_RGCTX_INFO_METHOD);
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, method), method_ins->dreg);
+
/*
* To avoid looking up the compiled code belonging to the target method
* in mono_delegate_trampoline (), we allocate a per-domain memory slot to
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, method_code), code_slot_ins->dreg);
}
- /* Set invoke_impl field */
if (cfg->compile_aot) {
- MonoClassMethodPair *del_tramp;
+ MonoDelegateClassMethodPair *del_tramp;
- del_tramp = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoClassMethodPair));
+ del_tramp = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoDelegateClassMethodPair));
del_tramp->klass = klass;
del_tramp->method = context_used ? NULL : method;
+ del_tramp->virtual = virtual;
EMIT_NEW_AOTCONST (cfg, tramp_ins, MONO_PATCH_INFO_DELEGATE_TRAMPOLINE, del_tramp);
} else {
- trampoline = mono_create_delegate_trampoline_info (cfg->domain, klass, context_used ? NULL : method);
+ if (virtual)
+ trampoline = mono_create_delegate_virtual_trampoline (cfg->domain, klass, context_used ? NULL : method);
+ else
+ trampoline = mono_create_delegate_trampoline_info (cfg->domain, klass, context_used ? NULL : method);
EMIT_NEW_PCONST (cfg, tramp_ins, trampoline);
}
- dreg = alloc_preg (cfg);
- MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, tramp_ins->dreg, MONO_STRUCT_OFFSET (MonoDelegateTrampInfo, invoke_impl));
- MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, invoke_impl), dreg);
+ /* Set invoke_impl field */
+ if (virtual) {
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, invoke_impl), tramp_ins->dreg);
+ } else {
+ dreg = alloc_preg (cfg);
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, tramp_ins->dreg, MONO_STRUCT_OFFSET (MonoDelegateTrampInfo, invoke_impl));
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, invoke_impl), dreg);
- dreg = alloc_preg (cfg);
- MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, tramp_ins->dreg, MONO_STRUCT_OFFSET (MonoDelegateTrampInfo, method_ptr));
- MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr), dreg);
+ dreg = alloc_preg (cfg);
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, tramp_ins->dreg, MONO_STRUCT_OFFSET (MonoDelegateTrampInfo, method_ptr));
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, obj->dreg, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr), dreg);
+ }
/* All the checks which are in mono_delegate_ctor () are done by the delegate trampoline */
static inline MonoClass*
mini_get_class (MonoMethod *method, guint32 token, MonoGenericContext *context)
{
+ MonoError error;
MonoClass *klass;
if (method->wrapper_type != MONO_WRAPPER_NONE) {
if (context)
klass = mono_class_inflate_generic_class (klass, context);
} else {
- klass = mono_class_get_full (method->klass->image, token, context);
+ klass = mono_class_get_and_inflate_typespec_checked (method->klass->image, token, context, &error);
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
}
if (klass)
mono_class_init (klass);
} else if (cmethod->klass->image != mono_defaults.corlib && !(cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) && !cmethod->klass->valuetype) {
/* 'The type parameter is instantiated as a reference type' case below. */
} else if (((cmethod->klass == mono_defaults.object_class) || (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) || (!cmethod->klass->valuetype && cmethod->klass->image != mono_defaults.corlib)) &&
- (MONO_TYPE_IS_VOID (fsig->ret) || MONO_TYPE_IS_PRIMITIVE (fsig->ret) || MONO_TYPE_IS_REFERENCE (fsig->ret) || mini_is_gsharedvt_type (cfg, fsig->ret)) &&
+ (MONO_TYPE_IS_VOID (fsig->ret) || MONO_TYPE_IS_PRIMITIVE (fsig->ret) || MONO_TYPE_IS_REFERENCE (fsig->ret) || MONO_TYPE_ISSTRUCT (fsig->ret) || mini_is_gsharedvt_type (cfg, fsig->ret)) &&
(fsig->param_count == 0 || (!fsig->hasthis && fsig->param_count == 1) || (fsig->param_count == 1 && (MONO_TYPE_IS_REFERENCE (fsig->params [0]) || mini_is_gsharedvt_type (cfg, fsig->params [0]))))) {
MonoInst *args [16];
if (mini_is_gsharedvt_type (cfg, fsig->ret)) {
ins = handle_unbox_gsharedvt (cfg, mono_class_from_mono_type (fsig->ret), ins, &bblock);
- } else if (MONO_TYPE_IS_PRIMITIVE (fsig->ret)) {
+ } else if (MONO_TYPE_IS_PRIMITIVE (fsig->ret) || MONO_TYPE_ISSTRUCT (fsig->ret)) {
MonoInst *add;
/* Unbox */
/*
* Making generic calls out of gsharedvt methods.
+ * This needs to be used for all generic calls, not just ones with a gsharedvt signature, to avoid
+ * patching gshared method addresses into a gsharedvt method.
*/
- if (cmethod && cfg->gsharedvt && mini_is_gsharedvt_signature (cfg, fsig)) {
+ if (cmethod && cfg->gsharedvt && (mini_is_gsharedvt_signature (cfg, fsig) || cmethod->is_inflated || cmethod->klass->generic_class)) {
MonoRgctxInfoType info_type;
if (virtual) {
cmethod, MONO_RGCTX_INFO_METHOD);
/* This is not needed, as the trampoline code will pass one, and it might be passed in the same reg as the imt arg */
vtable_arg = NULL;
+ } else if ((cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) && !imt_arg) {
+ /* This can happen when we call a fully instantiated iface method */
+ imt_arg = emit_get_rgctx_method (cfg, context_used,
+ cmethod, MONO_RGCTX_INFO_METHOD);
+ vtable_arg = NULL;
}
}
}
/* Generic sharing */
- /* FIXME: only do this for generic methods if
- they are not shared! */
+
+ /*
+ * Use this if the callee is gsharedvt sharable too, since
+ * at runtime we might find an instantiation so the call cannot
+ * be patched (the 'no_patch' code path in mini-trampolines.c).
+ */
if (context_used && !imt_arg && !array_rank && !delegate_invoke &&
- (!mono_method_is_generic_sharable (cmethod, TRUE) ||
+ (!mono_method_is_generic_sharable_full (cmethod, TRUE, FALSE, FALSE) ||
!mono_class_generic_sharing_enabled (cmethod->klass)) &&
(!virtual || MONO_METHOD_IS_FINAL (cmethod) ||
!(cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL))) {
MONO_INST_NEW (cfg, ins, *ip);
--sp;
CHECK_OPSIZE (5);
- klass = mono_class_get_full (image, read32 (ip + 1), generic_context);
+ klass = mono_class_get_and_inflate_typespec_checked (image, read32 (ip + 1), generic_context, &error);
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
CHECK_TYPELOAD (klass);
mono_class_init (klass);
MONO_INST_NEW (cfg, ins, *ip);
--sp;
CHECK_OPSIZE (5);
- klass = mono_class_get_full (image, read32 (ip + 1), generic_context);
+ klass = mono_class_get_and_inflate_typespec_checked (image, read32 (ip + 1), generic_context, &error);
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
CHECK_TYPELOAD (klass);
mono_class_init (klass);
tclass, MONO_RGCTX_INFO_REFLECTION_TYPE);
} else if (cfg->compile_aot) {
if (method->wrapper_type) {
- if (mono_class_get (tclass->image, tclass->type_token) == tclass && !generic_context) {
+ mono_error_init (&error); //got to do it since there are multiple conditionals below
+ if (mono_class_get_checked (tclass->image, tclass->type_token, &error) == tclass && !generic_context) {
/* Special case for static synchronized wrappers */
EMIT_NEW_TYPE_FROM_HANDLE_CONST (cfg, ins, tclass->image, tclass->type_token, generic_context);
} else {
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
/* FIXME: n is not a normal token */
DISABLE_AOT (cfg);
EMIT_NEW_PCONST (cfg, ins, NULL);
break;
}
case CEE_MONO_JIT_ATTACH: {
- MonoInst *args [16];
- MonoInst *ad_ins, *lmf_ins;
- MonoBasicBlock *next_bb = NULL;
+ MonoInst *args [16], *domain_ins;
+ MonoInst *ad_ins, *jit_tls_ins;
+ MonoBasicBlock *next_bb = NULL, *call_bb = NULL;
cfg->orig_domain_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
EMIT_NEW_PCONST (cfg, ins, NULL);
MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->orig_domain_var->dreg, ins->dreg);
-#if TARGET_WIN32
- ad_ins = NULL;
- lmf_ins = NULL;
-#else
ad_ins = mono_get_domain_intrinsic (cfg);
- lmf_ins = mono_get_lmf_intrinsic (cfg);
-#endif
+ jit_tls_ins = mono_get_jit_tls_intrinsic (cfg);
- if (MONO_ARCH_HAVE_TLS_GET && ad_ins && lmf_ins) {
+ if (MONO_ARCH_HAVE_TLS_GET && ad_ins && jit_tls_ins) {
NEW_BBLOCK (cfg, next_bb);
+ NEW_BBLOCK (cfg, call_bb);
+ if (cfg->compile_aot) {
+ /* AOT code is only used in the root domain */
+ EMIT_NEW_PCONST (cfg, domain_ins, NULL);
+ } else {
+ EMIT_NEW_PCONST (cfg, domain_ins, cfg->domain);
+ }
MONO_ADD_INS (cfg->cbb, ad_ins);
- MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, ad_ins->dreg, 0);
- MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, next_bb);
+ MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, ad_ins->dreg, domain_ins->dreg);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, call_bb);
+
+ MONO_ADD_INS (cfg->cbb, jit_tls_ins);
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, jit_tls_ins->dreg, 0);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBEQ, call_bb);
- MONO_ADD_INS (cfg->cbb, lmf_ins);
- MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, lmf_ins->dreg, 0);
- MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, next_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, next_bb);
+ MONO_START_BB (cfg, call_bb);
}
if (cfg->compile_aot) {
ip += 6;
if (cfg->verbose_level > 3)
g_print ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
- if ((handle_ins = handle_delegate_ctor (cfg, ctor_method->klass, target_ins, cmethod, context_used))) {
+ if ((handle_ins = handle_delegate_ctor (cfg, ctor_method->klass, target_ins, cmethod, context_used, FALSE))) {
sp --;
*sp = handle_ins;
CHECK_CFG_EXCEPTION;
ensure_method_is_allowed_to_call_method (cfg, method, cmethod, bblock, ip);
}
+ /*
+ * Optimize the common case of ldvirtftn+delegate creation
+ */
+ if ((sp > stack_start) && (ip + 6 + 5 < end) && ip_in_bb (cfg, bblock, ip + 6) && (ip [6] == CEE_NEWOBJ) && (ip > header->code && ip [-1] == CEE_DUP)) {
+ MonoMethod *ctor_method = mini_get_method (cfg, method, read32 (ip + 7), NULL, generic_context);
+ if (ctor_method && (ctor_method->klass->parent == mono_defaults.multicastdelegate_class)) {
+ MonoInst *target_ins, *handle_ins;
+ MonoMethod *invoke;
+ int invoke_context_used;
+
+ invoke = mono_get_delegate_invoke (ctor_method->klass);
+ if (!invoke || !mono_method_signature (invoke))
+ LOAD_ERROR;
+
+ invoke_context_used = mini_method_check_context_used (cfg, invoke);
+
+ target_ins = sp [-1];
+
+ if (mono_security_core_clr_enabled ())
+ ensure_method_is_allowed_to_call_method (cfg, method, ctor_method, bblock, ip);
+
+#if defined(MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE)
+ /* FIXME: SGEN support */
+ if (invoke_context_used == 0) {
+ ip += 6;
+ if (cfg->verbose_level > 3)
+ g_print ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
+ if ((handle_ins = handle_delegate_ctor (cfg, ctor_method->klass, target_ins, cmethod, context_used, TRUE))) {
+ sp -= 2;
+ *sp = handle_ins;
+ CHECK_CFG_EXCEPTION;
+ ip += 5;
+ sp ++;
+ break;
+ }
+ ip -= 6;
+ }
+#endif
+ }
+ }
+
--sp;
args [0] = *sp;
guint32 val;
int ialign;
- GSHAREDVT_FAILURE (*ip);
-
CHECK_STACK_OVF (1);
CHECK_OPSIZE (6);
token = read32 (ip + 2);
if (mono_metadata_token_table (token) == MONO_TABLE_TYPESPEC && !image_is_dynamic (method->klass->image) && !generic_context) {
- MonoType *type = mono_type_create_from_typespec (image, token);
+ MonoType *type = mono_type_create_from_typespec_checked (image, token, &error);
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
+ if (!type)
+ UNVERIFIED;
+
val = mono_type_size (type, &ialign);
} else {
- MonoClass *klass = mono_class_get_full (image, token, generic_context);
+ MonoClass *klass = mono_class_get_and_inflate_typespec_checked (image, token, generic_context, &error);
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
CHECK_TYPELOAD (klass);
mono_class_init (klass);
val = mono_type_size (&klass->byval_arg, &ialign);
+
+ if (mini_is_gsharedvt_klass (cfg, klass))
+ GSHAREDVT_FAILURE (*ip);
}
EMIT_NEW_ICONST (cfg, ins, val);
*sp++= ins;
#endif
/* This mutex protects architecture specific caches */
-#define mono_mini_arch_lock() EnterCriticalSection (&mini_arch_mutex)
-#define mono_mini_arch_unlock() LeaveCriticalSection (&mini_arch_mutex)
-static CRITICAL_SECTION mini_arch_mutex;
+#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex)
+#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex)
+static mono_mutex_t mini_arch_mutex;
MonoBreakpointInfo
mono_breakpoint_info [MONO_BREAKPOINT_ARRAY_SIZE];
/* The size of the single step instruction causing the actual fault */
static int single_step_fault_size;
-#ifdef HOST_WIN32
-/* On Win64 always reserve first 32 bytes for first four arguments */
-#define ARGS_OFFSET 48
-#else
+/* Offset between fp and the first argument in the callee */
#define ARGS_OFFSET 16
-#endif
#define GP_SCRATCH_REG AMD64_R11
/*
gr = 0;
fr = 0;
+#ifdef HOST_WIN32
+ /* Reserve space where the callee can save the argument registers */
+ stack_size = 4 * sizeof (mgreg_t);
+#endif
+
/* return value */
{
ret_type = mini_type_get_underlying_type (gsctx, sig->ret);
add_valuetype (gsctx, sig, ainfo, sig->params [i], FALSE, &gr, &fr, &stack_size);
break;
case MONO_TYPE_U8:
+
case MONO_TYPE_I8:
add_general (&gr, &stack_size, ainfo);
break;
add_general (&gr, &stack_size, &cinfo->sig_cookie);
}
-#ifdef HOST_WIN32
- // There always is 32 bytes reserved on the stack when calling on Winx64
- stack_size += 0x20;
-#endif
-
-#ifndef MONO_AMD64_NO_PUSHES
- if (stack_size & 0x8) {
- /* The AMD64 ABI requires each stack frame to be 16 byte aligned */
- cinfo->need_stack_align = TRUE;
- stack_size += 8;
- }
-#endif
-
cinfo->stack_usage = stack_size;
cinfo->reg_usage = gr;
cinfo->freg_usage = fr;
{
int flags;
- InitializeCriticalSection (&mini_arch_mutex);
+ mono_mutex_init_recursive (&mini_arch_mutex);
#if defined(__native_client_codegen__)
mono_native_tls_alloc (&nacl_instruction_depth, NULL);
mono_native_tls_set_value (nacl_instruction_depth, (gpointer)0);
void
mono_arch_cleanup (void)
{
- DeleteCriticalSection (&mini_arch_mutex);
+ mono_mutex_destroy (&mini_arch_mutex);
#if defined(__native_client_codegen__)
mono_native_tls_free (nacl_instruction_depth);
mono_native_tls_free (nacl_rex_tag);
cfg->arch.omit_fp = FALSE;
#endif
-#ifdef HOST_WIN32
- cfg->arch.omit_fp = FALSE;
-#endif
-
if (cfg->disable_omit_fp)
cfg->arch.omit_fp = FALSE;
cfg->arch.ss_trigger_page_var = ins;
}
-#ifdef MONO_AMD64_NO_PUSHES
- /*
- * When this is set, we pass arguments on the stack by moves, and by allocating
- * a bigger stack frame, instead of pushes.
- * Pushes complicate exception handling because the arguments on the stack have
- * to be popped each time a frame is unwound. They also make fp elimination
- * impossible.
- * FIXME: This doesn't work inside filter/finally clauses, since those execute
- * on a new frame which doesn't include a param area.
- */
- cfg->arch.no_pushes = TRUE;
-#endif
-
if (cfg->method->save_lmf)
cfg->create_lmf_var = TRUE;
cfg->lmf_ir_mono_lmf = TRUE;
#endif
}
-
-#ifndef MONO_AMD64_NO_PUSHES
- cfg->arch_eh_jit_info = 1;
-#endif
}
static void
static void
emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo)
{
- MonoInst *arg;
MonoMethodSignature *tmp_sig;
int sig_reg;
sig_reg = mono_alloc_ireg (cfg);
MONO_EMIT_NEW_SIGNATURECONST (cfg, sig_reg, tmp_sig);
- if (cfg->arch.no_pushes) {
- MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, AMD64_RSP, cinfo->sig_cookie.offset, sig_reg);
- } else {
- MONO_INST_NEW (cfg, arg, OP_X86_PUSH);
- arg->sreg1 = sig_reg;
- MONO_ADD_INS (cfg->cbb, arg);
- }
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, AMD64_RSP, cinfo->sig_cookie.offset, sig_reg);
}
static inline LLVMArgStorage
return;
}
- if (cinfo->need_stack_align) {
- if (!cfg->arch.no_pushes)
- MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
- }
-
/*
* Emit all arguments which are passed on the stack to prevent register
* allocation problems.
*/
- if (cfg->arch.no_pushes) {
- for (i = 0; i < n; ++i) {
- MonoType *t;
- ainfo = cinfo->args + i;
+ for (i = 0; i < n; ++i) {
+ MonoType *t;
+ ainfo = cinfo->args + i;
- in = call->args [i];
+ in = call->args [i];
- if (sig->hasthis && i == 0)
- t = &mono_defaults.object_class->byval_arg;
- else
- t = sig->params [i - sig->hasthis];
+ if (sig->hasthis && i == 0)
+ t = &mono_defaults.object_class->byval_arg;
+ else
+ t = sig->params [i - sig->hasthis];
- if (ainfo->storage == ArgOnStack && !MONO_TYPE_ISSTRUCT (t) && !call->tail_call) {
- if (!t->byref) {
- if (t->type == MONO_TYPE_R4)
- MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER4_MEMBASE_REG, AMD64_RSP, ainfo->offset, in->dreg);
- else if (t->type == MONO_TYPE_R8)
- MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER8_MEMBASE_REG, AMD64_RSP, ainfo->offset, in->dreg);
- else
- MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, AMD64_RSP, ainfo->offset, in->dreg);
- } else {
+ if (ainfo->storage == ArgOnStack && !MONO_TYPE_ISSTRUCT (t) && !call->tail_call) {
+ if (!t->byref) {
+ if (t->type == MONO_TYPE_R4)
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER4_MEMBASE_REG, AMD64_RSP, ainfo->offset, in->dreg);
+ else if (t->type == MONO_TYPE_R8)
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER8_MEMBASE_REG, AMD64_RSP, ainfo->offset, in->dreg);
+ else
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, AMD64_RSP, ainfo->offset, in->dreg);
- }
- if (cfg->compute_gc_maps) {
- MonoInst *def;
+ } else {
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, AMD64_RSP, ainfo->offset, in->dreg);
+ }
+ if (cfg->compute_gc_maps) {
+ MonoInst *def;
- EMIT_NEW_GC_PARAM_SLOT_LIVENESS_DEF (cfg, def, ainfo->offset, t);
- }
+ EMIT_NEW_GC_PARAM_SLOT_LIVENESS_DEF (cfg, def, ainfo->offset, t);
}
}
}
arg->inst_p1 = mono_mempool_alloc (cfg->mempool, sizeof (ArgInfo));
memcpy (arg->inst_p1, ainfo, sizeof (ArgInfo));
- MONO_ADD_INS (cfg->cbb, arg);
- }
- } else {
- if (cfg->arch.no_pushes) {
- /* Already done */
- } else {
- MONO_INST_NEW (cfg, arg, OP_X86_PUSH);
- arg->sreg1 = in->dreg;
- if (!sig->params [i - sig->hasthis]->byref) {
- if (sig->params [i - sig->hasthis]->type == MONO_TYPE_R4) {
- MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
- arg->opcode = OP_STORER4_MEMBASE_REG;
- arg->inst_destbasereg = X86_ESP;
- arg->inst_offset = 0;
- } else if (sig->params [i - sig->hasthis]->type == MONO_TYPE_R8) {
- MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
- arg->opcode = OP_STORER8_MEMBASE_REG;
- arg->inst_destbasereg = X86_ESP;
- arg->inst_offset = 0;
- }
- }
MONO_ADD_INS (cfg->cbb, arg);
}
}
}
}
-#ifdef HOST_WIN32
- if (call->inst.opcode != OP_TAILCALL) {
- MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SUB_IMM, X86_ESP, X86_ESP, 0x20);
- }
-#endif
-
if (cfg->method->save_lmf) {
MONO_INST_NEW (cfg, arg, OP_AMD64_SAVE_SP_TO_LMF);
MONO_ADD_INS (cfg->cbb, arg);
MonoInst *vtaddr, *load;
vtaddr = mono_compile_create_var (cfg, &ins->klass->byval_arg, OP_LOCAL);
- g_assert (!cfg->arch.no_pushes);
-
MONO_INST_NEW (cfg, load, OP_LDADDR);
cfg->has_indirection = TRUE;
load->inst_p0 = vtaddr;
MONO_ADD_INS (cfg->cbb, arg);
mono_call_inst_add_outarg_reg (cfg, call, arg->dreg, ainfo->pair_regs [0], FALSE);
} else {
- MONO_INST_NEW (cfg, arg, OP_X86_PUSH);
- arg->sreg1 = load->dreg;
- MONO_ADD_INS (cfg->cbb, arg);
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, AMD64_RSP, ainfo->offset, load->dreg);
}
} else {
if (size == 8) {
- if (cfg->arch.no_pushes) {
- int dreg = mono_alloc_ireg (cfg);
+ int dreg = mono_alloc_ireg (cfg);
- MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, src->dreg, 0);
- MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, AMD64_RSP, ainfo->offset, dreg);
- } else {
- /* Can't use this for < 8 since it does an 8 byte memory load */
- MONO_INST_NEW (cfg, arg, OP_X86_PUSH_MEMBASE);
- arg->inst_basereg = src->dreg;
- arg->inst_offset = 0;
- MONO_ADD_INS (cfg->cbb, arg);
- }
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, dreg, src->dreg, 0);
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, AMD64_RSP, ainfo->offset, dreg);
} else if (size <= 40) {
- if (cfg->arch.no_pushes) {
- mini_emit_memcpy (cfg, AMD64_RSP, ainfo->offset, src->dreg, 0, size, 4);
- } else {
- MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SUB_IMM, X86_ESP, X86_ESP, ALIGN_TO (size, 8));
- mini_emit_memcpy (cfg, X86_ESP, 0, src->dreg, 0, size, 4);
- }
+ mini_emit_memcpy (cfg, AMD64_RSP, ainfo->offset, src->dreg, 0, size, 4);
} else {
- if (cfg->arch.no_pushes) {
- // FIXME: Code growth
- mini_emit_memcpy (cfg, AMD64_RSP, ainfo->offset, src->dreg, 0, size, 4);
- } else {
- MONO_INST_NEW (cfg, arg, OP_X86_PUSH_OBJ);
- arg->inst_basereg = src->dreg;
- arg->inst_offset = 0;
- arg->inst_imm = size;
- MONO_ADD_INS (cfg->cbb, arg);
- }
+ // FIXME: Code growth
+ mini_emit_memcpy (cfg, AMD64_RSP, ainfo->offset, src->dreg, 0, size, 4);
}
if (cfg->compute_gc_maps) {
amd64_alu_reg_reg (code, X86_XOR, AMD64_RAX, AMD64_RAX);
amd64_lea_membase (code, AMD64_RDI, AMD64_RSP, offset);
- if (cfg->param_area && cfg->arch.no_pushes)
+ if (cfg->param_area)
amd64_alu_reg_imm (code, X86_ADD, AMD64_RDI, cfg->param_area);
amd64_cld (code);
#if defined(__default_codegen__)
code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, call->fptr, FALSE);
ins->flags |= MONO_INST_GC_CALLSITE;
ins->backend.pc_offset = code - cfg->native_code;
- if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention) && !cfg->arch.no_pushes)
- amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, call->stack_usage);
code = emit_move_return_value (cfg, ins, code);
break;
case OP_FCALL_REG:
amd64_call_reg (code, ins->sreg1);
ins->flags |= MONO_INST_GC_CALLSITE;
ins->backend.pc_offset = code - cfg->native_code;
- if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention) && !cfg->arch.no_pushes)
- amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, call->stack_usage);
code = emit_move_return_value (cfg, ins, code);
break;
case OP_FCALL_MEMBASE:
amd64_call_membase (code, ins->sreg1, ins->inst_offset);
ins->flags |= MONO_INST_GC_CALLSITE;
ins->backend.pc_offset = code - cfg->native_code;
- if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention) && !cfg->arch.no_pushes)
- amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, call->stack_usage);
code = emit_move_return_value (cfg, ins, code);
break;
case OP_DYN_CALL: {
break;
}
case OP_X86_PUSH:
- g_assert (!cfg->arch.no_pushes);
+ g_assert_not_reached ();
amd64_push_reg (code, ins->sreg1);
break;
case OP_X86_PUSH_IMM:
- g_assert (!cfg->arch.no_pushes);
+ g_assert_not_reached ();
g_assert (amd64_is_imm32 (ins->inst_imm));
amd64_push_imm (code, ins->inst_imm);
break;
case OP_X86_PUSH_MEMBASE:
- g_assert (!cfg->arch.no_pushes);
+ g_assert_not_reached ();
amd64_push_membase (code, ins->inst_basereg, ins->inst_offset);
break;
case OP_X86_PUSH_OBJ: {
int size = ALIGN_TO (ins->inst_imm, 8);
- g_assert (!cfg->arch.no_pushes);
+ g_assert_not_reached ();
amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, size);
amd64_push_reg (code, AMD64_RDI);
amd64_alu_reg_imm (code, X86_AND, ins->sreg1, ~(MONO_ARCH_FRAME_ALIGNMENT - 1));
code = mono_emit_stack_alloc (cfg, code, ins);
amd64_mov_reg_reg (code, ins->dreg, AMD64_RSP, 8);
- if (cfg->param_area && cfg->arch.no_pushes)
+ if (cfg->param_area)
amd64_alu_reg_imm (code, X86_ADD, ins->dreg, cfg->param_area);
break;
case OP_LOCALLOC_IMM: {
amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, size);
amd64_mov_reg_reg (code, ins->dreg, AMD64_RSP, 8);
}
- if (cfg->param_area && cfg->arch.no_pushes)
+ if (cfg->param_area)
amd64_alu_reg_imm (code, X86_ADD, ins->dreg, cfg->param_area);
break;
}
if ((MONO_BBLOCK_IS_IN_REGION (bb, MONO_REGION_FINALLY) ||
MONO_BBLOCK_IS_IN_REGION (bb, MONO_REGION_FINALLY)) &&
- cfg->param_area && cfg->arch.no_pushes) {
+ cfg->param_area) {
amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, ALIGN_TO (cfg->param_area, MONO_ARCH_FRAME_ALIGNMENT));
}
break;
/* The param area is always at offset 0 from sp */
/* This needs to be allocated here, since it has to come after the spill area */
- if (cfg->arch.no_pushes && cfg->param_area) {
+ if (cfg->param_area) {
if (cfg->arch.omit_fp)
// FIXME:
g_assert_not_reached ();
return start;
}
+
+gpointer
+mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
+{
+ guint8 *code, *start;
+ int size = 20;
+
+ start = code = mono_global_codeman_reserve (size);
+
+ /* Replace the this argument with the target */
+ amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8);
+ amd64_mov_reg_membase (code, AMD64_ARG_REG1, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 8);
+
+ if (load_imt_reg) {
+ /* Load the IMT reg */
+ amd64_mov_reg_membase (code, MONO_ARCH_IMT_REG, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 8);
+ }
+
+ /* Load the vtable */
+ amd64_mov_reg_membase (code, AMD64_RAX, AMD64_ARG_REG1, MONO_STRUCT_OFFSET (MonoObject, vtable), 8);
+ amd64_jump_membase (code, AMD64_RAX, offset);
+
+ return start;
+}
+
void
mono_arch_finish_init (void)
{
mono_arch_is_breakpoint_event (void *info, void *sigctx)
{
#ifdef HOST_WIN32
- EXCEPTION_RECORD* einfo = (EXCEPTION_RECORD*)info;
- return FALSE;
+ EXCEPTION_RECORD* einfo = ((EXCEPTION_POINTERS*)info)->ExceptionRecord;
+ if (einfo->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && (gpointer)einfo->ExceptionInformation [1] == bp_trigger_page)
+ return TRUE;
+ else
+ return FALSE;
#else
siginfo_t* sinfo = (siginfo_t*) info;
/* Sometimes the address is off by 4 */
mono_arch_is_single_step_event (void *info, void *sigctx)
{
#ifdef HOST_WIN32
- EXCEPTION_RECORD* einfo = (EXCEPTION_RECORD*)info;
- return FALSE;
+ EXCEPTION_RECORD* einfo = ((EXCEPTION_POINTERS*)info)->ExceptionRecord;
+ if (einfo->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && (gpointer)einfo->ExceptionInformation [1] == ss_trigger_page)
+ return TRUE;
+ else
+ return FALSE;
#else
siginfo_t* sinfo = (siginfo_t*) info;
/* Sometimes the address is off by 4 */
#include <signal.h>
#endif
-
+#if !defined(_MSC_VER)
/* sigcontext surrogate */
struct sigcontext {
guint64 eax;
guint64 edi;
guint64 eip;
};
+#endif
typedef void (* MonoW32ExceptionHandler) (int _dummy, EXCEPTION_POINTERS *info, void *context);
void win32_seh_init(void);
gint32 stack_alloc_size;
gint32 sp_fp_offset;
guint32 saved_iregs;
- gboolean omit_fp, omit_fp_computed, no_pushes;
+ gboolean omit_fp, omit_fp_computed;
gpointer cinfo;
gint32 async_point_count;
gpointer vret_addr_loc;
#define MONO_ARCH_NOMAP32BIT
-#elif defined (__FreeBSD__)
+#elif defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
#define REG_RAX 7
#define REG_RCX 4
#ifdef HOST_WIN32
#define MONO_AMD64_ARG_REG1 AMD64_RCX
#define MONO_AMD64_ARG_REG2 AMD64_RDX
+#define MONO_AMD64_ARG_REG3 AMD64_R8
#else
#define MONO_AMD64_ARG_REG1 AMD64_RDI
#define MONO_AMD64_ARG_REG2 AMD64_RSI
+#define MONO_AMD64_ARG_REG3 AMD64_RDX
#endif
#define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
#define MONO_ARCH_HAVE_LIVERANGE_OPS 1
#define MONO_ARCH_HAVE_XP_UNWIND 1
#define MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX 1
-#if !defined(HOST_WIN32)
#define MONO_ARCH_MONITOR_OBJECT_REG MONO_AMD64_ARG_REG1
-#endif
#define MONO_ARCH_HAVE_GET_TRAMPOLINES 1
#define MONO_ARCH_AOT_SUPPORTED 1
-#if !defined( HOST_WIN32 ) && !defined( __native_client__ )
+#if !defined( __native_client__ )
#define MONO_ARCH_SOFT_DEBUG_SUPPORTED 1
#endif
-#if !defined(HOST_WIN32) || defined(__sun)
#define MONO_ARCH_ENABLE_MONITOR_IL_FASTPATH 1
-#endif
#define MONO_ARCH_SUPPORT_TASKLETS 1
-#ifndef HOST_WIN32
-#define MONO_AMD64_NO_PUSHES 1
-#endif
-
#define MONO_ARCH_GSHARED_SUPPORTED 1
#define MONO_ARCH_DYN_CALL_SUPPORTED 1
#define MONO_ARCH_DYN_CALL_PARAM_AREA 0
#endif
/* This mutex protects architecture specific caches */
-#define mono_mini_arch_lock() EnterCriticalSection (&mini_arch_mutex)
-#define mono_mini_arch_unlock() LeaveCriticalSection (&mini_arch_mutex)
-static CRITICAL_SECTION mini_arch_mutex;
+#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex)
+#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex)
+static mono_mutex_t mini_arch_mutex;
static gboolean v5_supported = FALSE;
static gboolean v6_supported = FALSE;
case OP_FCALL_REG:
case OP_FCALL_MEMBASE:
if (IS_VFP) {
- if (((MonoCallInst*)ins)->signature->ret->type == MONO_TYPE_R4) {
+ MonoType *sig_ret = mini_type_get_underlying_type (NULL, ((MonoCallInst*)ins)->signature->ret);
+ if (sig_ret->type == MONO_TYPE_R4) {
if (IS_HARD_FLOAT) {
ARM_CVTS (code, ins->dreg, ARM_VFP_F0);
} else {
return NULL;
}
+gpointer
+mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
+{
+ return NULL;
+}
+
gpointer
mono_arch_get_this_arg_from_call (mgreg_t *regs, guint8 *code)
{
{
const char *cpu_arch;
- InitializeCriticalSection (&mini_arch_mutex);
+ mono_mutex_init_recursive (&mini_arch_mutex);
#ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
if (mini_get_debug_options ()->soft_breakpoints) {
single_step_func_wrapper = create_function_wrapper (debugger_agent_single_step_from_context);
*/
float_arg->flags |= MONO_INST_VOLATILE;
- MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, float_arg->dreg, in->dreg);
+ MONO_EMIT_NEW_UNALU (cfg, OP_FMOVE, float_arg->dreg, in->dreg);
/* We use the dreg to look up the instruction later. The hreg is used to
* emit the instruction that loads the value into the FP reg.
if (t->byref)
continue;
+ t = mini_replace_type (t);
+
switch (t->type) {
case MONO_TYPE_R4:
case MONO_TYPE_R8:
code = mono_arm_emit_vfp_scratch_restore (cfg, code, vfp_scratch1);
break;
- case OP_SETFRET:
- if (mono_method_signature (cfg->method)->ret->type == MONO_TYPE_R4) {
+ case OP_SETFRET: {
+ MonoType *sig_ret = mini_type_get_underlying_type (NULL, mono_method_signature (cfg->method)->ret);
+ if (sig_ret->type == MONO_TYPE_R4) {
ARM_CVTD (code, ARM_VFP_F0, ins->sreg1);
if (!IS_HARD_FLOAT) {
}
}
break;
+ }
case OP_FCONV_TO_I1:
code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, TRUE);
break;
if (ji->from_aot)
return mono_aot_get_unwind_info (ji, unwind_info_len);
else
- /* The upper 16 bits of ji->unwind_info might contain the epilog offset */
- return mono_get_cached_unwind_info (ji->unwind_info & 0xffff, unwind_info_len);
+ return mono_get_cached_unwind_info (ji->unwind_info, unwind_info_len);
+}
+
+int
+mono_jinfo_get_epilog_size (MonoJitInfo *ji)
+{
+ MonoArchEHJitInfo *info;
+
+ info = mono_jit_info_get_arch_eh_info (ji);
+ g_assert (info);
+
+ return info->epilog_size;
}
static int callee_saved_regs [] = { };
#elif defined(TARGET_S390X)
static int callee_saved_regs [] = { s390_r6, s390_r7, s390_r8, s390_r9, s390_r10, s390_r11, s390_r12, s390_r13, s390_r14 };
+#elif defined(TARGET_POWERPC)
+static int callee_saved_regs [] = { ppc_r6, ppc_r7, ppc_r8, ppc_r9, ppc_r10, ppc_r11, ppc_r12, ppc_r13, ppc_r14 };
#endif
static guint32
gboolean
mini_type_is_vtype (MonoCompile *cfg, MonoType *t)
{
- return MONO_TYPE_ISSTRUCT (t) || mini_is_gsharedvt_variable_type (cfg, t);
+ t = mini_native_type_replace_type (t);
+
+ return MONO_TYPE_ISSTRUCT (t) || mini_is_gsharedvt_variable_type (cfg, t);
}
gboolean
return NULL;
}
+gpointer
+mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
+{
+ return NULL;
+}
+
MonoInst*
mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
{
TargetOptions opts;
opts.JITExceptionHandling = 1;
+#if LLVM_API_VERSION >= 2
+ StringRef cpu_name = sys::getHostCPUName ();
+
+ // EngineBuilder no longer has a copy assignment operator (?)
+ std::unique_ptr<Module> Owner(unwrap(MP));
+ EngineBuilder b (std::move(Owner));
+ EngineBuilder &eb = b;
+#ifdef TARGET_AMD64
+ ExecutionEngine *EE = b.setJITMemoryManager (mono_mm).setTargetOptions (opts).setAllocateGVsWithCode (true).setMCPU (cpu_name).setCodeModel (CodeModel::Large).create ();
+#else
+ ExecutionEngine *EE = b.setJITMemoryManager (mono_mm).setTargetOptions (opts).setAllocateGVsWithCode (true).setMCPU (cpu_name).create ();
+#endif
+
+#else
+
EngineBuilder b (unwrap (MP));
EngineBuilder &eb = b;
eb = eb.setJITMemoryManager (mono_mm).setTargetOptions (opts).setAllocateGVsWithCode (true);
#endif
ExecutionEngine *EE = eb.create ();
+#endif
+
g_assert (EE);
mono_ee->EE = EE;
index = LLVMConstInt (LLVMInt32Type (), ins->inst_offset / size, FALSE);
addr = LLVMBuildGEP (builder, convert (ctx, values [ins->inst_destbasereg], LLVMPointerType (t, 0)), &index, 1, "");
}
- emit_store (ctx, bb, &builder, size, convert (ctx, LLVMConstInt (IntPtrType (), ins->inst_imm, FALSE), t), addr, is_volatile);
+ emit_store (ctx, bb, &builder, size, convert (ctx, LLVMConstInt (IntPtrType (), ins->inst_imm, FALSE), t), convert (ctx, addr, LLVMPointerType (t, 0)), is_volatile);
break;
}
};
/* This mutex protects architecture specific caches */
-#define mono_mini_arch_lock() EnterCriticalSection (&mini_arch_mutex)
-#define mono_mini_arch_unlock() LeaveCriticalSection (&mini_arch_mutex)
-static CRITICAL_SECTION mini_arch_mutex;
+#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex)
+#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex)
+static mono_mutex_t mini_arch_mutex;
int mono_exc_esp_offset = 0;
static int tls_mode = TLS_MODE_DETECT;
return NULL;
}
+gpointer
+mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
+{
+ return NULL;
+}
+
gpointer
mono_arch_get_this_arg_from_call (mgreg_t *regs, guint8 *code)
{
void
mono_arch_init (void)
{
- InitializeCriticalSection (&mini_arch_mutex);
+ mono_mutex_init_recursive (&mini_arch_mutex);
ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
void
mono_arch_cleanup (void)
{
- DeleteCriticalSection (&mini_arch_mutex);
+ mono_mutex_destroy (&mini_arch_mutex);
}
/*
#define BREAKPOINT_SIZE (PPC_LOAD_SEQUENCE_LENGTH + 4)
/* This mutex protects architecture specific caches */
-#define mono_mini_arch_lock() EnterCriticalSection (&mini_arch_mutex)
-#define mono_mini_arch_unlock() LeaveCriticalSection (&mini_arch_mutex)
-static CRITICAL_SECTION mini_arch_mutex;
+#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex)
+#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex)
+static mono_mutex_t mini_arch_mutex;
int mono_exc_esp_offset = 0;
static int tls_mode = TLS_MODE_DETECT;
return start;
}
+gpointer
+mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
+{
+ return NULL;
+}
+
gpointer
mono_arch_get_this_arg_from_call (mgreg_t *regs, guint8 *code)
{
if (mono_cpu_count () > 1)
cpu_hw_caps |= PPC_SMP_CAPABLE;
- InitializeCriticalSection (&mini_arch_mutex);
+ mono_mutex_init_recursive (&mini_arch_mutex);
ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
void
mono_arch_cleanup (void)
{
- DeleteCriticalSection (&mini_arch_mutex);
+ mono_mutex_destroy (&mini_arch_mutex);
}
/*
#define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
#define MONO_ARCH_EMULATE_FREM 1
#define MONO_ARCH_BIGMUL_INTRINS 1
+#define MONO_ARCH_GC_MAPS_SUPPORTED 1
/* Parameters used by the register allocator */
#define MONO_ARCH_CALLEE_REGS ((0xff << ppc_r3) | (1 << ppc_r11) | (1 << ppc_r12))
#define JUMP_SIZE 6
#define ENABLE_WRONG_METHOD_CHECK 0
-#define mono_mini_arch_lock() EnterCriticalSection (&mini_arch_mutex)
-#define mono_mini_arch_unlock() LeaveCriticalSection (&mini_arch_mutex)
+#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex)
+#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex)
/*========================= End of Defines =========================*/
breakpoint_t breakpointCode;
-static CRITICAL_SECTION mini_arch_mutex;
+static mono_mutex_t mini_arch_mutex;
/*====================== End of Global Variables ===================*/
{
guint8 *code;
- InitializeCriticalSection (&mini_arch_mutex);
+ mono_mutex_init_recursive (&mini_arch_mutex);
ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ);
bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ);
mono_vfree (ss_trigger_page, mono_pagesize ());
if (bp_trigger_page)
mono_vfree (bp_trigger_page, mono_pagesize ());
- DeleteCriticalSection (&mini_arch_mutex);
+ mono_mutex_destroy (&mini_arch_mutex);
}
/*========================= End of Function ========================*/
/*========================= End of Function ========================*/
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_get_delegate_virtual_invoke_impl. */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
+{
+ return NULL;
+}
+
+/*========================= End of Function ========================*/
+
/*------------------------------------------------------------------*/
/* */
/* Name - mono_arch_build_imt_thunk. */
}
- jit_tls = pthread_getspecific (mono_get_jit_tls_key ());
+ jit_tls = mono_get_jit_tls ();
#ifdef MONO_SPARC_THR_TLS
thr_setspecific (lmf_addr_key, &jit_tls->lmf);
#include <mono/utils/mono-counters.h>
#include <mono/utils/mono-error-internals.h>
#include <mono/utils/mono-membar.h>
+#include <mono/utils/mono-compiler.h>
#include "mini.h"
static GHashTable *rgctx_lazy_fetch_trampoline_hash_addr;
static guint32 trampoline_calls, jit_trampolines, unbox_trampolines, static_rgctx_trampolines;
-#define mono_trampolines_lock() EnterCriticalSection (&trampolines_mutex)
-#define mono_trampolines_unlock() LeaveCriticalSection (&trampolines_mutex)
-static CRITICAL_SECTION trampolines_mutex;
+#define mono_trampolines_lock() mono_mutex_lock (&trampolines_mutex)
+#define mono_trampolines_unlock() mono_mutex_unlock (&trampolines_mutex)
+static mono_mutex_t trampolines_mutex;
#ifdef MONO_ARCH_GSHARED_SUPPORTED
/*
* Either IMPL_METHOD or AOT_ADDR will be set on return.
- */
-static gpointer*
-#ifdef __GNUC__
-/*
+ *
+ * MONO_NEVER_INLINE :
* This works against problems when compiling with gcc 4.6 on arm. The 'then' part of
* this line gets executed, even when the condition is false:
* if (impl && mono_method_needs_static_rgctx_invoke (impl, FALSE))
* *need_rgctx_tramp = TRUE;
*/
-__attribute__ ((noinline))
-#endif
- mono_convert_imt_slot_to_vtable_slot (gpointer* slot, mgreg_t *regs, guint8 *code, MonoMethod *method, gboolean lookup_aot, MonoMethod **impl_method, gboolean *need_rgctx_tramp, gboolean *variance_used, gpointer *aot_addr)
+static MONO_NEVER_INLINE gpointer*
+mono_convert_imt_slot_to_vtable_slot (gpointer* slot, mgreg_t *regs, guint8 *code, MonoMethod *method, gboolean lookup_aot, MonoMethod **impl_method, gboolean *need_rgctx_tramp, gboolean *variance_used, gpointer *aot_addr)
{
MonoObject *this_argument = mono_arch_get_this_arg_from_call (regs, code);
MonoVTable *vt = this_argument->vtable;
invoke = mono_get_delegate_invoke (klass);
g_assert (invoke);
- tramp_data = mono_domain_alloc (domain, sizeof (MonoDelegateTrampInfo));
+ tramp_data = mono_domain_alloc0 (domain, sizeof (MonoDelegateTrampInfo));
tramp_data->invoke = invoke;
tramp_data->invoke_sig = mono_method_signature (invoke);
tramp_data->impl_this = mono_arch_get_delegate_invoke_impl (mono_method_signature (invoke), TRUE);
void
mono_trampolines_init (void)
{
- InitializeCriticalSection (&trampolines_mutex);
+ mono_mutex_init_recursive (&trampolines_mutex);
if (mono_aot_only)
return;
if (rgctx_lazy_fetch_trampoline_hash_addr)
g_hash_table_destroy (rgctx_lazy_fetch_trampoline_hash_addr);
- DeleteCriticalSection (&trampolines_mutex);
+ mono_mutex_destroy (&trampolines_mutex);
}
guint8 *
#endif
}
+gpointer
+mono_create_delegate_virtual_trampoline (MonoDomain *domain, MonoClass *klass, MonoMethod *method)
+{
+#ifdef MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE
+ MonoMethod *invoke = mono_get_delegate_invoke (klass);
+ g_assert (invoke);
+
+ return mono_get_delegate_virtual_invoke_impl (mono_method_signature (invoke), method);
+#else
+ return NULL;
+#endif
+}
+
gpointer
mono_create_rgctx_lazy_fetch_trampoline (guint32 offset)
{
if (timeBeginPeriod (1) != TIMERR_NOERROR)
return;
- if ((win32_timer = timeSetEvent (1, 0, win32_time_proc, 0, TIME_PERIODIC)) == 0) {
+ if ((win32_timer = timeSetEvent (1, 0, (LPTIMECALLBACK)win32_time_proc, (DWORD_PTR)NULL, TIME_PERIODIC)) == 0) {
timeEndPeriod (1);
return;
}
gboolean
mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo *info)
{
- g_error ("Windows systems haven't been ported to support mono_thread_state_init_from_handle");
- return FALSE;
+ DWORD id = mono_thread_info_get_tid (info);
+ HANDLE handle;
+ CONTEXT context;
+ DWORD result;
+ MonoContext *ctx;
+ MonoJitTlsData *jit_tls;
+ void *domain;
+ MonoLMF *lmf = NULL;
+ gpointer *addr;
+
+ tctx->valid = FALSE;
+ tctx->unwind_data [MONO_UNWIND_DATA_DOMAIN] = NULL;
+ tctx->unwind_data [MONO_UNWIND_DATA_LMF] = NULL;
+ tctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS] = NULL;
+
+ g_assert (id != GetCurrentThreadId ());
+
+ handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
+ g_assert (handle);
+
+ context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL;
+
+ if (!GetThreadContext (handle, &context)) {
+ CloseHandle (handle);
+ return FALSE;
+ }
+
+ g_assert (context.ContextFlags & CONTEXT_INTEGER);
+ g_assert (context.ContextFlags & CONTEXT_CONTROL);
+
+ ctx = &tctx->ctx;
+
+ memset (ctx, 0, sizeof (MonoContext));
+ mono_sigctx_to_monoctx (&context, ctx);
+
+ /* mono_set_jit_tls () sets this */
+ jit_tls = mono_thread_info_tls_get (info, TLS_KEY_JIT_TLS);
+ /* SET_APPDOMAIN () sets this */
+ domain = mono_thread_info_tls_get (info, TLS_KEY_DOMAIN);
+
+ /*Thread already started to cleanup, can no longer capture unwind state*/
+ if (!jit_tls || !domain)
+ return FALSE;
+
+ /*
+ * The current LMF address is kept in a separate TLS variable, and its hard to read its value without
+ * arch-specific code. But the address of the TLS variable is stored in another TLS variable which
+ * can be accessed through MonoThreadInfo.
+ */
+ /* mono_set_lmf_addr () sets this */
+ addr = mono_thread_info_tls_get (info, TLS_KEY_LMF_ADDR);
+ if (addr)
+ lmf = *addr;
+
+ tctx->unwind_data [MONO_UNWIND_DATA_DOMAIN] = domain;
+ tctx->unwind_data [MONO_UNWIND_DATA_JIT_TLS] = jit_tls;
+ tctx->unwind_data [MONO_UNWIND_DATA_LMF] = lmf;
+ tctx->valid = TRUE;
+
+ return TRUE;
}
#endif
/* This mutex protects architecture specific caches */
-#define mono_mini_arch_lock() EnterCriticalSection (&mini_arch_mutex)
-#define mono_mini_arch_unlock() LeaveCriticalSection (&mini_arch_mutex)
-static CRITICAL_SECTION mini_arch_mutex;
+#define mono_mini_arch_lock() mono_mutex_lock (&mini_arch_mutex)
+#define mono_mini_arch_unlock() mono_mutex_unlock (&mini_arch_mutex)
+static mono_mutex_t mini_arch_mutex;
#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
void
mono_arch_init (void)
{
- InitializeCriticalSection (&mini_arch_mutex);
+ mono_mutex_init_recursive (&mini_arch_mutex);
ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ);
bp_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
mono_vfree (ss_trigger_page, mono_pagesize ());
if (bp_trigger_page)
mono_vfree (bp_trigger_page, mono_pagesize ());
- DeleteCriticalSection (&mini_arch_mutex);
+ mono_mutex_destroy (&mini_arch_mutex);
}
/*
return start;
}
+gpointer
+mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
+{
+ guint8 *code, *start;
+ int size = 24;
+
+ /*
+ * The stack contains:
+ * <delegate>
+ * <return addr>
+ */
+ start = code = mono_global_codeman_reserve (size);
+
+ /* Replace the this argument with the target */
+ x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4);
+ x86_mov_reg_membase (code, X86_ECX, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 4);
+ x86_mov_membase_reg (code, X86_ESP, 4, X86_ECX, 4);
+
+ if (load_imt_reg) {
+ /* Load the IMT reg */
+ x86_mov_reg_membase (code, MONO_ARCH_IMT_REG, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 4);
+ }
+
+ /* Load the vtable */
+ x86_mov_reg_membase (code, X86_EAX, X86_ECX, MONO_STRUCT_OFFSET (MonoObject, vtable), 4);
+ x86_jump_membase (code, X86_EAX, offset);
+
+ return start;
+}
+
mgreg_t
mono_arch_context_get_int_reg (MonoContext *ctx, int reg)
{
#endif /* __HAIKU__ */
#if defined( __linux__) || defined(__sun) || defined(__APPLE__) || defined(__NetBSD__) || \
- defined(__FreeBSD__) || defined(__OpenBSD__)
+ defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
#define MONO_ARCH_USE_SIGACTION
#endif
*/
gboolean mono_use_llvm = FALSE;
-#define mono_jit_lock() EnterCriticalSection (&jit_mutex)
-#define mono_jit_unlock() LeaveCriticalSection (&jit_mutex)
-static CRITICAL_SECTION jit_mutex;
+#define mono_jit_lock() mono_mutex_lock (&jit_mutex)
+#define mono_jit_unlock() mono_mutex_unlock (&jit_mutex)
+static mono_mutex_t jit_mutex;
static MonoCodeManager *global_codeman;
else {
int ialign;
- size = mono_type_size (t, &ialign);
+ size = mini_type_stack_size (NULL, t, &ialign);
align = ialign;
if (MONO_CLASS_IS_SIMD (cfg, mono_class_from_mono_type (t)))
} else {
int ialign;
- size = mono_type_size (t, &ialign);
+ size = mini_type_stack_size (NULL, t, &ialign);
align = ialign;
if (mono_class_from_mono_type (t)->exception_type)
#endif
#endif
-MonoNativeTlsKey
-mono_get_jit_tls_key (void)
-{
- return mono_jit_tls_id;
-}
-
gint32
mono_get_jit_tls_offset (void)
{
int offset;
+
+#ifdef HOST_WIN32
+ if (mono_jit_tls_id)
+ offset = mono_jit_tls_id;
+ else
+ /* FIXME: Happens during startup */
+ offset = -1;
+#else
MONO_THREAD_VAR_OFFSET (mono_jit_tls, offset);
+#endif
return offset;
}
offset = mono_thread_get_tls_offset ();
break;
case TLS_KEY_JIT_TLS:
-#ifdef HOST_WIN32
- offset = mono_get_jit_tls_key ();
-#else
offset = mono_get_jit_tls_offset ();
-#endif
break;
case TLS_KEY_DOMAIN:
offset = mono_domain_get_tls_offset ();
res->data.rgctx_entry->data = mono_patch_info_dup_mp (mp, res->data.rgctx_entry->data);
break;
case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE:
- res->data.del_tramp = mono_mempool_alloc0 (mp, sizeof (MonoClassMethodPair));
- memcpy (res->data.del_tramp, patch_info->data.del_tramp, sizeof (MonoClassMethodPair));
+ res->data.del_tramp = mono_mempool_alloc0 (mp, sizeof (MonoDelegateClassMethodPair));
+ memcpy (res->data.del_tramp, patch_info->data.del_tramp, sizeof (MonoDelegateClassMethodPair));
break;
case MONO_PATCH_INFO_GSHAREDVT_CALL:
res->data.gsharedvt = mono_mempool_alloc (mp, sizeof (MonoJumpInfoGSharedVtCall));
/* Hash on the selector name */
return g_str_hash (ji->data.target);
case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE:
- return (ji->type << 8) | (gsize)ji->data.del_tramp->klass | (gsize)ji->data.del_tramp->method;
+ return (ji->type << 8) | (gsize)ji->data.del_tramp->klass | (gsize)ji->data.del_tramp->method | (gsize)ji->data.del_tramp->virtual;
default:
printf ("info type: %d\n", ji->type);
mono_print_ji (ji); printf ("\n");
case MONO_PATCH_INFO_GSHAREDVT_METHOD:
return ji1->data.gsharedvt_method->method == ji2->data.gsharedvt_method->method;
case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE:
- return ji1->data.del_tramp->klass == ji2->data.del_tramp->klass && ji1->data.del_tramp->method == ji2->data.del_tramp->method;
+ return ji1->data.del_tramp->klass == ji2->data.del_tramp->klass && ji1->data.del_tramp->method == ji2->data.del_tramp->method && ji1->data.del_tramp->virtual == ji2->data.del_tramp->virtual;
default:
if (ji1->data.target != ji2->data.target)
return 0;
break;
}
case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE: {
- MonoClassMethodPair *del_tramp = patch_info->data.del_tramp;
+ MonoDelegateClassMethodPair *del_tramp = patch_info->data.del_tramp;
- target = mono_create_delegate_trampoline_info (domain, del_tramp->klass, del_tramp->method);
+ if (del_tramp->virtual)
+ target = mono_create_delegate_virtual_trampoline (domain, del_tramp->klass, del_tramp->method);
+ else
+ target = mono_create_delegate_trampoline_info (domain, del_tramp->klass, del_tramp->method);
break;
}
case MONO_PATCH_INFO_SFLDA: {
if (stack_size)
arch_eh_info_size = sizeof (MonoArchEHJitInfo);
}
+
+ if (cfg->has_unwind_info_for_epilog && !arch_eh_info_size)
+ arch_eh_info_size = sizeof (MonoArchEHJitInfo);
if (cfg->try_block_holes) {
for (tmp = cfg->try_block_holes; tmp; tmp = tmp->next) {
unwind_desc = mono_cache_unwind_info (unwind_info, info_len);
if (cfg->has_unwind_info_for_epilog) {
- /*
- * The lower 16 bits identify the unwind descriptor, the upper 16 bits contain the offset of
- * the start of the epilog from the end of the method.
- */
- g_assert (unwind_desc < 0xffff);
- g_assert (cfg->code_size - cfg->epilog_begin < 0xffff);
- jinfo->unwind_info = ((cfg->code_size - cfg->epilog_begin) << 16) | unwind_desc;
- } else {
- jinfo->unwind_info = unwind_desc;
+ MonoArchEHJitInfo *info;
+
+ info = mono_jit_info_get_arch_eh_info (jinfo);
+ g_assert (info);
+ info->epilog_size = cfg->code_size - cfg->epilog_begin;
}
+ jinfo->unwind_info = unwind_desc;
g_free (unwind_info);
} else {
jinfo->unwind_info = cfg->used_int_regs;
gboolean run_cctors = (flags & JIT_FLAG_RUN_CCTORS) ? 1 : 0;
gboolean compile_aot = (flags & JIT_FLAG_AOT) ? 1 : 0;
gboolean full_aot = (flags & JIT_FLAG_FULL_AOT) ? 1 : 0;
+ gboolean llvm = (flags & JIT_FLAG_LLVM) ? 1 : 0;
InterlockedIncrement (&mono_jit_stats.methods_compiled);
if (mono_profiler_get_events () & MONO_PROFILE_JIT_COMPILATION)
}
#ifdef ENABLE_LLVM
- try_llvm = mono_use_llvm;
+ try_llvm = mono_use_llvm || llvm;
#endif
restart_compile:
else
shared = NULL;
- /*
- * FIXME: lookup_method_inner requires the loader lock.
- * FIXME: This is no longer true, can this be dropped ?
- */
- mono_loader_lock ();
mono_domain_lock (target_domain);
/* Check if some other thread already did the job. In this case, we can
discard the code this thread generated. */
- mono_domain_jit_code_hash_lock (target_domain);
-
info = lookup_method_inner (target_domain, method, shared);
if (info) {
/* We can't use a domain specific method in another domain */
// printf("Discarding code for method %s\n", method->name);
}
}
-
if (code == NULL) {
+ /* The lookup + insert is atomic since this is done inside the domain lock */
+ mono_domain_jit_code_hash_lock (target_domain);
mono_internal_hash_table_insert (&target_domain->jit_code_hash, cfg->jit_info->d.method, cfg->jit_info);
mono_domain_jit_code_hash_unlock (target_domain);
+
code = cfg->native_code;
if (cfg->generic_sharing_context && mono_method_is_generic_sharable (method, FALSE))
mono_stats.generics_shared_methods++;
if (cfg->gsharedvt)
mono_stats.gsharedvt_methods++;
- } else {
- mono_domain_jit_code_hash_unlock (target_domain);
}
jinfo = cfg->jit_info;
mono_emit_jit_map (jinfo);
#endif
mono_domain_unlock (target_domain);
- mono_loader_unlock ();
vtable = mono_class_vtable (target_domain, method->klass);
if (!vtable) {
mono_domain_lock (domain);
g_hash_table_remove (domain_jit_info (domain)->dynamic_code_hash, method);
+ mono_domain_jit_code_hash_lock (domain);
mono_internal_hash_table_remove (&domain->jit_code_hash, method);
+ mono_domain_jit_code_hash_unlock (domain);
g_hash_table_remove (domain_jit_info (domain)->jump_trampoline_hash, method);
mono_conc_hashtable_remove (domain_jit_info (domain)->runtime_invoke_hash, method);
return;
mono_handle_native_sigsegv (SIGSEGV, ctx);
- if (mono_do_crash_chaining)
+ if (mono_do_crash_chaining) {
mono_chain_signal (SIG_HANDLER_PARAMS);
+ return;
+ }
}
mono_arch_handle_exception (ctx, exc);
if (!mono_do_crash_chaining && mono_chain_signal (SIG_HANDLER_PARAMS))
return;
mono_handle_native_sigsegv (SIGSEGV, ctx);
- if (mono_do_crash_chaining)
+ if (mono_do_crash_chaining) {
mono_chain_signal (SIG_HANDLER_PARAMS);
+ return;
+ }
}
ji = mono_jit_info_table_find (mono_domain_get (), mono_arch_ip_from_context (ctx));
mono_handle_native_sigsegv (SIGSEGV, ctx);
- if (mono_do_crash_chaining)
+ if (mono_do_crash_chaining) {
mono_chain_signal (SIG_HANDLER_PARAMS);
+ return;
+ }
}
mono_arch_handle_exception (ctx, NULL);
return vtable_trampolines [index];
}
+gpointer
+mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method)
+{
+ gboolean is_virtual_generic, is_interface, load_imt_reg;
+ int offset, idx;
+
+ static guint8 **cache = NULL;
+ static int cache_size = 0;
+
+ if (!method)
+ return NULL;
+
+ /* FIXME Support more cases */
+ if (mono_aot_only)
+ return NULL;
+
+ if (MONO_TYPE_ISSTRUCT (sig->ret))
+ return NULL;
+
+ is_virtual_generic = method->is_inflated && mono_method_get_declaring_generic_method (method)->is_generic;
+ is_interface = method->klass->flags & TYPE_ATTRIBUTE_INTERFACE ? TRUE : FALSE;
+ load_imt_reg = is_virtual_generic || is_interface;
+
+ if (is_interface && !is_virtual_generic)
+ offset = ((gint32)mono_method_get_imt_slot (method) - MONO_IMT_SIZE) * SIZEOF_VOID_P;
+ else
+ offset = G_STRUCT_OFFSET (MonoVTable, vtable) + ((mono_method_get_vtable_index (method)) * (SIZEOF_VOID_P));
+
+ idx = (offset / SIZEOF_VOID_P + MONO_IMT_SIZE) * 2 + (load_imt_reg ? 1 : 0);
+ g_assert (idx >= 0);
+
+ /* Resize the cache to idx + 1 */
+ if (cache_size < idx + 1) {
+ mono_jit_lock ();
+ if (cache_size < idx + 1) {
+ guint8 **new_cache;
+ int new_cache_size = idx + 1;
+
+ new_cache = g_new0 (guint8*, new_cache_size);
+ if (cache)
+ memcpy (new_cache, cache, cache_size * sizeof (guint8*));
+ g_free (cache);
+
+ mono_memory_barrier ();
+ cache = new_cache;
+ cache_size = new_cache_size;
+ }
+ mono_jit_unlock ();
+ }
+
+ if (cache [idx])
+ return cache [idx];
+
+ return cache [idx] = mono_arch_get_delegate_virtual_invoke_impl (sig, method, offset, load_imt_reg);
+}
+
static gpointer
mini_get_imt_trampoline (int slot_index)
{
info->jit_trampoline_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
info->delegate_trampoline_hash = g_hash_table_new (class_method_pair_hash, class_method_pair_equal);
info->llvm_vcall_trampoline_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
-#ifdef HOST_WIN32
- // FIXME:
info->runtime_invoke_hash = mono_conc_hashtable_new_full (&domain->lock, mono_aligned_addr_hash, NULL, NULL, runtime_invoke_info_free);
-#else
- info->runtime_invoke_hash = mono_conc_hashtable_new_full (&domain->lock.mutex, mono_aligned_addr_hash, NULL, NULL, runtime_invoke_info_free);
-#endif
info->seq_points = g_hash_table_new_full (mono_aligned_addr_hash, NULL, NULL, seq_point_info_free);
info->arch_seq_points = g_hash_table_new (mono_aligned_addr_hash, NULL);
info->jump_target_hash = g_hash_table_new (NULL, NULL);
domain->runtime_info = NULL;
}
+#ifdef ENABLE_LLVM
+static gboolean
+llvm_init_inner (void)
+{
+ if (!mono_llvm_load (NULL))
+ return FALSE;
+
+ mono_llvm_init ();
+ return TRUE;
+}
+#endif
+
+/*
+ * mini_llvm_init:
+ *
+ * Load and initialize LLVM support.
+ * Return TRUE on success.
+ */
+gboolean
+mini_llvm_init (void)
+{
+#ifdef ENABLE_LLVM
+ static gboolean llvm_inited;
+ static gboolean init_result;
+
+ mono_loader_lock_if_inited ();
+ if (!llvm_inited) {
+ init_result = llvm_init_inner ();
+ llvm_inited = TRUE;
+ }
+ mono_loader_unlock_if_inited ();
+ return init_result;
+#else
+ return FALSE;
+#endif
+}
+
MonoDomain *
mini_init (const char *filename, const char *runtime_version)
{
}
#endif
- InitializeCriticalSection (&jit_mutex);
+ mono_mutex_init_recursive (&jit_mutex);
mono_cross_helpers_run ();
mono_native_tls_free (mono_jit_tls_id);
- DeleteCriticalSection (&jit_mutex);
+ mono_mutex_destroy (&jit_mutex);
- DeleteCriticalSection (&mono_delegate_section);
+ mono_mutex_destroy (&mono_delegate_section);
mono_code_manager_cleanup ();
} MonoJumpTableChunk;
static MonoJumpTableChunk* g_jumptable;
-#define mono_jumptable_lock() EnterCriticalSection (&jumptable_mutex)
-#define mono_jumptable_unlock() LeaveCriticalSection (&jumptable_mutex)
-static CRITICAL_SECTION jumptable_mutex;
+#define mono_jumptable_lock() mono_mutex_lock (&jumptable_mutex)
+#define mono_jumptable_unlock() mono_mutex_unlock (&jumptable_mutex)
+static mono_mutex_t jumptable_mutex;
static MonoJumpTableChunk*
mono_create_jumptable_chunk (guint32 max_entries)
mono_jumptable_init (void)
{
if (g_jumptable == NULL) {
- InitializeCriticalSection (&jumptable_mutex);
+ mono_mutex_init_recursive (&jumptable_mutex);
g_jumptable = mono_create_jumptable_chunk (DEFAULT_JUMPTABLE_CHUNK_ELEMENTS);
}
}
current = prev;
}
g_jumptable = NULL;
- DeleteCriticalSection (&jumptable_mutex);
+ mono_mutex_destroy (&jumptable_mutex);
}
}
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 100
+#define MONO_AOT_FILE_VERSION 102
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
MonoMethod *method;
} MonoClassMethodPair;
+typedef struct
+{
+ MonoClass *klass;
+ MonoMethod *method;
+ gboolean virtual;
+} MonoDelegateClassMethodPair;
+
/* Per-domain information maintained by the JIT */
typedef struct
{
MonoJumpInfoGSharedVtCall *gsharedvt;
MonoGSharedVtMethodInfo *gsharedvt_method;
MonoMethodSignature *sig;
- MonoClassMethodPair *del_tramp;
+ MonoDelegateClassMethodPair *del_tramp;
} data;
};
/* Whenever this is an AOT compilation */
JIT_FLAG_AOT = (1 << 1),
/* Whenever this is a full AOT compilation */
- JIT_FLAG_FULL_AOT = (1 << 2)
+ JIT_FLAG_FULL_AOT = (1 << 2),
+ /* Whenever to compile with LLVM */
+ JIT_FLAG_LLVM = (1 << 3),
} JitFlags;
/* Bit-fields in the MonoBasicBlock.region */
MonoJitTlsData* mono_get_jit_tls (void) MONO_INTERNAL;
MONO_API MonoDomain *mono_jit_thread_attach (MonoDomain *domain);
MONO_API void mono_jit_set_domain (MonoDomain *domain);
-MonoNativeTlsKey mono_get_jit_tls_key (void) MONO_INTERNAL;
gint32 mono_get_jit_tls_offset (void) MONO_INTERNAL;
gint32 mono_get_lmf_tls_offset (void) MONO_INTERNAL;
gint32 mono_get_lmf_addr_tls_offset (void) MONO_INTERNAL;
void mono_llvm_check_method_supported (MonoCompile *cfg) MONO_LLVM_INTERNAL;
void mono_llvm_free_domain_info (MonoDomain *domain) MONO_LLVM_INTERNAL;
+gboolean mini_llvm_init (void);
+
gboolean mono_method_blittable (MonoMethod *method) MONO_INTERNAL;
gboolean mono_method_same_domain (MonoJitInfo *caller, MonoJitInfo *callee) MONO_INTERNAL;
gpointer mono_create_jit_trampoline_in_domain (MonoDomain *domain, MonoMethod *method) MONO_LLVM_INTERNAL;
gpointer mono_create_delegate_trampoline (MonoDomain *domain, MonoClass *klass) MONO_INTERNAL;
MonoDelegateTrampInfo* mono_create_delegate_trampoline_info (MonoDomain *domain, MonoClass *klass, MonoMethod *method) MONO_INTERNAL;
+gpointer mono_create_delegate_virtual_trampoline (MonoDomain *domain, MonoClass *klass, MonoMethod *method) MONO_INTERNAL;
gpointer mono_create_rgctx_lazy_fetch_trampoline (guint32 offset) MONO_INTERNAL;
gpointer mono_create_monitor_enter_trampoline (void) MONO_INTERNAL;
gpointer mono_create_monitor_exit_trampoline (void) MONO_INTERNAL;
void mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) MONO_INTERNAL;
void mono_if_conversion (MonoCompile *cfg) MONO_INTERNAL;
+/* virtual function delegate */
+gpointer mono_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method) MONO_INTERNAL;
+
/* methods that must be provided by the arch-specific port */
void mono_arch_init (void) MONO_INTERNAL;
void mono_arch_finish_init (void) MONO_INTERNAL;
int mono_arch_get_this_arg_reg (guint8 *code) MONO_INTERNAL;
gpointer mono_arch_get_this_arg_from_call (mgreg_t *regs, guint8 *code) MONO_INTERNAL;
gpointer mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_target) MONO_INTERNAL;
+gpointer mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg) MONO_INTERNAL;
gpointer mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain, guint32 *code_len) MONO_INTERNAL;
void mono_arch_emit_imt_argument (MonoCompile *cfg, MonoCallInst *call, MonoInst *imt_arg) MONO_INTERNAL;
MonoMethod* mono_arch_find_imt_method (mgreg_t *regs, guint8 *code) MONO_INTERNAL;
gboolean mono_exception_walk_trace (MonoException *ex, MonoExceptionFrameWalk func, gpointer user_data);
void mono_restore_context (MonoContext *ctx) MONO_INTERNAL;
guint8* mono_jinfo_get_unwind_info (MonoJitInfo *ji, guint32 *unwind_info_len) MONO_INTERNAL;
+int mono_jinfo_get_epilog_size (MonoJitInfo *ji) MONO_INTERNAL;
gboolean
mono_find_jit_info_ext (MonoDomain *domain, MonoJitTlsData *jit_tls,
#ifndef GET_CONTEXT
#ifdef HOST_WIN32
+/* seh_vectored_exception_handler () passes in a CONTEXT* */
#define GET_CONTEXT \
void *ctx = context;
#else
/* keepalive_stacks could be a per-stack var to avoid locking overhead */
static MonoGHashTable *keepalive_stacks;
-static CRITICAL_SECTION tasklets_mutex;
-#define tasklets_lock() EnterCriticalSection(&tasklets_mutex)
-#define tasklets_unlock() LeaveCriticalSection(&tasklets_mutex)
+static mono_mutex_t tasklets_mutex;
+#define tasklets_lock() mono_mutex_lock(&tasklets_mutex)
+#define tasklets_unlock() mono_mutex_unlock(&tasklets_mutex)
/* LOCKING: tasklets_mutex is assumed to e taken */
static void
void
mono_tasklets_init (void)
{
- InitializeCriticalSection (&tasklets_mutex);
+ mono_mutex_init_recursive (&tasklets_mutex);
mono_add_internal_call ("Mono.Tasklets.Continuation::alloc", continuation_alloc);
mono_add_internal_call ("Mono.Tasklets.Continuation::free", continuation_free);
amd64_mov_reg_imm (code, AMD64_R11, 0);
amd64_mov_reg_membase (code, AMD64_R11, AMD64_R11, 0, 8);
} else {
- amd64_mov_reg_imm (code, AMD64_RDI, tramp_type);
+ amd64_mov_reg_imm (code, MONO_AMD64_ARG_REG1, tramp_type);
amd64_mov_reg_imm (code, AMD64_R11, stack_unaligned);
amd64_call_reg (code, AMD64_R11);
}
return buf;
}
-#ifdef MONO_ARCH_MONITOR_OBJECT_REG
-
gpointer
mono_arch_create_monitor_enter_trampoline (MonoTrampInfo **info, gboolean aot)
{
int owner_offset, nest_offset, dummy;
MonoJumpInfo *ji = NULL;
GSList *unwind_ops = NULL;
+ int obj_reg = MONO_AMD64_ARG_REG1;
+ int sync_reg = MONO_AMD64_ARG_REG2;
+ int tid_reg = MONO_AMD64_ARG_REG3;
- g_assert (MONO_ARCH_MONITOR_OBJECT_REG == AMD64_RDI);
+ g_assert (MONO_ARCH_MONITOR_OBJECT_REG == obj_reg);
mono_monitor_threads_sync_members_offset (&owner_offset, &nest_offset, &dummy);
g_assert (MONO_THREADS_SYNC_MEMBER_SIZE (owner_offset) == sizeof (gpointer));
unwind_ops = mono_arch_get_cie_program ();
- if (mono_thread_get_tls_offset () != -1) {
- /* MonoObject* obj is in RDI */
+ if (!aot && mono_thread_get_tls_offset () != -1) {
+ /* MonoObject* obj is in obj_reg */
/* is obj null? */
- amd64_test_reg_reg (code, AMD64_RDI, AMD64_RDI);
+ amd64_test_reg_reg (code, obj_reg, obj_reg);
/* if yes, jump to actual trampoline */
jump_obj_null = code;
amd64_branch8 (code, X86_CC_Z, -1, 1);
- /* load obj->synchronization to RCX */
- amd64_mov_reg_membase (code, AMD64_RCX, AMD64_RDI, MONO_STRUCT_OFFSET (MonoObject, synchronisation), 8);
+ /* load obj->synchronization to sync_reg */
+ amd64_mov_reg_membase (code, sync_reg, obj_reg, MONO_STRUCT_OFFSET (MonoObject, synchronisation), 8);
if (mono_gc_is_moving ()) {
/*if bit zero is set it's a thin hash*/
/*FIXME use testb encoding*/
- amd64_test_reg_imm (code, AMD64_RCX, 0x01);
+ amd64_test_reg_imm (code, sync_reg, 0x01);
jump_sync_thin_hash = code;
amd64_branch8 (code, X86_CC_NE, -1, 1);
/*clear bits used by the gc*/
- amd64_alu_reg_imm (code, X86_AND, AMD64_RCX, ~0x3);
+ amd64_alu_reg_imm (code, X86_AND, sync_reg, ~0x3);
}
/* is synchronization null? */
- amd64_test_reg_reg (code, AMD64_RCX, AMD64_RCX);
+ amd64_test_reg_reg (code, sync_reg, sync_reg);
/* if yes, jump to actual trampoline */
jump_sync_null = code;
amd64_branch8 (code, X86_CC_Z, -1, 1);
- /* load MonoInternalThread* into RDX */
- code = mono_amd64_emit_tls_get (code, AMD64_RDX, mono_thread_get_tls_offset ());
- /* load TID into RDX */
- amd64_mov_reg_membase (code, AMD64_RDX, AMD64_RDX, MONO_STRUCT_OFFSET (MonoInternalThread, tid), 8);
+ /* load MonoInternalThread* into tid_reg */
+ code = mono_amd64_emit_tls_get (code, tid_reg, mono_thread_get_tls_offset ());
+ /* load TID into tid_reg */
+ amd64_mov_reg_membase (code, tid_reg, tid_reg, MONO_STRUCT_OFFSET (MonoInternalThread, tid), 8);
/* is synchronization->owner null? */
- amd64_alu_membase_imm_size (code, X86_CMP, AMD64_RCX, owner_offset, 0, 8);
+ amd64_alu_membase_imm_size (code, X86_CMP, sync_reg, owner_offset, 0, 8);
/* if not, jump to next case */
jump_tid = code;
amd64_branch8 (code, X86_CC_NZ, -1, 1);
/* if yes, try a compare-exchange with the TID */
+ g_assert (tid_reg != X86_EAX);
/* zero RAX */
amd64_alu_reg_reg (code, X86_XOR, AMD64_RAX, AMD64_RAX);
/* compare and exchange */
amd64_prefix (code, X86_LOCK_PREFIX);
- amd64_cmpxchg_membase_reg_size (code, AMD64_RCX, owner_offset, AMD64_RDX, 8);
+ amd64_cmpxchg_membase_reg_size (code, sync_reg, owner_offset, tid_reg, 8);
/* if not successful, jump to actual trampoline */
jump_cmpxchg_failed = code;
amd64_branch8 (code, X86_CC_NZ, -1, 1);
/* next case: synchronization->owner is not null */
x86_patch (jump_tid, code);
/* is synchronization->owner == TID? */
- amd64_alu_membase_reg_size (code, X86_CMP, AMD64_RCX, owner_offset, AMD64_RDX, 8);
+ amd64_alu_membase_reg_size (code, X86_CMP, sync_reg, owner_offset, tid_reg, 8);
/* if not, jump to actual trampoline */
jump_other_owner = code;
amd64_branch8 (code, X86_CC_NZ, -1, 1);
/* if yes, increment nest */
- amd64_inc_membase_size (code, AMD64_RCX, nest_offset, 4);
+ amd64_inc_membase_size (code, sync_reg, nest_offset, 4);
/* return */
amd64_ret (code);
}
/* jump to the actual trampoline */
-#if MONO_AMD64_ARG_REG1 != AMD64_RDI
- amd64_mov_reg_reg (code, MONO_AMD64_ARG_REG1, AMD64_RDI);
-#endif
+ if (MONO_AMD64_ARG_REG1 != obj_reg)
+ amd64_mov_reg_reg (code, MONO_AMD64_ARG_REG1, obj_reg, sizeof (mgreg_t));
if (aot) {
code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "specific_trampoline_monitor_enter");
int owner_offset, nest_offset, entry_count_offset;
MonoJumpInfo *ji = NULL;
GSList *unwind_ops = NULL;
+ int obj_reg = MONO_AMD64_ARG_REG1;
+ int sync_reg = MONO_AMD64_ARG_REG2;
- g_assert (MONO_ARCH_MONITOR_OBJECT_REG == AMD64_RDI);
+ g_assert (obj_reg == MONO_ARCH_MONITOR_OBJECT_REG);
mono_monitor_threads_sync_members_offset (&owner_offset, &nest_offset, &entry_count_offset);
g_assert (MONO_THREADS_SYNC_MEMBER_SIZE (owner_offset) == sizeof (gpointer));
unwind_ops = mono_arch_get_cie_program ();
- if (mono_thread_get_tls_offset () != -1) {
- /* MonoObject* obj is in RDI */
+ if (!aot && mono_thread_get_tls_offset () != -1) {
+ /* MonoObject* obj is in obj_reg */
/* is obj null? */
- amd64_test_reg_reg (code, AMD64_RDI, AMD64_RDI);
+ amd64_test_reg_reg (code, obj_reg, obj_reg);
/* if yes, jump to actual trampoline */
jump_obj_null = code;
amd64_branch8 (code, X86_CC_Z, -1, 1);
/* load obj->synchronization to RCX */
- amd64_mov_reg_membase (code, AMD64_RCX, AMD64_RDI, MONO_STRUCT_OFFSET (MonoObject, synchronisation), 8);
+ amd64_mov_reg_membase (code, sync_reg, obj_reg, MONO_STRUCT_OFFSET (MonoObject, synchronisation), 8);
if (mono_gc_is_moving ()) {
/*if bit zero is set it's a thin hash*/
/*FIXME use testb encoding*/
- amd64_test_reg_imm (code, AMD64_RCX, 0x01);
+ amd64_test_reg_imm (code, sync_reg, 0x01);
jump_sync_thin_hash = code;
amd64_branch8 (code, X86_CC_NE, -1, 1);
/*clear bits used by the gc*/
- amd64_alu_reg_imm (code, X86_AND, AMD64_RCX, ~0x3);
+ amd64_alu_reg_imm (code, X86_AND, sync_reg, ~0x3);
}
/* is synchronization null? */
- amd64_test_reg_reg (code, AMD64_RCX, AMD64_RCX);
+ amd64_test_reg_reg (code, sync_reg, sync_reg);
/* if yes, jump to actual trampoline */
jump_sync_null = code;
amd64_branch8 (code, X86_CC_Z, -1, 1);
/* next case: synchronization is not null */
- /* load MonoInternalThread* into RDX */
- code = mono_amd64_emit_tls_get (code, AMD64_RDX, mono_thread_get_tls_offset ());
- /* load TID into RDX */
- amd64_mov_reg_membase (code, AMD64_RDX, AMD64_RDX, MONO_STRUCT_OFFSET (MonoInternalThread, tid), 8);
+ /* load MonoInternalThread* into RAX */
+ code = mono_amd64_emit_tls_get (code, AMD64_RAX, mono_thread_get_tls_offset ());
+ /* load TID into RAX */
+ amd64_mov_reg_membase (code, AMD64_RAX, AMD64_RAX, MONO_STRUCT_OFFSET (MonoInternalThread, tid), 8);
/* is synchronization->owner == TID */
- amd64_alu_membase_reg_size (code, X86_CMP, AMD64_RCX, owner_offset, AMD64_RDX, 8);
+ amd64_alu_membase_reg_size (code, X86_CMP, sync_reg, owner_offset, AMD64_RAX, 8);
/* if no, jump to actual trampoline */
jump_not_owned = code;
amd64_branch8 (code, X86_CC_NZ, -1, 1);
/* next case: synchronization->owner == TID */
/* is synchronization->nest == 1 */
- amd64_alu_membase_imm_size (code, X86_CMP, AMD64_RCX, nest_offset, 1, 4);
+ amd64_alu_membase_imm_size (code, X86_CMP, sync_reg, nest_offset, 1, 4);
/* if not, jump to next case */
jump_next = code;
amd64_branch8 (code, X86_CC_NZ, -1, 1);
/* if yes, is synchronization->entry_count zero? */
- amd64_alu_membase_imm_size (code, X86_CMP, AMD64_RCX, entry_count_offset, 0, 4);
+ amd64_alu_membase_imm_size (code, X86_CMP, sync_reg, entry_count_offset, 0, 4);
/* if not, jump to actual trampoline */
jump_have_waiters = code;
amd64_branch8 (code, X86_CC_NZ, -1 , 1);
/* if yes, set synchronization->owner to null and return */
- amd64_mov_membase_imm (code, AMD64_RCX, owner_offset, 0, 8);
+ amd64_mov_membase_imm (code, sync_reg, owner_offset, 0, 8);
amd64_ret (code);
/* next case: synchronization->nest is not 1 */
x86_patch (jump_next, code);
/* decrease synchronization->nest and return */
- amd64_dec_membase_size (code, AMD64_RCX, nest_offset, 4);
+ amd64_dec_membase_size (code, sync_reg, nest_offset, 4);
amd64_ret (code);
x86_patch (jump_obj_null, code);
}
/* jump to the actual trampoline */
-#if MONO_AMD64_ARG_REG1 != AMD64_RDI
- amd64_mov_reg_reg (code, MONO_AMD64_ARG_REG1, AMD64_RDI);
-#endif
+ if (MONO_AMD64_ARG_REG1 != obj_reg)
+ amd64_mov_reg_reg (code, MONO_AMD64_ARG_REG1, obj_reg, sizeof (mgreg_t));
if (aot) {
code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "specific_trampoline_monitor_exit");
return buf;
}
-#endif
void
mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
/*
This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
*/
-
if (mono_get_jit_tls_offset () != -1) {
- code = mono_amd64_emit_tls_get (code, AMD64_RDI, mono_get_jit_tls_offset ());
- amd64_mov_reg_membase (code, AMD64_RDI, AMD64_RDI, MONO_STRUCT_OFFSET (MonoJitTlsData, handler_block_return_address), 8);
+ code = mono_amd64_emit_tls_get (code, MONO_AMD64_ARG_REG1, mono_get_jit_tls_offset ());
+ amd64_mov_reg_membase (code, MONO_AMD64_ARG_REG1, MONO_AMD64_ARG_REG1, MONO_STRUCT_OFFSET (MonoJitTlsData, handler_block_return_address), 8);
/* Simulate a call */
amd64_push_reg (code, AMD64_RAX);
amd64_jump_code (code, tramp);
} else {
/*Slow path uses a c helper*/
- amd64_mov_reg_reg (code, AMD64_RDI, AMD64_RSP, 8);
+ amd64_mov_reg_reg (code, MONO_AMD64_ARG_REG1, AMD64_RSP, 8);
amd64_mov_reg_imm (code, AMD64_RAX, tramp);
amd64_push_reg (code, AMD64_RAX);
+ amd64_push_reg (code, AMD64_RAX);
amd64_jump_code (code, handler_block_trampoline_helper);
}
// FIXME:
x86_mov_membase_imm (code, X86_ESP, (3 * sizeof (mgreg_t)), 0, sizeof (mgreg_t));
- // FIXME:
#ifdef __APPLE__
/* check the stack is aligned after the ret ip is pushed */
- /*x86_mov_reg_reg (buf, X86_EDX, X86_ESP, 4);
- x86_alu_reg_imm (buf, X86_AND, X86_EDX, 15);
- x86_alu_reg_imm (buf, X86_CMP, X86_EDX, 0);
- x86_branch_disp (buf, X86_CC_Z, 3, FALSE);
- x86_breakpoint (buf);*/
+ /*
+ x86_mov_reg_reg (code, X86_EDX, X86_ESP, 4);
+ x86_alu_reg_imm (code, X86_AND, X86_EDX, 15);
+ x86_alu_reg_imm (code, X86_CMP, X86_EDX, 0);
+ x86_branch_disp (code, X86_CC_Z, 3, FALSE);
+ x86_breakpoint (code);
+ */
#endif
if (aot) {
#define ALIGN_TO(val,align) ((((size_t)val) + ((align) - 1)) & ~((align) - 1))
-static CRITICAL_SECTION unwind_mutex;
+static mono_mutex_t unwind_mutex;
static MonoUnwindInfo **cached_info;
static int cached_info_next, cached_info_size;
/* Statistics */
static int unwind_info_size;
-#define unwind_lock() EnterCriticalSection (&unwind_mutex)
-#define unwind_unlock() LeaveCriticalSection (&unwind_mutex)
+#define unwind_lock() mono_mutex_lock (&unwind_mutex)
+#define unwind_unlock() mono_mutex_unlock (&unwind_mutex)
#ifdef TARGET_AMD64
static int map_hw_reg_to_dwarf_reg [] = { 0, 2, 1, 3, 7, 6, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
#define DWARF_DATA_ALIGN (-4)
#define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (ARMREG_LR))
#elif defined(TARGET_ARM64)
-#define NUM_REGS 32
+#define NUM_REGS 96
#define DWARF_DATA_ALIGN (-8)
/* LR */
#define DWARF_PC_REG 30
static int map_hw_reg_to_dwarf_reg [] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ /* v8..v15 */
+ 72, 73, 74, 75, 76, 77, 78, 79,
};
#elif defined (TARGET_X86)
#ifdef __APPLE__
{
Loc locations [NUM_REGS];
guint8 reg_saved [NUM_REGS];
- int i, pos, reg, cfa_reg, cfa_offset, offset;
+ int i, pos, reg, cfa_reg = -1, cfa_offset = 0, offset;
guint8 *p;
guint8 *cfa_val;
UnwindState state_stack [1];
if (save_locations)
memset (save_locations, 0, save_locations_len * sizeof (mgreg_t*));
+ g_assert (cfa_reg != -1);
cfa_val = (guint8*)regs [mono_dwarf_reg_to_hw_reg (cfa_reg)] + cfa_offset;
for (i = 0; i < NUM_REGS; ++i) {
if (reg_saved [i] && locations [i].loc_type == LOC_OFFSET) {
void
mono_unwind_init (void)
{
- InitializeCriticalSection (&unwind_mutex);
+ mono_mutex_init_recursive (&unwind_mutex);
mono_counters_register ("Unwind info size", MONO_COUNTER_JIT | MONO_COUNTER_INT, &unwind_info_size);
}
{
int i;
- DeleteCriticalSection (&unwind_mutex);
+ mono_mutex_destroy (&unwind_mutex);
if (!cached_info)
return;
#include "image-writer.h"
#include "dwarfwriter.h"
+#include "mono/utils/mono-compiler.h"
+
#define USE_GDB_JIT_INTERFACE
/* The recommended gdb macro is: */
struct jit_code_entry *first_entry;
};
-
-#ifdef _MSC_VER
-#define MONO_NOINLINE __declspec (noinline)
-#else
-#define MONO_NOINLINE __attribute__((noinline))
-#endif
-
/* GDB puts a breakpoint in this function. */
-void MONO_NOINLINE __jit_debug_register_code(void);
+void MONO_NEVER_INLINE __jit_debug_register_code(void);
#if !defined(MONO_LLVM_LOADED) && defined(ENABLE_LLVM) && !defined(MONO_CROSS_COMPILE)
#else
/* gcc seems to inline/eliminate calls to noinline functions, thus the asm () */
-void MONO_NOINLINE __jit_debug_register_code(void) {
+void MONO_NEVER_INLINE __jit_debug_register_code(void) {
#if defined(__GNUC__)
asm ("");
#endif
#include <linux/ioctl.h>
#include <asm/byteorder.h>
+#include "mono/utils/mono-compiler.h"
+
/*
* User-space ABI bits:
*/
perf_arch_fetch_caller_regs(regs, CALLER_ADDR0);
}
-static __always_inline void
+static MONO_ALWAYS_INLINE void
perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
{
struct pt_regs hot_regs;
EXIT_LOG (logbuffer);
}
-#define MAX_FRAMES 16
+#define MAX_FRAMES 32
typedef struct {
int count;
MonoMethod* methods [MAX_FRAMES];
int32_t il_offsets [MAX_FRAMES];
int32_t native_offsets [MAX_FRAMES];
} FrameData;
-static int num_frames = MAX_FRAMES / 2;
+static int num_frames = MAX_FRAMES;
static mono_bool
walk_stack (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data)
* event, hence the collect_bt/emit_bt split.
*/
static void
-collect_bt (FrameData *data)
+collect_bt (FrameData *data, gboolean async_safe)
{
data->count = 0;
- mono_stack_walk_no_il (walk_stack, data);
+ if (async_safe)
+ mono_stack_walk_async_safe (walk_stack, data);
+ else
+ mono_stack_walk_no_il (walk_stack, data);
}
static void
len += 7;
len &= ~7;
if (do_bt)
- collect_bt (&data);
+ collect_bt (&data, FALSE);
logbuffer = ensure_logbuf (32 + MAX_FRAMES * 8);
now = current_time ();
ENTER_LOG (logbuffer, "gcalloc");
FrameData data;
LogBuffer *logbuffer;
if (do_bt)
- collect_bt (&data);
+ collect_bt (&data, FALSE);
logbuffer = ensure_logbuf (16 + MAX_FRAMES * 8);
now = current_time ();
ENTER_LOG (logbuffer, "throw");
FrameData data;
LogBuffer *logbuffer;
if (do_bt)
- collect_bt (&data);
+ collect_bt (&data, FALSE);
logbuffer = ensure_logbuf (16 + MAX_FRAMES * 8);
now = current_time ();
ENTER_LOG (logbuffer, "monitor");
if (in_shutdown)
return;
now = current_time ();
- collect_bt (&bt_data);
+ collect_bt (&bt_data, TRUE);
elapsed = (now - profiler->startup_time) / 10000;
if (do_debug) {
int len;
return 0;
}
filename = info->dlpi_name;
+ if (!filename)
+ return 0;
if (!info->dlpi_addr && !filename [0]) {
int l = readlink ("/proc/self/exe", buf, sizeof (buf) - 1);
if (l > 0) {
monitor-stress.cs \
thread-stress.cs \
gc-stress.cs \
+ gc-copy-stress.cs \
gc-graystack-stress.cs \
exit-stress.cs \
process-stress.cs \
if X86
if HOST_WIN32
-PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe finally_block_ending_in_dead_bb.exe
+PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe finally_block_ending_in_dead_bb.exe \
+ bug-18026.exe monitor.exe threadpool-exceptions5.exe
endif
endif
#
# Test that no symbols are missed in eglib-remap.h
#
-OK_G_SYMBOLS='g_list\|g_slist\|g_concat_dir_and_file'
+OK_G_SYMBOLS='g_list\|g_slist\|g_concat_dir_and_file\|g_Ctoc'
if NACL_CODEGEN
test-eglib-remap:
else
--- /dev/null
+using System;
+
+class T {
+
+ static int count = 1000000;
+ static int loops = 20;
+ static int persist_factor = 10;
+
+ static object obj;
+
+ static object[] persist;
+ static int persist_idx;
+
+ static void work () {
+ persist = new object[count / persist_factor + 1];
+ persist_idx = 0;
+ for (int i = 0; i < count; ++i) {
+ obj = new object ();
+ if (i % persist_factor == 0)
+ persist[persist_idx++] = obj;
+ }
+ }
+
+ static void Main (string[] args) {
+ if (args.Length > 0)
+ loops = int.Parse (args [0]);
+ if (args.Length > 1)
+ count = int.Parse (args [1]);
+ if (args.Length > 2)
+ persist_factor = int.Parse (args [2]);
+ for (int i = 0; i < loops; ++i) {
+ work ();
+ }
+ }
+}
[DllImport ("libtest", EntryPoint="mono_test_marshal_call_callback")]
public static extern int mono_test_marshal_call_callback ();
- public static int test_0_appdomain_swich () {
- callback = delegate () { return 42; };
- mono_test_marshal_set_callback (callback);
-
+ public static int test_0_appdomain_switch () {
// FIXME: The appdomain unload hangs
- return 0;
- /*
+ //return 0;
AppDomain ad = AppDomain.CreateDomain ("foo");
var c = (CallbackClass)ad.CreateInstanceAndUnwrap (
typeof (CallbackClass).Assembly.FullName, "Tests/CallbackClass");
- int res = c.OtherDomainTest ();
+ c.SetCallback ();
+ int domain_id = AppDomain.CurrentDomain.Id;
+ int new_id = mono_test_marshal_call_callback ();
+ int res = 0;
+ if (new_id == domain_id)
+ res = 1;
+ if (AppDomain.CurrentDomain.Id != domain_id)
+ res = 2;
AppDomain.Unload (ad);
return res;
- */
}
+ static int domain_callback () {
+ return AppDomain.CurrentDomain.Id;
+ }
+
class CallbackClass : MarshalByRefObject {
- public int OtherDomainTest () {
- int appDomainId = AppDomain.CurrentDomain.Id;
- int res = mono_test_marshal_call_callback ();
- if (res != 42)
- return 2;
- return appDomainId == AppDomain.CurrentDomain.Id ? 0 : 1;
+ public int SetCallback () {
+ mono_test_marshal_set_callback (domain_callback);
+ return 0;
}
}
}
'arg-knob' => 2, # loops
'ratio' => 10,
},
+ 'gc-copy-stress' => {
+ 'program' => 'gc-copy-stress.exe',
+ # loops, count, persist_factor
+ 'args' => [250, 500000, 10],
+ 'arg-knob' => 1, # count
+ 'ratio' => 4,
+ },
'thread-stress' => {
'program' => 'thread-stress.exe',
# loops
/test-gc-memfuncs
/test-mono-linked-list-set
/test-sgen-qsort
+/test-conc-hashtable
if !CROSS_COMPILE
if !HOST_WIN32
if SUPPORT_BOEHM
-if !PLATFORM_LINUX
+if !PLATFORM_GNU
test_sgen_qsort_SOURCES = test-sgen-qsort.c
test_sgen_qsort_CFLAGS = $(TEST_CFLAGS)
TESTS = test-sgen-qsort test-gc-memfuncs test-mono-linked-list-set test-conc-hashtable
-endif !PLATFORM_LINUX
+endif !PLATFORM_GNU
endif SUPPORT_BOEHM
endif !HOST_WIN32
endif !CROSS_COMPILE
mono-threads-mach.c \
mono-threads-mach-helper.c \
mono-threads-windows.c \
+ mono-threads-linux.c \
+ mono-threads-freebsd.c \
+ mono-threads-openbsd.c \
+ mono-threads-android.c \
mono-threads.h \
mono-tls.h \
mono-tls.c \
bsearch.c \
mono-signal-handler.h \
mono-conc-hashtable.h \
- mono-conc-hashtable.c
+ mono-conc-hashtable.c \
+ sha1.h \
+ sha1.c
arch_sources =
static MonoLockFreeArrayQueue delayed_free_queue = MONO_LOCK_FREE_ARRAY_QUEUE_INIT (sizeof (DelayedFreeItem));
/* The table for small ID assignment */
-static CRITICAL_SECTION small_id_mutex;
+static mono_mutex_t small_id_mutex;
static int small_id_next;
static int highest_small_id = -1;
static MonoBitSet *small_id_table;
{
int i, id = -1;
- EnterCriticalSection (&small_id_mutex);
+ mono_mutex_lock (&small_id_mutex);
if (!small_id_table)
small_id_table = mono_bitset_new (1, 0);
mono_memory_write_barrier ();
}
- LeaveCriticalSection (&small_id_mutex);
+ mono_mutex_unlock (&small_id_mutex);
return id;
}
mono_thread_small_id_free (int id)
{
/* MonoBitSet operations are not atomic. */
- EnterCriticalSection (&small_id_mutex);
+ mono_mutex_lock (&small_id_mutex);
g_assert (id >= 0 && id < small_id_table->size);
g_assert (mono_bitset_test_fast (small_id_table, id));
mono_bitset_clear_fast (small_id_table, id);
- LeaveCriticalSection (&small_id_mutex);
+ mono_mutex_unlock (&small_id_mutex);
}
static gboolean
{
int i;
- InitializeCriticalSection(&small_id_mutex);
+ mono_mutex_init_recursive(&small_id_mutex);
mono_counters_register ("Hazardous pointers", MONO_COUNTER_JIT | MONO_COUNTER_INT, &hazardous_pointer_count);
for (i = 0; i < HAZARD_TABLE_OVERFLOW; ++i) {
#include <nacl/nacl_dyncode.h>
#include <mono/mini/mini.h>
#endif
+#include <mono/utils/mono-mutex.h>
+
static uintptr_t code_memory_used = 0;
static size_t dynamic_code_alloc_count;
#define VALLOC_FREELIST_SIZE 16
-static CRITICAL_SECTION valloc_mutex;
+static mono_mutex_t valloc_mutex;
static GHashTable *valloc_freelists;
static void*
GSList *freelist;
if (!valloc_freelists) {
- InitializeCriticalSection (&valloc_mutex);
+ mono_mutex_init_recursive (&valloc_mutex);
valloc_freelists = g_hash_table_new (NULL, NULL);
}
/*
* Keep a small freelist of memory blocks to decrease pressure on the kernel memory subsystem to avoid #3321.
*/
- EnterCriticalSection (&valloc_mutex);
+ mono_mutex_lock (&valloc_mutex);
freelist = g_hash_table_lookup (valloc_freelists, GUINT_TO_POINTER (size));
if (freelist) {
ptr = freelist->data;
if (!ptr && preferred)
ptr = mono_valloc (NULL, size, MONO_PROT_RWX | ARCH_MAP_FLAGS);
}
- LeaveCriticalSection (&valloc_mutex);
+ mono_mutex_unlock (&valloc_mutex);
return ptr;
}
{
GSList *freelist;
- EnterCriticalSection (&valloc_mutex);
+ mono_mutex_lock (&valloc_mutex);
freelist = g_hash_table_lookup (valloc_freelists, GUINT_TO_POINTER (size));
if (!freelist || g_slist_length (freelist) < VALLOC_FREELIST_SIZE) {
freelist = g_slist_prepend (freelist, ptr);
} else {
mono_vfree (ptr, size);
}
- LeaveCriticalSection (&valloc_mutex);
+ mono_mutex_unlock (&valloc_mutex);
}
static void
return NULL;
} else {
/* Try to allocate code chunks next to each other to help the VM */
+ ptr = NULL;
if (last)
ptr = codechunk_valloc ((guint8*)last->data + last->size, chunk_size);
- else
+ if (!ptr)
ptr = codechunk_valloc (NULL, chunk_size);
if (!ptr)
return NULL;
#define MONO_THREAD_VAR_OFFSET(var,offset) (offset) = -1
#endif
-#elif defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
+#elif defined(TARGET_MACH) && (defined(__i386__) || defined(__x86_64__))
#define MONO_HAVE_FAST_TLS
#define MONO_FAST_TLS_SET(x,y) pthread_setspecific(x, y)
#endif
#include <float.h>
-#define isnan(x) _isnan(x)
#define trunc(x) (((x) < 0) ? ceil((x)) : floor((x)))
+#if _MSC_VER < 1800 /* VS 2013 */
+#define isnan(x) _isnan(x)
#define isinf(x) (_isnan(x) ? 0 : (_fpclass(x) == _FPCLASS_NINF) ? -1 : (_fpclass(x) == _FPCLASS_PINF) ? 1 : 0)
#define isnormal(x) _finite(x)
+#endif
#define popen _popen
#define pclose _pclose
#define MONO_ALWAYS_INLINE
#endif
+#ifdef __GNUC__
+#define MONO_NEVER_INLINE __attribute__((noinline))
+#elif defined(_MSC_VER)
+#define MONO_NEVER_INLINE __declspec(noinline)
+#else
+#define MONO_NEVER_INLINE
+#endif
+
#endif /* __UTILS_MONO_COMPILER_H__*/
static MONO_ALWAYS_INLINE int
mix_hash (int hash)
{
- return ((hash * 215497) >> 16) ^ (hash * 1823231) + hash;
+ return ((hash * 215497) >> 16) ^ (hash * 1823231 + hash);
}
static MONO_ALWAYS_INLINE void
#include <mono/utils/mono-context.h>
+#ifdef HOST_WIN32
+#include <windows.h>
+#endif
+
#ifdef __sun
#define REG_EAX EAX
#define REG_EBX EBX
mctx->esi = UCONTEXT_REG_ESI (ctx);
mctx->edi = UCONTEXT_REG_EDI (ctx);
mctx->eip = UCONTEXT_REG_EIP (ctx);
+#elif defined(HOST_WIN32)
+ CONTEXT *context = (CONTEXT*)sigctx;
+
+ mctx->eip = context->Eip;
+ mctx->edi = context->Edi;
+ mctx->esi = context->Esi;
+ mctx->ebx = context->Ebx;
+ mctx->edx = context->Edx;
+ mctx->ecx = context->Ecx;
+ mctx->eax = context->Eax;
+ mctx->ebp = context->Ebp;
+ mctx->esp = context->Esp;
#else
struct sigcontext *ctx = (struct sigcontext *)sigctx;
UCONTEXT_REG_ESI (ctx) = mctx->esi;
UCONTEXT_REG_EDI (ctx) = mctx->edi;
UCONTEXT_REG_EIP (ctx) = mctx->eip;
+#elif defined(HOST_WIN32)
+ CONTEXT *context = (CONTEXT*)sigctx;
+
+ context->Eip = mctx->eip;
+ context->Edi = mctx->edi;
+ context->Esi = mctx->esi;
+ context->Ebx = mctx->ebx;
+ context->Edx = mctx->edx;
+ context->Ecx = mctx->ecx;
+ context->Eax = mctx->eax;
+ context->Ebp = mctx->ebp;
+ context->Esp = mctx->esp;
#else
struct sigcontext *ctx = (struct sigcontext *)sigctx;
#include <mono/utils/mono-context.h>
+#ifdef HOST_WIN32
+#include <windows.h>
+#endif
+
void
mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx)
{
mctx->r14 = UCONTEXT_REG_R14 (ctx);
mctx->r15 = UCONTEXT_REG_R15 (ctx);
mctx->rip = UCONTEXT_REG_RIP (ctx);
+#elif defined(HOST_WIN32)
+ CONTEXT *context = (CONTEXT*)sigctx;
+
+ mctx->rip = context->Rip;
+ mctx->rax = context->Rax;
+ mctx->rcx = context->Rcx;
+ mctx->rdx = context->Rdx;
+ mctx->rbx = context->Rbx;
+ mctx->rsp = context->Rsp;
+ mctx->rbp = context->Rbp;
+ mctx->rsi = context->Rsi;
+ mctx->rdi = context->Rdi;
+ mctx->r8 = context->R8;
+ mctx->r9 = context->R9;
+ mctx->r10 = context->R10;
+ mctx->r11 = context->R11;
+ mctx->r12 = context->R12;
+ mctx->r13 = context->R13;
+ mctx->r14 = context->R14;
+ mctx->r15 = context->R15;
#else
MonoContext *ctx = (MonoContext *)sigctx;
UCONTEXT_REG_R14 (ctx) = mctx->r14;
UCONTEXT_REG_R15 (ctx) = mctx->r15;
UCONTEXT_REG_RIP (ctx) = mctx->rip;
+#elif defined(HOST_WIN32)
+ CONTEXT *context = (CONTEXT*)sigctx;
+
+ context->Rip = mctx->rip;
+ context->Rax = mctx->rax;
+ context->Rcx = mctx->rcx;
+ context->Rdx = mctx->rdx;
+ context->Rbx = mctx->rbx;
+ context->Rsp = mctx->rsp;
+ context->Rbp = mctx->rbp;
+ context->Rsi = mctx->rsi;
+ context->Rdi = mctx->rdi;
+ context->R8 = mctx->r8;
+ context->R9 = mctx->r9;
+ context->R10 = mctx->r10;
+ context->R11 = mctx->r11;
+ context->R12 = mctx->r12;
+ context->R13 = mctx->r13;
+ context->R14 = mctx->r14;
+ context->R15 = mctx->r15;
#else
MonoContext *ctx = (MonoContext *)sigctx;
: "rdx", "memory")
#endif
-#if !defined(HOST_WIN32)
#define MONO_ARCH_HAS_MONO_CONTEXT 1
-#endif
#elif (defined(__arm__) && !defined(MONO_CROSS_COMPILE)) || (defined(TARGET_ARM)) /* defined(__x86_64__) */
ctx.pc = ctx.regs [15]; \
} while (0)
+#define MONO_ARCH_HAS_MONO_CONTEXT 1
+
#elif (defined(__aarch64__) && !defined(MONO_CROSS_COMPILE)) || (defined(TARGET_ARM64))
#include <mono/arch/arm64/arm64-codegen.h>
#endif
+/*
+ * The naming is misleading, the SIGCTX argument should be the platform's context
+ * structure (ucontext_c on posix, CONTEXT on windows).
+ */
void mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx) MONO_INTERNAL;
+
+/*
+ * This will not completely initialize SIGCTX since MonoContext contains less
+ * information that the system context. The caller should obtain a SIGCTX from
+ * the system, and use this function to override the parts of it which are
+ * also in MonoContext.
+ */
void mono_monoctx_to_sigctx (MonoContext *mctx, void *sigctx) MONO_INTERNAL;
#endif /* __MONO_MONO_CONTEXT_H__ */
wchar_t* buf = NULL;
DWORD code = GetLastError ();
- if (FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL,
+ if (FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, 0, NULL))
{
ret = g_utf16_to_utf8 (buf, wcslen(buf), NULL, NULL, NULL);
void
mono_error_set_assembly_load (MonoError *error, const char *assembly_name, const char *msg_format, ...) MONO_INTERNAL;
+void
+mono_error_set_assembly_load_simple (MonoError *error, const char *assembly_name, gboolean refection_only) MONO_INTERNAL;
+
void
mono_error_set_type_load_class (MonoError *error, MonoClass *klass, const char *msg_format, ...) MONO_INTERNAL;
MonoException*
mono_error_prepare_exception (MonoError *error, MonoError *error_out) MONO_INTERNAL;
+MonoException*
+mono_error_convert_to_exception (MonoError *error) MONO_INTERNAL;
+
void
mono_error_raise_exception (MonoError *error) MONO_INTERNAL;
set_error_message ();
}
+
+void
+mono_error_set_assembly_load_simple (MonoError *oerror, const char *assembly_name, gboolean refection_only)
+{
+ if (refection_only)
+ mono_error_set_assembly_load (oerror, assembly_name, "Cannot resolve dependency to assembly because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.");
+ else
+ mono_error_set_assembly_load (oerror, assembly_name, "Could not load file or assembly or one of its dependencies.");
+}
+
void
mono_error_set_type_load_class (MonoError *oerror, MonoClass *klass, const char *msg_format, ...)
{
break;
case MONO_EXCEPTION_FILE_NOT_FOUND:
- if (loader_error->ref_only)
- mono_error_set_assembly_load (oerror, loader_error->assembly_name, "Cannot resolve dependency to assembly because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.");
- else
- mono_error_set_assembly_load (oerror, loader_error->assembly_name, "Could not load file or assembly or one of its dependencies.");
+ mono_error_set_assembly_load_simple (oerror, loader_error->assembly_name, loader_error->ref_only);
break;
case MONO_EXCEPTION_METHOD_ACCESS:
}
/*
-Raises the exception of @error.
-Does nothing if @error has a success error code.
-Aborts in case of a double fault. This happens when it can't recover from an error caused by trying
-to construct the first exception object.
-The error object @error is cleaned up.
+Convert this MonoError to an exception if it's faulty or return NULL.
+The error object is cleant after.
*/
-void
-mono_error_raise_exception (MonoError *target_error)
+
+MonoException*
+mono_error_convert_to_exception (MonoError *target_error)
{
MonoError error;
MonoException *ex;
if (mono_error_ok (target_error))
- return;
+ return NULL;
ex = mono_error_prepare_exception (target_error, &error);
if (!mono_error_ok (&error)) {
mono_error_cleanup (&error);
}
mono_error_cleanup (target_error);
+ return ex;
+}
- mono_raise_exception (ex);
+
+/*
+Raises the exception of @error.
+Does nothing if @error has a success error code.
+Aborts in case of a double fault. This happens when it can't recover from an error caused by trying
+to construct the first exception object.
+The error object @error is cleaned up.
+*/
+void
+mono_error_raise_exception (MonoError *target_error)
+{
+ MonoException *ex = mono_error_convert_to_exception (target_error);
+ if (ex)
+ mono_raise_exception (ex);
}
static const char *mono_log_domain = "Mono";
static GQueue *level_stack = NULL;
+static MonoPrintCallback print_callback, printerr_callback;
/**
* mono_trace_init:
{
return (level <= current_level && mask & current_mask);
}
+
+static MonoLogCallback log_callback;
+
+static const char*
+log_level_get_name (GLogLevelFlags log_level)
+{
+ switch (log_level & G_LOG_LEVEL_MASK) {
+ case G_LOG_LEVEL_ERROR: return "error";
+ case G_LOG_LEVEL_CRITICAL: return "critical";
+ case G_LOG_LEVEL_WARNING: return "warning";
+ case G_LOG_LEVEL_MESSAGE: return "message";
+ case G_LOG_LEVEL_INFO: return "info";
+ case G_LOG_LEVEL_DEBUG: return "debug";
+ default: return "unknown";
+ }
+}
+
+static void
+log_adapter (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
+{
+ log_callback (log_domain, log_level_get_name (log_level), message, log_level & G_LOG_LEVEL_ERROR, user_data);
+}
+
+/**
+ * mono_trace_set_log_handler:
+ *
+ * @callback The callback that will replace the default logging handler
+ * @user_data Argument passed to @callback
+ *
+ * The log handler replaces the default runtime logger. All logging requests with be routed to it.
+ * If the fatal argument in the callback is true, the callback must abort the current process. The runtime expects that
+ * execution will not resume after a fatal error.
+ */
+void
+mono_trace_set_log_handler (MonoLogCallback callback, void *user_data)
+{
+ g_assert (callback);
+ log_callback = callback;
+ g_log_set_default_handler (log_adapter, user_data);
+}
+
+static void
+print_handler (const char *string)
+{
+ print_callback (string, TRUE);
+}
+
+static void
+printerr_handler (const char *string)
+{
+ printerr_callback (string, FALSE);
+}
+
+/**
+ * mono_trace_set_print_handler:
+ *
+ * @callback The callback that will replace the default runtime behavior for stdout output.
+ *
+ * The print handler replaces the default runtime stdout output handler. This is used by free form output done by the runtime.
+ *
+ */
+void
+mono_trace_set_print_handler (MonoPrintCallback callback)
+{
+ g_assert (callback);
+ print_callback = callback;
+ g_set_print_handler (print_handler);
+}
+
+/**
+ * mono_trace_set_printerr_handler:
+ *
+ * @callback The callback that will replace the default runtime behavior for stderr output.
+ *
+ * The print handler replaces the default runtime stderr output handler. This is used by free form output done by the runtime.
+ *
+ */
+void
+mono_trace_set_printerr_handler (MonoPrintCallback callback)
+{
+ g_assert (callback);
+ printerr_callback = callback;
+ g_set_print_handler (printerr_handler);
+}
MONO_API void
mono_trace_set_mask_string (const char *value);
+typedef void (*MonoLogCallback) (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data);
+typedef void (*MonoPrintCallback) (const char *string, mono_bool is_stdout);
+
+MONO_API void
+mono_trace_set_log_handler (MonoLogCallback callback, void *user_data);
+
+MONO_API void
+mono_trace_set_print_handler (MonoPrintCallback callback);
+
+MONO_API void
+mono_trace_set_printerr_handler (MonoPrintCallback callback);
+
+
MONO_END_DECLS
#endif /* __MONO_LOGGER_H__ */
#ifndef __MONO_MUTEX_H__
#define __MONO_MUTEX_H__
+#include <config.h>
+
#include <glib.h>
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#include <time.h>
#ifdef HOST_WIN32
+#include <winsock2.h>
#include <windows.h>
#endif
}
#else
+#ifdef HOST_WIN32
+/* For select */
+#include <winsock2.h>
+#endif
+
int
mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout)
{
struct task_basic_info t_info;
mach_msg_type_number_t th_count = TASK_BASIC_INFO_COUNT;
- if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
- RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+ if (pid == getpid ()) {
+ /* task_for_pid () doesn't work on ios, even for the current process */
+ task = mach_task_self ();
+ } else {
+ if (task_for_pid (mach_task_self (), pid, &task) != KERN_SUCCESS)
+ RET_ERROR (MONO_PROCESS_ERROR_NOT_FOUND);
+ }
if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
- mach_port_deallocate (mach_task_self (), task);
+ if (pid != getpid ())
+ mach_port_deallocate (mach_task_self (), task);
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
}
else
ret = 0;
- mach_port_deallocate (mach_task_self (), task);
+ if (pid != getpid ())
+ mach_port_deallocate (mach_task_self (), task);
return ret;
#else
typedef int32_t mono_bool;
typedef uint8_t mono_byte;
typedef uint16_t mono_unichar2;
+typedef uint32_t mono_unichar4;
typedef void (*MonoFunc) (void* data, void* user_data);
typedef void (*MonoHFunc) (void* key, void* value, void* user_data);
#if defined(TARGET_X86)
-#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__DragonFly__)
#include <ucontext.h>
#endif
#if defined(__APPLE__)
#include <AvailabilityMacros.h>
#endif
-#if defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
#define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_eax)
#define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_ebx)
#define UCONTEXT_REG_ECX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_ecx)
#elif defined(TARGET_AMD64)
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <ucontext.h>
#endif
#define UCONTEXT_REG_R13(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r13)
#define UCONTEXT_REG_R14(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r14)
#define UCONTEXT_REG_R15(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r15)
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#define UCONTEXT_REG_RAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rax)
#define UCONTEXT_REG_RBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rbx)
#define UCONTEXT_REG_RCX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_rcx)
--- /dev/null
+#include <config.h>
+
+#if defined(PLATFORM_ANDROID)
+
+#ifdef ENABLE_EXTENSION_MODULE
+#include "../../../mono-extensions/mono/utils/mono-threads-android.c"
+#endif
+
+#endif
--- /dev/null
+#include <config.h>
+
+#if defined(__FreeBSD__)
+
+#include <pthread.h>
+#include <pthread_np.h>
+
+void
+mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize)
+{
+ pthread_attr_t attr;
+ guint8 *current = (guint8*)&attr;
+
+ *staddr = NULL;
+ *stsize = (size_t)-1;
+
+ pthread_attr_init (&attr);
+ pthread_attr_get_np (pthread_self (), &attr);
+
+ pthread_attr_getstack (&attr, (void**)staddr, stsize);
+ pthread_attr_destroy (&attr);
+}
+
+#endif
--- /dev/null
+#include <config.h>
+
+#if defined(__linux__) && !defined(PLATFORM_ANDROID)
+
+#include <mono/utils/mono-threads.h>
+#include <pthread.h>
+
+void
+mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize)
+{
+ pthread_attr_t attr;
+
+ *staddr = NULL;
+ *stsize = (size_t)-1;
+
+ pthread_getattr_np (pthread_self (), &attr);
+ pthread_attr_getstack (&attr, (void**)staddr, stsize);
+ pthread_attr_destroy (&attr);
+}
+
+#endif
#if defined(__MACH__)
+#include <stdio.h>
#include <objc/runtime.h>
#include <objc/message.h>
#include <mono/utils/mono-compiler.h>
#if defined(__MACH__)
+/* For pthread_main_np, pthread_get_stackaddr_np and pthread_get_stacksize_np */
+#define _DARWIN_C_SOURCE 1
+
#include <mono/utils/mach-support.h>
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-semaphore.h>
#include <mono/utils/mono-threads.h>
#include <mono/utils/hazard-pointer.h>
+#include <mono/utils/mono-mmap.h>
#include <mono/metadata/gc-internal.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/threads-types.h>
-#include <pthread.h>
-#include <errno.h>
-
void
mono_threads_init_platform (void)
{
/* pthread_setnmae_np() on Mac is not documented and doesn't receive thread id. */
}
+void
+mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize)
+{
+ *staddr = (guint8*)pthread_get_stackaddr_np (pthread_self());
+ *stsize = pthread_get_stacksize_np (pthread_self());
+
+#ifdef TARGET_OSX
+ /*
+ * Mavericks reports stack sizes as 512kb:
+ * http://permalink.gmane.org/gmane.comp.java.openjdk.hotspot.devel/11590
+ * https://bugs.openjdk.java.net/browse/JDK-8020753
+ */
+ if (pthread_main_np () && *stsize == 512 * 1024)
+ *stsize = 2048 * mono_pagesize ();
+#endif
+
+ /* staddr points to the start of the stack, not the end */
+ *staddr -= *stsize;
+}
+
#endif
--- /dev/null
+#include <config.h>
+
+#if defined(__OpenBSD__)
+
+#include <pthread.h>
+#include <pthread_np.h>
+
+void
+mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize)
+{
+ /* TODO : Determine if this code is actually still needed. It may already be covered by the case above. */
+ pthread_attr_t attr;
+ guint8 *current = (guint8*)&attr;
+
+ *staddr = NULL;
+ *stsize = (size_t)-1;
+
+ pthread_attr_init (&attr);
+
+ stack_t ss;
+ int rslt;
+
+ rslt = pthread_stackseg_np (pthread_self (), &ss);
+ g_assert (rslt == 0);
+
+ *staddr = (guint8*)((size_t)ss.ss_sp - ss.ss_size);
+ *stsize = ss.ss_size;
+
+ pthread_attr_destroy (&attr);
+}
+
+#endif
#include <config.h>
-#if defined(TARGET_OSX)
-/* For pthread_main_np () */
-#define _DARWIN_C_SOURCE 1
-#include <pthread.h>
-#endif
-
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
-#include <pthread.h>
-#include <pthread_np.h>
-#endif
-
#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-semaphore.h>
#include <mono/utils/mono-threads.h>
extern int tkill (pid_t tid, int signal);
#endif
-#if defined(PLATFORM_MACOSX) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
-void *pthread_get_stackaddr_np(pthread_t);
-size_t pthread_get_stacksize_np(pthread_t);
-#endif
-
#if defined(_POSIX_VERSION) || defined(__native_client__)
#include <sys/resource.h>
#include <signal.h>
MONO_SEM_POST (&info->create_suspended_sem);
}
-void
-mono_threads_core_get_stack_bounds (guint8 **staddr, size_t *stsize)
-{
-#if defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
- /* Mac OS X */
- *staddr = (guint8*)pthread_get_stackaddr_np (pthread_self());
- *stsize = pthread_get_stacksize_np (pthread_self());
-
-#ifdef TARGET_OSX
- /*
- * Mavericks reports stack sizes as 512kb:
- * http://permalink.gmane.org/gmane.comp.java.openjdk.hotspot.devel/11590
- * https://bugs.openjdk.java.net/browse/JDK-8020753
- */
- if (pthread_main_np () && *stsize == 512 * 1024)
- *stsize = 2048 * mono_pagesize ();
-#endif
-
- /* staddr points to the start of the stack, not the end */
- *staddr -= *stsize;
-
- /* When running under emacs, sometimes staddr is not aligned to a page size */
- *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize() - 1));
- return;
-
-#elif (defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_ATTR_GET_NP)) && defined(HAVE_PTHREAD_ATTR_GETSTACK)
- /* Linux, BSD */
-
- pthread_attr_t attr;
- guint8 *current = (guint8*)&attr;
-
- *staddr = NULL;
- *stsize = (size_t)-1;
-
- pthread_attr_init (&attr);
-
-#if defined(HAVE_PTHREAD_GETATTR_NP)
- /* Linux */
- pthread_getattr_np (pthread_self(), &attr);
-
-#elif defined(HAVE_PTHREAD_ATTR_GET_NP)
- /* BSD */
- pthread_attr_get_np (pthread_self(), &attr);
-
-#else
-#error Cannot determine which API is needed to retrieve pthread attributes.
-#endif
-
- pthread_attr_getstack (&attr, (void**)staddr, stsize);
- pthread_attr_destroy (&attr);
-
- if (*staddr)
- g_assert ((current > *staddr) && (current < *staddr + *stsize));
-
- /* When running under emacs, sometimes staddr is not aligned to a page size */
- *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
- return;
-
-#elif defined(__OpenBSD__)
- /* OpenBSD */
- /* TODO : Determine if this code is actually still needed. It may already be covered by the case above. */
-
- pthread_attr_t attr;
- guint8 *current = (guint8*)&attr;
-
- *staddr = NULL;
- *stsize = (size_t)-1;
-
- pthread_attr_init (&attr);
-
- stack_t ss;
- int rslt;
-
- rslt = pthread_stackseg_np(pthread_self(), &ss);
- g_assert (rslt == 0);
-
- *staddr = (guint8*)((size_t)ss.ss_sp - ss.ss_size);
- *stsize = ss.ss_size;
-
- pthread_attr_destroy (&attr);
-
- if (*staddr)
- g_assert ((current > *staddr) && (current < *staddr + *stsize));
-
- /* When running under emacs, sometimes staddr is not aligned to a page size */
- *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
- return;
-
-#elif defined(sun) || defined(__native_client__)
- /* Solaris/Illumos, NaCl */
- pthread_attr_t attr;
- pthread_attr_init (&attr);
- pthread_attr_getstacksize (&attr, &stsize);
- pthread_attr_destroy (&attr);
- *staddr = NULL;
- return;
-
-#else
- /* FIXME: It'd be better to use the 'error' preprocessor macro here so we know
- at compile-time if the target platform isn't supported. */
-#warning "Unable to determine how to retrieve a thread's stack-bounds for this platform in 'mono_thread_get_stack_bounds()'."
- *staddr = NULL;
- *stsize = 0;
- return;
-#endif
-}
-
gboolean
mono_threads_core_yield (void)
{
return handle;
}
+gpointer
+mono_threads_core_prepare_interrupt (HANDLE thread_handle)
+{
+ return wapi_prepare_interrupt_thread (thread_handle);
+}
+
+void
+mono_threads_core_finish_interrupt (gpointer wait_handle)
+{
+ wapi_finish_interrupt_thread (wait_handle);
+}
+
+void
+mono_threads_core_self_interrupt (void)
+{
+ wapi_self_interrupt ();
+}
+
+void
+mono_threads_core_clear_interruption (void)
+{
+ wapi_clear_interruption ();
+}
+
#if !defined (__MACH__)
#if !defined(__native_client__)
#if defined(HOST_WIN32)
#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-compiler.h>
#include <limits.h>
{
}
+static void CALLBACK
+interrupt_apc (ULONG_PTR param)
+{
+}
+
void
mono_threads_core_interrupt (MonoThreadInfo *info)
{
- g_assert (0);
+ DWORD id = mono_thread_info_get_tid (info);
+ HANDLE handle;
+
+ handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
+ g_assert (handle);
+
+ QueueUserAPC ((PAPCFUNC)interrupt_apc, handle, (ULONG_PTR)NULL);
+
+ CloseHandle (handle);
}
void
gboolean
mono_threads_core_suspend (MonoThreadInfo *info)
{
- g_assert_not_reached ();
+ DWORD id = mono_thread_info_get_tid (info);
+ HANDLE handle;
+ DWORD result;
+ gboolean res;
+
+ g_assert (id != GetCurrentThreadId ());
+
+ handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
+ g_assert (handle);
+
+ result = SuspendThread (handle);
+ if (result == (DWORD)-1) {
+ fprintf (stderr, "could not suspend thread %x (handle %p): %d\n", id, handle, GetLastError ()); fflush (stderr);
+ CloseHandle (handle);
+ return FALSE;
+ }
+
+ CloseHandle (handle);
+
+ res = mono_threads_get_runtime_callbacks ()->thread_state_init_from_handle (&info->suspend_state, info);
+ g_assert (res);
+
+ return TRUE;
}
gboolean
mono_threads_core_resume (MonoThreadInfo *info)
{
- g_assert_not_reached ();
+ DWORD id = mono_thread_info_get_tid (info);
+ HANDLE handle;
+ DWORD result;
+
+ handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
+ g_assert (handle);
+
+ if (info->async_target) {
+ MonoContext ctx;
+ CONTEXT context;
+ gboolean res;
+
+ ctx = info->suspend_state.ctx;
+ mono_threads_get_runtime_callbacks ()->setup_async_callback (&ctx, info->async_target, info->user_data);
+ info->async_target = info->user_data = NULL;
+
+ context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL;
+
+ if (!GetThreadContext (handle, &context)) {
+ CloseHandle (handle);
+ return FALSE;
+ }
+
+ g_assert (context.ContextFlags & CONTEXT_INTEGER);
+ g_assert (context.ContextFlags & CONTEXT_CONTROL);
+
+ mono_monoctx_to_sigctx (&ctx, &context);
+
+ context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL;
+ res = SetThreadContext (handle, &context);
+ g_assert (res);
+ }
+
+ result = ResumeThread (handle);
+ g_assert (result != (DWORD)-1);
+
+ CloseHandle (handle);
+
+ return result != (DWORD)-1;
}
void
}
#if HAVE_DECL___READFSDWORD==0
-static __inline__ __attribute__((always_inline))
-unsigned long long
+static MONO_ALWAYS_INLINE unsigned long long
__readfsdword (unsigned long offset)
{
unsigned long value;
return OpenThread (THREAD_ALL_ACCESS, TRUE, tid);
}
+#if !defined(__GNUC__)
+const DWORD MS_VC_EXCEPTION=0x406D1388;
+#pragma pack(push,8)
+typedef struct tagTHREADNAME_INFO
+{
+ DWORD dwType; // Must be 0x1000.
+ LPCSTR szName; // Pointer to name (in user addr space).
+ DWORD dwThreadID; // Thread ID (-1=caller thread).
+ DWORD dwFlags; // Reserved for future use, must be zero.
+} THREADNAME_INFO;
+#pragma pack(pop)
+#endif
+
void
mono_threads_core_set_name (MonoNativeThreadId tid, const char *name)
{
+#if !defined(__GNUC__)
+ /* http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx */
+ THREADNAME_INFO info;
+ info.dwType = 0x1000;
+ info.szName = name;
+ info.dwThreadID = tid;
+ info.dwFlags = 0;
+
+ __try {
+ RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER) {
+ }
+#endif
+}
+
+
+gpointer
+mono_threads_core_prepare_interrupt (HANDLE thread_handle)
+{
+ return NULL;
+}
+
+void
+mono_threads_core_finish_interrupt (gpointer wait_handle)
+{
+}
+
+void
+mono_threads_core_self_interrupt (void)
+{
+}
+
+void
+mono_threads_core_clear_interruption (void)
+{
}
#endif
#include <mono/utils/mono-tls.h>
#include <mono/utils/hazard-pointer.h>
#include <mono/utils/mono-memory-model.h>
+#include <mono/utils/mono-mmap.h>
#include <errno.h>
static size_t thread_info_size;
static MonoThreadInfoCallbacks threads_callbacks;
static MonoThreadInfoRuntimeCallbacks runtime_callbacks;
-static MonoNativeTlsKey thread_info_key, small_id_key;
+static MonoNativeTlsKey thread_info_key, thread_exited_key, small_id_key;
static MonoLinkedListSet thread_list;
static gboolean disable_new_interrupt = FALSE;
static gboolean mono_threads_inited = FALSE;
THREADS_DEBUG ("unregistering info %p\n", info);
+ mono_native_tls_set_value (thread_exited_key, GUINT_TO_POINTER (1));
+
mono_threads_core_unregister (info);
/*
mono_thread_small_id_free (small_id);
}
+static void
+thread_exited_dtor (void *arg)
+{
+#if defined(__MACH__)
+ /*
+ * Since we use pthread dtors to clean up thread data, if a thread
+ * is attached to the runtime by another pthread dtor after our dtor
+ * has ran, it will never be detached, leading to various problems
+ * since the thread ids etc. will be reused while they are still in
+ * the threads hashtables etc.
+ * Dtors are called in a loop until all user tls entries are 0,
+ * but the loop has a maximum count (4), so if we set the tls
+ * variable every time, it will remain set when system tls dtors
+ * are ran. This allows mono_thread_info_is_exiting () to detect
+ * whenever the thread is exiting, even if it is executed from a
+ * system tls dtor (i.e. obj-c dealloc methods).
+ */
+ mono_native_tls_set_value (thread_exited_key, GUINT_TO_POINTER (1));
+#endif
+}
+
/**
* Removes the current thread from the thread list.
* This must be called from the thread unregister callback and nowhere else.
}
}
+/*
+ * mono_thread_info_is_exiting:
+ *
+ * Return whenever the current thread is exiting, i.e. it is running pthread
+ * dtors.
+ */
+gboolean
+mono_thread_info_is_exiting (void)
+{
+#if defined(__MACH__)
+ if (mono_native_tls_get_value (thread_exited_key) == GUINT_TO_POINTER (1))
+ return TRUE;
+#endif
+ return FALSE;
+}
+
void
mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
{
thread_info_size = info_size;
#ifdef HOST_WIN32
res = mono_native_tls_alloc (&thread_info_key, NULL);
+ res = mono_native_tls_alloc (&thread_exited_key, NULL);
#else
res = mono_native_tls_alloc (&thread_info_key, unregister_thread);
+ res = mono_native_tls_alloc (&thread_exited_key, thread_exited_dtor);
#endif
g_assert (res);
The return value is only valid until a matching mono_thread_info_resume is called
*/
static MonoThreadInfo*
-mono_thread_info_suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel)
+mono_thread_info_suspend_sync (MonoNativeThreadId tid, gboolean interrupt_kernel, const char **error_condition)
{
MonoThreadHazardPointers *hp = mono_hazard_pointer_get ();
MonoThreadInfo *info = mono_thread_info_lookup (tid); /*info on HP1*/
- if (!info)
+ if (!info) {
+ *error_condition = "Thread not found";
return NULL;
+ }
MONO_SEM_WAIT_UNITERRUPTIBLE (&info->suspend_semaphore);
/*thread is on the process of detaching*/
if (mono_thread_info_run_state (info) > STATE_RUNNING) {
mono_hazard_pointer_clear (hp, 1);
+ *error_condition = "Thread is detaching";
return NULL;
}
if (!mono_threads_core_suspend (info)) {
MONO_SEM_POST (&info->suspend_semaphore);
mono_hazard_pointer_clear (hp, 1);
+ *error_condition = "Could not suspend thread";
return NULL;
}
mono_thread_info_suspend_lock ();
for (;;) {
- if (!(info = mono_thread_info_suspend_sync (id, interrupt_kernel))) {
- g_warning ("failed to suspend thread %p, hopefully it is dead", (gpointer)id);
+ const char *suspend_error = "Unknown error";
+ if (!(info = mono_thread_info_suspend_sync (id, interrupt_kernel, &suspend_error))) {
+ g_warning ("failed to suspend thread %p due to %s, hopefully it is dead", (gpointer)id, suspend_error);
mono_thread_info_suspend_unlock ();
return NULL;
}
break;
if (!mono_thread_info_core_resume (info)) {
- g_warning ("failed to result thread %p, hopefully it is dead", (gpointer)id);
+ g_warning ("failed to resume thread %p, hopefully it is dead", (gpointer)id);
mono_hazard_pointer_clear (mono_hazard_pointer_get (), 1);
mono_thread_info_suspend_unlock ();
return NULL;
#if defined (HAVE_BOEHM_GC) && !defined (USE_INCLUDED_LIBGC)
return FALSE;
#endif
- /*port not done*/
#if defined(HOST_WIN32)
- return FALSE;
+ return !disable_new_interrupt;
#endif
#if defined (__i386__)
return !disable_new_interrupt;
+#endif
+#if defined(__arm__) && !defined(__APPLE__)
+ return !disable_new_interrupt;
#endif
return FALSE;
}
void
mono_thread_info_get_stack_bounds (guint8 **staddr, size_t *stsize)
{
+ guint8 *current = (guint8 *)&stsize;
mono_threads_core_get_stack_bounds (staddr, stsize);
+ if (!*staddr)
+ return;
+
+ /* Sanity check the result */
+ g_assert ((current > *staddr) && (current < *staddr + *stsize));
+
+ /* When running under emacs, sometimes staddr is not aligned to a page size */
+ *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
}
gboolean
}
/*
- * mono_thread_info_open_handle:
+ * mono_threads_open_thread_handle:
*
* Return a io-layer/win32 handle for the thread identified by HANDLE/TID.
* The handle need to be closed by calling CloseHandle () when it is no
{
mono_threads_core_set_name (tid, name);
}
+
+/*
+ * mono_thread_info_prepare_interrupt:
+ *
+ * See wapi_prepare_interrupt ().
+ */
+gpointer
+mono_thread_info_prepare_interrupt (HANDLE thread_handle)
+{
+ return mono_threads_core_prepare_interrupt (thread_handle);
+}
+
+void
+mono_thread_info_finish_interrupt (gpointer wait_handle)
+{
+ mono_threads_core_finish_interrupt (wait_handle);
+}
+
+void
+mono_thread_info_interrupt (HANDLE thread_handle)
+{
+ gpointer wait_handle;
+
+ wait_handle = mono_thread_info_prepare_interrupt (thread_handle);
+ mono_thread_info_finish_interrupt (wait_handle);
+}
+
+void
+mono_thread_info_self_interrupt (void)
+{
+ mono_threads_core_self_interrupt ();
+}
+
+void
+mono_thread_info_clear_interruption (void)
+{
+ mono_threads_core_clear_interruption ();
+}
void
mono_thread_info_detach (void) MONO_INTERNAL;
+gboolean
+mono_thread_info_is_exiting (void) MONO_INTERNAL;
+
THREAD_INFO_TYPE *
mono_thread_info_current (void) MONO_INTERNAL;
HANDLE
mono_thread_info_open_handle (void);
+gpointer
+mono_thread_info_prepare_interrupt (HANDLE thread_handle);
+
+void
+mono_thread_info_finish_interrupt (gpointer wait_handle);
+
+void
+mono_thread_info_interrupt (HANDLE thread_handle);
+
+void
+mono_thread_info_self_interrupt (void);
+
+void
+mono_thread_info_clear_interruption (void);
+
HANDLE
mono_threads_create_thread (LPTHREAD_START_ROUTINE start, gpointer arg, guint32 stack_size, guint32 creation_flags, MonoNativeThreadId *out_tid);
HANDLE mono_threads_core_open_handle (void) MONO_INTERNAL;
HANDLE mono_threads_core_open_thread_handle (HANDLE handle, MonoNativeThreadId tid) MONO_INTERNAL;
void mono_threads_core_set_name (MonoNativeThreadId tid, const char *name) MONO_INTERNAL;
+gpointer mono_threads_core_prepare_interrupt (HANDLE thread_handle);
+void mono_threads_core_finish_interrupt (gpointer wait_handle);
+void mono_threads_core_self_interrupt (void);
+void mono_threads_core_clear_interruption (void);
MonoNativeThreadId mono_native_thread_id_get (void) MONO_INTERNAL;
--- /dev/null
+/* $OpenBSD: sha1.c,v 1.22 2012/08/27 21:05:43 miod Exp $ */
+
+/*
+ * SHA-1 in C
+ * By Steve Reid <steve@edmweb.com>
+ * 100% Public Domain
+ *
+ * Test Vectors (from FIPS PUB 180-1)
+ * "abc"
+ * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
+ * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
+ * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
+ * A million repetitions of "a"
+ * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
+ */
+
+#include <sys/param.h>
+#include <string.h>
+#include <stdint.h>
+#include <sha1.h>
+
+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
+
+/*
+ * blk0() and blk() perform the initial expand.
+ * I got the idea of expanding during the round function from SSLeay
+ */
+#if BYTE_ORDER == LITTLE_ENDIAN
+# define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
+ |(rol(block->l[i],8)&0x00FF00FF))
+#else
+# define blk0(i) block->l[i]
+#endif
+#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
+ ^block->l[(i+2)&15]^block->l[i&15],1))
+
+/*
+ * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1
+ */
+#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
+#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
+#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
+#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
+#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
+
+typedef union {
+ guint8 c[64];
+ guint32 l[16];
+} CHAR64LONG16;
+
+/*
+ * Hash a single 512-bit block. This is the core of the algorithm.
+ */
+void
+SHA1Transform(guint32 state[5], const guint8 buffer[SHA1_BLOCK_LENGTH])
+{
+ guint32 a, b, c, d, e;
+ guint8 workspace[SHA1_BLOCK_LENGTH];
+ CHAR64LONG16 *block = (CHAR64LONG16 *)workspace;
+
+ (void)memcpy(block, buffer, SHA1_BLOCK_LENGTH);
+
+ /* Copy context->state[] to working vars */
+ a = state[0];
+ b = state[1];
+ c = state[2];
+ d = state[3];
+ e = state[4];
+
+ /* 4 rounds of 20 operations each. Loop unrolled. */
+ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
+ R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
+ R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
+ R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
+ R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
+ R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
+ R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
+ R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
+ R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
+ R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
+ R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
+ R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
+ R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
+ R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
+ R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
+ R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
+ R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
+ R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
+ R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
+ R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
+
+ /* Add the working vars back into context.state[] */
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+ state[4] += e;
+
+ /* Wipe variables */
+ a = b = c = d = e = 0;
+}
+
+
+/*
+ * SHA1Init - Initialize new context
+ */
+void
+SHA1Init(SHA1_CTX *context)
+{
+
+ /* SHA1 initialization constants */
+ context->count = 0;
+ context->state[0] = 0x67452301;
+ context->state[1] = 0xEFCDAB89;
+ context->state[2] = 0x98BADCFE;
+ context->state[3] = 0x10325476;
+ context->state[4] = 0xC3D2E1F0;
+}
+
+
+/*
+ * Run your data through this.
+ */
+void
+SHA1Update(SHA1_CTX *context, const guint8 *data, size_t len)
+{
+ size_t i, j;
+
+ j = (size_t)((context->count >> 3) & 63);
+ context->count += (len << 3);
+ if ((j + len) > 63) {
+ (void)memcpy(&context->buffer[j], data, (i = 64-j));
+ SHA1Transform(context->state, context->buffer);
+ for ( ; i + 63 < len; i += 64)
+ SHA1Transform(context->state, (guint8 *)&data[i]);
+ j = 0;
+ } else {
+ i = 0;
+ }
+ (void)memcpy(&context->buffer[j], &data[i], len - i);
+}
+
+
+/*
+ * Add padding and return the message digest.
+ */
+void
+SHA1Pad(SHA1_CTX *context)
+{
+ guint8 finalcount[8];
+ guint i;
+
+ for (i = 0; i < 8; i++) {
+ finalcount[i] = (guint8)((context->count >>
+ ((7 - (i & 7)) * 8)) & 255); /* Endian independent */
+ }
+ SHA1Update(context, (guint8 *)"\200", 1);
+ while ((context->count & 504) != 448)
+ SHA1Update(context, (guint8 *)"\0", 1);
+ SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
+}
+
+void
+SHA1Final(guint8 digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context)
+{
+ guint i;
+
+ SHA1Pad(context);
+ if (digest) {
+ for (i = 0; i < SHA1_DIGEST_LENGTH; i++) {
+ digest[i] = (guint8)
+ ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
+ }
+ memset(context, 0, sizeof(*context));
+ }
+}
--- /dev/null
+/* $OpenBSD: sha1.h,v 1.24 2012/12/05 23:19:57 deraadt Exp $ */
+
+/*
+ * SHA-1 in C
+ * By Steve Reid <steve@edmweb.com>
+ * 100% Public Domain
+ */
+
+#ifndef _SHA1_H
+#define _SHA1_H
+
+#include <glib.h>
+
+#define SHA1_BLOCK_LENGTH 64
+#define SHA1_DIGEST_LENGTH 20
+#define SHA1_DIGEST_STRING_LENGTH (SHA1_DIGEST_LENGTH * 2 + 1)
+
+typedef struct {
+ guint32 state[5];
+ guint64 count;
+ guint8 buffer[SHA1_BLOCK_LENGTH];
+} SHA1_CTX;
+
+G_BEGIN_DECLS
+void SHA1Init(SHA1_CTX *);
+void SHA1Pad(SHA1_CTX *);
+void SHA1Transform(guint32 [5], const guint8 [SHA1_BLOCK_LENGTH]);
+void SHA1Update(SHA1_CTX *, const guint8 *, size_t);
+void SHA1Final(guint8 [SHA1_DIGEST_LENGTH], SHA1_CTX *);
+char *SHA1End(SHA1_CTX *, char *);
+char *SHA1File(const char *, char *);
+char *SHA1FileChunk(const char *, char *, off_t, off_t);
+char *SHA1Data(const guint8 *, size_t, char *);
+G_END_DECLS
+
+#define HTONDIGEST(x) do { \
+ x[0] = htonl(x[0]); \
+ x[1] = htonl(x[1]); \
+ x[2] = htonl(x[2]); \
+ x[3] = htonl(x[3]); \
+ x[4] = htonl(x[4]); } while (0)
+
+#define NTOHDIGEST(x) do { \
+ x[0] = ntohl(x[0]); \
+ x[1] = ntohl(x[1]); \
+ x[2] = ntohl(x[2]); \
+ x[3] = ntohl(x[3]); \
+ x[4] = ntohl(x[4]); } while (0)
+
+#endif /* _SHA1_H */
<ClCompile Include="..\mono\utils\mach-support-x86.c" />\r
<ClCompile Include="..\mono\utils\mach-support.c" />\r
<ClCompile Include="..\mono\utils\mono-codeman.c" />\r
+ <ClCompile Include="..\mono\utils\mono-conc-hashtable.c" />\r
<ClCompile Include="..\mono\utils\mono-context.c" />\r
<ClCompile Include="..\mono\utils\mono-counters.c" />\r
<ClCompile Include="..\mono\utils\mono-dl.c" />\r
<ClInclude Include="..\mono\utils\memcheck.h" />\r
<ClInclude Include="..\mono\utils\mono-codeman.h" />\r
<ClInclude Include="..\mono\utils\mono-compiler.h" />\r
+ <ClInclude Include="..\mono\utils\mono-conc-hashtable.h" />\r
<ClInclude Include="..\mono\utils\mono-context.h" />\r
<ClInclude Include="..\mono\utils\mono-counters.h" />\r
<ClInclude Include="..\mono\utils\mono-digest.h" />\r
<PreBuildEvent>\r
<Command>winsetup.bat</Command>\r
</PreBuildEvent>\r
+ <MASM>\r
+ <PreprocessorDefinitions>X64</PreprocessorDefinitions>\r
+ </MASM>\r
</ItemDefinitionGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
mono_metadata_implmap_from_method
mono_metadata_init
mono_metadata_interfaces_from_typedef
-mono_metadata_load_generic_param_constraints
mono_metadata_load_generic_params
mono_metadata_locate
mono_metadata_locate_token
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="MonoDefines">
<top_srcdir>$(MSBuildProjectDirectory)\..</top_srcdir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
- <PreprocessorDefinitions>__default_codegen__;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;GC_NOT_DLL;WIN32_THREADS;WINVER=0x0500;_WIN32_WINNT=0x0500;_WIN32_IE=0x0501;_UNICODE;UNICODE;WIN32_THREADS;FD_SETSIZE=1024;$(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>__default_codegen__;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;GC_NOT_DLL;WIN32_THREADS;WINVER=0x0500;_WIN32_WINNT=0x0500;_WIN32_IE=0x0501;_UNICODE;UNICODE;WIN32_THREADS;FD_SETSIZE=1024;$(PreprocessorDefinitions);_WINSOCKAPI_</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4273;4005</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>Mswsock.lib;ws2_32.lib;ole32.lib;oleaut32.lib;psapi.lib;version.lib;advapi32.lib;winmm.lib;kernel32.lib;$(AdditionalDependencies)</AdditionalDependencies>
# depend on $(symlinks) to ensure 'etc/mono' directory exists
etc/mono/config: ../data/config Makefile $(symlinks)
d=`cd ../support && pwd`; \
- sed 's,target="$(prefix)/lib/libMonoPosixHelper$(libsuffix)",target="'$$d'/libMonoPosixHelper.la",' ../data/config > $@t
+ sed 's,target="$(prefix)/$(reloc_libdir)/libMonoPosixHelper$(libsuffix)",target="'$$d'/libMonoPosixHelper.la",' ../data/config > $@t
if test -z "$(libgdiplus_loc)"; then :; else \
sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@t > $@tt; \
mv -f $@tt $@t; fi
prj2make$(SCRIPT_SUFFIX) \
soapsuds$(SCRIPT_SUFFIX) \
caspol$(SCRIPT_SUFFIX) \
+ cert-sync$(SCRIPT_SUFFIX) \
cert2spc$(SCRIPT_SUFFIX) \
certmgr$(SCRIPT_SUFFIX) \
chktrust$(SCRIPT_SUFFIX) \
// Apply global rule first <alias source="locale" path="../dayPeriodWidth[@type='wide']"/>
el = node.SelectSingleNode ("dayPeriods/dayPeriodContext/dayPeriodWidth[@type='wide']/dayPeriod[@type='am']");
+ // Manual edits for exact .net compatiblity
switch (ci.Name) {
case "en-AU":
df.AMDesignator = "AM";
break;
+ case "en-NZ":
+ df.AMDesignator = "a.m.";
+ break;
default:
if (el != null)
df.AMDesignator = el.InnerText;
case "en-AU":
df.PMDesignator = "PM";
break;
+ case "en-NZ":
+ df.PMDesignator = "p.m.";
+ break;
default:
if (el != null)
df.PMDesignator = el.InnerText;
if m:
generation = int (m.group (1))
concurrent = int (m.group (2))
- usecs = int (m.group (3))
- start = int (m.group (4))
+ msecs = int (m.group (3)) / 10.0 / 1000.0
+ start = int (m.group (4)) / 10.0 / 1000.0
if generation == 0:
generation = "minor"
- minor_pausetimes.append (usecs)
+ minor_pausetimes.append (msecs)
else:
generation = "major"
- major_pausetimes.append (usecs)
+ major_pausetimes.append (msecs)
if concurrent == 1:
kind = "CONC"
else:
kind = "SYNC"
- rec = (generation, start, start + usecs, kind)
+ rec = (generation, start, start + msecs, kind)
print rec
data.append (rec)
if show_major:
pausetimes += major_pausetimes
plt.hist (pausetimes, 100)
+ plt.xlabel ('Pause time in msec')
else:
data = np.array (data, dtype = [('caption', '|S20'), ('start', int), ('stop', int), ('kind', '|S20')])
cap, start, stop=data['caption'], data['start'], data['stop']