mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
182
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7b1a66b94 | ||
|
|
7b06e01c8f | ||
|
|
efb68a566b | ||
|
|
1ea3cc4cf0 | ||
|
|
2387e7270d | ||
|
|
dd49afdaf1 | ||
|
|
59b3a649d5 | ||
|
|
c5fd486b84 | ||
|
|
637aa4c949 | ||
|
|
5db35126ad | ||
|
|
7b270fecd9 | ||
|
|
4e6fe443a2 | ||
|
|
b2882b35e8 | ||
|
|
1c482a505c | ||
|
|
d14e5c26e2 | ||
|
|
de071f89a0 | ||
|
|
2ddeac257f | ||
|
|
00c96e5ee1 | ||
|
|
939f5b706d | ||
|
|
a549de0c98 | ||
|
|
e4767b2ed7 | ||
|
|
e336bccc7a | ||
|
|
5b5f567690 | ||
|
|
46184895e1 | ||
|
|
8b4bde4713 | ||
|
|
8e21b187db | ||
|
|
2557c91607 | ||
|
|
480b7f5d7b | ||
|
|
6629632a6a | ||
|
|
9f99215160 | ||
|
|
278f836939 | ||
|
|
e2bac9878f | ||
|
|
f275b6e485 | ||
|
|
bf926e9d96 | ||
|
|
6371e5446d | ||
|
|
e6553234a6 | ||
|
|
f85a872195 | ||
|
|
bcd23c2ce3 | ||
|
|
f243f57580 | ||
|
|
2eab3e93ec | ||
|
|
2f5dd747db | ||
|
|
9b21552888 | ||
|
|
130cc0265e | ||
|
|
1aa65b49b5 | ||
|
|
3d4af0a3ca | ||
|
|
34a36c6021 | ||
|
|
f544ec6a5a | ||
|
|
dadc02c527 | ||
|
|
b1d2757f8e | ||
|
|
87f3f3d032 | ||
|
|
a93743339f | ||
|
|
7faba06720 | ||
|
|
652318a44d | ||
|
|
724f0a6d4e | ||
|
|
5ebc3a5956 | ||
|
|
76cb00959c | ||
|
|
3397f96efb | ||
|
|
8c24850ae5 | ||
|
|
95974cdb7a | ||
|
|
8722a70b7a | ||
|
|
e6e4288c5b | ||
|
|
5bbfe2090e | ||
|
|
f9427d49b1 | ||
|
|
8561c8042c | ||
|
|
d9334ab132 | ||
|
|
27810cca75 | ||
|
|
38342a2028 | ||
|
|
ab969071df | ||
|
|
121aafc036 | ||
|
|
01443d56f9 | ||
|
|
d349d3cf66 | ||
|
|
508eeb5266 | ||
|
|
9698eebc3a | ||
|
|
bf0c63bdaf | ||
|
|
1f4d704c06 | ||
|
|
0c2a768d04 | ||
|
|
d4b59a0987 | ||
|
|
d66bd40a5e | ||
|
|
8ecd5784fc | ||
|
|
864017ae96 | ||
|
|
9fa61327c6 | ||
|
|
ac33be5c4f | ||
|
|
022cc2489d | ||
|
|
c9cd06e98c | ||
|
|
d3c3b9817a | ||
|
|
6574c4842c | ||
|
|
35af91a654 | ||
|
|
924eaae1b1 | ||
|
|
5c0653cc3b | ||
|
|
9b10d5247d | ||
|
|
eed9f45d27 | ||
|
|
e938f4fad3 | ||
|
|
47eb68cddb | ||
|
|
db68333eb7 | ||
|
|
3fd99b981e | ||
|
|
d59ab90071 | ||
|
|
8a7077c3fd | ||
|
|
fdb3f32aff | ||
|
|
bf91fdc886 | ||
|
|
afabc945e6 | ||
|
|
2d6f641629 | ||
|
|
cbbb130a5f | ||
|
|
47b637d576 | ||
|
|
82d4d8a64c | ||
|
|
e29ff8407d | ||
|
|
b2225d42ea | ||
|
|
5e95510e6e | ||
|
|
a583e2b947 | ||
|
|
a84f9e8fa3 | ||
|
|
c10bca60c9 | ||
|
|
6ddc460530 | ||
|
|
00f6a73eb1 | ||
|
|
37b08459d4 | ||
|
|
83ceed4489 | ||
|
|
bcd3aec7e5 | ||
|
|
e4ce9895a7 | ||
|
|
542d8e5b0e | ||
|
|
8a6f210585 | ||
|
|
989abab5fb | ||
|
|
e01b93cd98 | ||
|
|
1b19fbcc37 | ||
|
|
e46bc42fa8 | ||
|
|
eb6253ba03 | ||
|
|
3ed4f50114 | ||
|
|
427d699aa3 | ||
|
|
4e0d8f27ba | ||
|
|
1ee3e71937 | ||
|
|
988168e2c3 | ||
|
|
dbacc958c8 | ||
|
|
cc46bbf965 | ||
|
|
089e8de54b | ||
|
|
57a84b0eeb | ||
|
|
78a2769fe2 | ||
|
|
986ce54e81 | ||
|
|
4a7de092d4 | ||
|
|
bf76a83964 | ||
|
|
510576a508 | ||
|
|
75639f296f | ||
|
|
e7d5ef2c30 | ||
|
|
4d30c11e0c | ||
|
|
d3a81ce711 | ||
|
|
4170fd8523 | ||
|
|
73545d7a30 | ||
|
|
47ecadbebb | ||
|
|
b0b8b6fbd8 | ||
|
|
a5c3f5c622 | ||
|
|
b7f7a9261e | ||
|
|
ebe3ff9854 | ||
|
|
b4b1af268b | ||
|
|
37b6e49f7f | ||
|
|
766c997480 | ||
|
|
b79c922ef9 | ||
|
|
524ecb2f30 | ||
|
|
70ff2308c0 | ||
|
|
e19a0cdd3f | ||
|
|
ae1b7774cd | ||
|
|
579a15b47a | ||
|
|
d25226e6f7 | ||
|
|
9fb03707ab | ||
|
|
f82536d160 | ||
|
|
908a4b9c8d | ||
|
|
e2bf3c46d7 | ||
|
|
eb6fd2eb23 | ||
|
|
464026f902 | ||
|
|
3e9be851d4 | ||
|
|
35439fa111 | ||
|
|
822dba4a3e | ||
|
|
8d9bebe7fd | ||
|
|
452b871488 | ||
|
|
c3b5d44422 | ||
|
|
fcb0a02c88 | ||
|
|
b43ae3c971 | ||
|
|
f708641b8d | ||
|
|
4e10c1ab81 | ||
|
|
da3f57c214 | ||
|
|
48dccee80f | ||
|
|
1faa706804 | ||
|
|
38e2ec8469 | ||
|
|
57dbdb3e42 | ||
|
|
e83157f0bf | ||
|
|
6bc712404f | ||
|
|
31349722b8 |
No files matched your search
@@ -1,71 +1,23 @@
|
||||
2008-08-06 Zoltan Varga <[email protected]>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add dtrace-prelink.sh and build-mingw32.sh.
|
||||
|
||||
* scripts/Makefile.am (EXTRA_DIST): Add patch-quiet.sh.
|
||||
|
||||
2008-08-05 Marek Habersack <[email protected]>
|
||||
|
||||
* configure.in: use the PKG_CONFIG_PATH only when cross-compiling.
|
||||
|
||||
2008-08-05 Marek Habersack <[email protected]>
|
||||
|
||||
* configure.in: added support for cross-compilation
|
||||
|
||||
2008-08-05 Marek Habersack <[email protected]>
|
||||
|
||||
* build-mingw32.sh: added a script to build Mono for Windows on a
|
||||
Linux host using mingw.
|
||||
|
||||
2008-08-05 Marek Habersack <[email protected]>
|
||||
|
||||
* scripts/Makefile.am: added support for cross-compilation,
|
||||
including .bat generation for windows targets.
|
||||
|
||||
2008-08-05 Marek Habersack <[email protected]>
|
||||
|
||||
* scripts/smcs.bat.in, scripts/script.bat.in,
|
||||
scripts/script_umask.bat.in: added .bat templates.
|
||||
|
||||
2008-08-05 Marek Habersack <[email protected]>
|
||||
|
||||
* runtime/Makefile.am: mingw cross-compilation support.
|
||||
|
||||
2008-08-05 Andreas Färber <[email protected]>
|
||||
|
||||
* autogen.sh: Suppress arguments warning for NOCONFIGURE.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
2008-08-02 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Enable dtrace by default on platforms which support it.
|
||||
|
||||
2008-07-27 Zoltan Varga <[email protected]>
|
||||
|
||||
* scripts/patch-quiet.sh: Make the libtool --quiet flag configurable by
|
||||
V=1 as well.
|
||||
|
||||
2008-07-24 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Patch libtool to avoid the
|
||||
'copying selected object files ...' messages.
|
||||
|
||||
* configure.in: Invoke patch-quiet.sh using AC_CONFIG_COMMANDS so it
|
||||
runs during a reconfigure too.
|
||||
|
||||
Backported from trunk.
|
||||
|
||||
2008-07-24 Rodrigo Kumpera <[email protected]>
|
||||
|
||||
* configure.in: Change USED_GC_NAME to show if parallel mark is used.
|
||||
This is shown in mono --version.
|
||||
|
||||
2008-07-22 Mark Probst <[email protected]>
|
||||
|
||||
* configure.in: New configure option (--with-malloc-mempools) to
|
||||
make mempools use malloc for every single allocation, which makes
|
||||
it easier to use debugging/profiling tools like Valgrind.
|
||||
|
||||
2008-07-21 Zoltan Varga <[email protected]>
|
||||
|
||||
* configure.in: Invoke patch-quiet.sh using AC_CONFIG_COMMANDS so it
|
||||
runs during a reconfigure too.
|
||||
Backported from trunk.
|
||||
|
||||
2008-07-13 Zoltan Varga <[email protected]>
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ SUBDIRS = $(libgc_dir) $(eglib_dir) mono $(ikvm_native_dir) support docs data ru
|
||||
## 'tools' is not normally built
|
||||
DIST_SUBDIRS = libgc $(eglib_dir) mono ikvm-native support docs data runtime scripts man samples web tools msvc
|
||||
|
||||
EXTRA_DIST= mono-uninstalled.pc.in dtrace-prelink.sh build-mingw32.sh LICENSE
|
||||
EXTRA_DIST= mono-uninstalled.pc.in LICENSE
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = EXTERNAL_MCS=false EXTERNAL_RUNTIME=false
|
||||
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test x$NOCONFIGURE = x && test -z "$*"; then
|
||||
if test -z "$*"; then
|
||||
echo "**Warning**: I am going to run \`configure' with no arguments."
|
||||
echo "If you wish to pass any to it, please specify them on the"
|
||||
echo \`$0\'" command line."
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
CURDIR="`pwd`"
|
||||
CROSS_DIR=${1:-/opt/cross/}
|
||||
MINGW=${1:-i386-mingw32msvc}
|
||||
CROSS_BIN_DIR="$CROSS_DIR/bin"
|
||||
CROSS_DLL_DIR="$CROSS_DIR/$MINGW/bin"
|
||||
CROSS_PKG_CONFIG_DIR=$CROSS_DIR/$MINGW/lib/pkgconfig
|
||||
COPY_DLLS="libgio*.dll libglib*.dll libgmodule*.dll libgthread*.dll libgobject*.dll"
|
||||
PATH=$CROSS_BIN_DIR:$PATH
|
||||
INSTALL_DESTDIR="$CURDIR/mono-win32"
|
||||
PROFILES="default net_2_0 net_2_1 net_3_5"
|
||||
|
||||
export PATH
|
||||
|
||||
function setup ()
|
||||
{
|
||||
if [ -d ./.git/svn ]; then
|
||||
SVN_INFO='git svn info'
|
||||
elif [ -d ./.svn ]; then
|
||||
SVN_INFO='svn info'
|
||||
else
|
||||
SVN_INFO=""
|
||||
fi
|
||||
|
||||
if [ -n "$SVN_INFO" ]; then
|
||||
MONO_SVN_REVISION=`$SVN_INFO | grep Revision | sed 's/.*: //'`
|
||||
MONO_BRANCH=`$SVN_INFO | grep URL | sed -e 's;.*source/;;g' -e 's;/mono;;g'`
|
||||
else
|
||||
MONO_SVN_REVISION="rUNKNOWN"
|
||||
MONO_BRANCH="tarball"
|
||||
fi
|
||||
|
||||
MONO_VERSION=`grep AM_INIT_AUTOMAKE configure.in | cut -d ',' -f 2|tr -d '\)'`
|
||||
MONO_RELEASE="$MONO_VERSION-$MONO_BRANCH-r$MONO_SVN_REVISION"
|
||||
MONO_PREFIX="/mono-$MONO_RELEASE"
|
||||
|
||||
NOCONFIGURE=yes
|
||||
export NOCONFIGURE
|
||||
|
||||
echo Mono Win32 installation prefix: $MONO_PREFIX
|
||||
}
|
||||
|
||||
function build ()
|
||||
{
|
||||
./autogen.sh
|
||||
|
||||
if [ -f ./Makefile ]; then
|
||||
make distclean
|
||||
fi
|
||||
|
||||
if [ ! -d "$CURDIR/build-cross-windows" ]; then
|
||||
mkdir "$CURDIR/build-cross-windows"
|
||||
fi
|
||||
|
||||
cd "$CURDIR/build-cross-windows"
|
||||
rm -rf *
|
||||
../configure --prefix=$MONO_PREFIX --with-crosspkgdir=$CROSS_PKG_CONFIG_DIR --target=$MINGW --host=$MINGW --enable-parallel-mark --program-transform-name=""
|
||||
make
|
||||
cd "$CURDIR"
|
||||
|
||||
if [ ! -d "$CURDIR/build-cross-windows-mcs" ]; then
|
||||
mkdir "$CURDIR/build-cross-windows-mcs"
|
||||
fi
|
||||
cd "$CURDIR/build-cross-windows-mcs"
|
||||
rm -rf *
|
||||
../configure --prefix=$MONO_PREFIX --enable-parallel-mark
|
||||
make
|
||||
}
|
||||
|
||||
function doinstall ()
|
||||
{
|
||||
if [ -d "$INSTALL_DIR" ]; then
|
||||
rm -rf "$INSTALL_DIR"
|
||||
fi
|
||||
cd "$CURDIR/build-cross-windows"
|
||||
make DESTDIR="$INSTALL_DESTDIR" USE_BATCH_FILES=yes install
|
||||
|
||||
cd "$CURDIR/../mcs/mcs"
|
||||
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "mcs profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$CURDIR/../mcs/class"
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "class library profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$CURDIR/../mcs/tools"
|
||||
for p in $PROFILES; do
|
||||
make DESTDIR="$INSTALL_DESTDIR" PROFILE=$p install || echo "tools profile $p installation failed"
|
||||
done
|
||||
|
||||
cd "$CURDIR/mono-win32"
|
||||
for dll in $COPY_DLLS; do
|
||||
cp -ap "$CROSS_DLL_DIR"/$dll "$INSTALL_DESTDIR/$MONO_PREFIX/bin"
|
||||
done
|
||||
|
||||
rm -f "$CURDIR/mono-win32-$MONO_RELEASE".zip
|
||||
zip -9r "$CURDIR/mono-win32-$MONO_RELEASE".zip .
|
||||
|
||||
}
|
||||
|
||||
pushd . > /dev/null
|
||||
|
||||
setup
|
||||
build
|
||||
doinstall
|
||||
|
||||
popd > /dev/null
|
||||
+12
-47
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
|
||||
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono,2.1)
|
||||
AM_INIT_AUTOMAKE(mono,2.0)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
API_VER=1.0
|
||||
@@ -65,7 +65,6 @@ need_link_unlink=no
|
||||
# Thread configuration inspired by sleepycat's db
|
||||
AC_MSG_CHECKING([host platform characteristics])
|
||||
libgc_threads=no
|
||||
has_dtrace=no
|
||||
case "$host" in
|
||||
*-*-mingw*|*-*-cygwin*)
|
||||
platform_win32=yes
|
||||
@@ -78,8 +77,8 @@ case "$host" in
|
||||
HOST_CC="gcc"
|
||||
# Windows 2000 is required that includes Internet Explorer 5.01
|
||||
CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
|
||||
libmono_cflags="-mno-cygwin -mms-bitfields -mwindows"
|
||||
libmono_ldflags="-mno-cygwin -mms-bitfields -mwindows"
|
||||
libmono_cflags="-mno-cygwin"
|
||||
libmono_ldflags="-mno-cygwin"
|
||||
libdl=
|
||||
libgc_threads=win32
|
||||
gc_default=included
|
||||
@@ -225,7 +224,6 @@ case "$host" in
|
||||
libgc_threads=pthreads
|
||||
# This doesn't seem to work on solaris/x86, but the configure test runs
|
||||
with_tls=pthread
|
||||
has_dtrace=yes
|
||||
;;
|
||||
*-*-darwin*)
|
||||
platform_win32=no
|
||||
@@ -240,7 +238,6 @@ case "$host" in
|
||||
no_version_script=yes
|
||||
libdl=
|
||||
libgc_threads=pthreads
|
||||
has_dtrace=yes
|
||||
if test "x$cross_compiling" = "xyes"; then
|
||||
has_broken_apple_cpp=yes
|
||||
fi
|
||||
@@ -296,7 +293,6 @@ AC_SUBST(HOST_CC)
|
||||
AC_SUBST(BUILD_EXEEXT)
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
|
||||
AM_CONDITIONAL(USE_BATCH_FILES, [test x$platform_win32 = xyes -a x$cross_compiling = xyes])
|
||||
|
||||
# Set STDC_HEADERS
|
||||
AC_HEADER_STDC
|
||||
@@ -495,17 +491,9 @@ embedded)
|
||||
AC_CONFIG_SUBDIRS(eglib)
|
||||
;;
|
||||
system)
|
||||
if test "x$cross_compiling" = "xyes"; then
|
||||
pkg_config_path="$PKG_CONFIG_PATH"
|
||||
unset PKG_CONFIG_PATH
|
||||
fi
|
||||
BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
|
||||
BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
|
||||
if test "x$cross_compiling" = "xyes"; then
|
||||
PKG_CONFIG_PATH=$pkg_config_path
|
||||
export PKG_CONFIG_PATH
|
||||
fi
|
||||
|
||||
|
||||
## Versions of dependencies
|
||||
GLIB_REQUIRED_VERSION=1.3.11
|
||||
|
||||
@@ -1698,26 +1686,16 @@ if test "x$enable_big_arrays" = "xyes" ; then
|
||||
AC_DEFINE(MONO_BIG_ARRAYS,1,[Enable the allocation and indexing of arrays greater than Int32.MaxValue])
|
||||
fi
|
||||
|
||||
dnl **************
|
||||
dnl *** DTRACE ***
|
||||
dnl **************
|
||||
|
||||
AC_ARG_ENABLE(dtrace,[ --enable-dtrace Enable DTrace probes], enable_dtrace=$enableval, enable_dtrace=$has_dtrace)
|
||||
|
||||
if test "x$enable_dtrace" = "xyes"; then
|
||||
if test "x$has_dtrace" = "xno"; then
|
||||
AC_MSG_ERROR([DTrace probes are not supported on this platform.])
|
||||
fi
|
||||
AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
|
||||
if test "x$DTRACE" = "xno"; then
|
||||
AC_MSG_RESULT([dtrace utility not found, dtrace support disabled.])
|
||||
enable_dtrace=no
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if DTrace support is requested])
|
||||
AC_ARG_ENABLE(dtrace,[ --enable-dtrace Enable DTrace probes], enable_dtrace=$enableval, enable_dtrace=no)
|
||||
AC_MSG_RESULT($enable_dtrace)
|
||||
dtrace_g=no
|
||||
if test "x$enable_dtrace" = "xyes"; then
|
||||
AC_DEFINE(ENABLE_DTRACE, 1, [Enable DTrace probes])
|
||||
AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
|
||||
if test "x$DTRACE" = "xno"; then
|
||||
AC_MSG_FAILURE([DTrace requested but not found])
|
||||
fi
|
||||
DTRACEFLAGS=
|
||||
if test "x$ac_cv_sizeof_void_p" = "x8"; then
|
||||
case "$host" in
|
||||
@@ -2136,14 +2114,6 @@ AC_ARG_WITH(oprofile,[ --with-oprofile=no,<path> Enable oprofile support (defa
|
||||
fi
|
||||
])
|
||||
|
||||
MALLOC_MEMPOOLS=no
|
||||
AC_ARG_WITH(malloc_mempools,[ --with-malloc-mempools=yes,no Use malloc for each single mempool allocation (only for runtime debugging, defaults to NO)],[
|
||||
if test x$with_malloc_mempools = xyes; then
|
||||
MALLOC_MEMPOOLS=yes
|
||||
AC_DEFINE(USE_MALLOC_FOR_MEMPOOLS,1,[Use malloc for each single mempool allocation])
|
||||
fi
|
||||
])
|
||||
|
||||
AM_CONDITIONAL(HAVE_OPROFILE, test x$OPROFILE = xyes)
|
||||
AC_SUBST(OPROFILE_CFLAGS)
|
||||
AC_SUBST(OPROFILE_LIBS)
|
||||
@@ -2197,11 +2167,7 @@ AC_SUBST(mono_runtime)
|
||||
|
||||
mono_cfg_root=$mono_build_root/runtime
|
||||
if test x$platform_win32 = xyes; then
|
||||
if test "x$cross_compiling" = "xno"; then
|
||||
mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
|
||||
else
|
||||
mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\\'`\\etc
|
||||
fi
|
||||
mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
|
||||
else
|
||||
mono_cfg_dir=$mono_cfg_root/etc
|
||||
fi
|
||||
@@ -2438,7 +2404,6 @@ echo "
|
||||
zlib: $zlib_msg
|
||||
oprofile: $OPROFILE
|
||||
BigArrays: $enable_big_arrays
|
||||
DTrace: $enable_dtrace
|
||||
$disabled
|
||||
|
||||
"
|
||||
|
||||
@@ -1,16 +1,3 @@
|
||||
2008-08-05 Andreas Faerber <[email protected]>
|
||||
|
||||
* autogen.sh: Suppress arguments warning for NOCONFIGURE.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
2008-08-04 Bill Holmes <[email protected]>
|
||||
|
||||
* test/tests.h, test/Makefile.am, test/memory.c : Adding memory tests to test
|
||||
allocation routines return NULL when 0 size is passed in.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
2008-08-04 Bill Holmes <[email protected]>
|
||||
|
||||
* src/glib.h : Changing the allocation routines to return null if 0 size is
|
||||
@@ -1153,4 +1140,3 @@ Mon Oct 9 12:59:16 CEST 2006 Paolo Molaro <[email protected]>
|
||||
untested at this point.
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test x$NOCONFIGURE = x && test -z "$*"; then
|
||||
if test -z "$*"; then
|
||||
echo "**Warning**: I am going to run \`configure' with no arguments."
|
||||
echo "If you wish to pass any to it, please specify them on the"
|
||||
echo \`$0\'" command line."
|
||||
|
||||
@@ -824,4 +824,3 @@ gboolean g_utf8_validate (const gchar *str, gssize max_len, const gchar **
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@ SOURCES = \
|
||||
markup.c \
|
||||
utf8.c \
|
||||
endian.c \
|
||||
module.c \
|
||||
memory.c
|
||||
module.c
|
||||
|
||||
test_eglib_SOURCES = $(SOURCES)
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include "test.h"
|
||||
|
||||
RESULT
|
||||
test_memory_zero_size_allocations ()
|
||||
{
|
||||
gpointer p;
|
||||
|
||||
p = g_malloc (0);
|
||||
if (p)
|
||||
return FAILED ("Calling g_malloc with size zero should return NULL.");
|
||||
|
||||
p = g_malloc0 (0);
|
||||
if (p)
|
||||
return FAILED ("Calling g_malloc0 with size zero should return NULL.");
|
||||
|
||||
p = g_realloc (NULL, 0);
|
||||
if (p)
|
||||
return FAILED ("Calling g_realloc with size zero should return NULL.");
|
||||
|
||||
p = g_new (int, 0);
|
||||
if (p)
|
||||
return FAILED ("Calling g_new with size zero should return NULL.");
|
||||
|
||||
p = g_new0 (int, 0);
|
||||
if (p)
|
||||
return FAILED ("Calling g_new0 with size zero should return NULL.");
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
static Test memory_tests [] = {
|
||||
{ "zero_size_allocations", test_memory_zero_size_allocations},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
DEFINE_TEST_GROUP_INIT(memory_tests_init, memory_tests)
|
||||
|
||||
@@ -21,7 +21,6 @@ DEFINE_TEST_GROUP_INIT_H(markup_tests_init);
|
||||
DEFINE_TEST_GROUP_INIT_H(utf8_tests_init);
|
||||
DEFINE_TEST_GROUP_INIT_H(endian_tests_init);
|
||||
DEFINE_TEST_GROUP_INIT_H(module_tests_init);
|
||||
DEFINE_TEST_GROUP_INIT_H(memory_tests_init);
|
||||
|
||||
static Group test_groups [] = {
|
||||
{"string", string_tests_init},
|
||||
@@ -45,7 +44,6 @@ static Group test_groups [] = {
|
||||
{"utf8", utf8_tests_init},
|
||||
{"endian", endian_tests_init},
|
||||
{"module", module_tests_init},
|
||||
{"memory", memory_tests_init},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
+6
-6
@@ -1,8 +1,8 @@
|
||||
2008-08-05 Andreas Färber <[email protected]>
|
||||
2008-08-12 Geoff Norton <[email protected]>
|
||||
|
||||
* autogen.sh: Suppress arguments warning for NOCONFIGURE.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
* pthread_support.c: GCC shipped with SLES9 ppc gets confused with our current
|
||||
GC_setspecific define. Unfold the define into a static inline on all platforms
|
||||
except ppc where it is a static leaf function.
|
||||
|
||||
2008-08-03 Zoltan Varga <[email protected]>
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
* include/gc.h: Add GC_DllMain.
|
||||
* win32_threads.c: Rename DllMain to GC_DllMain.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
Contributed under MIT/X11 license.
|
||||
|
||||
2008-04-15 Jonathan Chambers <[email protected]>
|
||||
* include/private/gcconfig.h: Backport GC7 code to support Win64.
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test x$NOCONFIGURE = x && test -z "$*"; then
|
||||
if test -z "$*"; then
|
||||
echo "**Warning**: I am going to run \`configure' with no arguments."
|
||||
echo "If you wish to pass any to it, please specify them on the"
|
||||
echo \`$0\'" command line."
|
||||
|
||||
+13
-5
@@ -97,8 +97,11 @@
|
||||
typedef pthread_key_t GC_key_t;
|
||||
# endif
|
||||
# if defined(USE_COMPILER_TLS)
|
||||
/* Note sles9 gcc on powerpc gets confused by the define to set GC_thread_tls and pthread_setspecific
|
||||
* so we actually use a static inline function decalred below that is equivalent to:
|
||||
* define GC_setspecific(key, v) (GC_thread_tls = (v), pthread_setspecific ((key), (v)))
|
||||
*/
|
||||
# define GC_getspecific(x) (GC_thread_tls)
|
||||
# define GC_setspecific(key, v) (GC_thread_tls = (v), pthread_setspecific ((key), (v)))
|
||||
# define GC_key_create pthread_key_create
|
||||
typedef pthread_key_t GC_key_t;
|
||||
# endif
|
||||
@@ -191,14 +194,19 @@ static
|
||||
GC_key_t GC_thread_key;
|
||||
|
||||
#ifdef USE_COMPILER_TLS
|
||||
__thread MONO_TLS_FAST void* GC_thread_tls;
|
||||
|
||||
/*
|
||||
* gcc errors out with /tmp/ccdPMFuq.s:2994: Error: symbol `.LTLS4' is already defined
|
||||
* if the static is removed on ppc.
|
||||
* if the inline is added on powerpc
|
||||
*/
|
||||
#if defined(__ppc__) || defined(__powerpc__)
|
||||
static
|
||||
#if !defined(__ppc__) && !defined(__powerpc__)
|
||||
inline
|
||||
#endif
|
||||
__thread MONO_TLS_FAST void* GC_thread_tls;
|
||||
static int GC_setspecific (GC_key_t key, void *value) {
|
||||
GC_thread_tls = value;
|
||||
return pthread_setspecific (key, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
static GC_bool keys_initialized;
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
2008-08-01 Massimiliano Mantione <massi@ximian.com>
|
||||
* mono.1: Updated description of the logging profiler.
|
||||
2008-08-08 Zoltan Varga <vargaz@gmail.com>
|
||||
|
||||
* mono.1: Document the 'static' aot option.
|
||||
|
||||
2008-04-22 Robert Jordan <[email protected]>
|
||||
|
||||
|
||||
+535
-633
File diff suppressed because it is too large.
Load diff
@@ -1,8 +1,3 @@
|
||||
2008-08-04 Zoltan Varga <[email protected]>
|
||||
|
||||
* rules.make (PROFILE): If no profile is passed on the command line, make
|
||||
net_2_0 the default.
|
||||
|
||||
2008-06-30 Marek Safar <[email protected]>
|
||||
|
||||
* platforms/linux.make: Enable mcs optimizations.
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2008-07-24 Gert Driesen <[email protected]>
|
||||
|
||||
* Consts.cs.in; Update FxFileVersion and VsFileVersion for 2.0 SP1.
|
||||
|
||||
2008-04-13 Jb Evain <[email protected]>
|
||||
|
||||
* Consts.cs.in: update the 2.1 profile versions.
|
||||
|
||||
@@ -67,8 +67,8 @@ internal
|
||||
// Versions of .NET Framework 2.0 RTM
|
||||
public const string FxVersion = "2.0.0.0";
|
||||
public const string VsVersion = "8.0.0.0";
|
||||
public const string FxFileVersion = "2.0.50727.1433";
|
||||
public const string VsFileVersion = "8.0.50727.1433";
|
||||
public const string FxFileVersion = "2.0.50727.42";
|
||||
public const string VsFileVersion = "8.0.50727.42";
|
||||
#elif NET_1_1
|
||||
// Versions of .NET Framework 1.1 SP1
|
||||
public const string FxVersion = "1.0.5000.0";
|
||||
|
||||
@@ -89,7 +89,7 @@ endif
|
||||
# Rest of the configuration
|
||||
|
||||
ifndef PROFILE
|
||||
PROFILE = net_2_0
|
||||
PROFILE = default
|
||||
endif
|
||||
|
||||
include $(topdir)/build/profiles/$(PROFILE).make
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2008-07-31 Jb Evain <[email protected]>
|
||||
|
||||
* Makefile: update net_2_1_bootstrap_SUBDIRS to only build
|
||||
corlib and System.
|
||||
2008-05-22 Andreia Gaita <[email protected]>
|
||||
|
||||
* Makefile, Mono.Mozilla, Mono.WebBrowser: Long overdue rename of
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ net_3_5_dirs := \
|
||||
|
||||
default_SUBDIRS := $(common_dirs) $(default_dirs)
|
||||
net_2_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs)
|
||||
net_2_1_bootstrap_SUBDIRS := corlib System
|
||||
net_2_1_bootstrap_SUBDIRS := $(net_2_1_dirs)
|
||||
net_2_1_raw_SUBDIRS := $(net_2_1_dirs)
|
||||
net_3_5_SUBDIRS := $(net_3_5_dirs)
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2008-08-02 Gert Driesen <[email protected]>
|
||||
|
||||
* System.Windows.Forms_test.dll.sources: Added FormEventTest.cs.
|
||||
|
||||
2008-07-11 Jonathan Pobst <[email protected]>
|
||||
|
||||
* System.Windows.Forms.dll.sources: Remove the clearlooks, nice,
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2008-08-01 Geoff Norton <[email protected]>
|
||||
|
||||
* CarbonCursor.cs: If the window doesn't have a cursor set, revert
|
||||
to the default. Fixes #411114.
|
||||
|
||||
2008-07-31 Geoff Norton <[email protected]>
|
||||
|
||||
* WindowHandler.cs: Dont set ActiveWindow when emitting the event,
|
||||
its set when the event is handled. Fixes #393317.
|
||||
|
||||
2008-05-10 Geoff Norton <[email protected]>
|
||||
|
||||
* MouseHandler.cs: Fix the generation of msg.wParam for mouse up/down
|
||||
|
||||
@@ -32,6 +32,8 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Windows.Forms.CarbonInternal {
|
||||
internal class Cursor {
|
||||
internal static CarbonCursor defcur = new CarbonCursor (StdCursor.Default);
|
||||
|
||||
internal static Bitmap DefineStdCursorBitmap (StdCursor id) {
|
||||
// FIXME
|
||||
return new Bitmap (16, 16);
|
||||
@@ -47,8 +49,10 @@ namespace System.Windows.Forms.CarbonInternal {
|
||||
return (IntPtr) GCHandle.Alloc (cc);
|
||||
}
|
||||
internal static void SetCursor (IntPtr cursor) {
|
||||
if (cursor == IntPtr.Zero)
|
||||
if (cursor == IntPtr.Zero) {
|
||||
defcur.SetCursor ();
|
||||
return;
|
||||
}
|
||||
|
||||
CarbonCursor cc = (CarbonCursor) ((GCHandle) cursor).Target;
|
||||
|
||||
|
||||
@@ -121,7 +121,6 @@ namespace System.Windows.Forms.CarbonInternal {
|
||||
Form form = c.FindForm ();
|
||||
if (form != null) {
|
||||
Driver.SendMessage (form.Handle, Msg.WM_ACTIVATE, (IntPtr) WindowActiveFlags.WA_ACTIVE, IntPtr.Zero);
|
||||
XplatUICarbon.ActiveWindow = window;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +149,6 @@ namespace System.Windows.Forms.CarbonInternal {
|
||||
Form form = c.FindForm ();
|
||||
if (form != null) {
|
||||
Driver.SendMessage (form.Handle, Msg.WM_ACTIVATE, (IntPtr) WindowActiveFlags.WA_INACTIVE, IntPtr.Zero);
|
||||
XplatUICarbon.ActiveWindow = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
foreach (IntPtr utility_window in XplatUICarbon.UtilityWindows) {
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2008-07-31 George Giolfan <[email protected]>
|
||||
|
||||
* TabControlPainter.cs: Added DrawScrollButton, GetButtonState.
|
||||
|
||||
2008-06-09 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* TabControlPainter.cs: When calculating the display rectangle for
|
||||
|
||||
+2
-18
@@ -26,7 +26,6 @@ using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
|
||||
namespace System.Windows.Forms.Theming.Default
|
||||
{
|
||||
@@ -295,23 +294,8 @@ namespace System.Windows.Forms.Theming.Default
|
||||
if (tab.ShowSlider) {
|
||||
Rectangle right = GetRightScrollRect (tab);
|
||||
Rectangle left = GetLeftScrollRect (tab);
|
||||
DrawScrollButton (dc, right, area, ScrollButton.Right, tab.RightSliderState);
|
||||
DrawScrollButton (dc, left, area, ScrollButton.Left, tab.LeftSliderState);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void DrawScrollButton (Graphics dc, Rectangle bounds, Rectangle clippingArea, ScrollButton button, PushButtonState state)
|
||||
{
|
||||
ControlPaint.DrawScrollButton (dc, bounds, button, GetButtonState (state));
|
||||
}
|
||||
|
||||
static ButtonState GetButtonState (PushButtonState state)
|
||||
{
|
||||
switch (state) {
|
||||
case PushButtonState.Pressed:
|
||||
return ButtonState.Pushed;
|
||||
default:
|
||||
return ButtonState.Normal;
|
||||
ControlPaint.DrawScrollButton (dc, right, ScrollButton.Right, tab.RightSliderState);
|
||||
ControlPaint.DrawScrollButton (dc, left, ScrollButton.Left, tab.LeftSliderState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2008-07-31 George Giolfan <[email protected]>
|
||||
|
||||
* TabControlPainter.cs: Added DrawScrollButton.
|
||||
|
||||
2008-07-09 George Giolfan <[email protected]>
|
||||
|
||||
* TabControlPainter.cs, ToolStripPainter.cs: Now falls back to the default
|
||||
|
||||
-63
@@ -198,68 +198,5 @@ namespace System.Windows.Forms.Theming.VisualStyles
|
||||
return base.HasHotElementStyles (tabControl);
|
||||
return true;
|
||||
}
|
||||
protected override void DrawScrollButton (Graphics dc, Rectangle bounds, Rectangle clippingArea, ScrollButton button, PushButtonState state)
|
||||
{
|
||||
if (!ThemeVisualStyles.RenderClientAreas) {
|
||||
base.DrawScrollButton (dc, bounds, clippingArea, button, state);
|
||||
return;
|
||||
}
|
||||
VisualStyleElement element;
|
||||
if (button == ScrollButton.Left)
|
||||
switch (state) {
|
||||
case PushButtonState.Hot:
|
||||
element = VisualStyleElement.Spin.DownHorizontal.Hot;
|
||||
break;
|
||||
case PushButtonState.Pressed:
|
||||
element = VisualStyleElement.Spin.DownHorizontal.Pressed;
|
||||
break;
|
||||
default:
|
||||
element = VisualStyleElement.Spin.DownHorizontal.Normal;
|
||||
break;
|
||||
}
|
||||
else
|
||||
switch (state) {
|
||||
case PushButtonState.Hot:
|
||||
element = VisualStyleElement.Spin.UpHorizontal.Hot;
|
||||
break;
|
||||
case PushButtonState.Pressed:
|
||||
element = VisualStyleElement.Spin.UpHorizontal.Pressed;
|
||||
break;
|
||||
default:
|
||||
element = VisualStyleElement.Spin.UpHorizontal.Normal;
|
||||
break;
|
||||
}
|
||||
if (!VisualStyleRenderer.IsElementDefined (element)) {
|
||||
if (button == ScrollButton.Left)
|
||||
switch (state) {
|
||||
case PushButtonState.Hot:
|
||||
element = VisualStyleElement.ScrollBar.ArrowButton.LeftHot;
|
||||
break;
|
||||
case PushButtonState.Pressed:
|
||||
element = VisualStyleElement.ScrollBar.ArrowButton.LeftPressed;
|
||||
break;
|
||||
default:
|
||||
element = VisualStyleElement.ScrollBar.ArrowButton.LeftNormal;
|
||||
break;
|
||||
}
|
||||
else
|
||||
switch (state) {
|
||||
case PushButtonState.Hot:
|
||||
element = VisualStyleElement.ScrollBar.ArrowButton.RightHot;
|
||||
break;
|
||||
case PushButtonState.Pressed:
|
||||
element = VisualStyleElement.ScrollBar.ArrowButton.RightPressed;
|
||||
break;
|
||||
default:
|
||||
element = VisualStyleElement.ScrollBar.ArrowButton.RightNormal;
|
||||
break;
|
||||
}
|
||||
if (!VisualStyleRenderer.IsElementDefined (element)) {
|
||||
base.DrawScrollButton (dc, bounds, clippingArea, button, state);
|
||||
return;
|
||||
}
|
||||
}
|
||||
new VisualStyleRenderer (element).DrawBackground (dc, bounds, clippingArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,3 @@
|
||||
2008-07-31 George Giolfan <[email protected]>
|
||||
|
||||
* GtkPlus.cs, VisualStylesGtkPlus.cs: Added support for some elements,
|
||||
clipping and excluding a rectangle from the painted area.
|
||||
* VisualStyleElement.cs: Added constants for parts and states.
|
||||
|
||||
2008-07-14 George Giolfan <[email protected]>
|
||||
|
||||
* VisualStyleElement.cs: Fixed
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+170
-1448
File diff suppressed because it is too large.
Load diff
+22
-837
@@ -47,21 +47,7 @@ namespace System.Windows.Forms.VisualStyles
|
||||
S_FALSE
|
||||
}
|
||||
enum ThemeHandle {
|
||||
BUTTON = 1,
|
||||
#if NET_2_0
|
||||
COMBOBOX,
|
||||
#endif
|
||||
EDIT,
|
||||
HEADER,
|
||||
PROGRESS,
|
||||
REBAR,
|
||||
SCROLLBAR,
|
||||
SPIN,
|
||||
STATUS,
|
||||
TAB,
|
||||
TOOLBAR,
|
||||
TRACKBAR,
|
||||
TREEVIEW
|
||||
BUTTON = 1
|
||||
}
|
||||
|
||||
#region UxTheme
|
||||
@@ -79,682 +65,78 @@ namespace System.Windows.Forms.VisualStyles
|
||||
}
|
||||
public int UxThemeDrawThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, Rectangle clipRectangle)
|
||||
{
|
||||
return (int)(DrawBackground ((ThemeHandle)(int)hTheme, dc, iPartId, iStateId, bounds, clipRectangle, Rectangle.Empty) ? S.S_OK : S.S_FALSE);
|
||||
return (int)(DrawBackground ((ThemeHandle)(int)hTheme, dc, iPartId, iStateId, bounds, clipRectangle) ? S.S_OK : S.S_FALSE);
|
||||
}
|
||||
public int UxThemeDrawThemeBackground (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds)
|
||||
{
|
||||
return UxThemeDrawThemeBackground (hTheme, dc, iPartId, iStateId, bounds, bounds);
|
||||
}
|
||||
bool DrawBackground (ThemeHandle themeHandle, IDeviceContext dc, int part, int state, Rectangle bounds, Rectangle clipRectangle, Rectangle excludedArea) {
|
||||
GtkPlusState gtk_plus_state;
|
||||
GtkPlusToggleButtonValue gtk_plus_toggle_button_value;
|
||||
static bool DrawBackground (ThemeHandle themeHandle, IDeviceContext dc, int part, int state, Rectangle bounds, Rectangle clipRectangle) {
|
||||
switch (themeHandle) {
|
||||
#region BUTTON
|
||||
case ThemeHandle.BUTTON:
|
||||
switch ((BUTTONPARTS)part) {
|
||||
#region BP_PUSHBUTTON
|
||||
case BUTTONPARTS.BP_PUSHBUTTON:
|
||||
switch ((PUSHBUTTONSTATES)state) {
|
||||
case PUSHBUTTONSTATES.PBS_NORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
break;
|
||||
case PUSHBUTTONSTATES.PBS_HOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
break;
|
||||
case PUSHBUTTONSTATES.PBS_PRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
break;
|
||||
case PUSHBUTTONSTATES.PBS_DISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
break;
|
||||
case PUSHBUTTONSTATES.PBS_DEFAULTED:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
GtkPlus.ButtonPaint (dc, bounds, clipRectangle, (PUSHBUTTONSTATES)state == PUSHBUTTONSTATES.PBS_DEFAULTED, gtk_plus_state);
|
||||
return true;
|
||||
#endregion
|
||||
#region BP_RADIOBUTTON
|
||||
case BUTTONPARTS.BP_RADIOBUTTON:
|
||||
switch ((RADIOBUTTONSTATES)state) {
|
||||
case RADIOBUTTONSTATES.RBS_UNCHECKEDNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
|
||||
break;
|
||||
case RADIOBUTTONSTATES.RBS_UNCHECKEDPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
|
||||
break;
|
||||
case RADIOBUTTONSTATES.RBS_UNCHECKEDHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
|
||||
break;
|
||||
case RADIOBUTTONSTATES.RBS_UNCHECKEDDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
|
||||
break;
|
||||
case RADIOBUTTONSTATES.RBS_CHECKEDNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
|
||||
break;
|
||||
case RADIOBUTTONSTATES.RBS_CHECKEDPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
|
||||
break;
|
||||
case RADIOBUTTONSTATES.RBS_CHECKEDHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
|
||||
break;
|
||||
case RADIOBUTTONSTATES.RBS_CHECKEDDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
GtkPlus.RadioButtonPaint (dc, bounds, clipRectangle, gtk_plus_state, gtk_plus_toggle_button_value);
|
||||
return true;
|
||||
#endregion
|
||||
#region BP_CHECKBOX
|
||||
case BUTTONPARTS.BP_CHECKBOX:
|
||||
GtkPlusState gtk_plus_state;
|
||||
GtkPlusCheckBoxValue gtk_plus_check_box_value;
|
||||
switch ((CHECKBOXSTATES)state) {
|
||||
case CHECKBOXSTATES.CBS_UNCHECKEDNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Unchecked;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_UNCHECKEDPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Unchecked;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_UNCHECKEDHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Unchecked;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_UNCHECKEDDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Unchecked;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Unchecked;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_CHECKEDNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Checked;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_CHECKEDPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Checked;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_CHECKEDHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Checked;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_CHECKEDDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Checked;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Checked;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_MIXEDNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Mixed;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Mixed;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_MIXEDPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Mixed;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Mixed;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_MIXEDHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Mixed;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Mixed;
|
||||
break;
|
||||
case CHECKBOXSTATES.CBS_MIXEDDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
gtk_plus_toggle_button_value = GtkPlusToggleButtonValue.Mixed;
|
||||
gtk_plus_check_box_value = GtkPlusCheckBoxValue.Mixed;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
GtkPlus.CheckBoxPaint (dc, bounds, clipRectangle, gtk_plus_state, gtk_plus_toggle_button_value);
|
||||
return true;
|
||||
#endregion
|
||||
#region BP_GROUPBOX
|
||||
case BUTTONPARTS.BP_GROUPBOX:
|
||||
switch ((GROUPBOXSTATES)state) {
|
||||
case GROUPBOXSTATES.GBS_NORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
break;
|
||||
case GROUPBOXSTATES.GBS_DISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
GtkPlus.GroupBoxPaint (dc, bounds, excludedArea, gtk_plus_state);
|
||||
return true;
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region COMBOBOX
|
||||
#if NET_2_0
|
||||
case ThemeHandle.COMBOBOX:
|
||||
switch ((COMBOBOXPARTS)part) {
|
||||
#region CP_DROPDOWNBUTTON
|
||||
case COMBOBOXPARTS.CP_DROPDOWNBUTTON:
|
||||
switch ((COMBOBOXSTYLESTATES)state) {
|
||||
case COMBOBOXSTYLESTATES.CBXS_NORMAL: gtk_plus_state = GtkPlusState.Normal; break;
|
||||
case COMBOBOXSTYLESTATES.CBXS_HOT: gtk_plus_state = GtkPlusState.Hot; break;
|
||||
case COMBOBOXSTYLESTATES.CBXS_PRESSED: gtk_plus_state = GtkPlusState.Pressed; break;
|
||||
case COMBOBOXSTYLESTATES.CBXS_DISABLED: gtk_plus_state = GtkPlusState.Disabled; break;
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.ComboBoxPaintDropDownButton (dc, bounds, clipRectangle, gtk_plus_state);
|
||||
return true;
|
||||
#endregion
|
||||
#region CP_BORDER
|
||||
case COMBOBOXPARTS.CP_BORDER:
|
||||
switch ((BORDERSTATES)state) {
|
||||
case BORDERSTATES.CBB_NORMAL:
|
||||
case BORDERSTATES.CBB_HOT:
|
||||
case BORDERSTATES.CBB_FOCUSED:
|
||||
case BORDERSTATES.CBB_DISABLED:
|
||||
GtkPlus.ComboBoxPaintBorder (dc, bounds, clipRectangle);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
#endif
|
||||
#endregion
|
||||
#region EDIT
|
||||
case ThemeHandle.EDIT:
|
||||
switch ((EDITPARTS)part) {
|
||||
#region EP_EDITTEXT
|
||||
case EDITPARTS.EP_EDITTEXT:
|
||||
switch ((EDITTEXTSTATES)state) {
|
||||
case EDITTEXTSTATES.ETS_NORMAL:
|
||||
case EDITTEXTSTATES.ETS_ASSIST:
|
||||
case EDITTEXTSTATES.ETS_READONLY:
|
||||
case EDITTEXTSTATES.ETS_HOT:
|
||||
case EDITTEXTSTATES.ETS_SELECTED:
|
||||
case EDITTEXTSTATES.ETS_FOCUSED:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
break;
|
||||
case EDITTEXTSTATES.ETS_DISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.TextBoxPaint (dc, bounds, excludedArea, gtk_plus_state);
|
||||
return true;
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region HEADER
|
||||
case ThemeHandle.HEADER:
|
||||
switch ((HEADERPARTS)part) {
|
||||
#region HP_HEADERITEM
|
||||
case HEADERPARTS.HP_HEADERITEM:
|
||||
switch ((HEADERITEMSTATES)state) {
|
||||
case HEADERITEMSTATES.HIS_NORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
break;
|
||||
case HEADERITEMSTATES.HIS_HOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
break;
|
||||
case HEADERITEMSTATES.HIS_PRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.HeaderPaint (dc, bounds, clipRectangle, gtk_plus_state);
|
||||
return true;
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region PROGRESS
|
||||
case ThemeHandle.PROGRESS:
|
||||
switch ((PROGRESSPARTS)part) {
|
||||
case PROGRESSPARTS.PP_BAR:
|
||||
case PROGRESSPARTS.PP_BARVERT:
|
||||
GtkPlus.ProgressBarPaintBar (dc, bounds, clipRectangle);
|
||||
return true;
|
||||
case PROGRESSPARTS.PP_CHUNK:
|
||||
case PROGRESSPARTS.PP_CHUNKVERT:
|
||||
GtkPlus.ProgressBarPaintChunk (dc, bounds, clipRectangle);
|
||||
GtkPlus.CheckBoxPaint (dc, bounds, clipRectangle, gtk_plus_state, gtk_plus_check_box_value);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region REBAR
|
||||
case ThemeHandle.REBAR:
|
||||
switch ((REBARPARTS)part) {
|
||||
case REBARPARTS.RP_BAND:
|
||||
GtkPlus.ToolBarPaint (dc, bounds, clipRectangle);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region SCROLLBAR
|
||||
case ThemeHandle.SCROLLBAR:
|
||||
switch ((SCROLLBARPARTS)part) {
|
||||
#region SBP_ARROWBTN
|
||||
case SCROLLBARPARTS.SBP_ARROWBTN:
|
||||
bool horizontal;
|
||||
bool up_or_left;
|
||||
switch ((ARROWBTNSTATES)state) {
|
||||
case ARROWBTNSTATES.ABS_UPNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
horizontal = false;
|
||||
up_or_left = true;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_UPHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
horizontal = false;
|
||||
up_or_left = true;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_UPPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
horizontal = false;
|
||||
up_or_left = true;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_UPDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
horizontal = false;
|
||||
up_or_left = true;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_DOWNNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
horizontal = false;
|
||||
up_or_left = false;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_DOWNHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
horizontal = false;
|
||||
up_or_left = false;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_DOWNPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
horizontal = false;
|
||||
up_or_left = false;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_DOWNDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
horizontal = false;
|
||||
up_or_left = false;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_LEFTNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
horizontal = true;
|
||||
up_or_left = true;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_LEFTHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
horizontal = true;
|
||||
up_or_left = true;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_LEFTPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
horizontal = true;
|
||||
up_or_left = true;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_LEFTDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
horizontal = true;
|
||||
up_or_left = true;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_RIGHTNORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
horizontal = true;
|
||||
up_or_left = false;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_RIGHTHOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
horizontal = true;
|
||||
up_or_left = false;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_RIGHTPRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
horizontal = true;
|
||||
up_or_left = false;
|
||||
break;
|
||||
case ARROWBTNSTATES.ABS_RIGHTDISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
horizontal = true;
|
||||
up_or_left = false;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.ScrollBarPaintArrowButton (dc, bounds, clipRectangle, gtk_plus_state, horizontal, up_or_left);
|
||||
return true;
|
||||
#endregion
|
||||
#region SBP_THUMBBTNHORZ, SBP_THUMBBTNVERT
|
||||
case SCROLLBARPARTS.SBP_THUMBBTNHORZ:
|
||||
case SCROLLBARPARTS.SBP_THUMBBTNVERT:
|
||||
if (!GetGtkPlusState ((SCROLLBARSTYLESTATES)state, out gtk_plus_state))
|
||||
return false;
|
||||
GtkPlus.ScrollBarPaintThumbButton (
|
||||
dc,
|
||||
bounds,
|
||||
clipRectangle,
|
||||
gtk_plus_state,
|
||||
(SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_THUMBBTNHORZ);
|
||||
return true;
|
||||
#endregion
|
||||
#region SBP_LOWERTRACKHORZ, SBP_UPPERTRACKHORZ, SBP_LOWERTRACKVERT, SBP_UPPERTRACKVERT
|
||||
case SCROLLBARPARTS.SBP_LOWERTRACKHORZ:
|
||||
case SCROLLBARPARTS.SBP_UPPERTRACKHORZ:
|
||||
case SCROLLBARPARTS.SBP_LOWERTRACKVERT:
|
||||
case SCROLLBARPARTS.SBP_UPPERTRACKVERT:
|
||||
if (!GetGtkPlusState ((SCROLLBARSTYLESTATES)state, out gtk_plus_state))
|
||||
return false;
|
||||
GtkPlus.ScrollBarPaintTrack (
|
||||
dc,
|
||||
bounds,
|
||||
clipRectangle,
|
||||
gtk_plus_state,
|
||||
(SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_LOWERTRACKHORZ ||
|
||||
(SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_UPPERTRACKHORZ,
|
||||
(SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_UPPERTRACKHORZ ||
|
||||
(SCROLLBARPARTS)part == SCROLLBARPARTS.SBP_UPPERTRACKVERT);
|
||||
return true;
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region SPIN
|
||||
case ThemeHandle.SPIN:
|
||||
bool up;
|
||||
switch ((SPINPARTS)part) {
|
||||
#region SPNP_UP
|
||||
case SPINPARTS.SPNP_UP:
|
||||
up = true;
|
||||
switch ((UPSTATES)state) {
|
||||
case UPSTATES.UPS_NORMAL: gtk_plus_state = GtkPlusState.Normal; break;
|
||||
case UPSTATES.UPS_HOT: gtk_plus_state = GtkPlusState.Hot; break;
|
||||
case UPSTATES.UPS_PRESSED: gtk_plus_state = GtkPlusState.Pressed; break;
|
||||
case UPSTATES.UPS_DISABLED: gtk_plus_state = GtkPlusState.Disabled; break;
|
||||
default: return false;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region SPNP_DOWN
|
||||
case SPINPARTS.SPNP_DOWN:
|
||||
up = false;
|
||||
switch ((DOWNSTATES)state) {
|
||||
case DOWNSTATES.DNS_NORMAL: gtk_plus_state = GtkPlusState.Normal; break;
|
||||
case DOWNSTATES.DNS_HOT: gtk_plus_state = GtkPlusState.Hot; break;
|
||||
case DOWNSTATES.DNS_PRESSED: gtk_plus_state = GtkPlusState.Pressed; break;
|
||||
case DOWNSTATES.DNS_DISABLED: gtk_plus_state = GtkPlusState.Disabled; break;
|
||||
default: return false;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.UpDownPaint (dc, bounds, clipRectangle, up, gtk_plus_state);
|
||||
return true;
|
||||
#endregion
|
||||
#region STATUS
|
||||
case ThemeHandle.STATUS:
|
||||
switch ((STATUSPARTS)part) {
|
||||
case STATUSPARTS.SP_GRIPPER:
|
||||
GtkPlus.StatusBarPaintGripper (dc, bounds, clipRectangle);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TABCONTROL
|
||||
case ThemeHandle.TAB:
|
||||
bool selected;
|
||||
switch ((TABPARTS)part) {
|
||||
#region TABP_TABITEM
|
||||
case TABPARTS.TABP_TABITEM:
|
||||
switch ((TABITEMSTATES)state) {
|
||||
case TABITEMSTATES.TIS_SELECTED:
|
||||
selected = true;
|
||||
break;
|
||||
case TABITEMSTATES.TIS_NORMAL:
|
||||
case TABITEMSTATES.TIS_HOT:
|
||||
case TABITEMSTATES.TIS_DISABLED:
|
||||
selected = false;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region TABP_TABITEMLEFTEDGE
|
||||
case TABPARTS.TABP_TABITEMLEFTEDGE:
|
||||
switch ((TABITEMLEFTEDGESTATES)state) {
|
||||
case TABITEMLEFTEDGESTATES.TILES_SELECTED:
|
||||
selected = true;
|
||||
break;
|
||||
case TABITEMLEFTEDGESTATES.TILES_NORMAL:
|
||||
case TABITEMLEFTEDGESTATES.TILES_HOT:
|
||||
case TABITEMLEFTEDGESTATES.TILES_DISABLED:
|
||||
selected = false;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region TABP_TABITEMRIGHTEDGE
|
||||
case TABPARTS.TABP_TABITEMRIGHTEDGE:
|
||||
switch ((TABITEMRIGHTEDGESTATES)state) {
|
||||
case TABITEMRIGHTEDGESTATES.TIRES_SELECTED:
|
||||
selected = true;
|
||||
break;
|
||||
case TABITEMRIGHTEDGESTATES.TIRES_NORMAL:
|
||||
case TABITEMRIGHTEDGESTATES.TIRES_HOT:
|
||||
case TABITEMRIGHTEDGESTATES.TIRES_DISABLED:
|
||||
selected = false;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region TABP_TABITEMBOTHEDGE
|
||||
case TABPARTS.TABP_TABITEMBOTHEDGE:
|
||||
selected = false;
|
||||
break;
|
||||
#endregion
|
||||
#region TABP_TOPTABITEM
|
||||
case TABPARTS.TABP_TOPTABITEM:
|
||||
switch ((TOPTABITEMSTATES)state) {
|
||||
case TOPTABITEMSTATES.TTIS_SELECTED:
|
||||
selected = true;
|
||||
break;
|
||||
case TOPTABITEMSTATES.TTIS_NORMAL:
|
||||
case TOPTABITEMSTATES.TTIS_HOT:
|
||||
case TOPTABITEMSTATES.TTIS_DISABLED:
|
||||
selected = false;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region TABP_TOPTABITEMLEFTEDGE
|
||||
case TABPARTS.TABP_TOPTABITEMLEFTEDGE:
|
||||
switch ((TOPTABITEMLEFTEDGESTATES)state) {
|
||||
case TOPTABITEMLEFTEDGESTATES.TTILES_SELECTED:
|
||||
selected = true;
|
||||
break;
|
||||
case TOPTABITEMLEFTEDGESTATES.TTILES_NORMAL:
|
||||
case TOPTABITEMLEFTEDGESTATES.TTILES_HOT:
|
||||
case TOPTABITEMLEFTEDGESTATES.TTILES_DISABLED:
|
||||
selected = false;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region TABP_TOPTABITEMRIGHTEDGE
|
||||
case TABPARTS.TABP_TOPTABITEMRIGHTEDGE:
|
||||
switch ((TOPTABITEMRIGHTEDGESTATES)state) {
|
||||
case TOPTABITEMRIGHTEDGESTATES.TTIRES_SELECTED:
|
||||
selected = true;
|
||||
break;
|
||||
case TOPTABITEMRIGHTEDGESTATES.TTIRES_NORMAL:
|
||||
case TOPTABITEMRIGHTEDGESTATES.TTIRES_HOT:
|
||||
case TOPTABITEMRIGHTEDGESTATES.TTIRES_DISABLED:
|
||||
selected = false;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region TABP_TOPTABITEMBOTHEDGE
|
||||
case TABPARTS.TABP_TOPTABITEMBOTHEDGE:
|
||||
selected = false;
|
||||
break;
|
||||
#endregion
|
||||
#region TABP_PANE
|
||||
case TABPARTS.TABP_PANE:
|
||||
GtkPlus.TabControlPaintPane (dc, bounds, clipRectangle);
|
||||
return true;
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.TabControlPaintTabItem (dc, bounds, clipRectangle, selected ? GtkPlusState.Pressed : GtkPlusState.Normal);
|
||||
return true;
|
||||
#endregion
|
||||
#region TOOLBAR
|
||||
case ThemeHandle.TOOLBAR:
|
||||
switch ((TOOLBARPARTS)part) {
|
||||
case TOOLBARPARTS.TP_BUTTON:
|
||||
switch ((TOOLBARSTYLESTATES)state) {
|
||||
case TOOLBARSTYLESTATES.TS_NORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
break;
|
||||
case TOOLBARSTYLESTATES.TS_HOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
break;
|
||||
case TOOLBARSTYLESTATES.TS_PRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
break;
|
||||
case TOOLBARSTYLESTATES.TS_DISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
break;
|
||||
case TOOLBARSTYLESTATES.TS_CHECKED:
|
||||
case TOOLBARSTYLESTATES.TS_HOTCHECKED:
|
||||
GtkPlus.ToolBarPaintCheckedButton (dc, bounds, clipRectangle);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.ToolBarPaintButton (dc, bounds, clipRectangle, gtk_plus_state);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TRACKBAR
|
||||
case ThemeHandle.TRACKBAR:
|
||||
switch ((TRACKBARPARTS)part) {
|
||||
#region TKP_TRACK
|
||||
case TRACKBARPARTS.TKP_TRACK:
|
||||
switch ((TRACKSTATES)state) {
|
||||
case TRACKSTATES.TRS_NORMAL:
|
||||
GtkPlus.TrackBarPaintTrack (dc, bounds, clipRectangle, true);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TKP_TRACKVERT
|
||||
case TRACKBARPARTS.TKP_TRACKVERT:
|
||||
switch ((TRACKVERTSTATES)state) {
|
||||
case TRACKVERTSTATES.TRVS_NORMAL:
|
||||
GtkPlus.TrackBarPaintTrack (dc, bounds, clipRectangle, false);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TKP_THUMB
|
||||
case TRACKBARPARTS.TKP_THUMB:
|
||||
switch ((THUMBSTATES)state) {
|
||||
case THUMBSTATES.TUS_NORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
break;
|
||||
case THUMBSTATES.TUS_HOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
break;
|
||||
case THUMBSTATES.TUS_PRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
break;
|
||||
case THUMBSTATES.TUS_FOCUSED:
|
||||
gtk_plus_state = GtkPlusState.Selected;
|
||||
break;
|
||||
case THUMBSTATES.TUS_DISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.TrackBarPaintThumb (dc, bounds, clipRectangle, gtk_plus_state, true);
|
||||
return true;
|
||||
#endregion
|
||||
#region TKP_THUMBVERT
|
||||
case TRACKBARPARTS.TKP_THUMBVERT:
|
||||
switch ((THUMBVERTSTATES)state) {
|
||||
case THUMBVERTSTATES.TUVS_NORMAL:
|
||||
gtk_plus_state = GtkPlusState.Normal;
|
||||
break;
|
||||
case THUMBVERTSTATES.TUVS_HOT:
|
||||
gtk_plus_state = GtkPlusState.Hot;
|
||||
break;
|
||||
case THUMBVERTSTATES.TUVS_PRESSED:
|
||||
gtk_plus_state = GtkPlusState.Pressed;
|
||||
break;
|
||||
case THUMBVERTSTATES.TUVS_FOCUSED:
|
||||
gtk_plus_state = GtkPlusState.Selected;
|
||||
break;
|
||||
case THUMBVERTSTATES.TUVS_DISABLED:
|
||||
gtk_plus_state = GtkPlusState.Disabled;
|
||||
break;
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.TrackBarPaintThumb (dc, bounds, clipRectangle, gtk_plus_state, false);
|
||||
return true;
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TREEVIEW
|
||||
case ThemeHandle.TREEVIEW:
|
||||
switch ((TREEVIEWPARTS)part) {
|
||||
case TREEVIEWPARTS.TVP_GLYPH:
|
||||
bool closed;
|
||||
switch ((GLYPHSTATES)state) {
|
||||
case GLYPHSTATES.GLPS_CLOSED : closed = true; break;
|
||||
case GLYPHSTATES.GLPS_OPENED: closed = false; break;
|
||||
default: return false;
|
||||
}
|
||||
GtkPlus.TreeViewPaintGlyph (dc, bounds, clipRectangle, closed);
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
static bool GetGtkPlusState (SCROLLBARSTYLESTATES state, out GtkPlusState result)
|
||||
{
|
||||
switch (state) {
|
||||
case SCROLLBARSTYLESTATES.SCRBS_NORMAL:
|
||||
result = GtkPlusState.Normal;
|
||||
break;
|
||||
case SCROLLBARSTYLESTATES.SCRBS_HOT:
|
||||
result = GtkPlusState.Hot;
|
||||
break;
|
||||
case SCROLLBARSTYLESTATES.SCRBS_PRESSED:
|
||||
result = GtkPlusState.Pressed;
|
||||
break;
|
||||
case SCROLLBARSTYLESTATES.SCRBS_DISABLED:
|
||||
result = GtkPlusState.Disabled;
|
||||
break;
|
||||
default:
|
||||
result = (GtkPlusState)0;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public int UxThemeDrawThemeEdge (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects, out Rectangle result)
|
||||
{
|
||||
result = Rectangle.Empty;
|
||||
@@ -766,22 +148,8 @@ namespace System.Windows.Forms.VisualStyles
|
||||
}
|
||||
public int UxThemeGetThemeBackgroundContentRect (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle bounds, out Rectangle result)
|
||||
{
|
||||
return (int)(GetBackgroundContentRectangle ((ThemeHandle)(int)hTheme, iPartId, iStateId, bounds, out result) ? S.S_OK : S.S_FALSE);
|
||||
}
|
||||
bool GetBackgroundContentRectangle (ThemeHandle handle, int part, int state, Rectangle bounds, out Rectangle result)
|
||||
{
|
||||
switch (handle) {
|
||||
case ThemeHandle.PROGRESS:
|
||||
switch ((PROGRESSPARTS)part) {
|
||||
case PROGRESSPARTS.PP_BAR:
|
||||
case PROGRESSPARTS.PP_BARVERT:
|
||||
result = GtkPlus.ProgressBarGetBackgroundContentRectagle (bounds);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
result = Rectangle.Empty;
|
||||
return false;
|
||||
return (int)S.S_FALSE;
|
||||
}
|
||||
public int UxThemeGetThemeBackgroundExtent (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, Rectangle contentBounds, out Rectangle result)
|
||||
{
|
||||
@@ -815,29 +183,8 @@ namespace System.Windows.Forms.VisualStyles
|
||||
}
|
||||
public int UxThemeGetThemeInt (IntPtr hTheme, int iPartId, int iStateId, IntegerProperty prop, out int result)
|
||||
{
|
||||
return (int)(GetInteger ((ThemeHandle)(int)hTheme, iPartId, iStateId, prop, out result) ? S.S_OK : S.S_FALSE);
|
||||
}
|
||||
bool GetInteger (ThemeHandle handle, int part, int state, IntegerProperty property, out int result)
|
||||
{
|
||||
switch (handle) {
|
||||
case ThemeHandle.PROGRESS:
|
||||
switch ((PROGRESSPARTS)part) {
|
||||
case PROGRESSPARTS.PP_CHUNK:
|
||||
case PROGRESSPARTS.PP_CHUNKVERT:
|
||||
switch (property) {
|
||||
case IntegerProperty.ProgressChunkSize:
|
||||
result = ThemeWin32Classic.ProgressBarGetChunkSize ();
|
||||
return true;
|
||||
case IntegerProperty.ProgressSpaceSize:
|
||||
result = ThemeWin32Classic.ProgressBarChunkSpacing;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
result = 0;
|
||||
return false;
|
||||
return (int)S.S_FALSE;
|
||||
}
|
||||
public int UxThemeGetThemeMargins (IntPtr hTheme, IDeviceContext dc, int iPartId, int iStateId, MarginProperty prop, out Padding result)
|
||||
{
|
||||
@@ -855,48 +202,13 @@ namespace System.Windows.Forms.VisualStyles
|
||||
bool GetPartSize (ThemeHandle themeHandle, IDeviceContext dc, int part, int state, Rectangle bounds, bool rectangleSpecified, ThemeSizeType type, out Size result)
|
||||
{
|
||||
switch (themeHandle) {
|
||||
#region BUTTON
|
||||
case ThemeHandle.BUTTON:
|
||||
switch ((BUTTONPARTS)part) {
|
||||
case BUTTONPARTS.BP_RADIOBUTTON:
|
||||
result = GtkPlus.RadioButtonGetSize ();
|
||||
return true;
|
||||
case BUTTONPARTS.BP_CHECKBOX:
|
||||
result = GtkPlus.CheckBoxGetSize ();
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region HEADER
|
||||
case ThemeHandle.HEADER:
|
||||
switch ((HEADERPARTS)part) {
|
||||
case HEADERPARTS.HP_HEADERITEM:
|
||||
result = new Size (0, ThemeWin32Classic.ListViewGetHeaderHeight ());
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
#region TRACKBAR
|
||||
case ThemeHandle.TRACKBAR:
|
||||
switch ((TRACKBARPARTS)part) {
|
||||
case TRACKBARPARTS.TKP_TRACK:
|
||||
result = new Size (0, ThemeWin32Classic.TrackBarHorizontalTrackHeight);
|
||||
return true;
|
||||
case TRACKBARPARTS.TKP_TRACKVERT:
|
||||
result = new Size (ThemeWin32Classic.TrackBarVerticalTrackWidth, 0);
|
||||
return true;
|
||||
case TRACKBARPARTS.TKP_THUMB:
|
||||
case TRACKBARPARTS.TKP_THUMBVERT:
|
||||
result = ThemeWin32Classic.TrackBarGetThumbSize ();
|
||||
if ((TRACKBARPARTS)part == TRACKBARPARTS.TKP_THUMBVERT) {
|
||||
int temporary = result.Width;
|
||||
result.Width = result.Height;
|
||||
result.Height = temporary;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
}
|
||||
result = Size.Empty;
|
||||
return false;
|
||||
@@ -946,138 +258,11 @@ namespace System.Windows.Forms.VisualStyles
|
||||
public bool UxThemeIsThemePartDefined (IntPtr hTheme, int iPartId)
|
||||
{
|
||||
switch ((ThemeHandle)(int)hTheme) {
|
||||
#region BUTTON
|
||||
case ThemeHandle.BUTTON:
|
||||
switch ((BUTTONPARTS)iPartId) {
|
||||
case BUTTONPARTS.BP_PUSHBUTTON:
|
||||
case BUTTONPARTS.BP_CHECKBOX:
|
||||
case BUTTONPARTS.BP_RADIOBUTTON:
|
||||
case BUTTONPARTS.BP_GROUPBOX:
|
||||
return true;
|
||||
case BUTTONPARTS.BP_CHECKBOX: return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region COMBOBOX
|
||||
#if NET_2_0
|
||||
case ThemeHandle.COMBOBOX:
|
||||
switch ((COMBOBOXPARTS)iPartId) {
|
||||
case COMBOBOXPARTS.CP_DROPDOWNBUTTON:
|
||||
case COMBOBOXPARTS.CP_BORDER:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endif
|
||||
#endregion
|
||||
#region EDIT
|
||||
case ThemeHandle.EDIT:
|
||||
switch ((EDITPARTS)iPartId) {
|
||||
case EDITPARTS.EP_EDITTEXT:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region HEADER
|
||||
case ThemeHandle.HEADER:
|
||||
switch ((HEADERPARTS)iPartId) {
|
||||
case HEADERPARTS.HP_HEADERITEM:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region PROGRESS
|
||||
case ThemeHandle.PROGRESS:
|
||||
switch ((PROGRESSPARTS)iPartId) {
|
||||
case PROGRESSPARTS.PP_BAR:
|
||||
case PROGRESSPARTS.PP_BARVERT:
|
||||
case PROGRESSPARTS.PP_CHUNK:
|
||||
case PROGRESSPARTS.PP_CHUNKVERT:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region REBAR
|
||||
case ThemeHandle.REBAR:
|
||||
switch ((REBARPARTS)iPartId) {
|
||||
case REBARPARTS.RP_BAND:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region SCROLLBAR
|
||||
case ThemeHandle.SCROLLBAR:
|
||||
switch ((SCROLLBARPARTS)iPartId) {
|
||||
case SCROLLBARPARTS.SBP_ARROWBTN:
|
||||
case SCROLLBARPARTS.SBP_THUMBBTNHORZ:
|
||||
case SCROLLBARPARTS.SBP_THUMBBTNVERT:
|
||||
case SCROLLBARPARTS.SBP_LOWERTRACKHORZ:
|
||||
case SCROLLBARPARTS.SBP_UPPERTRACKHORZ:
|
||||
case SCROLLBARPARTS.SBP_LOWERTRACKVERT:
|
||||
case SCROLLBARPARTS.SBP_UPPERTRACKVERT:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region SPIN
|
||||
case ThemeHandle.SPIN:
|
||||
switch ((SPINPARTS)iPartId) {
|
||||
case SPINPARTS.SPNP_UP:
|
||||
case SPINPARTS.SPNP_DOWN:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region STATUS
|
||||
case ThemeHandle.STATUS:
|
||||
switch ((STATUSPARTS)iPartId) {
|
||||
case STATUSPARTS.SP_GRIPPER:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TABCONTROL
|
||||
case ThemeHandle.TAB:
|
||||
switch ((TABPARTS)iPartId) {
|
||||
case TABPARTS.TABP_TABITEM:
|
||||
case TABPARTS.TABP_TABITEMLEFTEDGE:
|
||||
case TABPARTS.TABP_TABITEMRIGHTEDGE:
|
||||
case TABPARTS.TABP_TABITEMBOTHEDGE:
|
||||
case TABPARTS.TABP_TOPTABITEM:
|
||||
case TABPARTS.TABP_TOPTABITEMLEFTEDGE:
|
||||
case TABPARTS.TABP_TOPTABITEMRIGHTEDGE:
|
||||
case TABPARTS.TABP_TOPTABITEMBOTHEDGE:
|
||||
case TABPARTS.TABP_PANE:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TOOLBAR
|
||||
case ThemeHandle.TOOLBAR:
|
||||
switch ((TOOLBARPARTS)iPartId) {
|
||||
case TOOLBARPARTS.TP_BUTTON:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TRACKBAR
|
||||
case ThemeHandle.TRACKBAR:
|
||||
switch ((TRACKBARPARTS)iPartId) {
|
||||
case TRACKBARPARTS.TKP_TRACK:
|
||||
case TRACKBARPARTS.TKP_TRACKVERT:
|
||||
case TRACKBARPARTS.TKP_THUMB:
|
||||
case TRACKBARPARTS.TKP_THUMBVERT:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
#region TREEVIEW
|
||||
case ThemeHandle.TREEVIEW:
|
||||
switch ((TREEVIEWPARTS)iPartId) {
|
||||
case TREEVIEWPARTS.TVP_GLYPH:
|
||||
return true;
|
||||
default: return false;
|
||||
}
|
||||
#endregion
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
@@ -1167,7 +352,7 @@ namespace System.Windows.Forms.VisualStyles
|
||||
#region VisualStyleRenderer
|
||||
public void VisualStyleRendererDrawBackgroundExcludingArea (IntPtr theme, IDeviceContext dc, int part, int state, Rectangle bounds, Rectangle excludedArea)
|
||||
{
|
||||
DrawBackground ((ThemeHandle)(int)theme, dc, part, state, bounds, bounds, excludedArea);
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -1,3 +1,33 @@
|
||||
2008-08-12 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* XplatUIX11.cs: Handle the obscured regions while scrolling using
|
||||
GraphicsExpose event, processing it just after we copy the scrolled
|
||||
area. This ensures that the next calls to ScrollWindow will copy
|
||||
regions already updated, and the scrolling will be smooth. Also remove
|
||||
the code that was trying to detect the obscured regions, since we are
|
||||
not using it anymore (too slow).
|
||||
|
||||
2008-08-12 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListBox.cs: Fix the -temporary- broken selection in ListBox for
|
||||
MultiExtended mode, by separating some logic between the ctrl/shift
|
||||
handling. Also ignore any MouseMove events generated together with
|
||||
MouseDown events - we are only interested in the real motion event.
|
||||
Fixes part of #414963.
|
||||
|
||||
2008-08-12 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* XplatUIX11.cs: When getting EnterNotify with mode other than
|
||||
NotifyNormal (pseudo motion events), ignore them as we used to do
|
||||
before, since it's breaking our selection code and some drag and drop
|
||||
operations, because of the confusion of generating extra events (not
|
||||
fired by .net, btw).
|
||||
|
||||
2008-08-08 Jonathan Pobst <[email protected]>
|
||||
|
||||
* DataGridViewCell.cs: Guard against an AOORE when checking if a cell
|
||||
is selected. [Fixes bug #414143]
|
||||
|
||||
2008-08-07 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* GridEntry.cs: Check if current property is a ICustomTypeDescriptor
|
||||
@@ -10,6 +40,20 @@
|
||||
* PropertyGrid.cs: Refresh should also repopulate the PropertyGrid.
|
||||
[Fixes part of bug #415452]
|
||||
|
||||
2008-08-07 Andreia Gaita <[email protected]>
|
||||
|
||||
* WebBrowser.cs: Remove extraneous CWL. Fixes #411372 (partially)
|
||||
|
||||
2008-08-06 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListBox.cs: Selection changes made in the MouseDown handler should
|
||||
use the *Core versions of selection in SelectedIndices collection,
|
||||
since the SelectedIndexChanged/SelectedValueChanged events are fired
|
||||
until we get a MouseUp event, and thus we need to separate the logic
|
||||
from the events, as done in the keyboard navigation. Also, fire those
|
||||
selection events from keyboard navigation in SelectionMode.None, even
|
||||
if we don't have a selection, as .Net does.
|
||||
|
||||
2008-08-05 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* GridEntry.cs: ITypeDescriptorContext should be relative to the parent
|
||||
@@ -23,22 +67,27 @@
|
||||
share the same logic.
|
||||
[Fixes bug #414454]
|
||||
|
||||
2008-08-03 Carlos Alberto Cortez <[email protected]>
|
||||
2008-08-01 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListBox.cs: Selection changes made in the MouseDown handler should
|
||||
use the *Core versions of selection in SelectedIndices collection,
|
||||
since the SelectedIndexChanged/SelectedValueChanged events are fired
|
||||
until we get a MouseUp event, and thus we need to separate the logic
|
||||
from the events, as done in the keyboard navigation. Also, fire those
|
||||
selection events from keyboard navigation in SelectionMode.None, even
|
||||
if we don't have a selection, as .Net does.
|
||||
* DateTimePicker.cs:
|
||||
* ThemeWin32Classic.cs: Add a editing capability to DateTimePicker, in
|
||||
order to set the value as required (which means: when selection
|
||||
changes for a part being edited, and not before that if not needed).
|
||||
Also use an enum to describe which part are we using, and use the
|
||||
selection as a property in PartData, in order to notify the
|
||||
DateTimePicker owner that we need to end the current edit.
|
||||
Fixes #383462.
|
||||
|
||||
2008-08-01 Jonathan Pobst <monkey@jpobst.com>
|
||||
2008-08-01 Carlos Alberto Cortez <calberto.cortez@gmail.com>
|
||||
|
||||
* ToolStripButton.cs, ToolStripMenuItem.cs: Guard against a NRE my
|
||||
last change introduced when an item is clicked but isn't on a toolstrip.
|
||||
* ThemeWin32Classic.cs: Don't draw ListViewSubItem instances from
|
||||
DrawListViewItem - we need to reuse the main item's drawing for the
|
||||
first sub item in case owner draw is true, but wants the system to
|
||||
do the default draw for the first sub item, without incurring in a
|
||||
recursion problem.
|
||||
Fixes #410880.
|
||||
|
||||
2008-07-31 Carlos Alberto Cortez <[email protected]>
|
||||
2008-08-01 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListBindingHelper.cs: When looking for an object's properties, check
|
||||
if it implements ICustomTypeDescriptor, in which case we should
|
||||
@@ -46,44 +95,22 @@
|
||||
actual properties. This is what .Net seems to do.
|
||||
Fixes a UsingWebBrowser problem during initialization.
|
||||
|
||||
|
||||
2008-08-01 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ToolStripButton.cs, ToolStripMenuItem.cs: Guard against a NRE my
|
||||
last change introduced when an item is clicked but isn't on a toolstrip.
|
||||
|
||||
2008-07-31 Geoff Norton <[email protected]>
|
||||
|
||||
* XplatUICarbon.cs: Properly implement PeekMessage and DoEvents.
|
||||
Fixes #396983
|
||||
|
||||
2008-07-31 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ToolStrip.cs: Fix an NRE caused by clicking on a ToolStripButton
|
||||
sitting on a MenuStrip.
|
||||
|
||||
2008-07-31 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ToolStripButton.cs: If we "click" a top button on a menustrip that has
|
||||
no children with the keyboard, we need to release the keyboard capture.
|
||||
[Fixes bug #413567]
|
||||
|
||||
2008-07-31 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ToolStripMenuItem.cs: If we "click" a top level menu item that has
|
||||
no children with the keyboard, we need to release the keyboard capture.
|
||||
[Fixes bug #413567]
|
||||
|
||||
2008-07-31 George Giolfan <[email protected]>
|
||||
|
||||
* ThemeVisualStyles.cs: Made ScrollBar rendering less strict so it supports
|
||||
the GTK+-based implementation of VisualStyles.
|
||||
* ThemeWin32Classic.cs: Exposed various layout values for use in the
|
||||
GTK+-based implementation of VisualStyles: ListViewGetHeaderHeight(Font),
|
||||
ListViewGetHeaderHeight(), ProgressBarChunkSpacing, ProgressBarGetChunkSize(),
|
||||
ProgressBarGetChunkSize(int), ProgressBarDefaultHeight,
|
||||
TrackBarGetThumbSize(), TrackBarVerticalTrackWidth,
|
||||
TrackBarHorizontalTrackHeight.
|
||||
|
||||
2008-07-31 George Giolfan <[email protected]>
|
||||
|
||||
* TabControl.cs: Added hot style handling for the scroll buttons.
|
||||
right_slider_state, left_slider_state are now of type PushButtonState to
|
||||
allow for a hot state. Added tracking of the mouse button being held down
|
||||
on a tab page. Extracted HasHotElementStyles, RightScrollButtonArea,
|
||||
LeftScrollButtonArea.
|
||||
* Theme.cs, ThemeWin32Classic.cs: Removed TabControlGetLeftScrollRect,
|
||||
TabControlGetRightScrollRect.
|
||||
|
||||
2008-07-30 Everaldo Canuto <[email protected]>
|
||||
|
||||
* MenuAPI.cs: Check for null GrabControl on ProcessMnemonic to prevent
|
||||
@@ -101,6 +128,12 @@
|
||||
* Form.cs: Ensure closing events are raised only once.
|
||||
[Fixes bug #413143]
|
||||
|
||||
2008-07-29 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ListBox.cs: Don't let the user set TopIndex so high that it
|
||||
scrolls up far enough to show empty items.
|
||||
[Fixes bug #412728]
|
||||
|
||||
2008-07-30 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* X11Keyboard.cs: Refactor SendKeyboardInput to accept the keycode,
|
||||
@@ -121,7 +154,7 @@
|
||||
* MenuAPI.cs: Don't create tracker on TrackPopupMenu, it will be created in
|
||||
MainMenu (already done) and ContextMenu creation.
|
||||
|
||||
* ContextMenu.cs: Create tracker on construction.
|
||||
* ContextMenu.cs: Create tracker on construction.
|
||||
|
||||
2008-07-30 Everaldo Canuto <[email protected]>
|
||||
|
||||
@@ -159,27 +192,6 @@
|
||||
all keyboard messages.
|
||||
[Fixes bug #378728]
|
||||
|
||||
2008-07-29 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ListBox.cs: Don't let the user set TopIndex so high that it
|
||||
scrolls up far enough to show empty items.
|
||||
[Fixes bug #412728]
|
||||
|
||||
2008-07-29 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ThemeWin32Classic.cs: Actually commit the changes to fix #410880
|
||||
(I'm an idiot and forgot to commit the actual changes, as well as
|
||||
specify the right file, which is this one, not ListView.cs).
|
||||
|
||||
2008-07-28 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListView.cs: Don't draw ListViewSubItem instances from
|
||||
DrawListViewItem - we need to reuse the main item's drawing for the
|
||||
first sub item in case owner draw is true, but wants the system to
|
||||
do the default draw for the first sub item, without incurring in a
|
||||
recursion problem.
|
||||
Fixes #410880.
|
||||
|
||||
2008-07-28 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ToolStripButton.cs: Update Checked for CheckOnClick before
|
||||
@@ -196,15 +208,6 @@
|
||||
* PropertyGrid.cs: Invalidate the View when the PropertyTab
|
||||
changes.
|
||||
|
||||
2008-07-25 Gert Driesen <[email protected]>
|
||||
|
||||
* WebBrowser.cs: Removed debug output.
|
||||
|
||||
2008-07-25 Jonathan Pobst <[email protected]>
|
||||
|
||||
* FileDialog.cs: Apply patch from Ernesto to clean up some
|
||||
dialog messages.
|
||||
|
||||
2008-07-25 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* TableLayoutPanel.cs: Perform layout on GrowStyle change, so
|
||||
@@ -248,26 +251,10 @@
|
||||
|
||||
* TableLayoutPanel.cs: Layout on Row/Column count change.
|
||||
|
||||
2008-07-22 Gert Driesen <[email protected]>
|
||||
|
||||
* ListViewItem.cs: Changed binary serialization to match MS. Fixes
|
||||
bug #409351.
|
||||
* PictureBox.cs: When ImageLocation is set to null or an empty string,
|
||||
only set image to null if it was previously initialized from an url
|
||||
(or using ImageLocation). In ImageLocation, load specified image
|
||||
asynchronously if WaitOnLoad is false. Added support for local file
|
||||
paths to LoadAsync, and added missing argument check.
|
||||
|
||||
2008-07-22 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* DateTimePicker.cs:
|
||||
* ThemeWin32Classic.cs: Add a editing capability to DateTimePicker, in
|
||||
order to set the value as required (which means: when selection
|
||||
changes for a part being edited, and not before that if not needed).
|
||||
Also use an enum to describe which part are we using, and use the
|
||||
selection as a property in PartData, in order to notify the
|
||||
DateTimePicker owner that we need to end the current edit.
|
||||
Fixes #383462.
|
||||
2008-07-15 Jonathan Pobst <[email protected]>
|
||||
[Backport to 2.0]
|
||||
* ImageList.cs: Fix ICollection.CopyTo implementation for
|
||||
ImageListCollection. [Fixes bug #409169]
|
||||
|
||||
2008-07-17 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
@@ -284,11 +271,6 @@
|
||||
returned which caused GetPropertiesSupported == false in most cases.
|
||||
[Fixes bug #409027]
|
||||
|
||||
2008-07-15 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ImageList.cs: Fix ICollection.CopyTo implementation for
|
||||
ImageListCollection. [Fixes bug #409169]
|
||||
|
||||
2008-07-14 Jonathan Pobst <[email protected]>
|
||||
|
||||
* MenuAPI.cs, ToolStripDropDown.cs: Use VirtualScreen instead of
|
||||
|
||||
@@ -314,10 +314,10 @@ namespace System.Windows.Forms {
|
||||
return true;
|
||||
|
||||
if (DataGridView != null) {
|
||||
if (RowIndex >= 0 && DataGridView.Rows [RowIndex].Selected)
|
||||
if (RowIndex >= 0 && RowIndex < DataGridView.Rows.Count && DataGridView.Rows [RowIndex].Selected)
|
||||
return true;
|
||||
|
||||
if (ColumnIndex >= 0 && DataGridView.Columns [ColumnIndex].Selected)
|
||||
if (ColumnIndex >= 0 && ColumnIndex < DataGridView.Columns.Count && DataGridView.Columns [ColumnIndex].Selected)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -940,7 +940,7 @@ namespace System.Windows.Forms
|
||||
|
||||
if (checkFileExists) {
|
||||
if (!File.Exists (internalfullfilename)) {
|
||||
string message = "\"" + internalfullfilename + "\" does not exist. Please verify that you have entered the correct file name.";
|
||||
string message = "\"" + internalfullfilename + "\" doesn't exist. Please verify that you have entered the correct file name.";
|
||||
MessageBox.Show (message, openSaveButton.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
@@ -949,7 +949,7 @@ namespace System.Windows.Forms
|
||||
if (fileDialogType == FileDialogType.SaveFileDialog) {
|
||||
if (overwritePrompt) {
|
||||
if (File.Exists (internalfullfilename)) {
|
||||
string message = "\"" + internalfullfilename + "\" already exists. Do you want to overwrite it?";
|
||||
string message = "\"" + internalfullfilename + "\" exists. Overwrite ?";
|
||||
DialogResult dr = MessageBox.Show (message, openSaveButton.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
|
||||
if (dr == DialogResult.Cancel)
|
||||
return;
|
||||
@@ -958,7 +958,7 @@ namespace System.Windows.Forms
|
||||
|
||||
if (createPrompt) {
|
||||
if (!File.Exists (internalfullfilename)) {
|
||||
string message = "\"" + internalfullfilename + "\" does not exist. Do you want to create it?";
|
||||
string message = "\"" + internalfullfilename + "\" doesn't exist. Create ?";
|
||||
DialogResult dr = MessageBox.Show (message, openSaveButton.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
|
||||
if (dr == DialogResult.Cancel)
|
||||
return;
|
||||
@@ -994,7 +994,7 @@ namespace System.Windows.Forms
|
||||
|
||||
if (checkPathExists && mwfFileView.CurrentRealFolder != null) {
|
||||
if (!Directory.Exists (mwfFileView.CurrentRealFolder)) {
|
||||
string message = "\"" + mwfFileView.CurrentRealFolder + "\" does not exist. Please verify that you have entered the correct directory name.";
|
||||
string message = "\"" + mwfFileView.CurrentRealFolder + "\" doesn't exist. Please verify that you have entered the correct directory name.";
|
||||
MessageBox.Show (message, openSaveButton.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
|
||||
if (InitialDirectory.Length == 0 || !Directory.Exists (InitialDirectory))
|
||||
@@ -3339,7 +3339,7 @@ namespace System.Windows.Forms
|
||||
} else
|
||||
File.Move (sourceFileName, destFileName);
|
||||
} catch (Exception e) {
|
||||
MessageBox.Show (e.Message, "Error Renaming File",
|
||||
MessageBox.Show (e.Message, "Error Renaming Folder",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1696,6 +1696,7 @@ namespace System.Windows.Forms
|
||||
int anchor = -1;
|
||||
int[] prev_selection;
|
||||
bool button_pressed = false;
|
||||
Point button_pressed_loc = new Point (-1, -1);
|
||||
|
||||
private void SelectExtended (int index)
|
||||
{
|
||||
@@ -1709,7 +1710,7 @@ namespace System.Windows.Forms
|
||||
|
||||
if (ctrl_pressed)
|
||||
foreach (int i in prev_selection)
|
||||
if (!selected_indices.Contains (i))
|
||||
if (!new_selection.Contains (i))
|
||||
new_selection.Add (i);
|
||||
|
||||
// Need to make a copy since we can't enumerate and modify the collection
|
||||
@@ -1751,16 +1752,28 @@ namespace System.Windows.Forms
|
||||
shift_pressed = (XplatUI.State.ModifierKeys & Keys.Shift) != 0;
|
||||
ctrl_pressed = (XplatUI.State.ModifierKeys & Keys.Control) != 0;
|
||||
|
||||
if (shift_pressed) {
|
||||
SelectedIndices.ClearCore ();
|
||||
SelectExtended (index);
|
||||
break;
|
||||
}
|
||||
|
||||
anchor = index;
|
||||
|
||||
if (ctrl_pressed) {
|
||||
prev_selection = new int [SelectedIndices.Count];
|
||||
SelectedIndices.CopyTo (prev_selection, 0);
|
||||
} else
|
||||
SelectedIndices.ClearCore ();
|
||||
|
||||
if (!shift_pressed)
|
||||
anchor = index;
|
||||
if (SelectedIndices.Contains (index))
|
||||
SelectedIndices.RemoveCore (index);
|
||||
else
|
||||
SelectedIndices.AddCore (index);
|
||||
|
||||
SelectExtended (index);
|
||||
break;
|
||||
}
|
||||
|
||||
SelectedIndices.ClearCore ();
|
||||
SelectedIndices.AddCore (index);
|
||||
break;
|
||||
|
||||
case SelectionMode.None:
|
||||
@@ -1770,15 +1783,19 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
button_pressed = true;
|
||||
button_pressed_loc = new Point (e.X, e.Y);
|
||||
FocusedItem = index;
|
||||
}
|
||||
|
||||
private void OnMouseMoveLB (object sender, MouseEventArgs e)
|
||||
{
|
||||
if (!button_pressed)
|
||||
// Don't take into account MouseMove events generated with MouseDown
|
||||
if (!button_pressed || button_pressed_loc == new Point (e.X, e.Y))
|
||||
return;
|
||||
|
||||
int index = IndexAtClientPoint (e.X, e.Y);
|
||||
if (index == -1)
|
||||
return;
|
||||
|
||||
switch (SelectionMode) {
|
||||
case SelectionMode.One:
|
||||
|
||||
@@ -1129,15 +1129,15 @@ namespace System.Windows.Forms
|
||||
[TypeConverter (typeof(ListViewSubItemConverter))]
|
||||
public class ListViewSubItem
|
||||
{
|
||||
[NonSerialized]
|
||||
private Color back_color;
|
||||
private Font font;
|
||||
private Color fore_color;
|
||||
internal ListViewItem owner;
|
||||
private string text = string.Empty;
|
||||
#if NET_2_0
|
||||
private string name;
|
||||
private object userData;
|
||||
private string name = String.Empty;
|
||||
private object tag;
|
||||
#endif
|
||||
private SubItemStyle style;
|
||||
[NonSerialized]
|
||||
internal Rectangle bounds;
|
||||
|
||||
#region Public Constructors
|
||||
@@ -1156,22 +1156,23 @@ namespace System.Windows.Forms
|
||||
{
|
||||
this.owner = owner;
|
||||
Text = text;
|
||||
this.style = new SubItemStyle (foreColor,
|
||||
backColor, font);
|
||||
this.fore_color = foreColor;
|
||||
this.back_color = backColor;
|
||||
this.font = font;
|
||||
}
|
||||
#endregion // Public Constructors
|
||||
|
||||
#region Public Instance Properties
|
||||
public Color BackColor {
|
||||
get {
|
||||
if (style.backColor != Color.Empty)
|
||||
return style.backColor;
|
||||
if (this.back_color != Color.Empty)
|
||||
return this.back_color;
|
||||
if (this.owner != null && this.owner.ListView != null)
|
||||
return this.owner.ListView.BackColor;
|
||||
return ThemeEngine.Current.ColorWindow;
|
||||
}
|
||||
set {
|
||||
style.backColor = value;
|
||||
back_color = value;
|
||||
Invalidate ();
|
||||
}
|
||||
}
|
||||
@@ -1198,30 +1199,30 @@ namespace System.Windows.Forms
|
||||
[Localizable (true)]
|
||||
public Font Font {
|
||||
get {
|
||||
if (style.font != null)
|
||||
return style.font;
|
||||
if (font != null)
|
||||
return font;
|
||||
else if (owner != null)
|
||||
return owner.Font;
|
||||
return ThemeEngine.Current.DefaultFont;
|
||||
}
|
||||
set {
|
||||
if (style.font == value)
|
||||
set {
|
||||
if (font == value)
|
||||
return;
|
||||
style.font = value;
|
||||
font = value;
|
||||
Invalidate ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Color ForeColor {
|
||||
get {
|
||||
if (style.foreColor != Color.Empty)
|
||||
return style.foreColor;
|
||||
if (this.fore_color != Color.Empty)
|
||||
return this.fore_color;
|
||||
if (this.owner != null && this.owner.ListView != null)
|
||||
return this.owner.ListView.ForeColor;
|
||||
return ThemeEngine.Current.ColorWindowText;
|
||||
}
|
||||
set {
|
||||
style.foreColor = value;
|
||||
set {
|
||||
fore_color = value;
|
||||
Invalidate ();
|
||||
}
|
||||
}
|
||||
@@ -1230,12 +1231,10 @@ namespace System.Windows.Forms
|
||||
[Localizable (true)]
|
||||
public string Name {
|
||||
get {
|
||||
if (name == null)
|
||||
return string.Empty;
|
||||
return name;
|
||||
}
|
||||
set {
|
||||
name = value;
|
||||
name = value == null ? String.Empty : value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1245,10 +1244,10 @@ namespace System.Windows.Forms
|
||||
[Localizable (false)]
|
||||
public object Tag {
|
||||
get {
|
||||
return userData;
|
||||
return tag;
|
||||
}
|
||||
set {
|
||||
userData = value;
|
||||
tag = value;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1273,7 +1272,9 @@ namespace System.Windows.Forms
|
||||
#region Public Methods
|
||||
public void ResetStyle ()
|
||||
{
|
||||
style.Reset ();
|
||||
font = ThemeEngine.Current.DefaultFont;
|
||||
back_color = ThemeEngine.Current.DefaultControlBackColor;
|
||||
fore_color = ThemeEngine.Current.DefaultControlForeColor;
|
||||
Invalidate ();
|
||||
}
|
||||
|
||||
@@ -1283,6 +1284,7 @@ namespace System.Windows.Forms
|
||||
}
|
||||
#endregion // Public Methods
|
||||
|
||||
|
||||
#region Private Methods
|
||||
private void Invalidate ()
|
||||
{
|
||||
@@ -1292,15 +1294,6 @@ namespace System.Windows.Forms
|
||||
owner.Invalidate ();
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[OnDeserialized]
|
||||
void OnDeserialized (StreamingContext context)
|
||||
{
|
||||
name = null;
|
||||
userData = null;
|
||||
}
|
||||
#endif
|
||||
|
||||
internal int Height {
|
||||
get {
|
||||
return bounds.Height;
|
||||
@@ -1313,32 +1306,6 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
#endregion // Private Methods
|
||||
|
||||
[Serializable]
|
||||
class SubItemStyle
|
||||
{
|
||||
public SubItemStyle ()
|
||||
{
|
||||
}
|
||||
|
||||
public SubItemStyle (Color foreColor, Color backColor, Font font)
|
||||
{
|
||||
this.foreColor = foreColor;
|
||||
this.backColor = backColor;
|
||||
this.font = font;
|
||||
}
|
||||
|
||||
public void Reset ()
|
||||
{
|
||||
foreColor = Color.Empty;
|
||||
backColor = Color.Empty;
|
||||
font = null;
|
||||
}
|
||||
|
||||
public Color backColor;
|
||||
public Color foreColor;
|
||||
public Font font;
|
||||
}
|
||||
}
|
||||
|
||||
public class ListViewSubItemCollection : IList, ICollection, IEnumerable
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace System.Windows.Forms {
|
||||
private Image initial_image;
|
||||
private bool wait_on_load;
|
||||
private WebClient image_download;
|
||||
private bool image_from_url;
|
||||
#endif
|
||||
private int no_update;
|
||||
#endregion // Fields
|
||||
@@ -121,7 +120,22 @@ namespace System.Windows.Forms {
|
||||
[Localizable(true)]
|
||||
public Image Image {
|
||||
get { return image; }
|
||||
set { ChangeImage (value, false); }
|
||||
set {
|
||||
StopAnimation ();
|
||||
|
||||
image = value;
|
||||
|
||||
if (IsHandleCreated) {
|
||||
UpdateSize ();
|
||||
if (image != null && ImageAnimator.CanAnimate (image)) {
|
||||
frame_handler = new EventHandler (OnAnimateImage);
|
||||
ImageAnimator.Animate (image, frame_handler);
|
||||
}
|
||||
if (no_update == 0) {
|
||||
Invalidate ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DefaultValue(BorderStyle.None)]
|
||||
@@ -161,13 +175,8 @@ namespace System.Windows.Forms {
|
||||
set {
|
||||
image_location = value;
|
||||
|
||||
if (!string.IsNullOrEmpty (value)) {
|
||||
if (WaitOnLoad)
|
||||
Load (value);
|
||||
else
|
||||
LoadAsync (value);
|
||||
} else if (image_from_url)
|
||||
ChangeImage (null, true);
|
||||
if (!string.IsNullOrEmpty (value))
|
||||
Load (value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +276,7 @@ namespace System.Windows.Forms {
|
||||
|
||||
protected override void OnPaint (PaintEventArgs pe)
|
||||
{
|
||||
ThemeEngine.Current.DrawPictureBox (pe.Graphics, pe.ClipRectangle, this);
|
||||
ThemeEngine.Current.DrawPictureBox (pe.Graphics, pe.ClipRectangle, this);
|
||||
base.OnPaint (pe);
|
||||
}
|
||||
|
||||
@@ -378,29 +387,7 @@ namespace System.Windows.Forms {
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void ChangeImage (Image value, bool from_url)
|
||||
{
|
||||
StopAnimation ();
|
||||
|
||||
#if NET_2_0
|
||||
image_from_url = from_url;
|
||||
#endif
|
||||
image = value;
|
||||
|
||||
if (IsHandleCreated) {
|
||||
UpdateSize ();
|
||||
if (image != null && ImageAnimator.CanAnimate (image)) {
|
||||
frame_handler = new EventHandler (OnAnimateImage);
|
||||
ImageAnimator.Animate (image, frame_handler);
|
||||
}
|
||||
if (no_update == 0) {
|
||||
Invalidate ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Private Methods
|
||||
private void StopAnimation ()
|
||||
{
|
||||
if (frame_handler == null)
|
||||
@@ -456,7 +443,7 @@ namespace System.Windows.Forms {
|
||||
Invalidate ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if NET_2_0
|
||||
void ImageDownload_DownloadDataCompleted (object sender, DownloadDataCompletedEventArgs e)
|
||||
{
|
||||
@@ -502,9 +489,9 @@ namespace System.Windows.Forms {
|
||||
|
||||
if (url.Contains ("://"))
|
||||
using (Stream s = ImageDownload.OpenRead (url))
|
||||
ChangeImage (Image.FromStream (s), true);
|
||||
Image = Image.FromStream (s);
|
||||
else
|
||||
ChangeImage (Image.FromFile (url), true);
|
||||
Image = Image.FromFile (url);
|
||||
}
|
||||
|
||||
public void LoadAsync ()
|
||||
@@ -519,29 +506,17 @@ namespace System.Windows.Forms {
|
||||
Load (url);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty (url))
|
||||
throw new InvalidOperationException ("ImageLocation not specified.");
|
||||
|
||||
image_location = url;
|
||||
ChangeImage (InitialImage, true);
|
||||
Image = InitialImage;
|
||||
|
||||
if (ImageDownload.IsBusy)
|
||||
ImageDownload.CancelAsync ();
|
||||
|
||||
Uri uri = null;
|
||||
try {
|
||||
uri = new Uri (url);
|
||||
} catch (UriFormatException) {
|
||||
uri = new Uri (Path.GetFullPath (url));
|
||||
}
|
||||
|
||||
ImageDownload.DownloadProgressChanged += new DownloadProgressChangedEventHandler (ImageDownload_DownloadProgressChanged);
|
||||
ImageDownload.DownloadDataCompleted += new DownloadDataCompletedEventHandler (ImageDownload_DownloadDataCompleted);
|
||||
ImageDownload.DownloadDataAsync (uri);
|
||||
ImageDownload.DownloadDataAsync (new Uri (url));
|
||||
}
|
||||
#endif
|
||||
|
||||
public override string ToString() {
|
||||
return String.Format("{0}, SizeMode: {1}", base.ToString (), SizeMode);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ using System.ComponentModel.Design;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms.Theming;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
|
||||
namespace System.Windows.Forms {
|
||||
#if NET_2_0
|
||||
@@ -56,11 +55,10 @@ namespace System.Windows.Forms {
|
||||
private bool show_tool_tips;
|
||||
private TabSizeMode size_mode;
|
||||
private bool show_slider = false;
|
||||
private PushButtonState right_slider_state = PushButtonState.Normal;
|
||||
private PushButtonState left_slider_state = PushButtonState.Normal;
|
||||
private ButtonState right_slider_state;
|
||||
private ButtonState left_slider_state;
|
||||
private int slider_pos = 0;
|
||||
TabPage entered_tab_page;
|
||||
bool mouse_down_on_a_tab_page;
|
||||
#if NET_2_0
|
||||
private bool rightToLeftLayout;
|
||||
#endif
|
||||
@@ -317,7 +315,7 @@ namespace System.Windows.Forms {
|
||||
|
||||
if (new_index != -1) {
|
||||
int le = TabPages[new_index].TabBounds.Right;
|
||||
int re = LeftScrollButtonArea.Left;
|
||||
int re = ThemeEngine.Current.TabControlGetLeftScrollRect (this).Left;
|
||||
if (show_slider && le > re) {
|
||||
int i = 0;
|
||||
for (i = 0; i < new_index - 1; i++) {
|
||||
@@ -453,36 +451,12 @@ namespace System.Windows.Forms {
|
||||
get { return slider_pos; }
|
||||
}
|
||||
|
||||
internal PushButtonState RightSliderState {
|
||||
internal ButtonState RightSliderState {
|
||||
get { return right_slider_state; }
|
||||
private set {
|
||||
if (right_slider_state == value)
|
||||
return;
|
||||
PushButtonState old_value = right_slider_state;
|
||||
right_slider_state = value;
|
||||
if (NeedsToInvalidateScrollButton (old_value, value))
|
||||
Invalidate (RightScrollButtonArea);
|
||||
}
|
||||
}
|
||||
|
||||
internal PushButtonState LeftSliderState {
|
||||
internal ButtonState LeftSliderState {
|
||||
get { return left_slider_state; }
|
||||
set {
|
||||
if (left_slider_state == value)
|
||||
return;
|
||||
PushButtonState old_value = left_slider_state;
|
||||
left_slider_state = value;
|
||||
if (NeedsToInvalidateScrollButton (old_value, value))
|
||||
Invalidate (LeftScrollButtonArea);
|
||||
}
|
||||
}
|
||||
|
||||
bool NeedsToInvalidateScrollButton (PushButtonState oldState, PushButtonState newState)
|
||||
{
|
||||
if ((oldState == PushButtonState.Hot && newState == PushButtonState.Normal) ||
|
||||
(oldState == PushButtonState.Normal && newState == PushButtonState.Hot))
|
||||
return HasHotElementStyles;
|
||||
return true;
|
||||
}
|
||||
|
||||
internal TabPage EnteredTabPage {
|
||||
@@ -490,7 +464,7 @@ namespace System.Windows.Forms {
|
||||
private set {
|
||||
if (entered_tab_page == value)
|
||||
return;
|
||||
if (HasHotElementStyles) {
|
||||
if (ThemeElements.CurrentTheme.TabControlPainter.HasHotElementStyles (this)) {
|
||||
Region area_to_invalidate = new Region ();
|
||||
area_to_invalidate.MakeEmpty ();
|
||||
if (entered_tab_page != null)
|
||||
@@ -908,10 +882,10 @@ namespace System.Windows.Forms {
|
||||
return;
|
||||
|
||||
if (ShowSlider) {
|
||||
Rectangle right = RightScrollButtonArea;
|
||||
Rectangle left = LeftScrollButtonArea;
|
||||
Rectangle right = ThemeEngine.Current.TabControlGetRightScrollRect (this);
|
||||
Rectangle left = ThemeEngine.Current.TabControlGetLeftScrollRect (this);
|
||||
if (right.Contains (e.X, e.Y)) {
|
||||
right_slider_state = PushButtonState.Pressed;
|
||||
right_slider_state = ButtonState.Pushed;
|
||||
if (CanScrollRight) {
|
||||
slider_pos++;
|
||||
SizeTabs ();
|
||||
@@ -936,7 +910,7 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
return;
|
||||
} else if (left.Contains (e.X, e.Y)) {
|
||||
left_slider_state = PushButtonState.Pressed;
|
||||
left_slider_state = ButtonState.Pushed;
|
||||
if (CanScrollLeft) {
|
||||
slider_pos--;
|
||||
SizeTabs ();
|
||||
@@ -967,50 +941,25 @@ namespace System.Windows.Forms {
|
||||
if (!GetTabRect (i).Contains (e.X, e.Y))
|
||||
continue;
|
||||
SelectedIndex = i;
|
||||
mouse_down_on_a_tab_page = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void MouseUpHandler (object sender, MouseEventArgs e)
|
||||
{
|
||||
mouse_down_on_a_tab_page = false;
|
||||
if (ShowSlider && (left_slider_state == PushButtonState.Pressed || right_slider_state == PushButtonState.Pressed)) {
|
||||
if (ShowSlider && (left_slider_state == ButtonState.Pushed || right_slider_state == ButtonState.Pushed)) {
|
||||
Rectangle invalid;
|
||||
if (left_slider_state == PushButtonState.Pressed) {
|
||||
invalid = LeftScrollButtonArea;
|
||||
left_slider_state = GetScrollButtonState (invalid, e.Location);
|
||||
} else {
|
||||
invalid = RightScrollButtonArea;
|
||||
right_slider_state = GetScrollButtonState (invalid, e.Location);
|
||||
}
|
||||
if (left_slider_state == ButtonState.Pushed)
|
||||
invalid = ThemeEngine.Current.TabControlGetLeftScrollRect (this);
|
||||
else
|
||||
invalid = ThemeEngine.Current.TabControlGetRightScrollRect (this);
|
||||
left_slider_state = ButtonState.Normal;
|
||||
right_slider_state = ButtonState.Normal;
|
||||
|
||||
Invalidate (invalid);
|
||||
}
|
||||
}
|
||||
|
||||
bool HasHotElementStyles {
|
||||
get {
|
||||
return ThemeElements.CurrentTheme.TabControlPainter.HasHotElementStyles (this);
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle LeftScrollButtonArea {
|
||||
get {
|
||||
return ThemeElements.CurrentTheme.TabControlPainter.GetLeftScrollRect (this);
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle RightScrollButtonArea {
|
||||
get {
|
||||
return ThemeElements.CurrentTheme.TabControlPainter.GetRightScrollRect (this);
|
||||
}
|
||||
}
|
||||
|
||||
static PushButtonState GetScrollButtonState (Rectangle scrollButtonArea, Point cursorLocation)
|
||||
{
|
||||
return scrollButtonArea.Contains (cursorLocation) ? PushButtonState.Hot : PushButtonState.Normal;
|
||||
}
|
||||
|
||||
private void SizeChangedHandler (object sender, EventArgs e)
|
||||
{
|
||||
Redraw ();
|
||||
@@ -1435,25 +1384,6 @@ namespace System.Windows.Forms {
|
||||
|
||||
void OnMouseMove (object sender, MouseEventArgs e)
|
||||
{
|
||||
if (!mouse_down_on_a_tab_page && ShowSlider) {
|
||||
if (LeftSliderState == PushButtonState.Pressed ||
|
||||
RightSliderState == PushButtonState.Pressed)
|
||||
return;
|
||||
if (LeftScrollButtonArea.Contains (e.Location)) {
|
||||
LeftSliderState = PushButtonState.Hot;
|
||||
RightSliderState = PushButtonState.Normal;
|
||||
EnteredTabPage = null;
|
||||
return;
|
||||
}
|
||||
if (RightScrollButtonArea.Contains (e.Location)) {
|
||||
RightSliderState = PushButtonState.Hot;
|
||||
LeftSliderState = PushButtonState.Normal;
|
||||
EnteredTabPage = null;
|
||||
return;
|
||||
}
|
||||
LeftSliderState = PushButtonState.Normal;
|
||||
RightSliderState = PushButtonState.Normal;
|
||||
}
|
||||
if (EnteredTabPage != null && EnteredTabPage.TabBounds.Contains (e.Location))
|
||||
return;
|
||||
for (int index = 0; index < TabCount; index++) {
|
||||
@@ -1468,10 +1398,6 @@ namespace System.Windows.Forms {
|
||||
|
||||
void OnMouseLeave (object sender, EventArgs e)
|
||||
{
|
||||
if (ShowSlider) {
|
||||
LeftSliderState = PushButtonState.Normal;
|
||||
RightSliderState = PushButtonState.Normal;
|
||||
}
|
||||
EnteredTabPage = null;
|
||||
}
|
||||
#endregion // Internal & Private Methods
|
||||
|
||||
@@ -945,6 +945,8 @@ namespace System.Windows.Forms
|
||||
public abstract Point TabControlImagePadding { get; }
|
||||
public abstract int TabControlScrollerWidth { get; }
|
||||
|
||||
public abstract Rectangle TabControlGetLeftScrollRect (TabControl tab);
|
||||
public abstract Rectangle TabControlGetRightScrollRect (TabControl tab);
|
||||
public abstract Rectangle TabControlGetDisplayRectangle (TabControl tab);
|
||||
public abstract Rectangle TabControlGetPanelRect (TabControl tab);
|
||||
public abstract Size TabControlGetSpacing (TabControl tab);
|
||||
|
||||
@@ -1319,10 +1319,8 @@ namespace System.Windows.Forms
|
||||
|
||||
if (bar.Enabled && bar.ThumbPos.Height >= 20) {
|
||||
element = VisualStyleElement.ScrollBar.GripperVertical.Normal;
|
||||
if (VisualStyleRenderer.IsElementDefined (element)) {
|
||||
renderer = new VisualStyleRenderer (element);
|
||||
renderer.DrawBackground (dc, bar.ThumbPos, clip);
|
||||
}
|
||||
renderer = new VisualStyleRenderer (element);
|
||||
renderer.DrawBackground (dc, bar.ThumbPos, clip);
|
||||
}
|
||||
#endregion
|
||||
} else {
|
||||
@@ -1411,10 +1409,8 @@ namespace System.Windows.Forms
|
||||
|
||||
if (bar.Enabled && bar.ThumbPos.Height >= 20) {
|
||||
element = VisualStyleElement.ScrollBar.GripperHorizontal.Normal;
|
||||
if (VisualStyleRenderer.IsElementDefined (element)) {
|
||||
renderer = new VisualStyleRenderer (element);
|
||||
renderer.DrawBackground (dc, bar.ThumbPos, clip);
|
||||
}
|
||||
renderer = new VisualStyleRenderer (element);
|
||||
renderer.DrawBackground (dc, bar.ThumbPos, clip);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -1448,9 +1444,12 @@ namespace System.Windows.Forms
|
||||
get {
|
||||
return
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.ArrowButton.DownDisabled) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.GripperHorizontal.Normal) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.GripperVertical.Normal) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.LeftTrackHorizontal.Disabled) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.LowerTrackVertical.Disabled) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.RightTrackHorizontal.Disabled) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.SizeBox.LeftAlign) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.ThumbButtonHorizontal.Disabled) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.ThumbButtonVertical.Disabled) &&
|
||||
VisualStyleRenderer.IsElementDefined (VisualStyleElement.ScrollBar.UpperTrackVertical.Disabled);
|
||||
@@ -2164,4 +2163,4 @@ namespace System.Windows.Forms
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3138,20 +3138,10 @@ namespace System.Windows.Forms
|
||||
|
||||
// Sizing
|
||||
public override int ListViewGetHeaderHeight (ListView listView, Font font)
|
||||
{
|
||||
return ListViewGetHeaderHeight (font);
|
||||
}
|
||||
|
||||
static int ListViewGetHeaderHeight (Font font)
|
||||
{
|
||||
return font.Height + 5;
|
||||
}
|
||||
|
||||
public static int ListViewGetHeaderHeight ()
|
||||
{
|
||||
return ListViewGetHeaderHeight (ThemeEngine.Current.DefaultFont);
|
||||
}
|
||||
|
||||
public override Size ListViewCheckBoxSize {
|
||||
get { return new Size (16, 16); }
|
||||
}
|
||||
@@ -4202,13 +4192,13 @@ namespace System.Windows.Forms
|
||||
case 0:
|
||||
default: // Blocks
|
||||
Rectangle block_rect;
|
||||
int space_betweenblocks = ProgressBarChunkSpacing;
|
||||
int space_betweenblocks = 2;
|
||||
int block_width;
|
||||
int increment;
|
||||
int barpos_pixels;
|
||||
int block_count = 0;
|
||||
|
||||
block_width = ProgressBarGetChunkSize (client_area.Height);
|
||||
block_width = (client_area.Height * 2) / 3;
|
||||
barpos_pixels = (int)(((double)(ctrl.Value - ctrl.Minimum) * client_area.Width) / (Math.Max (ctrl.Maximum - ctrl.Minimum, 1)));
|
||||
increment = block_width + space_betweenblocks;
|
||||
|
||||
@@ -4236,23 +4226,9 @@ namespace System.Windows.Forms
|
||||
}
|
||||
}
|
||||
|
||||
public const int ProgressBarChunkSpacing = 2;
|
||||
|
||||
public static int ProgressBarGetChunkSize ()
|
||||
{
|
||||
return ProgressBarGetChunkSize (ProgressBarDefaultHeight);
|
||||
}
|
||||
|
||||
static int ProgressBarGetChunkSize (int progressBarClientAreaHeight)
|
||||
{
|
||||
return (progressBarClientAreaHeight * 2) / 3;
|
||||
}
|
||||
|
||||
const int ProgressBarDefaultHeight = 23;
|
||||
|
||||
public override Size ProgressBarDefaultSize {
|
||||
get {
|
||||
return new Size (100, ProgressBarDefaultHeight);
|
||||
return new Size (100, 23);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5012,6 +4988,16 @@ namespace System.Windows.Forms
|
||||
ThemeElements.CurrentTheme.TabControlPainter.Draw (dc, area, tab);
|
||||
}
|
||||
|
||||
public override Rectangle TabControlGetLeftScrollRect (TabControl tab)
|
||||
{
|
||||
return ThemeElements.CurrentTheme.TabControlPainter.GetLeftScrollRect (tab);
|
||||
}
|
||||
|
||||
public override Rectangle TabControlGetRightScrollRect (TabControl tab)
|
||||
{
|
||||
return ThemeElements.CurrentTheme.TabControlPainter.GetRightScrollRect (tab);
|
||||
}
|
||||
|
||||
public override Rectangle TabControlGetDisplayRectangle (TabControl tab)
|
||||
{
|
||||
return ThemeElements.CurrentTheme.TabControlPainter.GetDisplayRectangle (tab);
|
||||
@@ -5538,7 +5524,7 @@ namespace System.Windows.Forms
|
||||
thumb_area.X = area.X + channel_startpoint.X;
|
||||
thumb_area.Y = area.Y + channel_startpoint.Y;
|
||||
thumb_area.Height = area.Height - space_from_right - space_from_left;
|
||||
thumb_area.Width = TrackBarVerticalTrackWidth;
|
||||
thumb_area.Width = 4;
|
||||
|
||||
pixel_len = thumb_area.Height - 11;
|
||||
if (tb.Maximum == tb.Minimum) {
|
||||
@@ -5586,7 +5572,7 @@ namespace System.Windows.Forms
|
||||
thumb_area.X = area.X + channel_startpoint.X;
|
||||
thumb_area.Y = area.Y + channel_startpoint.Y;
|
||||
thumb_area.Width = area.Width - space_from_right - space_from_left;
|
||||
thumb_area.Height = TrackBarHorizontalTrackHeight;
|
||||
thumb_area.Height = 4;
|
||||
|
||||
pixel_len = thumb_area.Width - 11;
|
||||
if (tb.Maximum == tb.Minimum) {
|
||||
@@ -5602,20 +5588,11 @@ namespace System.Windows.Forms
|
||||
}
|
||||
|
||||
protected virtual Size TrackBarGetThumbSize (TrackBar trackBar)
|
||||
{
|
||||
return TrackBarGetThumbSize ();
|
||||
}
|
||||
|
||||
public static Size TrackBarGetThumbSize ()
|
||||
{
|
||||
/* Draw thumb fixed 10x22 size */
|
||||
return new Size (10, 22);
|
||||
}
|
||||
|
||||
public const int TrackBarVerticalTrackWidth = 4;
|
||||
|
||||
public const int TrackBarHorizontalTrackHeight = 4;
|
||||
|
||||
#region Ticks
|
||||
protected interface ITrackBarTickPainter
|
||||
{
|
||||
|
||||
@@ -1234,6 +1234,13 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
|
||||
internal override void DoEvents() {
|
||||
MSG msg = new MSG ();
|
||||
|
||||
while (PeekMessage (null, ref msg, IntPtr.Zero, 0, 0, (uint)PeekMessageFlags.PM_REMOVE)) {
|
||||
TranslateMessage (ref msg);
|
||||
DispatchMessage (ref msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal override void EnableWindow(IntPtr handle, bool Enable) {
|
||||
@@ -1561,7 +1568,34 @@ namespace System.Windows.Forms {
|
||||
}
|
||||
|
||||
internal override bool PeekMessage(Object queue_id, ref MSG msg, IntPtr hWnd, int wFilterMin, int wFilterMax, uint flags) {
|
||||
return true;
|
||||
IntPtr evtRef = IntPtr.Zero;
|
||||
IntPtr target = GetEventDispatcherTarget();
|
||||
CheckTimers (DateTime.UtcNow);
|
||||
ReceiveNextEvent (0, IntPtr.Zero, 0, true, ref evtRef);
|
||||
if (evtRef != IntPtr.Zero && target != IntPtr.Zero) {
|
||||
SendEventToEventTarget (evtRef, target);
|
||||
ReleaseEvent (evtRef);
|
||||
}
|
||||
|
||||
lock (queuelock) {
|
||||
if (MessageQueue.Count <= 0) {
|
||||
return false;
|
||||
} else {
|
||||
object queueobj;
|
||||
if (flags == (uint)PeekMessageFlags.PM_REMOVE)
|
||||
queueobj = MessageQueue.Dequeue ();
|
||||
else
|
||||
queueobj = MessageQueue.Peek ();
|
||||
|
||||
if (queueobj is GCHandle) {
|
||||
XplatUIDriverSupport.ExecuteClientMessage((GCHandle)queueobj);
|
||||
return false;
|
||||
}
|
||||
msg = (MSG)queueobj;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
internal override bool PostMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam) {
|
||||
|
||||
@@ -4009,7 +4009,7 @@ namespace System.Windows.Forms {
|
||||
if (!hwnd.Enabled) {
|
||||
goto ProcessNextMessage;
|
||||
}
|
||||
if (xevent.CrossingEvent.mode != NotifyMode.NotifyNormal && xevent.CrossingEvent.window != hwnd.client_window) {
|
||||
if (xevent.CrossingEvent.mode != NotifyMode.NotifyNormal) {
|
||||
goto ProcessNextMessage;
|
||||
}
|
||||
msg.message = Msg.WM_MOUSE_ENTER;
|
||||
@@ -4860,6 +4860,33 @@ namespace System.Windows.Forms {
|
||||
y = dest_y_return;
|
||||
}
|
||||
|
||||
bool GraphicsExposePredicate (IntPtr display, ref XEvent xevent, IntPtr arg)
|
||||
{
|
||||
return (xevent.type == XEventName.GraphicsExpose || xevent.type == XEventName.NoExpose) &&
|
||||
arg == xevent.GraphicsExposeEvent.drawable;
|
||||
}
|
||||
|
||||
delegate bool EventPredicate (IntPtr display, ref XEvent xevent, IntPtr arg);
|
||||
|
||||
void ProcessGraphicsExpose (Hwnd hwnd)
|
||||
{
|
||||
XEvent xevent = new XEvent ();
|
||||
IntPtr handle = Hwnd.HandleFromObject (hwnd);
|
||||
EventPredicate predicate = GraphicsExposePredicate;
|
||||
|
||||
for (;;) {
|
||||
XIfEvent (Display, ref xevent, predicate, handle);
|
||||
if (xevent.type != XEventName.GraphicsExpose)
|
||||
break;
|
||||
|
||||
AddExpose (hwnd, xevent.ExposeEvent.window == hwnd.ClientWindow, xevent.GraphicsExposeEvent.x, xevent.GraphicsExposeEvent.y,
|
||||
xevent.GraphicsExposeEvent.width, xevent.GraphicsExposeEvent.height);
|
||||
|
||||
if (xevent.GraphicsExposeEvent.count == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
internal override void ScrollWindow(IntPtr handle, Rectangle area, int XAmount, int YAmount, bool with_children) {
|
||||
Hwnd hwnd;
|
||||
IntPtr gc;
|
||||
@@ -4913,6 +4940,8 @@ namespace System.Windows.Forms {
|
||||
Rectangle dirty_area = GetDirtyArea (area, dest_rect, XAmount, YAmount);
|
||||
AddExpose (hwnd, true, dirty_area.X, dirty_area.Y, dirty_area.Width, dirty_area.Height);
|
||||
|
||||
ProcessGraphicsExpose (hwnd);
|
||||
|
||||
XFreeGC(DisplayHandle, gc);
|
||||
}
|
||||
|
||||
@@ -4966,94 +4995,10 @@ namespace System.Windows.Forms {
|
||||
visible_area.Intersect (r);
|
||||
}
|
||||
|
||||
// If region is null, the entire area is visible.
|
||||
// Get the area not obscured otherwise.
|
||||
Region visible_region = GetVisibleRegion (c, visible_area);
|
||||
if (visible_region != null) {
|
||||
RectangleF rectf = visible_region.GetBounds (Hwnd.GraphicsContext);
|
||||
visible_area = new Rectangle ((int) rectf.X, (int) rectf.Y,
|
||||
(int) rectf.Width, (int) rectf.Height);
|
||||
|
||||
visible_region.Dispose ();
|
||||
}
|
||||
|
||||
visible_area.Location = c.PointToClient (visible_area.Location);
|
||||
return visible_area;
|
||||
}
|
||||
|
||||
// Obscured area by other toplevel windows
|
||||
Region GetVisibleRegion (Control c, Rectangle visible_area)
|
||||
{
|
||||
Region visible_region = null;
|
||||
IntPtr Root;
|
||||
IntPtr Parent;
|
||||
IntPtr Children;
|
||||
int ChildCount;
|
||||
|
||||
Control form = c.FindForm ();
|
||||
if (form == null || !form.IsHandleCreated)
|
||||
return null;
|
||||
|
||||
Hwnd hwnd = Hwnd.GetObjectFromWindow (form.Handle);
|
||||
IntPtr form_handle = hwnd.whole_window;
|
||||
|
||||
lock (XlibLock) {
|
||||
XQueryTree (DisplayHandle, RootWindow, out Root, out Parent, out Children, out ChildCount);
|
||||
}
|
||||
|
||||
int intptr_size = IntPtr.Size;
|
||||
bool above = false;
|
||||
|
||||
for (int i = 0; i < ChildCount; i++) {
|
||||
IntPtr window = Marshal.ReadIntPtr (Children, i * intptr_size);
|
||||
|
||||
XWindowAttributes win_attrs = new XWindowAttributes ();
|
||||
lock (XlibLock) {
|
||||
XGetWindowAttributes (DisplayHandle, window, ref win_attrs);
|
||||
}
|
||||
|
||||
Rectangle win_area = new Rectangle (win_attrs.x, win_attrs.y,
|
||||
win_attrs.width, win_attrs.height);
|
||||
|
||||
if (win_attrs.map_state != MapState.IsViewable || !win_area.IntersectsWith (visible_area))
|
||||
continue;
|
||||
|
||||
IntPtr SubChildren;
|
||||
int SubChildCount;
|
||||
|
||||
if (above) {
|
||||
if (visible_region == null)
|
||||
visible_region = new Region (visible_area);
|
||||
|
||||
visible_region.Exclude (win_area);
|
||||
continue;
|
||||
}
|
||||
|
||||
lock (XlibLock) {
|
||||
XQueryTree (DisplayHandle, window, out Root, out Parent, out SubChildren, out SubChildCount);
|
||||
}
|
||||
|
||||
if (SubChildren != IntPtr.Zero) {
|
||||
IntPtr sub_win = new IntPtr (Marshal.ReadInt32 (SubChildren));
|
||||
|
||||
lock (XlibLock) {
|
||||
XFree (SubChildren);
|
||||
}
|
||||
|
||||
if (sub_win == form_handle)
|
||||
above = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Children != IntPtr.Zero) {
|
||||
lock (XlibLock) {
|
||||
XFree (Children);
|
||||
}
|
||||
}
|
||||
|
||||
return visible_region;
|
||||
}
|
||||
|
||||
internal override void SendAsyncMethod (AsyncMethodData method) {
|
||||
Hwnd hwnd;
|
||||
XEvent xevent = new XEvent ();
|
||||
@@ -6286,6 +6231,9 @@ namespace System.Windows.Forms {
|
||||
|
||||
[DllImport ("libX11")]
|
||||
internal extern static void XPeekEvent (IntPtr display, ref XEvent xevent);
|
||||
|
||||
[DllImport ("libX11")]
|
||||
internal extern static void XIfEvent (IntPtr display, ref XEvent xevent, Delegate event_predicate, IntPtr arg);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,6 @@ System.Windows.Forms/ErrorProviderTest.cs
|
||||
System.Windows.Forms/FlowPanelTests.cs
|
||||
System.Windows.Forms/FocusTest.cs
|
||||
System.Windows.Forms/FolderBrowserDialogTest.cs
|
||||
System.Windows.Forms/FormEventTest.cs
|
||||
System.Windows.Forms/FormHandleTest.cs
|
||||
System.Windows.Forms/FormTest.cs
|
||||
System.Windows.Forms/EventArgsTest.cs
|
||||
|
||||
@@ -1,52 +1,23 @@
|
||||
2008-08-02 Gert Driesen <[email protected]>
|
||||
|
||||
* FormEventTest.cs: Modified several tests to no longer require manual
|
||||
intervention. Added/improved tests for Form events.
|
||||
|
||||
2008-07-31 Carlos Alberto Cortez <[email protected]>
|
||||
2008-08-01 Carlos Alberto Cortez <[email protected]>
|
||||
|
||||
* ListBindingHelperTest.cs: New test for GetList receiving an IEnumerable
|
||||
object which return instances of ICustomTypeDescriptor instances,
|
||||
instead of actual items.
|
||||
|
||||
2008-07-30 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* TableLayoutTest.cs: Add tests for bug #412582
|
||||
|
||||
2008-07-29 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ListBox.cs: Make test not font dependent.
|
||||
|
||||
2008-07-29 Jonathan Pobst <[email protected]>
|
||||
|
||||
* ListBox.cs: Add test for bug #412728.
|
||||
|
||||
2008-07-30 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* TableLayoutTest.cs: Add tests for bug #412582
|
||||
|
||||
2008-07-25 Ivan N. Zlatev <[email protected]>
|
||||
|
||||
* TableLayoutTest.cs: Add test for bug #412161
|
||||
|
||||
2008-07-23 Gert Driesen <[email protected]>
|
||||
|
||||
* ListViewItemTest.cs: Marked SerializeExact_Mono as NotWorking to fix
|
||||
buildbot.
|
||||
|
||||
2008-07-22 Gert Driesen <[email protected]>
|
||||
|
||||
* ListViewItemTest.cs: Enabled (de)serialization tests.
|
||||
* PictureBoxTest.cs: Enabled tests for bug #378308.
|
||||
|
||||
2008-07-20 Gert Driesen <[email protected]>
|
||||
|
||||
* ListViewItemTest.cs: Fixed tests.
|
||||
|
||||
2008-07-20 Gert Driesen <[email protected]>
|
||||
|
||||
* ListViewItemTest.cs: Added ListViewSubItem (de)serialization tests,
|
||||
added/improved ctor tests and add property tests.
|
||||
* PictureBoxTest.cs: Added tests for Load(Async) argument checks.
|
||||
|
||||
2008-07-15 Jonathan Pobst <[email protected]>
|
||||
|
||||
[Backport to 2.0]
|
||||
* ImageListTest.cs: Add test for bug #409169.
|
||||
|
||||
2008-07-14 Jonathan Pobst <[email protected]>
|
||||
@@ -60,7 +31,7 @@
|
||||
2008-07-12 Gert Driesen <[email protected]>
|
||||
|
||||
* PictureBoxTest.cs: Split up ImageLocation test in sync and async
|
||||
tests.
|
||||
tests. Added tests for Load argument checks.
|
||||
|
||||
2008-07-11 Gert Driesen <[email protected]>
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Threading;
|
||||
using Timer = System.Windows.Forms.Timer;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MonoTests.System.Windows.Forms
|
||||
@@ -26,490 +25,55 @@ namespace MonoTests.System.Windows.Forms
|
||||
eventhandled = true;
|
||||
}
|
||||
|
||||
private Form _form;
|
||||
|
||||
[TearDown]
|
||||
public void TearDown ()
|
||||
[Test, Ignore ("Manual Intervention")]
|
||||
public void ActivatedTest ()
|
||||
{
|
||||
if (_form != null)
|
||||
_form.Dispose ();
|
||||
Form myform = new Form ();
|
||||
myform.ShowInTaskbar = false;
|
||||
myform.Activated += new EventHandler (New_EventHandler);
|
||||
myform.Activate ();
|
||||
myform.ShowDialog ();
|
||||
Assert.AreEqual (true, eventhandled, "#A1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Activated ()
|
||||
[Test, Ignore ("Manual Intervention")]
|
||||
public void ClosedTest ()
|
||||
{
|
||||
if (TestHelper.RunningOnUnix)
|
||||
Assert.Ignore ("#7 fails");
|
||||
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("Activated"), "#1");
|
||||
_form.Activate ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("Activated"), "#2");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#3");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#4");
|
||||
_form.Activate ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#5");
|
||||
_form.Hide ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#6");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Activated"), "#7");
|
||||
Form myform = new Form ();
|
||||
myform.ShowInTaskbar = false;
|
||||
myform.Closed += new EventHandler (New_EventHandler);
|
||||
eventhandled = false;
|
||||
myform.Close ();
|
||||
myform.ShowDialog ();
|
||||
Assert.AreEqual (true, eventhandled, "#A2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Activated_Dialog ()
|
||||
[Test, Ignore ("Manual Intervention")]
|
||||
public void DeactivateTest ()
|
||||
{
|
||||
if (TestHelper.RunningOnUnix)
|
||||
Assert.Ignore ("#4 fails");
|
||||
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("Activated"), "#1");
|
||||
_form.Activate ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("Activated"), "#2");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#3");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Activated"), "#4");
|
||||
Form myform = new Form ();
|
||||
myform.ShowInTaskbar = false;
|
||||
myform.Deactivate += new EventHandler (New_EventHandler);
|
||||
eventhandled = false;
|
||||
myform.Close ();
|
||||
myform.Activate ();
|
||||
myform.ShowDialog ();
|
||||
Assert.AreEqual (true, eventhandled, "#A3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Closed ()
|
||||
[Test, Ignore ("Manual Intervention")]
|
||||
public void LoadTest ()
|
||||
{
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("Closed"), "#1");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closed"), "#2");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closed"), "#3");
|
||||
Form myform = new Form ();
|
||||
myform.ShowInTaskbar = false;
|
||||
myform.Load += new EventHandler (New_EventHandler);
|
||||
eventhandled = false;
|
||||
myform.ShowDialog ();
|
||||
Assert.AreEqual (true, eventhandled, "#A4");
|
||||
myform.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Closed_Dialog ()
|
||||
{
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closed"), "#1");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Closed"), "#2");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Closed"), "#3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Closing ()
|
||||
{
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("Closing"), "#1");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closing"), "#2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Closing_Dialog ()
|
||||
{
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closing"), "#1");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Closing"), "#2");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Closing"), "#3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Deactivate ()
|
||||
{
|
||||
if (TestHelper.RunningOnUnix)
|
||||
Assert.Ignore ("#3 or #5 fail");
|
||||
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.Activate ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("Deactivate"), "#1");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("Deactivate"), "#2");
|
||||
_form.Hide ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Deactivate"), "#3");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Deactivate"), "#4");
|
||||
_form.Hide ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Deactivate"), "#5");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Deactivate"), "#6");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Deactivate"), "#7");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Deactivate_Dialog ()
|
||||
{
|
||||
if (TestHelper.RunningOnUnix)
|
||||
Assert.Ignore ("#2 sometimes fails");
|
||||
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.Activate ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("Deactivate"), "#1");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Deactivate"), "#2");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Deactivate"), "#3");
|
||||
}
|
||||
|
||||
[Test] // bug #413898
|
||||
public void EventOrder ()
|
||||
{
|
||||
if (TestHelper.RunningOnUnix)
|
||||
Assert.Ignore ("#A3 fails");
|
||||
|
||||
string [] expectedEvents_Show = {
|
||||
"Load",
|
||||
"VisibleChanged",
|
||||
"GotFocus",
|
||||
"Activated" };
|
||||
|
||||
string [] expectedEvents_Close = {
|
||||
"Closing",
|
||||
#if NET_2_0
|
||||
"FormClosing",
|
||||
#endif
|
||||
"Closed",
|
||||
#if NET_2_0
|
||||
"FormClosed",
|
||||
#endif
|
||||
"Deactivate",
|
||||
"LostFocus",
|
||||
"HandleDestroyed",
|
||||
"Disposed" };
|
||||
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
|
||||
Assert.IsTrue (logger.ContainsEventsOrdered (expectedEvents_Show), "#A1:" + logger.EventsJoined());
|
||||
Assert.AreEqual (1, logger.CountEvents ("Load"), "#A2");
|
||||
Assert.AreEqual (1, logger.CountEvents ("VisibleChanged"), "#A3");
|
||||
Assert.AreEqual (1, logger.CountEvents ("GotFocus"), "#A4");
|
||||
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#A5");
|
||||
Assert.AreEqual (0, logger.CountEvents ("Closing"), "#A6");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (0, logger.CountEvents ("FormClosing"), "#A7");
|
||||
#endif
|
||||
Assert.AreEqual (0, logger.CountEvents ("Closed"), "#A8");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (0, logger.CountEvents ("FormClosed"), "#A9");
|
||||
#endif
|
||||
Assert.AreEqual (0, logger.CountEvents ("Deactivate"), "#A10");
|
||||
Assert.AreEqual (0, logger.CountEvents ("LostFocus"), "#A11");
|
||||
Assert.AreEqual (0, logger.CountEvents ("HandleDestroyed"), "#A12");
|
||||
Assert.AreEqual (0, logger.CountEvents ("Disposed"), "#A13");
|
||||
|
||||
logger.Clear ();
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
|
||||
Assert.IsTrue (logger.ContainsEventsOrdered (expectedEvents_Close), "#B1:" + logger.EventsJoined ());
|
||||
Assert.AreEqual (0, logger.CountEvents ("Load"), "#B2");
|
||||
Assert.AreEqual (0, logger.CountEvents ("VisibleChanged"), "#B3");
|
||||
Assert.AreEqual (0, logger.CountEvents ("GotFocus"), "#B4");
|
||||
Assert.AreEqual (0, logger.CountEvents ("Activated"), "#B5");
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closing"), "#B6");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosing"), "#B7");
|
||||
#endif
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closed"), "#B8");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#B9");
|
||||
#endif
|
||||
Assert.AreEqual (1, logger.CountEvents ("Deactivate"), "#B10");
|
||||
Assert.AreEqual (1, logger.CountEvents ("LostFocus"), "#B11");
|
||||
Assert.AreEqual (1, logger.CountEvents ("HandleDestroyed"), "#B12");
|
||||
Assert.AreEqual (1, logger.CountEvents ("Disposed"), "#B13");
|
||||
}
|
||||
|
||||
[Test] // bug #413898
|
||||
public void EventOrder_Dialog ()
|
||||
{
|
||||
if (TestHelper.RunningOnUnix)
|
||||
Assert.Ignore ("#A1 fails");
|
||||
|
||||
string [] expectedEvents = {
|
||||
"Load",
|
||||
"VisibleChanged",
|
||||
"GotFocus",
|
||||
"Activated",
|
||||
"Closing",
|
||||
#if NET_2_0
|
||||
"FormClosing",
|
||||
#endif
|
||||
"Closed",
|
||||
#if NET_2_0
|
||||
"FormClosed",
|
||||
#endif
|
||||
"VisibleChanged",
|
||||
"Deactivate",
|
||||
"LostFocus",
|
||||
"HandleDestroyed" };
|
||||
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
|
||||
_form.ShowDialog ();
|
||||
Assert.IsTrue (logger.ContainsEventsOrdered (expectedEvents), "#A1:" + logger.EventsJoined ());
|
||||
Assert.AreEqual (1, logger.CountEvents ("Load"), "#A2");
|
||||
Assert.AreEqual (2, logger.CountEvents ("VisibleChanged"), "#A3");
|
||||
Assert.AreEqual (1, logger.CountEvents ("GotFocus"), "#A4");
|
||||
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#A5");
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closing"), "#A6");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosing"), "#A7");
|
||||
#endif
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closed"), "#A8");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#A9");
|
||||
#endif
|
||||
Assert.AreEqual (1, logger.CountEvents ("Deactivate"), "#A10");
|
||||
Assert.AreEqual (1, logger.CountEvents ("LostFocus"), "#A11");
|
||||
Assert.AreEqual (1, logger.CountEvents ("HandleDestroyed"), "#A12");
|
||||
Assert.AreEqual (0, logger.CountEvents ("Disposed"), "#A13");
|
||||
|
||||
logger.Clear ();
|
||||
|
||||
_form.ShowDialog ();
|
||||
Assert.IsTrue (logger.ContainsEventsOrdered (expectedEvents), "#B1:" + logger.EventsJoined ());
|
||||
Assert.AreEqual (1, logger.CountEvents ("Load"), "#B2");
|
||||
Assert.AreEqual (2, logger.CountEvents ("VisibleChanged"), "#B3");
|
||||
Assert.AreEqual (1, logger.CountEvents ("GotFocus"), "#B4");
|
||||
Assert.AreEqual (1, logger.CountEvents ("Activated"), "#B5");
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closing"), "#B6");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosing"), "#B7");
|
||||
#endif
|
||||
Assert.AreEqual (1, logger.CountEvents ("Closed"), "#B8");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#B9");
|
||||
#endif
|
||||
Assert.AreEqual (1, logger.CountEvents ("Deactivate"), "#B10");
|
||||
Assert.AreEqual (1, logger.CountEvents ("LostFocus"), "#B11");
|
||||
Assert.AreEqual (1, logger.CountEvents ("HandleDestroyed"), "#B12");
|
||||
Assert.AreEqual (0, logger.CountEvents ("Disposed"), "#B13");
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[Test]
|
||||
public void FormClosed ()
|
||||
{
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("FormClosed"), "#1");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("FormClosed"), "#2");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#3");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#4");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FormClosed_Dialog ()
|
||||
{
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("FormClosed"), "#1");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#2");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#3");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosed"), "#4");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FormClosing ()
|
||||
{
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("FormClosing"), "#1");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (0, logger.CountEvents ("FormClosing"), "#2");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosing"), "#3");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosing"), "#4");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosing"), "#5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FormClosing_Dialog ()
|
||||
{
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("FormClosing"));
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("FormClosing"));
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("FormClosing"));
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void Load ()
|
||||
{
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("Load"), "#1");
|
||||
_form.Show ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Load"), "#2");
|
||||
_form.Show ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Load"), "#3");
|
||||
_form.Hide ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Load"), "#4");
|
||||
_form.Show ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Load"), "#5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Load_Dialog ()
|
||||
{
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("Load"), "#1");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Load"), "#2");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Load"), "#3");
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[Test]
|
||||
public void Shown ()
|
||||
{
|
||||
_form = new Form ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
//_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("Shown"), "#1");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Shown"), "#2");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Shown"), "#3");
|
||||
_form.Hide ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Shown"), "#4");
|
||||
_form.Show ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Shown"), "#5");
|
||||
_form.Close ();
|
||||
Application.DoEvents ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Shown"), "#6");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Shown_Dialog ()
|
||||
{
|
||||
_form = new DelayedCloseForm ();
|
||||
EventLogger logger = new EventLogger (_form);
|
||||
_form.ShowInTaskbar = false;
|
||||
Assert.AreEqual (0, logger.CountEvents ("Shown"), "#1");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (1, logger.CountEvents ("Shown"), "#2");
|
||||
_form.ShowDialog ();
|
||||
Assert.AreEqual (2, logger.CountEvents ("Shown"), "#3");
|
||||
}
|
||||
#endif
|
||||
|
||||
class DelayedCloseForm : Form
|
||||
{
|
||||
private Timer _timer;
|
||||
|
||||
public DelayedCloseForm ()
|
||||
{
|
||||
_timer = new Timer ();
|
||||
_timer.Tick += new EventHandler (OnTick);
|
||||
_timer.Interval = 50;
|
||||
|
||||
Closed += new EventHandler (OnClosed);
|
||||
Load += new EventHandler (OnLoad);
|
||||
}
|
||||
|
||||
void OnClosed (object sender, EventArgs e)
|
||||
{
|
||||
_timer.Enabled = false;
|
||||
}
|
||||
|
||||
void OnLoad (object sender, EventArgs e)
|
||||
{
|
||||
_timer.Enabled = true;
|
||||
}
|
||||
|
||||
void OnTick (object sender, EventArgs e)
|
||||
{
|
||||
Close ();
|
||||
Application.DoEvents ();
|
||||
}
|
||||
}
|
||||
|
||||
class MyForm : Form
|
||||
class MyForm : Form
|
||||
{
|
||||
public void MaximizeBoundsTest ()
|
||||
{
|
||||
@@ -520,22 +84,24 @@ namespace MonoTests.System.Windows.Forms
|
||||
[Test]
|
||||
public void MaximizedBoundsChangedTest ()
|
||||
{
|
||||
_form = new MyForm ();
|
||||
_form.MaximizedBoundsChanged += new EventHandler (New_EventHandler);
|
||||
MyForm myform = new MyForm ();
|
||||
myform.MaximizedBoundsChanged += new EventHandler (New_EventHandler);
|
||||
eventhandled = false;
|
||||
((MyForm) _form).MaximizeBoundsTest ();
|
||||
myform.MaximizeBoundsTest ();
|
||||
Assert.AreEqual (true, eventhandled, "#A5");
|
||||
myform.Dispose ();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MaximumSizeChangedTest ()
|
||||
{
|
||||
_form = new Form ();
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.MaximumSizeChanged += new EventHandler (New_EventHandler);
|
||||
Form myform = new Form ();
|
||||
myform.ShowInTaskbar = false;
|
||||
myform.MaximumSizeChanged += new EventHandler (New_EventHandler);
|
||||
eventhandled = false;
|
||||
_form.MaximumSize = new Size (500, 500);
|
||||
myform.MaximumSize = new Size (500, 500);
|
||||
Assert.AreEqual (true, eventhandled, "#A6");
|
||||
myform.Dispose ();
|
||||
}
|
||||
|
||||
[Test, Ignore ("Manual Intervention")]
|
||||
@@ -563,12 +129,13 @@ namespace MonoTests.System.Windows.Forms
|
||||
[Test]
|
||||
public void MinimumSizeChangedTest ()
|
||||
{
|
||||
_form = new Form ();
|
||||
_form.ShowInTaskbar = false;
|
||||
_form.MinimumSizeChanged += new EventHandler (New_EventHandler);
|
||||
Form myform = new Form ();
|
||||
myform.ShowInTaskbar = false;
|
||||
myform.MinimumSizeChanged += new EventHandler (New_EventHandler);
|
||||
eventhandled = false;
|
||||
_form.MinimumSize = new Size(100, 100);
|
||||
myform.MinimumSize = new Size(100, 100);
|
||||
Assert.AreEqual (true, eventhandled, "#A10");
|
||||
myform.Dispose ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,8 +186,10 @@ namespace MonoTests.System.Windows.Forms
|
||||
CultureInfo oldci = Thread.CurrentThread.CurrentCulture;
|
||||
CultureInfo oldcui = Thread.CurrentThread.CurrentUICulture;
|
||||
InputLanguage oldil = InputLanguage.CurrentInputLanguage;
|
||||
try {
|
||||
if (InputLanguage.InstalledInputLanguages.Count > 1) {
|
||||
try
|
||||
{
|
||||
if (InputLanguage.InstalledInputLanguages.Count > 1)
|
||||
{
|
||||
InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages[0];
|
||||
myform.InputLanguageChanged += new InputLanguageChangedEventHandler (InputLanguage_Handler);
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo ("ta-IN");
|
||||
@@ -628,7 +197,9 @@ namespace MonoTests.System.Windows.Forms
|
||||
InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages[1];
|
||||
Assert.AreEqual (true, eventhandled, "#A15");
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
finally
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = oldci;
|
||||
Thread.CurrentThread.CurrentUICulture = oldcui;
|
||||
InputLanguage.CurrentInputLanguage = oldil;
|
||||
@@ -638,7 +209,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
}
|
||||
|
||||
[TestFixture,Ignore ("Test Breaks")]
|
||||
public class InputLanguageChangingEvent
|
||||
public class InputLanguageChangingdEvent
|
||||
{
|
||||
static bool eventhandled = false;
|
||||
public void InputLangChanging_Handler(object sender,InputLanguageChangingEventArgs e)
|
||||
@@ -647,14 +218,15 @@ namespace MonoTests.System.Windows.Forms
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InputLanguageChangingEventTest ()
|
||||
public void InputLanguageChangingEventTest ()
|
||||
{
|
||||
Form myform = new Form ();
|
||||
myform.ShowInTaskbar = false;
|
||||
CultureInfo oldci = Thread.CurrentThread.CurrentCulture;
|
||||
CultureInfo oldcui = Thread.CurrentThread.CurrentUICulture;
|
||||
InputLanguage oldil = InputLanguage.CurrentInputLanguage;
|
||||
try {
|
||||
try
|
||||
{
|
||||
if (InputLanguage.InstalledInputLanguages.Count > 1)
|
||||
{
|
||||
InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages[0];
|
||||
@@ -664,7 +236,9 @@ namespace MonoTests.System.Windows.Forms
|
||||
InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages[1];
|
||||
Assert.AreEqual (true, eventhandled, "#A16");
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
finally
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = oldci;
|
||||
Thread.CurrentThread.CurrentUICulture = oldcui;
|
||||
InputLanguage.CurrentInputLanguage = oldil;
|
||||
|
||||
@@ -30,7 +30,6 @@ using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using NUnit.Framework;
|
||||
|
||||
@@ -696,644 +695,35 @@ namespace MonoTests.System.Windows.Forms
|
||||
[TestFixture]
|
||||
public class ListViewSubItemTest
|
||||
{
|
||||
[Test] // ctor ()
|
||||
public void Constructor1 ()
|
||||
[Test]
|
||||
public void ListViewSubItemConstructorTest ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
|
||||
Assert.AreEqual (string.Empty, subItem.Text, "#1");
|
||||
ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem (null, null);
|
||||
Assert.AreEqual (String.Empty, subItem.Text, "#A1");
|
||||
|
||||
ListViewItem.ListViewSubItem subItem2 = new ListViewItem.ListViewSubItem (null, "SubItem2");
|
||||
Assert.AreEqual ("SubItem2", subItem2.Text, "#A2");
|
||||
|
||||
Font fnt = new Font ("Arial", 12);
|
||||
ListViewItem.ListViewSubItem subItem3 = new ListViewItem.ListViewSubItem (null, "SubItem3",
|
||||
Color.Blue, Color.Green, fnt);
|
||||
Assert.AreEqual ("SubItem3", subItem3.Text, "#A3");
|
||||
Assert.AreEqual (Color.Green, subItem3.BackColor, "#A4");
|
||||
Assert.AreEqual (Color.Blue, subItem3.ForeColor, "#A5");
|
||||
Assert.AreEqual (fnt, subItem3.Font, "#A6");
|
||||
}
|
||||
|
||||
[Test] // ctor (ListViewItem, String)
|
||||
public void Constructor2 ()
|
||||
[Test]
|
||||
public void ListViewSubItemPropertiesTest ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem;
|
||||
ListViewItem item = new ListViewItem ();
|
||||
ListViewItem.ListViewSubItem subItem1 = new ListViewItem.ListViewSubItem ();
|
||||
Assert.AreEqual (string.Empty, subItem1.Text, "#A1");
|
||||
|
||||
subItem = new ListViewItem.ListViewSubItem (null, null);
|
||||
Assert.IsNotNull (subItem.Font, "#A1");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#A2");
|
||||
Assert.IsNull (subItem.Tag, "#A3");
|
||||
#endif
|
||||
Assert.AreEqual (String.Empty, subItem.Text, "#A4");
|
||||
|
||||
subItem = new ListViewItem.ListViewSubItem (item, "SubItem2");
|
||||
Assert.IsNotNull (subItem.Font, "#B1");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#B2");
|
||||
Assert.IsNull (subItem.Tag, "#B3");
|
||||
#endif
|
||||
Assert.AreEqual ("SubItem2", subItem.Text, "#B4");
|
||||
subItem1.Text = null;
|
||||
Assert.AreEqual (string.Empty, subItem1.Text, "#B1");
|
||||
subItem1.Text = "test";
|
||||
Assert.AreEqual ("test", subItem1.Text, "#B2");
|
||||
}
|
||||
|
||||
[Test] // ctor (ListViewItem, String, Color, Color, Font)
|
||||
public void Constructor3 ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem;
|
||||
Font font = new Font ("Arial", 12);
|
||||
ListViewItem item = new ListViewItem ();
|
||||
|
||||
subItem = new ListViewItem.ListViewSubItem (null, null,
|
||||
Color.Blue, Color.Red, null);
|
||||
Assert.AreEqual (Color.Red, subItem.BackColor, "#A1");
|
||||
Assert.IsNotNull (subItem.Font, "#A2");
|
||||
Assert.AreEqual (Color.Blue, subItem.ForeColor, "#A3");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#A4");
|
||||
Assert.IsNull (subItem.Tag, "#A5");
|
||||
#endif
|
||||
Assert.AreEqual (string.Empty, subItem.Text, "#A6");
|
||||
|
||||
subItem = new ListViewItem.ListViewSubItem (item, "SubItem3",
|
||||
Color.Blue, Color.Green, font);
|
||||
Assert.AreEqual (Color.Green, subItem.BackColor, "#B1");
|
||||
Assert.AreSame (font, subItem.Font, "#B2");
|
||||
Assert.AreEqual (Color.Blue, subItem.ForeColor, "#B3");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#B4");
|
||||
Assert.IsNull (subItem.Tag, "#B5");
|
||||
#endif
|
||||
Assert.AreEqual ("SubItem3", subItem.Text, "#B6");
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
[Test]
|
||||
public void Name ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
|
||||
subItem.Name = "foo";
|
||||
Assert.AreEqual ("foo", subItem.Name, "#1");
|
||||
subItem.Name = null;
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#2");
|
||||
subItem.Name = "bar";
|
||||
Assert.AreEqual ("bar", subItem.Name, "#3");
|
||||
subItem.Name = string.Empty;
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#4");
|
||||
subItem.Name = " \t ";
|
||||
Assert.AreEqual (" \t ", subItem.Name, "#5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Tag ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
|
||||
subItem.Tag = "foo";
|
||||
Assert.AreEqual ("foo", subItem.Tag, "#1");
|
||||
subItem.Tag = null;
|
||||
Assert.IsNull (subItem.Tag, "#2");
|
||||
subItem.Tag = 5;
|
||||
Assert.AreEqual (5, subItem.Tag, "#3");
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void Text ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
|
||||
subItem.Text = "foo";
|
||||
Assert.AreEqual ("foo", subItem.Text, "#1");
|
||||
subItem.Text = null;
|
||||
Assert.AreEqual (string.Empty, subItem.Text, "#2");
|
||||
subItem.Text = "bar";
|
||||
Assert.AreEqual ("bar", subItem.Text, "#3");
|
||||
subItem.Text = string.Empty;
|
||||
Assert.AreEqual (string.Empty, subItem.Text, "#4");
|
||||
subItem.Text = " \t ";
|
||||
Assert.AreEqual (" \t ", subItem.Text, "#5");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Serialize ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem;
|
||||
Font font = new Font ("Arial", 12);
|
||||
ListViewItem item = new ListViewItem ();
|
||||
|
||||
subItem = new ListViewItem.ListViewSubItem (item,
|
||||
"SubItemText", Color.Yellow, Color.Green,
|
||||
font);
|
||||
#if NET_2_0
|
||||
subItem.Name = "foo";
|
||||
subItem.Tag = "bar";
|
||||
#endif
|
||||
|
||||
MemoryStream ms = new MemoryStream ();
|
||||
BinaryFormatter formatter = new BinaryFormatter ();
|
||||
formatter.Serialize (ms, subItem);
|
||||
ms.Position = 0;
|
||||
|
||||
subItem = (ListViewItem.ListViewSubItem)
|
||||
formatter.Deserialize (ms);
|
||||
|
||||
Assert.AreEqual (Color.Green, subItem.BackColor, "#A1");
|
||||
Assert.AreEqual (font, subItem.Font, "#A2");
|
||||
Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#A3");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#A4");
|
||||
Assert.IsNull (subItem.Tag, "#A5");
|
||||
#endif
|
||||
Assert.AreEqual ("SubItemText", subItem.Text, "#A6");
|
||||
|
||||
ms.Position = 0;
|
||||
byte [] ser = new byte [ms.Length];
|
||||
ms.Read (ser, 0, ser.Length);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("NotDotNet")]
|
||||
[Category ("NotWorking")] // fails on buildbot
|
||||
public void SerializeExact_Mono ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem;
|
||||
Font font = new Font ("Arial", 12);
|
||||
ListViewItem item = new ListViewItem ();
|
||||
|
||||
subItem = new ListViewItem.ListViewSubItem (item,
|
||||
"SubItemText", Color.Yellow, Color.Green,
|
||||
font);
|
||||
#if NET_2_0
|
||||
subItem.Name = "foo";
|
||||
subItem.Tag = "bar";
|
||||
#endif
|
||||
|
||||
MemoryStream ms = new MemoryStream ();
|
||||
BinaryFormatter formatter = new BinaryFormatter ();
|
||||
formatter.AssemblyFormat = FormatterAssemblyStyle.Full;
|
||||
formatter.Serialize (ms, subItem);
|
||||
ms.Position = 0;
|
||||
|
||||
byte [] ser = new byte [ms.Length];
|
||||
ms.Read (ser, 0, ser.Length);
|
||||
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (_serializedV20_Mono, ser);
|
||||
#else
|
||||
Assert.AreEqual (_serializedV11_Mono, ser);
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("NotWorking")]
|
||||
public void SerializeExact_MS ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem;
|
||||
Font font = new Font ("Arial", 12);
|
||||
ListViewItem item = new ListViewItem ();
|
||||
|
||||
subItem = new ListViewItem.ListViewSubItem (item,
|
||||
"SubItemText", Color.Yellow, Color.Green,
|
||||
font);
|
||||
#if NET_2_0
|
||||
subItem.Name = "foo";
|
||||
subItem.Tag = "bar";
|
||||
#endif
|
||||
|
||||
MemoryStream ms = new MemoryStream ();
|
||||
BinaryFormatter formatter = new BinaryFormatter ();
|
||||
formatter.Serialize (ms, subItem);
|
||||
ms.Position = 0;
|
||||
|
||||
byte [] ser = new byte [ms.Length];
|
||||
ms.Read (ser, 0, ser.Length);
|
||||
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (_serializedV20_MS, ser);
|
||||
#else
|
||||
Assert.AreEqual (_serializedV11_MS, ser);
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Deserialize ()
|
||||
{
|
||||
ListViewItem.ListViewSubItem subItem;
|
||||
MemoryStream ms;
|
||||
BinaryFormatter formatter = new BinaryFormatter ();
|
||||
|
||||
ms = new MemoryStream ();
|
||||
ms.Write (_serializedV11_Mono, 0, _serializedV11_Mono.Length);
|
||||
ms.Position = 0;
|
||||
|
||||
subItem = (ListViewItem.ListViewSubItem)
|
||||
formatter.Deserialize (ms);
|
||||
|
||||
// FIXME: bug #410693
|
||||
//Assert.AreEqual (Color.Green, subItem.BackColor, "#A1");
|
||||
Assert.AreEqual ("Green", subItem.BackColor.Name, "#A1");
|
||||
Assert.IsNotNull (subItem.Font, "#A2");
|
||||
// FIXME: bug #410693
|
||||
//Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#A3");
|
||||
Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#A3");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#A4");
|
||||
Assert.IsNull (subItem.Tag, "#A5");
|
||||
#endif
|
||||
Assert.AreEqual ("SubItemText", subItem.Text, "#A6");
|
||||
|
||||
ms = new MemoryStream ();
|
||||
ms.Write (_serializedV11_MS, 0, _serializedV11_MS.Length);
|
||||
ms.Position = 0;
|
||||
|
||||
subItem = (ListViewItem.ListViewSubItem)
|
||||
formatter.Deserialize (ms);
|
||||
|
||||
// FIXME: bug #410693
|
||||
//Assert.AreEqual (Color.Green, subItem.BackColor, "#B1");
|
||||
Assert.AreEqual ("Green", subItem.BackColor.Name, "#B1");
|
||||
Assert.IsNotNull (subItem.Font, "#B2");
|
||||
// FIXME: bug #410693
|
||||
//Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#B3");
|
||||
Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#B3");
|
||||
#if NET_2_0
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#B4");
|
||||
Assert.IsNull (subItem.Tag, "#B5");
|
||||
#endif
|
||||
Assert.AreEqual ("SubItemText", subItem.Text, "#B6");
|
||||
|
||||
#if NET_2_0
|
||||
ms = new MemoryStream ();
|
||||
ms.Write (_serializedV20_Mono, 0, _serializedV20_Mono.Length);
|
||||
ms.Position = 0;
|
||||
|
||||
subItem = (ListViewItem.ListViewSubItem)
|
||||
formatter.Deserialize (ms);
|
||||
|
||||
// FIXME: bug #410693
|
||||
//Assert.AreEqual (Color.Green, subItem.BackColor, "#C1");
|
||||
Assert.AreEqual ("Green", subItem.BackColor.Name, "#C1");
|
||||
Assert.IsNotNull (subItem.Font, "#C2");
|
||||
// FIXME: bug #410693
|
||||
//Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#C3");
|
||||
Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#C3");
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#C4");
|
||||
Assert.IsNull (subItem.Tag, "#C5");
|
||||
Assert.AreEqual ("SubItemText", subItem.Text, "#C6");
|
||||
|
||||
ms = new MemoryStream ();
|
||||
ms.Write (_serializedV20_MS, 0, _serializedV20_MS.Length);
|
||||
ms.Position = 0;
|
||||
|
||||
subItem = (ListViewItem.ListViewSubItem)
|
||||
formatter.Deserialize (ms);
|
||||
|
||||
// FIXME: bug #410693
|
||||
//Assert.AreEqual (Color.Green, subItem.BackColor, "#D1");
|
||||
Assert.AreEqual ("Green", subItem.BackColor.Name, "#D1");
|
||||
Assert.IsNotNull (subItem.Font, "#D2");
|
||||
// FIXME: bug #410693
|
||||
//Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#D3");
|
||||
Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#D3");
|
||||
Assert.AreEqual (string.Empty, subItem.Name, "#D4");
|
||||
Assert.IsNull (subItem.Tag, "#D5");
|
||||
Assert.AreEqual ("SubItemText", subItem.Text, "#D6");
|
||||
#endif
|
||||
}
|
||||
|
||||
static byte [] _serializedV11_MS = {
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
|
||||
0x5a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
|
||||
0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
|
||||
0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x2e,
|
||||
0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43,
|
||||
0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74,
|
||||
0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
|
||||
0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37,
|
||||
0x37, 0x61, 0x35, 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65,
|
||||
0x30, 0x38, 0x39, 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79,
|
||||
0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
|
||||
0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49,
|
||||
0x74, 0x65, 0x6d, 0x02, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78,
|
||||
0x74, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x04, 0x3e, 0x53,
|
||||
0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f,
|
||||
0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00, 0x00, 0x02,
|
||||
0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x53, 0x75,
|
||||
0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74, 0x09, 0x04,
|
||||
0x00, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x54, 0x53, 0x79,
|
||||
0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
|
||||
0x67, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d,
|
||||
0x31, 0x2e, 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c,
|
||||
0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65,
|
||||
0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c,
|
||||
0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d,
|
||||
0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64,
|
||||
0x35, 0x30, 0x61, 0x33, 0x61, 0x05, 0x04, 0x00, 0x00, 0x00, 0x3e,
|
||||
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64,
|
||||
0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75,
|
||||
0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74,
|
||||
0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00,
|
||||
0x09, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09,
|
||||
0x66, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66,
|
||||
0x6f, 0x6e, 0x74, 0x04, 0x04, 0x04, 0x14, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
|
||||
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00, 0x00, 0x14, 0x53,
|
||||
0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
|
||||
0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00,
|
||||
0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
|
||||
0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x05,
|
||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0xfa, 0xff, 0xff,
|
||||
0xff, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
|
||||
0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x04, 0x00, 0x00, 0x00, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x0a,
|
||||
0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05,
|
||||
0x73, 0x74, 0x61, 0x74, 0x65, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00,
|
||||
0x00, 0x00, 0x01, 0x09, 0x07, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x01, 0x00,
|
||||
0x0a, 0x01, 0xf9, 0xff, 0xff, 0xff, 0xfa, 0xff, 0xff, 0xff, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x01, 0x00,
|
||||
0x0a, 0x09, 0x08, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00,
|
||||
0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
|
||||
0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00,
|
||||
0x00, 0x00, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a,
|
||||
0x65, 0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69,
|
||||
0x74, 0x01, 0x00, 0x04, 0x04, 0x0b, 0x18, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
|
||||
0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x05, 0x00,
|
||||
0x00, 0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44,
|
||||
0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70,
|
||||
0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x05, 0x00, 0x00,
|
||||
0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x09, 0x00, 0x00, 0x00, 0x05,
|
||||
0x41, 0x72, 0x69, 0x61, 0x6c, 0x00, 0x00, 0x40, 0x41, 0x05, 0xf6,
|
||||
0xff, 0xff, 0xff, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e,
|
||||
0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e,
|
||||
0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x00, 0x00, 0x00, 0x07,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xf5, 0xff, 0xff, 0xff,
|
||||
0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
|
||||
0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69,
|
||||
0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x00, 0x00, 0x07,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00,
|
||||
0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b };
|
||||
|
||||
static byte [] _serializedV20_MS = {
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
|
||||
0x57, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
|
||||
0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
|
||||
0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
|
||||
0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
|
||||
0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
|
||||
0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
|
||||
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35,
|
||||
0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39,
|
||||
0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||
0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
|
||||
0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
|
||||
0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x04, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78, 0x74, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x08, 0x75,
|
||||
0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x01, 0x01, 0x04, 0x02,
|
||||
0x3e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
|
||||
0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53,
|
||||
0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49,
|
||||
0x74, 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00,
|
||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b,
|
||||
0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74,
|
||||
0x06, 0x04, 0x00, 0x00, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x09, 0x05,
|
||||
0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x03, 0x62, 0x61,
|
||||
0x72, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x51, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2c,
|
||||
0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
|
||||
0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
|
||||
0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
|
||||
0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
|
||||
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x30, 0x33, 0x66, 0x35,
|
||||
0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61,
|
||||
0x05, 0x05, 0x00, 0x00, 0x00, 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||
0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
|
||||
0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
|
||||
0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79,
|
||||
0x6c, 0x65, 0x03, 0x00, 0x00, 0x00, 0x09, 0x62, 0x61, 0x63, 0x6b,
|
||||
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09, 0x66, 0x6f, 0x72, 0x65, 0x43,
|
||||
0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66, 0x6f, 0x6e, 0x74, 0x04, 0x04,
|
||||
0x04, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
|
||||
0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x07, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
|
||||
0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f,
|
||||
0x6c, 0x6f, 0x72, 0x07, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73,
|
||||
0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
|
||||
0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0x14, 0x53, 0x79, 0x73,
|
||||
0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
|
||||
0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x00, 0x00, 0x00, 0x04,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x0a,
|
||||
0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05,
|
||||
0x73, 0x74, 0x61, 0x74, 0x65, 0x01, 0x00, 0x00, 0x00, 0x09, 0x07,
|
||||
0x07, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x4f, 0x00, 0x01, 0x00, 0x01, 0xf7, 0xff, 0xff,
|
||||
0xff, 0xf8, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xa6, 0x00, 0x01, 0x00, 0x09, 0x0a, 0x00, 0x00,
|
||||
0x00, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
|
||||
0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00, 0x00, 0x04, 0x4e, 0x61,
|
||||
0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x05, 0x53, 0x74, 0x79,
|
||||
0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x04, 0x04,
|
||||
0x0b, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
|
||||
0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53,
|
||||
0x74, 0x79, 0x6c, 0x65, 0x07, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79,
|
||||
0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
|
||||
0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55,
|
||||
0x6e, 0x69, 0x74, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x06, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x41, 0x72, 0x69, 0x61, 0x6c,
|
||||
0x00, 0x00, 0x40, 0x41, 0x05, 0xf4, 0xff, 0xff, 0xff, 0x18, 0x53,
|
||||
0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
|
||||
0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c,
|
||||
0x65, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||
0x5f, 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x05, 0xf3, 0xff, 0xff, 0xff, 0x1b, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
|
||||
0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69,
|
||||
0x74, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||
0x5f, 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
|
||||
0x00, 0x0b };
|
||||
|
||||
static byte [] _serializedV11_Mono = {
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
|
||||
0x5a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
|
||||
0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
|
||||
0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x2e,
|
||||
0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43,
|
||||
0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74,
|
||||
0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
|
||||
0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37,
|
||||
0x37, 0x61, 0x35, 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65,
|
||||
0x30, 0x38, 0x39, 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79,
|
||||
0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
|
||||
0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49,
|
||||
0x74, 0x65, 0x6d, 0x02, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78,
|
||||
0x74, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x04, 0x3e, 0x53,
|
||||
0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f,
|
||||
0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00, 0x00, 0x02,
|
||||
0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x53, 0x75,
|
||||
0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74, 0x09, 0x04,
|
||||
0x00, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x54, 0x53, 0x79,
|
||||
0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
|
||||
0x67, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d,
|
||||
0x31, 0x2e, 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c,
|
||||
0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65,
|
||||
0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c,
|
||||
0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d,
|
||||
0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64,
|
||||
0x35, 0x30, 0x61, 0x33, 0x61, 0x05, 0x04, 0x00, 0x00, 0x00, 0x3e,
|
||||
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64,
|
||||
0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75,
|
||||
0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74,
|
||||
0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00,
|
||||
0x09, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09,
|
||||
0x66, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66,
|
||||
0x6f, 0x6e, 0x74, 0x04, 0x04, 0x04, 0x14, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
|
||||
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00, 0x00, 0x14, 0x53,
|
||||
0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
|
||||
0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00,
|
||||
0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
|
||||
0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x05,
|
||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x06, 0x00, 0x00,
|
||||
0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
|
||||
0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x04, 0x00, 0x00, 0x00, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x05,
|
||||
0x73, 0x74, 0x61, 0x74, 0x65, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,
|
||||
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00,
|
||||
0x00, 0x00, 0x01, 0x09, 0x07, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00,
|
||||
0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x4f, 0x00,
|
||||
0x06, 0x07, 0x00, 0x00, 0x00, 0x05, 0x47, 0x72, 0x65, 0x65, 0x6e,
|
||||
0x01, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xff,
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0xa6, 0x00, 0x06,
|
||||
0x09, 0x00, 0x00, 0x00, 0x06, 0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77,
|
||||
0x09, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x13,
|
||||
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77,
|
||||
0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00,
|
||||
0x00, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a, 0x65,
|
||||
0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69, 0x74,
|
||||
0x01, 0x00, 0x04, 0x04, 0x0b, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||
0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46,
|
||||
0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x05, 0x00, 0x00,
|
||||
0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
|
||||
0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68,
|
||||
0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x05, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x41,
|
||||
0x72, 0x69, 0x61, 0x6c, 0x00, 0x00, 0x40, 0x41, 0x05, 0x0c, 0x00,
|
||||
0x00, 0x00, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44,
|
||||
0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74,
|
||||
0x53, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0d, 0x00, 0x00, 0x00, 0x1b,
|
||||
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77,
|
||||
0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63,
|
||||
0x73, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00, 0x00,
|
||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x0b };
|
||||
|
||||
static byte [] _serializedV20_Mono = {
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
|
||||
0x57, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
|
||||
0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
|
||||
0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
|
||||
0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
|
||||
0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
|
||||
0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
|
||||
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35,
|
||||
0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39,
|
||||
0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||
0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
|
||||
0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
|
||||
0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x04, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78, 0x74, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x08, 0x75, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74,
|
||||
0x61, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x01, 0x02, 0x04,
|
||||
0x3e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
|
||||
0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53,
|
||||
0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49,
|
||||
0x74, 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00,
|
||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b,
|
||||
0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74,
|
||||
0x06, 0x04, 0x00, 0x00, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x06, 0x05,
|
||||
0x00, 0x00, 0x00, 0x03, 0x62, 0x61, 0x72, 0x09, 0x06, 0x00, 0x00,
|
||||
0x00, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x51, 0x53, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2c,
|
||||
0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
|
||||
0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
|
||||
0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
|
||||
0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
|
||||
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x30, 0x33, 0x66, 0x35,
|
||||
0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61,
|
||||
0x05, 0x06, 0x00, 0x00, 0x00, 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||
0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
|
||||
0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
|
||||
0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79,
|
||||
0x6c, 0x65, 0x03, 0x00, 0x00, 0x00, 0x09, 0x62, 0x61, 0x63, 0x6b,
|
||||
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09, 0x66, 0x6f, 0x72, 0x65, 0x43,
|
||||
0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66, 0x6f, 0x6e, 0x74, 0x04, 0x04,
|
||||
0x04, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
|
||||
0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x07, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
|
||||
0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f,
|
||||
0x6c, 0x6f, 0x72, 0x07, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73,
|
||||
0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
|
||||
0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00,
|
||||
0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73,
|
||||
0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
|
||||
0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x00, 0x00, 0x00, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
|
||||
0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x00, 0x00, 0x01, 0x09, 0x07,
|
||||
0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xff, 0x00, 0x00,
|
||||
0x00, 0x00, 0x07, 0x00, 0x4f, 0x00, 0x06, 0x09, 0x00, 0x00, 0x00,
|
||||
0x05, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x01, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
|
||||
0x00, 0x07, 0x00, 0xa6, 0x00, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x06,
|
||||
0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x09, 0x0c, 0x00, 0x00, 0x00,
|
||||
0x05, 0x0c, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||
0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46,
|
||||
0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00, 0x00, 0x04, 0x4e, 0x61, 0x6d,
|
||||
0x65, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x05, 0x53, 0x74, 0x79, 0x6c,
|
||||
0x65, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x04, 0x04, 0x0b,
|
||||
0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
|
||||
0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74,
|
||||
0x79, 0x6c, 0x65, 0x07, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79, 0x73,
|
||||
0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
|
||||
0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e,
|
||||
0x69, 0x74, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06,
|
||||
0x0d, 0x00, 0x00, 0x00, 0x05, 0x41, 0x72, 0x69, 0x61, 0x6c, 0x00,
|
||||
0x00, 0x40, 0x41, 0x05, 0x0e, 0x00, 0x00, 0x00, 0x18, 0x53, 0x79,
|
||||
0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
|
||||
0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65,
|
||||
0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,
|
||||
0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x0f, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65,
|
||||
0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47,
|
||||
0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74,
|
||||
0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,
|
||||
0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x0b };
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
|
||||
@@ -140,6 +140,7 @@ namespace MonoTests.System.Windows.Forms
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("NotWorking")]
|
||||
public void ImageLocation_Sync ()
|
||||
{
|
||||
Form f = new Form ();
|
||||
@@ -321,72 +322,6 @@ namespace MonoTests.System.Windows.Forms
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // LoadAsync ()
|
||||
public void LoadAsync1_ImageLocation_Empty ()
|
||||
{
|
||||
PictureBox pb = new PictureBox ();
|
||||
pb.ImageLocation = string.Empty;
|
||||
|
||||
try {
|
||||
pb.LoadAsync ();
|
||||
Assert.Fail ("#1");
|
||||
} catch (InvalidOperationException ex) {
|
||||
// ImageLocation must be set
|
||||
Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
|
||||
Assert.IsNull (ex.InnerException, "#3");
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // LoadAsync ()
|
||||
public void LoadAsync1_ImageLocation_Null ()
|
||||
{
|
||||
PictureBox pb = new PictureBox ();
|
||||
pb.ImageLocation = null;
|
||||
|
||||
try {
|
||||
pb.LoadAsync ();
|
||||
Assert.Fail ("#1");
|
||||
} catch (InvalidOperationException ex) {
|
||||
// ImageLocation must be set
|
||||
Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
|
||||
Assert.IsNull (ex.InnerException, "#3");
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // LoadAsync (String)
|
||||
public void LoadASync2_Url_Empty ()
|
||||
{
|
||||
PictureBox pb = new PictureBox ();
|
||||
|
||||
try {
|
||||
pb.LoadAsync (string.Empty);
|
||||
Assert.Fail ("#1");
|
||||
} catch (InvalidOperationException ex) {
|
||||
// ImageLocation must be set
|
||||
Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
|
||||
Assert.IsNull (ex.InnerException, "#3");
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
}
|
||||
}
|
||||
|
||||
[Test] // LoadAsync (String)
|
||||
public void LoadAsync2_Url_Null ()
|
||||
{
|
||||
PictureBox pb = new PictureBox ();
|
||||
|
||||
try {
|
||||
pb.LoadAsync ((string) null);
|
||||
Assert.Fail ("#1");
|
||||
} catch (InvalidOperationException ex) {
|
||||
// ImageLocation must be set
|
||||
Assert.AreEqual (typeof (InvalidOperationException), ex.GetType (), "#2");
|
||||
Assert.IsNull (ex.InnerException, "#3");
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2008-08-06 Ankit Jain <[email protected]>
|
||||
|
||||
* Csc.cs (AddResponseFileCommands): Don't quote DefineConstants.
|
||||
Correctly handle response filenames and win32 resource switch.
|
||||
|
||||
2008-06-02 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* AssemblyResolver.cs : do not crash when there is no mono installed.
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Microsoft.Build.Tasks {
|
||||
else
|
||||
commandLine.AppendSwitch ("/checked-");
|
||||
|
||||
commandLine.AppendSwitchUnquotedIfNotNull ("/define:", DefineConstants);
|
||||
commandLine.AppendSwitchIfNotNull ("/define:", DefineConstants);
|
||||
|
||||
commandLine.AppendSwitchIfNotNull ("/nowarn:", DisabledWarnings);
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Microsoft.Build.Tasks {
|
||||
|
||||
if (ResponseFiles != null)
|
||||
foreach (ITaskItem item in ResponseFiles)
|
||||
commandLine.AppendSwitchIfNotNull ("@", item.ItemSpec);
|
||||
commandLine.AppendFileNameIfNotNull (String.Format ("@{0}",item.ItemSpec));
|
||||
|
||||
if (Bag ["WarningLevel"] != null)
|
||||
commandLine.AppendSwitchIfNotNull ("/warn:", WarningLevel.ToString ());
|
||||
@@ -98,7 +98,7 @@ namespace Microsoft.Build.Tasks {
|
||||
commandLine.AppendSwitchIfNotNull ("/warnaserror-:", WarningsNotAsErrors);
|
||||
|
||||
if (Win32Resource != null)
|
||||
commandLine.AppendSwitchIfNotNull ("/win32res:", Win32Resource);
|
||||
commandLine.AppendSwitchIfNotNull ("/win32res:", String.Format ("\"{0}\"", Win32Resource));
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2008-08-06 Ankit Jain <[email protected]>
|
||||
|
||||
* CscTest.cs: Alter tests to checking for quoting in various switches.
|
||||
|
||||
2008-06-02 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* ResolveAssemblyReferenceTest.cs: marked some failing tests as
|
||||
|
||||
@@ -244,10 +244,10 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
CscExtended csc = new CscExtended ();
|
||||
CommandLineBuilderExtension clbe = new CommandLineBuilderExtension ();
|
||||
|
||||
csc.LangVersion = "A'B";
|
||||
csc.LangVersion = "A";
|
||||
csc.ARFC (clbe);
|
||||
|
||||
Assert.AreEqual ("/langversion:\"A'B\"", clbe.ToString (), "A1");
|
||||
Assert.AreEqual ("/langversion:A", clbe.ToString (), "A1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -257,10 +257,10 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
CscExtended csc = new CscExtended ();
|
||||
CommandLineBuilderExtension clbe = new CommandLineBuilderExtension ();
|
||||
|
||||
csc.ModuleAssemblyName = "A'B";
|
||||
csc.ModuleAssemblyName = "A";
|
||||
csc.ARFC (clbe);
|
||||
|
||||
Assert.AreEqual ("/moduleassemblyname:\"A'B\"", clbe.ToString (), "A1");
|
||||
Assert.AreEqual ("/moduleassemblyname:A", clbe.ToString (), "A1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -307,10 +307,10 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
CscExtended csc = new CscExtended ();
|
||||
CommandLineBuilderExtension clbe = new CommandLineBuilderExtension ();
|
||||
|
||||
csc.WarningsAsErrors = "A'B";
|
||||
csc.WarningsAsErrors = "A";
|
||||
csc.ARFC (clbe);
|
||||
|
||||
Assert.AreEqual ("/warnaserror+:\"A'B\"", clbe.ToString (), "A1");
|
||||
Assert.AreEqual ("/warnaserror+:A", clbe.ToString (), "A1");
|
||||
}
|
||||
[Test]
|
||||
public void TestWarningNotAsErrors ()
|
||||
@@ -318,10 +318,10 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
CscExtended csc = new CscExtended ();
|
||||
CommandLineBuilderExtension clbe = new CommandLineBuilderExtension ();
|
||||
|
||||
csc.WarningsNotAsErrors = "A'B";
|
||||
csc.WarningsNotAsErrors = "A";
|
||||
csc.ARFC (clbe);
|
||||
|
||||
Assert.AreEqual ("/warnaserror-:\"A'B\"", clbe.ToString (), "A1");
|
||||
Assert.AreEqual ("/warnaserror-:A", clbe.ToString (), "A1");
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -333,11 +333,11 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
CommandLineBuilderExtension c1 = new CommandLineBuilderExtension ();
|
||||
CommandLineBuilderExtension c2 = new CommandLineBuilderExtension ();
|
||||
|
||||
csc.AdditionalLibPaths = new string [2] { "A'Foo", "B" };
|
||||
csc.AdditionalLibPaths = new string [2] { "A", "B" };
|
||||
csc.ARFC (c1);
|
||||
csc.ACLC (c2);
|
||||
|
||||
Assert.AreEqual ("/lib:\"A'Foo\",B", c1.ToString (), "A1");
|
||||
Assert.AreEqual ("/lib:A,B", c1.ToString (), "A1");
|
||||
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
|
||||
}
|
||||
|
||||
@@ -363,11 +363,11 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
CommandLineBuilderExtension c1 = new CommandLineBuilderExtension ();
|
||||
CommandLineBuilderExtension c2 = new CommandLineBuilderExtension ();
|
||||
|
||||
csc.MainEntryPoint = "A;B";
|
||||
csc.MainEntryPoint = "A";
|
||||
csc.ARFC (c1);
|
||||
csc.ACLC (c2);
|
||||
|
||||
Assert.AreEqual ("/main:\"A;B\"", c1.ToString (), "A1");
|
||||
Assert.AreEqual ("/main:A", c1.ToString (), "A1");
|
||||
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
|
||||
}
|
||||
|
||||
@@ -378,11 +378,11 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
CommandLineBuilderExtension c1 = new CommandLineBuilderExtension ();
|
||||
CommandLineBuilderExtension c2 = new CommandLineBuilderExtension ();
|
||||
|
||||
csc.References = new ITaskItem [2] { new TaskItem ("A;C"), new TaskItem ("B") };
|
||||
csc.References = new ITaskItem [2] { new TaskItem ("A"), new TaskItem ("B") };
|
||||
csc.ARFC (c1);
|
||||
csc.ACLC (c2);
|
||||
|
||||
Assert.AreEqual ("/reference:\"A;C\" /reference:B", c1.ToString (), "A1");
|
||||
Assert.AreEqual ("/reference:A /reference:B", c1.ToString (), "A1");
|
||||
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
|
||||
}
|
||||
|
||||
@@ -393,11 +393,11 @@ namespace MonoTests.Microsoft.Build.Tasks {
|
||||
CommandLineBuilderExtension c1 = new CommandLineBuilderExtension ();
|
||||
CommandLineBuilderExtension c2 = new CommandLineBuilderExtension ();
|
||||
|
||||
csc.ResponseFiles = new ITaskItem [2] { new TaskItem ("A\'Foo"), new TaskItem ("B") };
|
||||
csc.ResponseFiles = new ITaskItem [2] { new TaskItem ("A"), new TaskItem ("B") };
|
||||
csc.ARFC (c1);
|
||||
csc.ACLC (c2);
|
||||
|
||||
Assert.AreEqual ("@\"A'Foo\" @B", c1.ToString (), "A1");
|
||||
Assert.AreEqual ("@A @B", c1.ToString (), "A1");
|
||||
Assert.AreEqual (String.Empty, c2.ToString (), "A2");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
2008-08-06 Ankit Jain <[email protected]>
|
||||
|
||||
* CommandLineBuilder.cs (AppendSwitchIfNotNull): Quote individual items
|
||||
of the array.
|
||||
|
||||
2008-07-31 Ankit Jain <[email protected]>
|
||||
|
||||
* CommandLineBuilder.cs (chars): Use a char array instead of a
|
||||
hashtable. Add ';' to the list.
|
||||
(embeddedQuotes): Regex not required.
|
||||
(IsQuotingRequired): Update.
|
||||
(VerifyThrowNoEmbeddedDoubleQuotes): Update.
|
||||
Use VerifyThrowNoEmbeddedDoubleQuotes at appropriate points (see tests).
|
||||
|
||||
2007-05-16 Marek Sieradzki <[email protected]>
|
||||
|
||||
* CommandLineBuilder.cs: Add quotes when there are needed.
|
||||
|
||||
+46
-41
@@ -38,11 +38,22 @@ namespace Microsoft.Build.Utilities
|
||||
public class CommandLineBuilder
|
||||
{
|
||||
StringBuilder commandLine;
|
||||
static char [] chars;
|
||||
static Hashtable chars;
|
||||
static Regex embeddedQuotes;
|
||||
|
||||
static CommandLineBuilder ()
|
||||
{
|
||||
chars = new char [] {' ', '\t', '\n', '\u000b', '\u000c', '\'', '\"', ';'};
|
||||
chars = new Hashtable ();
|
||||
|
||||
chars.Add (' ', null);
|
||||
chars.Add ('\t', null);
|
||||
chars.Add ('\n', null);
|
||||
chars.Add ('\u000b', null);
|
||||
chars.Add ('\u000c', null);
|
||||
chars.Add ('\'', null);
|
||||
chars.Add ('\"', null);
|
||||
|
||||
embeddedQuotes = new Regex ("\"\"");
|
||||
}
|
||||
|
||||
public CommandLineBuilder ()
|
||||
@@ -55,7 +66,6 @@ namespace Microsoft.Build.Utilities
|
||||
if (fileName == null)
|
||||
return;
|
||||
|
||||
VerifyThrowNoEmbeddedDoubleQuotes (null, fileName);
|
||||
AppendSpaceIfNotEmpty ();
|
||||
AppendFileNameWithQuoting (fileName);
|
||||
}
|
||||
@@ -65,10 +75,8 @@ namespace Microsoft.Build.Utilities
|
||||
if (fileItem == null)
|
||||
return;
|
||||
|
||||
string filename = fileItem.ToString ();
|
||||
VerifyThrowNoEmbeddedDoubleQuotes (null, filename);
|
||||
AppendSpaceIfNotEmpty ();
|
||||
AppendFileNameWithQuoting (filename);
|
||||
AppendFileNameWithQuoting (fileItem.ToString ());
|
||||
}
|
||||
|
||||
public void AppendFileNamesIfNotNull (string[] fileNames,
|
||||
@@ -83,15 +91,13 @@ namespace Microsoft.Build.Utilities
|
||||
bool appendDelimiter = false;
|
||||
AppendSpaceIfNotEmpty ();
|
||||
for (int i = 0; i < fileNames.Length; i++) {
|
||||
string filename = fileNames [i];
|
||||
if (filename == null)
|
||||
if (fileNames [i] == null)
|
||||
continue;
|
||||
VerifyThrowNoEmbeddedDoubleQuotes (null, filename);
|
||||
if (appendDelimiter) {
|
||||
commandLine.Append (delimiter);
|
||||
AppendFileNameWithQuoting (filename);
|
||||
AppendFileNameWithQuoting (fileNames [i]);
|
||||
} else {
|
||||
AppendFileNameWithQuoting (filename);
|
||||
AppendFileNameWithQuoting (fileNames [i]);
|
||||
appendDelimiter = true;
|
||||
}
|
||||
}
|
||||
@@ -109,16 +115,13 @@ namespace Microsoft.Build.Utilities
|
||||
bool appendDelimiter = false;
|
||||
AppendSpaceIfNotEmpty ();
|
||||
for (int i = 0; i < fileItems.Length; i++) {
|
||||
string filename = fileItems [i].ToString ();
|
||||
if (fileItems [i] == null)
|
||||
continue;
|
||||
|
||||
VerifyThrowNoEmbeddedDoubleQuotes (null, filename);
|
||||
if (appendDelimiter) {
|
||||
commandLine.Append (delimiter);
|
||||
AppendFileNameWithQuoting (filename);
|
||||
AppendFileNameWithQuoting (fileItems [i].ToString ());
|
||||
} else {
|
||||
AppendFileNameWithQuoting (filename);
|
||||
AppendFileNameWithQuoting (fileItems [i].ToString ());
|
||||
appendDelimiter = true;
|
||||
}
|
||||
}
|
||||
@@ -158,11 +161,10 @@ namespace Microsoft.Build.Utilities
|
||||
|
||||
if (parameter == null)
|
||||
return;
|
||||
|
||||
VerifyThrowNoEmbeddedDoubleQuotes (switchName, parameter);
|
||||
|
||||
AppendSpaceIfNotEmpty ();
|
||||
commandLine.Append (switchName);
|
||||
AppendTextWithQuoting (parameter);
|
||||
commandLine.AppendFormat ("{0}{1}",switchName,
|
||||
parameter);
|
||||
}
|
||||
|
||||
public void AppendSwitchIfNotNull (string switchName,
|
||||
@@ -174,11 +176,9 @@ namespace Microsoft.Build.Utilities
|
||||
if (parameter == null)
|
||||
return;
|
||||
|
||||
string value = parameter.ToString ();
|
||||
VerifyThrowNoEmbeddedDoubleQuotes (switchName, value);
|
||||
AppendSpaceIfNotEmpty ();
|
||||
commandLine.Append (switchName);
|
||||
AppendTextWithQuoting (value);
|
||||
commandLine.AppendFormat ("{0}{1}",switchName,
|
||||
parameter.ToString ());
|
||||
}
|
||||
|
||||
public void AppendSwitchIfNotNull (string switchName,
|
||||
@@ -198,16 +198,13 @@ namespace Microsoft.Build.Utilities
|
||||
commandLine.AppendFormat ("{0}",switchName);
|
||||
bool appendDelimiter = false;
|
||||
for (int i = 0; i < parameters.Length; i++) {
|
||||
string value = parameters [i];
|
||||
if (value == null)
|
||||
if (parameters [i] == null)
|
||||
continue;
|
||||
|
||||
VerifyThrowNoEmbeddedDoubleQuotes (switchName, value);
|
||||
if (appendDelimiter) {
|
||||
commandLine.Append (delimiter);
|
||||
AppendTextWithQuoting (value);
|
||||
commandLine.Append (parameters [i]);
|
||||
} else {
|
||||
AppendTextWithQuoting (value);
|
||||
commandLine.Append (parameters [i]);
|
||||
appendDelimiter = true;
|
||||
}
|
||||
}
|
||||
@@ -230,16 +227,13 @@ namespace Microsoft.Build.Utilities
|
||||
commandLine.AppendFormat ("{0}",switchName);
|
||||
bool appendDelimiter = false;
|
||||
for (int i = 0; i < parameters.Length; i++) {
|
||||
string value = parameters [i].ToString ();
|
||||
if (value == null)
|
||||
if (parameters [i] == null)
|
||||
continue;
|
||||
|
||||
VerifyThrowNoEmbeddedDoubleQuotes (switchName, value);
|
||||
if (appendDelimiter) {
|
||||
commandLine.Append (delimiter);
|
||||
AppendTextWithQuoting (value);
|
||||
commandLine.Append (parameters [i].ToString ());
|
||||
} else {
|
||||
AppendTextWithQuoting (value);
|
||||
commandLine.Append (parameters [i].ToString ());
|
||||
appendDelimiter = true;
|
||||
}
|
||||
}
|
||||
@@ -347,16 +341,27 @@ namespace Microsoft.Build.Utilities
|
||||
|
||||
protected virtual bool IsQuotingRequired (string parameter)
|
||||
{
|
||||
return parameter != null && parameter.IndexOfAny (chars) >= 0;
|
||||
parameter.Trim ();
|
||||
// FIXME: change this to regex
|
||||
foreach (char c in parameter) {
|
||||
if (chars.Contains (c))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual void VerifyThrowNoEmbeddedDoubleQuotes (string switchName,
|
||||
string parameter)
|
||||
{
|
||||
if (parameter != null && parameter.IndexOf ('"') >= 0)
|
||||
throw new ArgumentException (
|
||||
String.Format ("Illegal quote passed to the command line switch named \"{0}\". The value was [{1}].",
|
||||
switchName, parameter));
|
||||
if (parameter != null) {
|
||||
Match m = embeddedQuotes.Match (parameter);
|
||||
|
||||
if (m.Success)
|
||||
throw new ArgumentException (
|
||||
String.Format ("Illegal quote passed to the command line switch named \"{0}\". The value was [{1}].",
|
||||
switchName, parameter));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
2008-08-06 Ankit Jain <[email protected]>
|
||||
|
||||
* CommandLineBuilderTest.cs: Add more tests.
|
||||
|
||||
2008-07-31 Ankit Jain <[email protected]>
|
||||
|
||||
* CommandLineBuilderTest.cs: Add more tests.
|
||||
|
||||
2007-05-16 Marek Sieradzki <[email protected]>
|
||||
|
||||
* CommandLineBuilderTest.cs: Added tests for filenames that contain
|
||||
|
||||
Executable → Regular
+12
-151
@@ -112,6 +112,7 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
[Test]
|
||||
public void TestAppendFileNameIfNotNull2 ()
|
||||
{
|
||||
|
||||
string filename = "filename.txt";
|
||||
|
||||
clb = new CommandLineBuilder ();
|
||||
@@ -340,23 +341,19 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
|
||||
clb.AppendSwitchIfNotNull ("/switch", array, null);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void TestAppendSwitchIfNotNull7 ()
|
||||
{
|
||||
clb = new CommandLineBuilder ();
|
||||
|
||||
|
||||
clb.AppendSwitchIfNotNull ("/switch:", (string[]) null, ";");
|
||||
|
||||
Assert.AreEqual (String.Empty, clb.ToString (), "A1");
|
||||
|
||||
clb.AppendSwitchIfNotNull ("/switch:", array, ";");
|
||||
|
||||
Assert.AreEqual ("/switch:a;b;c", clb.ToString (), "A2");
|
||||
|
||||
clb.AppendSwitchIfNotNull ("/switch:", new string[] { "a'b", "c" }, ";");
|
||||
Assert.AreEqual ("/switch:a;b;c /switch:\"a'b\";c", clb.ToString(), "A3");
|
||||
|
||||
clb.AppendSwitchIfNotNull ("/switch:", "a;b;c");
|
||||
Assert.AreEqual ("/switch:a;b;c /switch:\"a'b\";c /switch:\"a;b;c\"", clb.ToString(), "A4");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -383,39 +380,12 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
clb = new CommandLineBuilder ();
|
||||
|
||||
clb.AppendSwitchIfNotNull ("/switch:", (ITaskItem[]) null, ";");
|
||||
|
||||
Assert.AreEqual (String.Empty, clb.ToString (), "A1");
|
||||
|
||||
clb.AppendSwitchIfNotNull ("/switch:", items, ";");
|
||||
|
||||
Assert.AreEqual ("/switch:a;b", clb.ToString (), "A2");
|
||||
|
||||
clb.AppendSwitchIfNotNull("/switch:", new ITaskItem[] { new TaskItem("a'b"), new TaskItem("c") }, ";");
|
||||
Assert.AreEqual ("/switch:a;b /switch:\"a'b\";c", clb.ToString(), "A3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAppendSwitchIfNotNul11()
|
||||
{
|
||||
clb = new CommandLineBuilder();
|
||||
|
||||
clb.AppendSwitchIfNotNull("/z:", " a b");
|
||||
clb.AppendSwitchIfNotNull("/z:", "c\tb");
|
||||
clb.AppendSwitchIfNotNull("/z:", "ab\n");
|
||||
clb.AppendSwitchIfNotNull("/z:", "xyz\u000babc");
|
||||
clb.AppendSwitchIfNotNull("/z:", "\u000cabc");
|
||||
clb.AppendSwitchIfNotNull("/z:", "a 'hello' b");
|
||||
clb.AppendSwitchIfNotNull("/z:", "a;b");
|
||||
|
||||
Assert.AreEqual("/z:\" a b\" /z:\"c\tb\" /z:\"ab\n\" " +
|
||||
"/z:\"xyz\u000babc\" /z:\"\u000cabc\" /z:\"a 'hello' b\" /z:\"a;b\"",
|
||||
clb.ToString(), "A1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentException))]
|
||||
public void TestAppendSwitchIfNotNull12()
|
||||
{
|
||||
clb = new CommandLineBuilder();
|
||||
clb.AppendSwitchIfNotNull("/z:", "x \"hello\" y");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -499,9 +469,6 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
clb.AppendSwitchUnquotedIfNotNull ("/switch:", array, ";");
|
||||
|
||||
Assert.AreEqual ("/switch:a;b;c", clb.ToString (), "A2");
|
||||
|
||||
clb.AppendSwitchUnquotedIfNotNull ("/switch:", new string[] { "a'b", "c", "d" }, ";");
|
||||
Assert.AreEqual ("/switch:a;b;c /switch:a'b;c;d", clb.ToString(), "A3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -578,7 +545,6 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
{
|
||||
CLBTester clbt = new CLBTester ();
|
||||
|
||||
Assert.AreEqual (false, clbt.IsQuotingRequired (null), "A0");
|
||||
Assert.AreEqual (false, clbt.IsQuotingRequired (""), "A1");
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired (" "), "A2");
|
||||
Assert.AreEqual (false, clbt.IsQuotingRequired ("a"), "A3");
|
||||
@@ -591,11 +557,6 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired ("\n \n"), "A10");
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired ("\t\t"), "A11");
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired ("\t \t"), "A12");
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired("a;b"), "A13");
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired("a\u000bc"), "A14");
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired("a\u000cx"), "A15");
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired("\""), "A16");
|
||||
Assert.AreEqual (true, clbt.IsQuotingRequired(" abc"), "A17");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -608,118 +569,18 @@ namespace MonoTests.Microsoft.Build.Utilities {
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes (null, "");
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes (" ", "");
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes ("", " ");
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes ("\"abc\"", "");
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes ("x\"y", "");
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes ("\"\"", "");
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes ("\'\'", "\'\'");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentException),
|
||||
"Illegal quote passed to the command line switch named \"a\". The value was [\"\"].")]
|
||||
public void TestVerifyThrowNoEmbeddedDoubleQuotes2 ()
|
||||
{
|
||||
CheckVerifyThrowNoEmbeddedDoubleQuotes (new CLBTester (), "a",
|
||||
"\"a\"", true, typeof (ArgumentException), "A1");
|
||||
}
|
||||
CLBTester clbt = new CLBTester ();
|
||||
|
||||
[Test]
|
||||
public void TestVerifyThrowNoEmbeddedDoubleQuotes3 ()
|
||||
{
|
||||
CheckVerifyThrowNoEmbeddedDoubleQuotes (new CLBTester (), "a", "\"\"", true, typeof(ArgumentException), "A1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestVerifyThrowNoEmbeddedDoubleQuotes4 ()
|
||||
{
|
||||
CheckVerifyThrowNoEmbeddedDoubleQuotes (new CLBTester (), "a", "\"foo", true, typeof(ArgumentException), "A1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestVerifyThrowNoEmbeddedDoubleQuotes5 ()
|
||||
{
|
||||
CheckVerifyThrowNoEmbeddedDoubleQuotes (new CLBTester (), null, "a\"b", true, typeof(ArgumentException), "A1");
|
||||
}
|
||||
|
||||
private void CheckVerifyThrowNoEmbeddedDoubleQuotes(CLBTester clbt, string switchName, string parameter,
|
||||
bool expectException, Type exceptionType, string id)
|
||||
{
|
||||
try
|
||||
{
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes(switchName, parameter);
|
||||
} catch (Exception e) {
|
||||
if (!expectException)
|
||||
Assert.Fail("({0}) Unexpected exception : {1}", id, exceptionType.ToString());
|
||||
if (e.GetType () != exceptionType)
|
||||
Assert.Fail("({0}) Expected exception of {1} type but got {2}", id, exceptionType.ToString(), e.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (expectException)
|
||||
Assert.Fail("({0}) Didn't get expected exception {1}", id, exceptionType.ToString());
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentException))]
|
||||
public void TestEmbeddedQuotes1()
|
||||
{
|
||||
new CommandLineBuilder().AppendFileNameIfNotNull("a\"b");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException))]
|
||||
public void TestEmbeddedQuotes2()
|
||||
{
|
||||
new CommandLineBuilder().AppendFileNameIfNotNull(new TaskItem ("a\"b"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException))]
|
||||
public void TestEmbeddedQuotes3()
|
||||
{
|
||||
new CommandLineBuilder().AppendFileNamesIfNotNull(new ITaskItem[] { new TaskItem ("xyz"), new TaskItem("a\"b") }, ":");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException))]
|
||||
public void TestEmbeddedQuotes4()
|
||||
{
|
||||
new CommandLineBuilder().AppendFileNamesIfNotNull(new string[] { "xyz", "a\"b" }, ":");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException))]
|
||||
public void TestEmbeddedQuotes5()
|
||||
{
|
||||
new CommandLineBuilder().AppendSwitchIfNotNull("foo", new TaskItem("a\"b"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException))]
|
||||
public void TestEmbeddedQuotes6()
|
||||
{
|
||||
new CommandLineBuilder().AppendSwitchIfNotNull("foo", "a\"b");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException))]
|
||||
public void TestEmbeddedQuotes7()
|
||||
{
|
||||
new CommandLineBuilder().AppendSwitchIfNotNull("foo", new ITaskItem[] { new TaskItem ("xyz"), new TaskItem("a\"b") }, ":");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException))]
|
||||
public void TestEmbeddedQuotes8()
|
||||
{
|
||||
new CommandLineBuilder().AppendSwitchIfNotNull("foo", new string[] {"xyz", "a\"b" }, ":");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestEmbeddedQuotes9()
|
||||
{
|
||||
CommandLineBuilder clb = new CommandLineBuilder();
|
||||
clb.AppendSwitchUnquotedIfNotNull("foo", new TaskItem("a\"b"));
|
||||
clb.AppendSwitchUnquotedIfNotNull("foo", "a\"b");
|
||||
clb.AppendSwitchUnquotedIfNotNull("foo", new ITaskItem[] { new TaskItem ("xyz"), new TaskItem("a\"b") }, ":");
|
||||
clb.AppendSwitchUnquotedIfNotNull("foo", new string[] { "xyz", "a\"b" }, ":");
|
||||
clbt.VerifyThrowNoEmbeddedDoubleQuotes ("a", "\"\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
2008-08-04 Zoltan Varga <[email protected]>
|
||||
2008-07-30 Zoltan Varga <[email protected]>
|
||||
|
||||
* SqliteParameterUnitTests.cs: Disable the InsertRandomValuesWithParameter
|
||||
* SqliteParameterUnitTests.cs: Disable the random value insertion
|
||||
test as it fails randomly.
|
||||
|
||||
2008-07-15 Marek Habersack <[email protected]>
|
||||
|
||||
@@ -24,8 +24,8 @@ namespace MonoTests.Mono.Data.Sqlite
|
||||
}
|
||||
|
||||
[Test]
|
||||
// Fails 'randomly'
|
||||
[Category ("NotWorking")]
|
||||
// fails randomly :)
|
||||
public void InsertRandomValuesWithParameter()
|
||||
{
|
||||
SqliteParameter textP = new SqliteParameter();
|
||||
|
||||
+2
-2
@@ -46,9 +46,9 @@ namespace System.Configuration.Install
|
||||
_useNewContext = true;
|
||||
}
|
||||
|
||||
public AssemblyInstaller (string fileName, string[] commandLine)
|
||||
public AssemblyInstaller (string filename, string[] commandLine)
|
||||
{
|
||||
Path = System.IO.Path.GetFullPath (fileName);
|
||||
Path = System.IO.Path.GetFullPath (filename);
|
||||
_commandLine = commandLine;
|
||||
_useNewContext = true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
2008-07-24 Gert Driesen <[email protected]>
|
||||
|
||||
* AssemblyInstaller.cs: Fixed argument name to match MS.
|
||||
|
||||
2008-06-11 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* Installer.cs : populate 'installers' instance. Fixed bug #397126.
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
2008-07-24 Gert Driesen <[email protected]>
|
||||
|
||||
* EventLogInstaller.cs: API compatibility fixes for issues reported
|
||||
by corcompare.
|
||||
|
||||
2007-09-27 Atsushi Enomoto <[email protected]>
|
||||
|
||||
* PerformanceCounterInstaller.cs, EventLogInstaller.cs :
|
||||
|
||||
@@ -50,8 +50,9 @@ namespace System.Diagnostics
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
// in MSDN, documented as System.Diagnostics.Design.StringValueConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
|
||||
[Editor ("System.Windows.Forms.Design.FileNameEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing )]
|
||||
[TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
|
||||
[TypeConverter (typeof (StringConverter))]
|
||||
[ComVisible (false)]
|
||||
public string CategoryResourceFile {
|
||||
get { return _categoryResourceFile; }
|
||||
@@ -59,8 +60,9 @@ namespace System.Diagnostics
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
// in MSDN, documented as System.Diagnostics.Design.StringValueConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
|
||||
[Editor ("System.Windows.Forms.Design.FileNameEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing )]
|
||||
[TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
|
||||
[TypeConverter (typeof (StringConverter))]
|
||||
[ComVisible (false)]
|
||||
public string MessageResourceFile {
|
||||
get { return _messageResourceFile; }
|
||||
@@ -68,8 +70,9 @@ namespace System.Diagnostics
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
// in MSDN, documented as System.Diagnostics.Design.StringValueConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
|
||||
[Editor ("System.Windows.Forms.Design.FileNameEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing )]
|
||||
[TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
|
||||
[TypeConverter (typeof (StringConverter))]
|
||||
[ComVisible (false)]
|
||||
public string ParameterResourceFile {
|
||||
get { return _parameterResourceFile; }
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
2008-08-02 Gert Driesen <[email protected]>
|
||||
|
||||
* Makefile
|
||||
* t47.cs
|
||||
* t47.exe.config
|
||||
* t47.exe.expected: added test for bug #413203.
|
||||
|
||||
2008-07-02 Gert Driesen <[email protected]>
|
||||
|
||||
* t46.cs: Improve test coverage.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe t11.exe t12.exe t15.exe t16.exe t17.exe t18.exe t19.exe t20.exe t21.exe t22.exe t23.exe t24.exe t25.exe t26.exe t27.exe t28.exe t29.exe t30.exe t31.exe t32.exe t33.exe t34.exe t35.exe t36.exe t37.exe t38.exe t39.exe t40.exe t41.exe t42.exe t43.exe t44.exe t45.exe t46.exe t47.exe
|
||||
TESTS = t1.exe t2.exe t3.exe t4.exe t5.exe t6.exe t7.exe t8.exe t9.exe t10.exe t11.exe t12.exe t15.exe t16.exe t17.exe t18.exe t19.exe t20.exe t21.exe t22.exe t23.exe t24.exe t25.exe t26.exe t27.exe t28.exe t29.exe t30.exe t31.exe t32.exe t33.exe t34.exe t35.exe t36.exe t37.exe t38.exe t39.exe t40.exe t41.exe t42.exe t43.exe t44.exe t45.exe t46.exe
|
||||
# t13.exe t14.exe
|
||||
|
||||
check: local compare
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
#define TRACE
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace MonoTest.Configuration
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main ()
|
||||
{
|
||||
Trace.Write ("OK");
|
||||
|
||||
string basedir = AppDomain.CurrentDomain.BaseDirectory;
|
||||
string output = Path.Combine (basedir, "log.tmp");
|
||||
|
||||
try {
|
||||
using (StreamReader sr = new StreamReader (Path.Combine (basedir, "log.tmp"), Encoding.UTF8)) {
|
||||
string text = sr.ReadToEnd ();
|
||||
Console.WriteLine (text);
|
||||
}
|
||||
} finally {
|
||||
File.Delete (output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomFileListener : TraceListener
|
||||
{
|
||||
private string Prefix {
|
||||
get {
|
||||
return Attributes ["prefix"];
|
||||
}
|
||||
}
|
||||
|
||||
private string OutputFile {
|
||||
get {
|
||||
string basedir = AppDomain.CurrentDomain.BaseDirectory;
|
||||
return Path.Combine (basedir, Attributes ["output"]);
|
||||
}
|
||||
}
|
||||
|
||||
protected override string [] GetSupportedAttributes ()
|
||||
{
|
||||
return new string [] { "output", "prefix", "suffix" };
|
||||
}
|
||||
|
||||
public override void Write (string message)
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter (OutputFile, true, Encoding.UTF8)) {
|
||||
if (Prefix != null)
|
||||
sw.Write (Prefix);
|
||||
sw.Write (message);
|
||||
sw.Write (Attributes.Count.ToString (CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteLine (string message)
|
||||
{
|
||||
using (StreamWriter sw = new StreamWriter (OutputFile, true, Encoding.UTF8)) {
|
||||
if (Prefix != null)
|
||||
sw.Write (Prefix);
|
||||
sw.WriteLine (message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<configuration>
|
||||
<system.diagnostics>
|
||||
<sharedListeners>
|
||||
<add name="CustomFile" type="MonoTest.Configuration.CustomFileListener, t47" traceOutputOptions="None" output="log.tmp" prefix="Custom:" />
|
||||
</sharedListeners>
|
||||
<trace>
|
||||
<listeners>
|
||||
<add name="CustomFile" />
|
||||
</listeners>
|
||||
</trace>
|
||||
</system.diagnostics>
|
||||
</configuration>
|
||||
@@ -1 +0,0 @@
|
||||
Custom:OK2
|
||||
@@ -1,8 +1,3 @@
|
||||
2008-08-05 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* System.Core.dll.sources: Add new files for crypto.
|
||||
* System.Core_test.dll.sources: Add crypto unit tests.
|
||||
|
||||
2008-05-01 Jb Evain <[email protected]>
|
||||
|
||||
* System.Core-2008.csproj, System.Core.dll.sources: add new files.
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/Locale.cs
|
||||
../../build/common/MonoTODOAttribute.cs
|
||||
../corlib/Mono.Security.Cryptography/CryptoTools.cs
|
||||
../corlib/Mono.Security.Cryptography/SymmetricTransform.cs
|
||||
Assembly/AssemblyInfo.cs
|
||||
System/Actions.cs
|
||||
System/Funcs.cs
|
||||
@@ -65,17 +62,3 @@ System.Linq.Expressions/ParameterExpression.cs
|
||||
System.Linq.Expressions/TypeBinaryExpression.cs
|
||||
System.Linq.Expressions/UnaryExpression.cs
|
||||
System.Collections.Generic/HashSet.cs
|
||||
System.Security.Cryptography/Aes.cs
|
||||
System.Security.Cryptography/AesManaged.cs
|
||||
System.Security.Cryptography/AesCryptoServiceProvider.cs
|
||||
System.Security.Cryptography/AesTransform.cs
|
||||
System.Security.Cryptography/CngAlgorithm.cs
|
||||
System.Security.Cryptography/CngAlgorithmGroup.cs
|
||||
System.Security.Cryptography/MD5Cng.cs
|
||||
System.Security.Cryptography/SHA1Cng.cs
|
||||
System.Security.Cryptography/SHA256Cng.cs
|
||||
System.Security.Cryptography/SHA256CryptoServiceProvider.cs
|
||||
System.Security.Cryptography/SHA384Cng.cs
|
||||
System.Security.Cryptography/SHA384CryptoServiceProvider.cs
|
||||
System.Security.Cryptography/SHA512Cng.cs
|
||||
System.Security.Cryptography/SHA512CryptoServiceProvider.cs
|
||||
@@ -58,18 +58,3 @@ System.Linq.Expressions/ExpressionTest_TypeAs.cs
|
||||
System.Linq.Expressions/ExpressionTest_TypeIs.cs
|
||||
System.Linq.Expressions/ExpressionTest_UnaryPlus.cs
|
||||
System.Linq.Expressions/ExpressionTest_Utils.cs
|
||||
../../corlib/Test/System.Security.Cryptography/HashAlgorithmTest.cs
|
||||
../../corlib/Test/System.Security.Cryptography/SHA1Test.cs
|
||||
../../corlib/Test/System.Security.Cryptography/SHA256Test.cs
|
||||
../../corlib/Test/System.Security.Cryptography/SHA384Test.cs
|
||||
../../corlib/Test/System.Security.Cryptography/SHA512Test.cs
|
||||
System.Security.Cryptography/CngAlgorithmTest.cs
|
||||
System.Security.Cryptography/CngAlgorithmGroupTest.cs
|
||||
System.Security.Cryptography/MD5CngTest.cs
|
||||
System.Security.Cryptography/SHA1CngTest.cs
|
||||
System.Security.Cryptography/SHA256CngTest.cs
|
||||
System.Security.Cryptography/SHA256CryptoServiceProviderTest.cs
|
||||
System.Security.Cryptography/SHA384CngTest.cs
|
||||
System.Security.Cryptography/SHA384CryptoServiceProviderTest.cs
|
||||
System.Security.Cryptography/SHA512CngTest.cs
|
||||
System.Security.Cryptography/SHA512CryptoServiceProviderTest.cs
|
||||
@@ -371,8 +371,13 @@ namespace System.Linq.Expressions {
|
||||
break;
|
||||
case ExpressionType.RightShift:
|
||||
case ExpressionType.LeftShift:
|
||||
ig.Emit (OpCodes.Ldc_I4, left.Type == typeof (int) ? 0x1f : 0x3f);
|
||||
ig.Emit (OpCodes.And);
|
||||
if (left.Type == typeof (int)) {
|
||||
ig.Emit (OpCodes.Ldc_I4, 0x1f);
|
||||
ig.Emit (OpCodes.And);
|
||||
} else {
|
||||
ig.Emit (OpCodes.Ldc_I4, 0x3f);
|
||||
ig.Emit (OpCodes.And);
|
||||
}
|
||||
if (NodeType == ExpressionType.RightShift)
|
||||
ig.Emit (is_unsigned ? OpCodes.Shr_Un : OpCodes.Shr);
|
||||
else
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
2008-07-24 Marek Safar <marek.safar@gmail.com>
|
||||
2008-08-08 Jb Evain <jbevain@novell.com>
|
||||
|
||||
* Enumerable.cs (First): Optimized.
|
||||
* Enumerable.cs (Take): fix not too consume an uneeded item from
|
||||
the source enumerable. Fix #415644.
|
||||
|
||||
2008-05-27 Jb Evain <[email protected]>
|
||||
|
||||
|
||||
@@ -578,21 +578,8 @@ namespace System.Linq
|
||||
public static TSource First<TSource> (this IEnumerable<TSource> source)
|
||||
{
|
||||
Check.Source (source);
|
||||
|
||||
var list = source as IList<TSource>;
|
||||
if (list != null) {
|
||||
if (list.Count != 0)
|
||||
return list [0];
|
||||
|
||||
throw new InvalidOperationException ();
|
||||
} else {
|
||||
using (var enumerator = source.GetEnumerator ()) {
|
||||
if (enumerator.MoveNext ())
|
||||
return enumerator.Current;
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
return source.First (PredicateOf<TSource>.Always, Fallback.Throw);
|
||||
}
|
||||
|
||||
public static TSource First<TSource> (this IEnumerable<TSource> source, Func<TSource, bool> predicate)
|
||||
@@ -2029,10 +2016,10 @@ namespace System.Linq
|
||||
|
||||
int counter = 0;
|
||||
foreach (TSource element in source) {
|
||||
if (counter++ == count)
|
||||
yield break;
|
||||
|
||||
yield return element;
|
||||
|
||||
if (++counter == count)
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
//
|
||||
// System.Security.Cryptography.Aes.cs
|
||||
// based on mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
|
||||
//
|
||||
// Authors:
|
||||
// Dan Lewis ([email protected])
|
||||
// Andrew Birkett ([email protected])
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// (C) 2002
|
||||
// Copyright (C) 2004-2006,2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// References:
|
||||
// a. FIPS PUB 197: Advanced Encryption Standard
|
||||
// http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
|
||||
|
||||
public abstract class Aes : SymmetricAlgorithm {
|
||||
|
||||
public static new Aes Create ()
|
||||
{
|
||||
return Create ("System.Security.Cryptography.Aes");
|
||||
}
|
||||
|
||||
public static new Aes Create (string algName)
|
||||
{
|
||||
return (Aes) CryptoConfig.CreateFromName (algName);
|
||||
}
|
||||
|
||||
protected Aes ()
|
||||
{
|
||||
KeySizeValue = 256;
|
||||
BlockSizeValue = 128;
|
||||
FeedbackSizeValue = 128;
|
||||
|
||||
LegalKeySizesValue = new KeySizes [1];
|
||||
LegalKeySizesValue [0] = new KeySizes (128, 256, 64);
|
||||
|
||||
LegalBlockSizesValue = new KeySizes [1];
|
||||
LegalBlockSizesValue [0] = new KeySizes (128, 128, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
//
|
||||
// System.Security.Cryptography.AesCryptoServiceProvider class
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot ([email protected])
|
||||
//
|
||||
// Copyright (C) 2008 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 Mono.Security.Cryptography;
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
[HostProtection (SecurityAction.LinkDemand, MayLeakOnAbort=true)]
|
||||
public sealed class AesCryptoServiceProvider : Aes {
|
||||
|
||||
public AesCryptoServiceProvider ()
|
||||
{
|
||||
}
|
||||
|
||||
public override void GenerateIV ()
|
||||
{
|
||||
IVValue = KeyBuilder.IV (BlockSizeValue >> 3);
|
||||
}
|
||||
|
||||
public override void GenerateKey ()
|
||||
{
|
||||
KeyValue = KeyBuilder.Key (KeySizeValue >> 3);
|
||||
}
|
||||
|
||||
public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV)
|
||||
{
|
||||
return new AesTransform (this, false, rgbKey, rgbIV);
|
||||
}
|
||||
|
||||
public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV)
|
||||
{
|
||||
return new AesTransform (this, true, rgbKey, rgbIV);
|
||||
}
|
||||
|
||||
// I suppose some attributes differs ?!? because this does not look required
|
||||
|
||||
public override byte[] IV {
|
||||
get { return base.IV; }
|
||||
set { base.IV = value; }
|
||||
}
|
||||
|
||||
public override byte[] Key {
|
||||
get { return base.Key; }
|
||||
set { base.Key = value; }
|
||||
}
|
||||
|
||||
public override int KeySize {
|
||||
get { return base.KeySize; }
|
||||
set { base.KeySize = value; }
|
||||
}
|
||||
#if false
|
||||
public override int FeedbackSize {
|
||||
get { return base.FeedbackSize; }
|
||||
set { base.FeedbackSize = value; }
|
||||
}
|
||||
|
||||
public override CipherMode Mode {
|
||||
get { return base.CipherMode; }
|
||||
set { base.CipherMode = value; }
|
||||
}
|
||||
|
||||
public override PaddingMode Padding {
|
||||
get { return base.PaddingMode; }
|
||||
set { base.PaddingMode = value; }
|
||||
}
|
||||
#endif
|
||||
public override ICryptoTransform CreateDecryptor ()
|
||||
{
|
||||
return CreateDecryptor (Key, IV);
|
||||
}
|
||||
|
||||
public override ICryptoTransform CreateEncryptor()
|
||||
{
|
||||
return CreateEncryptor (Key, IV);
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
//
|
||||
// System.Security.Cryptography.AesManaged.cs
|
||||
//
|
||||
// Authors:
|
||||
// Mark Crichton ([email protected])
|
||||
// Andrew Birkett ([email protected])
|
||||
// Sebastien Pouliot ([email protected])
|
||||
// Kazuki Oikawa ([email protected])
|
||||
//
|
||||
// (C) 2002
|
||||
// Portions (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
|
||||
// Copyright (C) 2004-2005,2008 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 Mono.Security.Cryptography;
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// References:
|
||||
// a. FIPS PUB 197: Advanced Encryption Standard
|
||||
// http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
|
||||
// b. Aes Specification
|
||||
// http://csrc.nist.gov/CryptoToolkit/aes/Aes/Aes-ammended.pdf
|
||||
|
||||
[HostProtection (SecurityAction.LinkDemand, MayLeakOnAbort=true)]
|
||||
public sealed class AesManaged : Aes {
|
||||
|
||||
public AesManaged ()
|
||||
{
|
||||
}
|
||||
|
||||
public override void GenerateIV ()
|
||||
{
|
||||
IVValue = KeyBuilder.IV (BlockSizeValue >> 3);
|
||||
}
|
||||
|
||||
public override void GenerateKey ()
|
||||
{
|
||||
KeyValue = KeyBuilder.Key (KeySizeValue >> 3);
|
||||
}
|
||||
|
||||
public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV)
|
||||
{
|
||||
return new AesTransform (this, false, rgbKey, rgbIV);
|
||||
}
|
||||
|
||||
public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV)
|
||||
{
|
||||
return new AesTransform (this, true, rgbKey, rgbIV);
|
||||
}
|
||||
|
||||
// I suppose some attributes differs ?!? because this does not look required
|
||||
|
||||
public override byte[] IV {
|
||||
get { return base.IV; }
|
||||
set { base.IV = value; }
|
||||
}
|
||||
|
||||
public override byte[] Key {
|
||||
get { return base.Key; }
|
||||
set { base.Key = value; }
|
||||
}
|
||||
|
||||
public override int KeySize {
|
||||
get { return base.KeySize; }
|
||||
set { base.KeySize = value; }
|
||||
}
|
||||
#if false
|
||||
public override int FeedbackSize {
|
||||
get { return base.FeedbackSize; }
|
||||
set { base.FeedbackSize = value; }
|
||||
}
|
||||
|
||||
public override CipherMode Mode {
|
||||
get { return base.CipherMode; }
|
||||
set { base.CipherMode = value; }
|
||||
}
|
||||
|
||||
public override PaddingMode Padding {
|
||||
get { return base.PaddingMode; }
|
||||
set { base.PaddingMode = value; }
|
||||
}
|
||||
#endif
|
||||
public override ICryptoTransform CreateDecryptor ()
|
||||
{
|
||||
return CreateDecryptor (Key, IV);
|
||||
}
|
||||
|
||||
public override ICryptoTransform CreateEncryptor()
|
||||
{
|
||||
return CreateEncryptor (Key, IV);
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,17 +0,0 @@
|
||||
2008-08-05 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* Aes.cs: New. Base class for AES cipher.
|
||||
* AesCryptoServiceProvider.cs: New. CSP implementation
|
||||
of AES. For mono we're reusing the managed AesTransform
|
||||
* AesManaged.cs: New. Managed implementation of AES.
|
||||
* AesTransform.cs: New. Actual managed code for AES.
|
||||
* CngAlgorithm.cs: New.
|
||||
* CngAlgorithmGroup.cs: New.
|
||||
* MD5Cng.cs: New. Generated code.
|
||||
* SHA1Cng.cs: New. Generated code.
|
||||
* SHA256Cng.cs: New. Generated code.
|
||||
* SHA256CryptoServiceProvider.cs: New. Generated code.
|
||||
* SHA384Cng.cs: New. Generated code.
|
||||
* SHA384CryptoServiceProvider.cs: New. Generated code.
|
||||
* SHA512Cng.cs: New. Generated code.
|
||||
* SHA512CryptoServiceProvider.cs: New. Generated code.
|
||||
@@ -1,196 +0,0 @@
|
||||
//
|
||||
// System.Security.Cryptography.CngAlgorithm
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 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.Security.Cryptography {
|
||||
|
||||
// note: CNG stands for "Cryptography API: Next Generation"
|
||||
|
||||
[Serializable]
|
||||
public sealed class CngAlgorithm : IEquatable<CngAlgorithm> {
|
||||
|
||||
private string algo;
|
||||
|
||||
public CngAlgorithm (string algorithm)
|
||||
{
|
||||
if (algorithm == null)
|
||||
throw new ArgumentNullException ("algorithm");
|
||||
if (algorithm.Length == 0)
|
||||
throw new ArgumentException ("algorithm");
|
||||
|
||||
algo = algorithm;
|
||||
}
|
||||
|
||||
public string Algorithm {
|
||||
get { return algo; }
|
||||
}
|
||||
|
||||
public bool Equals (CngAlgorithm other)
|
||||
{
|
||||
if (other == null)
|
||||
return false;
|
||||
return algo == other.algo;
|
||||
}
|
||||
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
return Equals (obj as CngAlgorithm);
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return algo.GetHashCode ();
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return algo;
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
static CngAlgorithm dh256;
|
||||
static CngAlgorithm dh384;
|
||||
static CngAlgorithm dh521;
|
||||
static CngAlgorithm dsa256;
|
||||
static CngAlgorithm dsa384;
|
||||
static CngAlgorithm dsa521;
|
||||
static CngAlgorithm md5;
|
||||
static CngAlgorithm sha1;
|
||||
static CngAlgorithm sha256;
|
||||
static CngAlgorithm sha384;
|
||||
static CngAlgorithm sha512;
|
||||
|
||||
public static CngAlgorithm ECDiffieHellmanP256 {
|
||||
get {
|
||||
if (dh256 == null)
|
||||
dh256 = new CngAlgorithm ("ECDH_P256");
|
||||
return dh256;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm ECDiffieHellmanP384 {
|
||||
get {
|
||||
if (dh384 == null)
|
||||
dh384 = new CngAlgorithm ("ECDH_P384");
|
||||
return dh384;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm ECDiffieHellmanP521 {
|
||||
get {
|
||||
if (dh521 == null)
|
||||
dh521 = new CngAlgorithm ("ECDH_P521");
|
||||
return dh521;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm ECDsaP256 {
|
||||
get {
|
||||
if (dsa256 == null)
|
||||
dsa256 = new CngAlgorithm ("ECDSA_P256");
|
||||
return dsa256;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm ECDsaP384 {
|
||||
get {
|
||||
if (dsa384 == null)
|
||||
dsa384 = new CngAlgorithm ("ECDSA_P384");
|
||||
return dsa384;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm ECDsaP521 {
|
||||
get {
|
||||
if (dsa521 == null)
|
||||
dsa521 = new CngAlgorithm ("ECDSA_P521");
|
||||
return dsa521;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm MD5 {
|
||||
get {
|
||||
if (md5 == null)
|
||||
md5 = new CngAlgorithm ("MD5");
|
||||
return md5;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm Sha1 {
|
||||
get {
|
||||
if (sha1 == null)
|
||||
sha1 = new CngAlgorithm ("SHA1");
|
||||
return sha1;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm Sha256 {
|
||||
get {
|
||||
if (sha256 == null)
|
||||
sha256 = new CngAlgorithm ("SHA256");
|
||||
return sha256;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm Sha384 {
|
||||
get {
|
||||
if (sha384 == null)
|
||||
sha384 = new CngAlgorithm ("SHA384");
|
||||
return sha384;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithm Sha512 {
|
||||
get {
|
||||
if (sha512 == null)
|
||||
sha512 = new CngAlgorithm ("SHA512");
|
||||
return sha512;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool operator == (CngAlgorithm left, CngAlgorithm right)
|
||||
{
|
||||
if ((object)left == null)
|
||||
return ((object)right == null);
|
||||
if ((object)right == null)
|
||||
return false;
|
||||
return left.algo == right.algo;
|
||||
}
|
||||
|
||||
public static bool operator != (CngAlgorithm left, CngAlgorithm right)
|
||||
{
|
||||
if ((object)left == null)
|
||||
return ((object)right != null);
|
||||
if ((object)right == null)
|
||||
return true;
|
||||
return left.algo != right.algo;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
//
|
||||
// System.Security.Cryptography.CngAlgorithmGroup
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 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.Security.Cryptography {
|
||||
|
||||
// note: CNG stands for "Cryptography API: Next Generation"
|
||||
|
||||
[Serializable]
|
||||
public sealed class CngAlgorithmGroup : IEquatable<CngAlgorithmGroup> {
|
||||
|
||||
private string group;
|
||||
|
||||
public CngAlgorithmGroup (string algorithmGroup)
|
||||
{
|
||||
if (algorithmGroup == null)
|
||||
throw new ArgumentNullException ("algorithmGroup");
|
||||
if (algorithmGroup.Length == 0)
|
||||
throw new ArgumentException ("algorithmGroup");
|
||||
|
||||
group = algorithmGroup;
|
||||
}
|
||||
|
||||
public string AlgorithmGroup {
|
||||
get { return group; }
|
||||
}
|
||||
|
||||
public bool Equals (CngAlgorithmGroup other)
|
||||
{
|
||||
return this == other;
|
||||
}
|
||||
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
return Equals (obj as CngAlgorithmGroup);
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return group.GetHashCode ();
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return group;
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
private static CngAlgorithmGroup dh;
|
||||
private static CngAlgorithmGroup dsa;
|
||||
private static CngAlgorithmGroup ecdh;
|
||||
private static CngAlgorithmGroup ecdsa;
|
||||
private static CngAlgorithmGroup rsa;
|
||||
|
||||
public static CngAlgorithmGroup DiffieHellman {
|
||||
get {
|
||||
if (dh == null)
|
||||
dh = new CngAlgorithmGroup ("DH");
|
||||
return dh;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithmGroup Dsa {
|
||||
get {
|
||||
if (dsa == null)
|
||||
dsa = new CngAlgorithmGroup ("DSA");
|
||||
return dsa;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithmGroup ECDiffieHellman {
|
||||
get {
|
||||
if (ecdh == null)
|
||||
ecdh = new CngAlgorithmGroup ("ECDH");
|
||||
return ecdh;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithmGroup ECDsa {
|
||||
get {
|
||||
if (ecdsa == null)
|
||||
ecdsa = new CngAlgorithmGroup ("ECDSA");
|
||||
return ecdsa;
|
||||
}
|
||||
}
|
||||
|
||||
public static CngAlgorithmGroup Rsa {
|
||||
get {
|
||||
if (rsa == null)
|
||||
rsa = new CngAlgorithmGroup ("RSA");
|
||||
return rsa;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool operator == (CngAlgorithmGroup left, CngAlgorithmGroup right)
|
||||
{
|
||||
if ((object)left == null)
|
||||
return ((object)right == null);
|
||||
if ((object)right == null)
|
||||
return false;
|
||||
return left.group == right.group;
|
||||
}
|
||||
|
||||
public static bool operator != (CngAlgorithmGroup left, CngAlgorithmGroup right)
|
||||
{
|
||||
if ((object)left == null)
|
||||
return ((object)right != null);
|
||||
if ((object)right == null)
|
||||
return true;
|
||||
return left.group != right.group;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// NOTE: DO NOT EDIT - This file was automatically generated using
|
||||
// /mcs/class/System.Core/tools/hashwrap.cs
|
||||
//
|
||||
// System.Security.Cryptography.MD5Cng
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// 'Software'), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// this is a wrapper around MD5CryptoServiceProvider
|
||||
// see README.CNG and README.CSP for more details
|
||||
|
||||
public sealed class MD5Cng : MD5 {
|
||||
|
||||
static byte[] Empty = new byte [0];
|
||||
|
||||
private MD5 hash;
|
||||
|
||||
[SecurityCritical]
|
||||
public MD5Cng ()
|
||||
{
|
||||
// note: we don't use MD5.Create since CryptoConfig could,
|
||||
// if set to use this class, result in a endless recursion
|
||||
hash = new MD5CryptoServiceProvider ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
public override void Initialize ()
|
||||
{
|
||||
hash.Initialize ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void HashCore (byte[] array, int ibStart, int cbSize)
|
||||
{
|
||||
hash.TransformBlock (array, ibStart, cbSize, null, 0);
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override byte[] HashFinal ()
|
||||
{
|
||||
hash.TransformFinalBlock (Empty, 0, 0);
|
||||
HashValue = hash.Hash;
|
||||
return HashValue;
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
(hash as IDisposable).Dispose ();
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
CNG stands for "Cryptography API: Next Generation"
|
||||
|
||||
CNG is the replacement for CryptoAPI under Windows Vista (and later) and
|
||||
just like CryptoAPI it is a Windows-specific, native (unmanaged) library.
|
||||
|
||||
In MS implementation the *Cng classes are simply managed wrappers around
|
||||
the native CNG libraries. This is similar to older *CryptoServiceProvider
|
||||
classes that provided managed wrappers around CryptoAPI.
|
||||
|
||||
In Mono implementation the *Cng classes are, mostly[1], wrappers around
|
||||
existing managed classes provided in older version of the framework.
|
||||
This is essentially similar to what Mono already does for the
|
||||
*CryptoServiceProvider classes (i.e. provide managed implementation).
|
||||
|
||||
Of couse this won't affect people using the base algorithm classes to
|
||||
create the default instance of their algorithm.
|
||||
|
||||
E.g.
|
||||
SHA256 hash = SHA256.Create ();
|
||||
has been working for years and will continue to do so.
|
||||
|
||||
|
||||
New CNG crypto classes Wrapper around
|
||||
---------------------- --------------
|
||||
ECDsaCng none [1]
|
||||
ECDiffieHellmanCng none [1]
|
||||
MD5Cng MD5CryptoServiceProvider [mscorlib]
|
||||
SHA1Cng SHA1Managed [mscorlib]
|
||||
SHA256Cng SHA256Managed [mscorlib]
|
||||
SHA384Cng SHA384Managed [mscorlib]
|
||||
SHA512Cng SHA512Managed [mscorlib]
|
||||
|
||||
|
||||
[1] Two specific cases, namely ECDH and ECDSA, are new algorithms that
|
||||
were not available before CNG and for which Mono does not, at the
|
||||
present time, have managed alternatives.
|
||||
|
||||
The *actual* behavior of both class is to throw a PlatformException
|
||||
just like running the same code would do under Windows XP (or earlier).
|
||||
Once we have managed implementations for both algorithms we'll behave
|
||||
like Vista.
|
||||
@@ -1,20 +0,0 @@
|
||||
Even if CNG is replacing CryptoAPI there is still new stuff, well
|
||||
wrappers, being added. This is important, for Windows users, since CNG
|
||||
is only available in Windows Vista (and later OS).
|
||||
|
||||
Since Mono does not support CryptoAPI (even on Windows) all the classes
|
||||
with a CryptoServiceProvider suffix are wrappers around managed
|
||||
implementations of the same cryptographic algorithm.
|
||||
|
||||
|
||||
New CSP crypto classes Wrapper around
|
||||
---------------------- --------------
|
||||
AesCryptoServiceProvider RijndaelManaged [1]
|
||||
SHA256CryptoServiceProvider SHA256Managed [mscorlib]
|
||||
SHA384CryptoServiceProvider SHA384Managed [mscorlib]
|
||||
SHA512CryptoServiceProvider SHA512Managed [mscorlib]
|
||||
|
||||
|
||||
[1] Not a true wrapper but a copy of the source. This is required
|
||||
since AesManaged is available in Silverlight 2.0 (and RijndaelManaged
|
||||
is not available in mscorlib).
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// NOTE: DO NOT EDIT - This file was automatically generated using
|
||||
// /mcs/class/System.Core/tools/hashwrap.cs
|
||||
//
|
||||
// System.Security.Cryptography.SHA1Cng
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// 'Software'), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// this is a wrapper around SHA1Managed
|
||||
// see README.CNG and README.CSP for more details
|
||||
|
||||
public sealed class SHA1Cng : SHA1 {
|
||||
|
||||
static byte[] Empty = new byte [0];
|
||||
|
||||
private SHA1 hash;
|
||||
|
||||
[SecurityCritical]
|
||||
public SHA1Cng ()
|
||||
{
|
||||
// note: we don't use SHA1.Create since CryptoConfig could,
|
||||
// if set to use this class, result in a endless recursion
|
||||
hash = new SHA1Managed ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
public override void Initialize ()
|
||||
{
|
||||
hash.Initialize ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void HashCore (byte[] array, int ibStart, int cbSize)
|
||||
{
|
||||
hash.TransformBlock (array, ibStart, cbSize, null, 0);
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override byte[] HashFinal ()
|
||||
{
|
||||
hash.TransformFinalBlock (Empty, 0, 0);
|
||||
HashValue = hash.Hash;
|
||||
return HashValue;
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
(hash as IDisposable).Dispose ();
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// NOTE: DO NOT EDIT - This file was automatically generated using
|
||||
// /mcs/class/System.Core/tools/hashwrap.cs
|
||||
//
|
||||
// System.Security.Cryptography.SHA256Cng
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// 'Software'), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// this is a wrapper around SHA256Managed
|
||||
// see README.CNG and README.CSP for more details
|
||||
|
||||
public sealed class SHA256Cng : SHA256 {
|
||||
|
||||
static byte[] Empty = new byte [0];
|
||||
|
||||
private SHA256 hash;
|
||||
|
||||
[SecurityCritical]
|
||||
public SHA256Cng ()
|
||||
{
|
||||
// note: we don't use SHA256.Create since CryptoConfig could,
|
||||
// if set to use this class, result in a endless recursion
|
||||
hash = new SHA256Managed ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
public override void Initialize ()
|
||||
{
|
||||
hash.Initialize ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void HashCore (byte[] array, int ibStart, int cbSize)
|
||||
{
|
||||
hash.TransformBlock (array, ibStart, cbSize, null, 0);
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override byte[] HashFinal ()
|
||||
{
|
||||
hash.TransformFinalBlock (Empty, 0, 0);
|
||||
HashValue = hash.Hash;
|
||||
return HashValue;
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
(hash as IDisposable).Dispose ();
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// NOTE: DO NOT EDIT - This file was automatically generated using
|
||||
// /mcs/class/System.Core/tools/hashwrap.cs
|
||||
//
|
||||
// System.Security.Cryptography.SHA256CryptoServiceProvider
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// 'Software'), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// this is a wrapper around SHA256Managed
|
||||
// see README.CNG and README.CSP for more details
|
||||
|
||||
public sealed class SHA256CryptoServiceProvider : SHA256 {
|
||||
|
||||
static byte[] Empty = new byte [0];
|
||||
|
||||
private SHA256 hash;
|
||||
|
||||
[SecurityCritical]
|
||||
public SHA256CryptoServiceProvider ()
|
||||
{
|
||||
// note: we don't use SHA256.Create since CryptoConfig could,
|
||||
// if set to use this class, result in a endless recursion
|
||||
hash = new SHA256Managed ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
public override void Initialize ()
|
||||
{
|
||||
hash.Initialize ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void HashCore (byte[] array, int ibStart, int cbSize)
|
||||
{
|
||||
hash.TransformBlock (array, ibStart, cbSize, null, 0);
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override byte[] HashFinal ()
|
||||
{
|
||||
hash.TransformFinalBlock (Empty, 0, 0);
|
||||
HashValue = hash.Hash;
|
||||
return HashValue;
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
(hash as IDisposable).Dispose ();
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// NOTE: DO NOT EDIT - This file was automatically generated using
|
||||
// /mcs/class/System.Core/tools/hashwrap.cs
|
||||
//
|
||||
// System.Security.Cryptography.SHA384Cng
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// 'Software'), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// this is a wrapper around SHA384Managed
|
||||
// see README.CNG and README.CSP for more details
|
||||
|
||||
public sealed class SHA384Cng : SHA384 {
|
||||
|
||||
static byte[] Empty = new byte [0];
|
||||
|
||||
private SHA384 hash;
|
||||
|
||||
[SecurityCritical]
|
||||
public SHA384Cng ()
|
||||
{
|
||||
// note: we don't use SHA384.Create since CryptoConfig could,
|
||||
// if set to use this class, result in a endless recursion
|
||||
hash = new SHA384Managed ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
public override void Initialize ()
|
||||
{
|
||||
hash.Initialize ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void HashCore (byte[] array, int ibStart, int cbSize)
|
||||
{
|
||||
hash.TransformBlock (array, ibStart, cbSize, null, 0);
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override byte[] HashFinal ()
|
||||
{
|
||||
hash.TransformFinalBlock (Empty, 0, 0);
|
||||
HashValue = hash.Hash;
|
||||
return HashValue;
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
(hash as IDisposable).Dispose ();
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// NOTE: DO NOT EDIT - This file was automatically generated using
|
||||
// /mcs/class/System.Core/tools/hashwrap.cs
|
||||
//
|
||||
// System.Security.Cryptography.SHA384CryptoServiceProvider
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// 'Software'), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// this is a wrapper around SHA384Managed
|
||||
// see README.CNG and README.CSP for more details
|
||||
|
||||
public sealed class SHA384CryptoServiceProvider : SHA384 {
|
||||
|
||||
static byte[] Empty = new byte [0];
|
||||
|
||||
private SHA384 hash;
|
||||
|
||||
[SecurityCritical]
|
||||
public SHA384CryptoServiceProvider ()
|
||||
{
|
||||
// note: we don't use SHA384.Create since CryptoConfig could,
|
||||
// if set to use this class, result in a endless recursion
|
||||
hash = new SHA384Managed ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
public override void Initialize ()
|
||||
{
|
||||
hash.Initialize ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void HashCore (byte[] array, int ibStart, int cbSize)
|
||||
{
|
||||
hash.TransformBlock (array, ibStart, cbSize, null, 0);
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override byte[] HashFinal ()
|
||||
{
|
||||
hash.TransformFinalBlock (Empty, 0, 0);
|
||||
HashValue = hash.Hash;
|
||||
return HashValue;
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
(hash as IDisposable).Dispose ();
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// NOTE: DO NOT EDIT - This file was automatically generated using
|
||||
// /mcs/class/System.Core/tools/hashwrap.cs
|
||||
//
|
||||
// System.Security.Cryptography.SHA512Cng
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// 'Software'), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// this is a wrapper around SHA512Managed
|
||||
// see README.CNG and README.CSP for more details
|
||||
|
||||
public sealed class SHA512Cng : SHA512 {
|
||||
|
||||
static byte[] Empty = new byte [0];
|
||||
|
||||
private SHA512 hash;
|
||||
|
||||
[SecurityCritical]
|
||||
public SHA512Cng ()
|
||||
{
|
||||
// note: we don't use SHA512.Create since CryptoConfig could,
|
||||
// if set to use this class, result in a endless recursion
|
||||
hash = new SHA512Managed ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
public override void Initialize ()
|
||||
{
|
||||
hash.Initialize ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void HashCore (byte[] array, int ibStart, int cbSize)
|
||||
{
|
||||
hash.TransformBlock (array, ibStart, cbSize, null, 0);
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override byte[] HashFinal ()
|
||||
{
|
||||
hash.TransformFinalBlock (Empty, 0, 0);
|
||||
HashValue = hash.Hash;
|
||||
return HashValue;
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
(hash as IDisposable).Dispose ();
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//
|
||||
// NOTE: DO NOT EDIT - This file was automatically generated using
|
||||
// /mcs/class/System.Core/tools/hashwrap.cs
|
||||
//
|
||||
// System.Security.Cryptography.SHA512CryptoServiceProvider
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// 'Software'), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Security.Cryptography {
|
||||
|
||||
// this is a wrapper around SHA512Managed
|
||||
// see README.CNG and README.CSP for more details
|
||||
|
||||
public sealed class SHA512CryptoServiceProvider : SHA512 {
|
||||
|
||||
static byte[] Empty = new byte [0];
|
||||
|
||||
private SHA512 hash;
|
||||
|
||||
[SecurityCritical]
|
||||
public SHA512CryptoServiceProvider ()
|
||||
{
|
||||
// note: we don't use SHA512.Create since CryptoConfig could,
|
||||
// if set to use this class, result in a endless recursion
|
||||
hash = new SHA512Managed ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
public override void Initialize ()
|
||||
{
|
||||
hash.Initialize ();
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void HashCore (byte[] array, int ibStart, int cbSize)
|
||||
{
|
||||
hash.TransformBlock (array, ibStart, cbSize, null, 0);
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override byte[] HashFinal ()
|
||||
{
|
||||
hash.TransformFinalBlock (Empty, 0, 0);
|
||||
HashValue = hash.Hash;
|
||||
return HashValue;
|
||||
}
|
||||
|
||||
[SecurityCritical]
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
(hash as IDisposable).Dispose ();
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,3 @@
|
||||
2008-08-04 Jb Evain <[email protected]>
|
||||
|
||||
* TimeZoneInfo.cs: avoid using a SortedDictionary when not needed.
|
||||
|
||||
2008-06-25 Jb Evain <[email protected]>
|
||||
|
||||
* TimeZoneInfo.cs: remove the dependance to Mono.DataConverter
|
||||
|
||||
@@ -668,7 +668,7 @@ namespace System
|
||||
|
||||
Dictionary<int, string> abbreviations = ParseAbbreviations (buffer, 44 + 4 * timecnt + timecnt + 6 * typecnt, charcnt);
|
||||
Dictionary<int, TimeType> time_types = ParseTimesTypes (buffer, 44 + 4 * timecnt + timecnt, typecnt, abbreviations);
|
||||
List<KeyValuePair<DateTime, TimeType>> transitions = ParseTransitions (buffer, 44, timecnt, time_types);
|
||||
SortedList<DateTime, TimeType> transitions = ParseTransitions (buffer, 44, timecnt, time_types);
|
||||
|
||||
if (time_types.Count == 0)
|
||||
throw new InvalidTimeZoneException ();
|
||||
@@ -685,9 +685,8 @@ namespace System
|
||||
List<AdjustmentRule> adjustmentRules = new List<AdjustmentRule> ();
|
||||
|
||||
for (int i = 0; i < transitions.Count; i++) {
|
||||
var pair = transitions [i];
|
||||
DateTime ttime = pair.Key;
|
||||
TimeType ttype = pair.Value;
|
||||
DateTime ttime = transitions.Keys [i];
|
||||
TimeType ttype = transitions [ttime];
|
||||
if (!ttype.IsDst) {
|
||||
if (standardDisplayName != ttype.Name || baseUtcOffset.TotalSeconds != ttype.Offset) {
|
||||
standardDisplayName = ttype.Name;
|
||||
@@ -775,16 +774,16 @@ namespace System
|
||||
return types;
|
||||
}
|
||||
|
||||
static List<KeyValuePair<DateTime, TimeType>> ParseTransitions (byte [] buffer, int index, int count, Dictionary<int, TimeType> time_types)
|
||||
static SortedList<DateTime, TimeType> ParseTransitions (byte [] buffer, int index, int count, Dictionary<int, TimeType> time_types)
|
||||
{
|
||||
var list = new List<KeyValuePair<DateTime, TimeType>> (count);
|
||||
var trans = new SortedList<DateTime, TimeType> (count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
int unixtime = ReadBigEndianInt32 (buffer, index + 4 * i);
|
||||
DateTime ttime = DateTimeFromUnixTime (unixtime);
|
||||
byte ttype = buffer [index + 4 * count + i];
|
||||
list.Add (new KeyValuePair<DateTime, TimeType> (ttime, time_types [(int)ttype]));
|
||||
trans.Add (ttime, time_types [(int)ttype]);
|
||||
}
|
||||
return list;
|
||||
return trans;
|
||||
}
|
||||
|
||||
static DateTime DateTimeFromUnixTime (long unix_time)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2008-08-08 Jb Evain <[email protected]>
|
||||
|
||||
* EnumerableTest.cs: add test to ensure that Take doesn't consume
|
||||
an uneeded item from the source enumerable. Test by
|
||||
Jonathan Pryor <[email protected]>.
|
||||
|
||||
2008-05-20 Roei Erez <[email protected]>
|
||||
|
||||
* Add tests for Queryable.AsQureyable
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -264,6 +265,26 @@ namespace MonoTests.System.Linq {
|
||||
AssertAreSame (new [] {0, 1, 2, 3}, Enumerable.Range (0, 4));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestTakeTakesProperNumberOfItems ()
|
||||
{
|
||||
var stream = new MemoryStream (new byte [] { 1, 2, 3, 4, 0 });
|
||||
|
||||
Assert.AreEqual (0, stream.Position);
|
||||
|
||||
foreach (byte b in AsEnumerable (stream).Take (2))
|
||||
;
|
||||
|
||||
Assert.AreEqual (2, stream.Position);
|
||||
}
|
||||
|
||||
static IEnumerable<byte> AsEnumerable (Stream stream)
|
||||
{
|
||||
byte b;
|
||||
while ((b = (byte) stream.ReadByte ()) >= 0)
|
||||
yield return b;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestOrderBy ()
|
||||
{
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
2008-08-05 Sebastien Pouliot <[email protected]>
|
||||
|
||||
* CngAlgorithmGroupTest.cs: New. Unit tests.
|
||||
* CngAlgorithmTest.cs: New. Unit tests.
|
||||
* MD5CngTest.cs: New. MD5 unit tests.
|
||||
* SHA1CngTest.cs: New. SHA1 unit tests.
|
||||
* SHA256CngTest.cs: New. SHA256 unit tests.
|
||||
* SHA256CryptoServiceProviderTest.cs: New. SHA256 unit tests.
|
||||
* SHA384CngTest.cs: New. SHA384 unit tests.
|
||||
* SHA384CryptoServiceProviderTest.cs: New. SHA384 unit tests.
|
||||
* SHA512CngTest.cs: New. SHA512 unit tests.
|
||||
* SHA512CryptoServiceProviderTest.cs: New. SHA512 unit tests.
|
||||
@@ -1,144 +0,0 @@
|
||||
//
|
||||
// Unit tests for System.Security.Cryptography.CngAlgorithmGroup
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 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.Security.Cryptography;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Security.Cryptography {
|
||||
|
||||
[TestFixture]
|
||||
public class CngAlgorithmGroupTest {
|
||||
|
||||
[Test]
|
||||
public void StaticProperties ()
|
||||
{
|
||||
Assert.IsNotNull (CngAlgorithmGroup.DiffieHellman, "DiffieHellman");
|
||||
Assert.IsNotNull (CngAlgorithmGroup.Dsa, "Dsa");
|
||||
Assert.IsNotNull (CngAlgorithmGroup.ECDiffieHellman, "ECDiffieHellman");
|
||||
Assert.IsNotNull (CngAlgorithmGroup.ECDsa, "ECDsa");
|
||||
Assert.IsNotNull (CngAlgorithmGroup.Rsa, "Rsa");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentNullException))]
|
||||
public void ConstructorNull ()
|
||||
{
|
||||
new CngAlgorithmGroup (null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentException))]
|
||||
public void ConstructorEmpty ()
|
||||
{
|
||||
new CngAlgorithmGroup (String.Empty);
|
||||
}
|
||||
|
||||
static CngAlgorithmGroup mono = new CngAlgorithmGroup ("mono");
|
||||
|
||||
private void Check (CngAlgorithmGroup group)
|
||||
{
|
||||
Assert.AreEqual (group.AlgorithmGroup, group.ToString (), "Algorithm/ToString");
|
||||
Assert.AreEqual (group.GetHashCode (), group.AlgorithmGroup.GetHashCode (), "GetHashCode");
|
||||
Assert.IsTrue (group.Equals (group), "Equals(self)");
|
||||
Assert.IsTrue (group.Equals ((object) group), "Equals((object)self)");
|
||||
|
||||
CngAlgorithmGroup copy = new CngAlgorithmGroup (group.AlgorithmGroup);
|
||||
Assert.AreEqual (group.GetHashCode (), copy.GetHashCode (), "Copy");
|
||||
Assert.IsTrue (group.Equals (copy), "Equals(copy)");
|
||||
Assert.IsTrue (group.Equals ((object) copy), "Equals((object)copy)");
|
||||
Assert.IsTrue (group == copy, "algo==copy");
|
||||
Assert.IsFalse (group != copy, "algo!=copy");
|
||||
|
||||
Assert.IsFalse (group.Equals (mono), "Equals(mono)");
|
||||
Assert.IsFalse (group.Equals ((object) mono), "Equals((object)mono)");
|
||||
Assert.IsFalse (group == mono, "algo==mono");
|
||||
Assert.IsTrue (group != mono, "algo!=mono");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConstructorCustom ()
|
||||
{
|
||||
CngAlgorithmGroup group = new CngAlgorithmGroup ("custom");
|
||||
Check (group);
|
||||
Assert.IsFalse (group.Equals ((CngAlgorithmGroup) null), "Equals((CngAlgorithmGroup)null)");
|
||||
Assert.IsFalse (group.Equals ((object) null), "Equals((object)null)");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DiffieHellman ()
|
||||
{
|
||||
CngAlgorithmGroup group = CngAlgorithmGroup.DiffieHellman;
|
||||
Assert.AreEqual ("DH", group.AlgorithmGroup, "AlgorithmGroup");
|
||||
Assert.IsTrue (group.Equals (CngAlgorithmGroup.DiffieHellman), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (group, CngAlgorithmGroup.DiffieHellman), "ReferenceEquals");
|
||||
Check (group);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Dsa ()
|
||||
{
|
||||
CngAlgorithmGroup group = CngAlgorithmGroup.Dsa;
|
||||
Assert.AreEqual ("DSA", group.AlgorithmGroup, "AlgorithmGroup");
|
||||
Assert.IsTrue (group.Equals (CngAlgorithmGroup.Dsa), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (group, CngAlgorithmGroup.Dsa), "ReferenceEquals");
|
||||
Check (group);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ECDiffieHellman ()
|
||||
{
|
||||
CngAlgorithmGroup group = CngAlgorithmGroup.ECDiffieHellman;
|
||||
Assert.AreEqual ("ECDH", group.AlgorithmGroup, "AlgorithmGroup");
|
||||
Assert.IsTrue (group.Equals (CngAlgorithmGroup.ECDiffieHellman), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (group, CngAlgorithmGroup.ECDiffieHellman), "ReferenceEquals");
|
||||
Check (group);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ECDsa ()
|
||||
{
|
||||
CngAlgorithmGroup group = CngAlgorithmGroup.ECDsa;
|
||||
Assert.AreEqual ("ECDSA", group.AlgorithmGroup, "AlgorithmGroup");
|
||||
Assert.IsTrue (group.Equals (CngAlgorithmGroup.ECDsa), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (group, CngAlgorithmGroup.ECDsa), "ReferenceEquals");
|
||||
Check (group);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Rsa ()
|
||||
{
|
||||
CngAlgorithmGroup group = CngAlgorithmGroup.Rsa;
|
||||
Assert.AreEqual ("RSA", group.AlgorithmGroup, "AlgorithmGroup");
|
||||
Assert.IsTrue (group.Equals (CngAlgorithmGroup.Rsa), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (group, CngAlgorithmGroup.Rsa), "ReferenceEquals");
|
||||
Check (group);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
//
|
||||
// Unit tests for System.Security.Cryptography.CngAlgorithm
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <[email protected]>
|
||||
//
|
||||
// Copyright (C) 2008 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.Security.Cryptography;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Security.Cryptography {
|
||||
|
||||
[TestFixture]
|
||||
public class CngAlgorithmTest {
|
||||
|
||||
[Test]
|
||||
public void StaticProperties ()
|
||||
{
|
||||
Assert.IsNotNull (CngAlgorithm.ECDiffieHellmanP256, "ECDiffieHellmanP256");
|
||||
Assert.IsNotNull (CngAlgorithm.ECDiffieHellmanP384, "ECDiffieHellmanP384");
|
||||
Assert.IsNotNull (CngAlgorithm.ECDiffieHellmanP521, "ECDiffieHellmanP521");
|
||||
Assert.IsNotNull (CngAlgorithm.ECDsaP256, "ECDsaP256");
|
||||
Assert.IsNotNull (CngAlgorithm.ECDsaP384, "ECDsaP384");
|
||||
Assert.IsNotNull (CngAlgorithm.ECDsaP521, "ECDsaP521");
|
||||
Assert.IsNotNull (CngAlgorithm.MD5, "MD5");
|
||||
Assert.IsNotNull (CngAlgorithm.Sha1, "Sha1");
|
||||
Assert.IsNotNull (CngAlgorithm.Sha256, "Sha256");
|
||||
Assert.IsNotNull (CngAlgorithm.Sha384, "Sha384");
|
||||
Assert.IsNotNull (CngAlgorithm.Sha512, "Sha512");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentNullException))]
|
||||
public void ConstructorNull ()
|
||||
{
|
||||
new CngAlgorithm (null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentException))]
|
||||
public void ConstructorEmpty ()
|
||||
{
|
||||
new CngAlgorithm (String.Empty);
|
||||
}
|
||||
|
||||
static CngAlgorithm mono = new CngAlgorithm ("mono");
|
||||
|
||||
private void Check (CngAlgorithm algo)
|
||||
{
|
||||
Assert.AreEqual (algo.Algorithm, algo.ToString (), "Algorithm/ToString");
|
||||
Assert.AreEqual (algo.GetHashCode (), algo.Algorithm.GetHashCode (), "GetHashCode");
|
||||
Assert.IsTrue (algo.Equals (algo), "Equals(self)");
|
||||
Assert.IsTrue (algo.Equals ((object)algo), "Equals((object)self)");
|
||||
|
||||
CngAlgorithm copy = new CngAlgorithm (algo.Algorithm);
|
||||
Assert.AreEqual (algo.GetHashCode (), copy.GetHashCode (), "Copy");
|
||||
Assert.IsTrue (algo.Equals (copy), "Equals(copy)");
|
||||
Assert.IsTrue (algo.Equals ((object)copy), "Equals((object)copy)");
|
||||
Assert.IsTrue (algo == copy, "algo==copy");
|
||||
Assert.IsFalse (algo != copy, "algo!=copy");
|
||||
|
||||
Assert.IsFalse (algo.Equals (mono), "Equals(mono)");
|
||||
Assert.IsFalse (algo.Equals ((object)mono), "Equals((object)mono)");
|
||||
Assert.IsFalse (algo == mono, "algo==mono");
|
||||
Assert.IsTrue (algo != mono, "algo!=mono");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConstructorCustom ()
|
||||
{
|
||||
CngAlgorithm algo = new CngAlgorithm ("custom");
|
||||
Check (algo);
|
||||
Assert.IsFalse (algo.Equals ((CngAlgorithm) null), "Equals((CngAlgorithm)null)");
|
||||
Assert.IsFalse (algo.Equals ((object) null), "Equals((object)null)");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ECDiffieHellmanP256 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.ECDiffieHellmanP256;
|
||||
Assert.AreEqual ("ECDH_P256", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.ECDiffieHellmanP256), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.ECDiffieHellmanP256), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ECDiffieHellmanP384 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.ECDiffieHellmanP384;
|
||||
Assert.AreEqual ("ECDH_P384", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.ECDiffieHellmanP384), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.ECDiffieHellmanP384), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ECDiffieHellmanP521 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.ECDiffieHellmanP521;
|
||||
Assert.AreEqual ("ECDH_P521", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.ECDiffieHellmanP521), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.ECDiffieHellmanP521), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ECDsaP256 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.ECDsaP256;
|
||||
Assert.AreEqual ("ECDSA_P256", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.ECDsaP256), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.ECDsaP256), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ECDsaP384 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.ECDsaP384;
|
||||
Assert.AreEqual ("ECDSA_P384", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.ECDsaP384), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.ECDsaP384), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ECDsaP521 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.ECDsaP521;
|
||||
Assert.AreEqual ("ECDSA_P521", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.ECDsaP521), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.ECDsaP521), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MD5 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.MD5;
|
||||
Assert.AreEqual ("MD5", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.MD5), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.MD5), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha1 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.Sha1;
|
||||
Assert.AreEqual ("SHA1", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.Sha1), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.Sha1), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha256 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.Sha256;
|
||||
Assert.AreEqual ("SHA256", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.Sha256), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.Sha256), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha384 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.Sha384;
|
||||
Assert.AreEqual ("SHA384", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.Sha384), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.Sha384), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha512 ()
|
||||
{
|
||||
CngAlgorithm algo = CngAlgorithm.Sha512;
|
||||
Assert.AreEqual ("SHA512", algo.Algorithm, "Algorithm");
|
||||
Assert.IsTrue (algo.Equals (CngAlgorithm.Sha512), "Equals(static)");
|
||||
Assert.IsTrue (Object.ReferenceEquals (algo, CngAlgorithm.Sha512), "ReferenceEquals");
|
||||
Check (algo);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 688 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user